调试接口

This commit is contained in:
wangxiaowei
2025-12-25 00:06:10 +08:00
parent df5d7aa94e
commit 2e61a619d3
13 changed files with 64 additions and 41 deletions

12
env/.env vendored
View File

@ -1,4 +1,4 @@
VITE_APP_TITLE = '茶址'
VITE_APP_TITLE = '茶址管理端'
VITE_APP_PORT = 9002
VITE_UNI_APPID = '__UNI__D1E5001'
@ -10,17 +10,17 @@ VITE_APP_PUBLIC_BASE=/
# 登录页面
VITE_LOGIN_URL = '/pages/login/login'
# 第一个请求地址
VITE_SERVER_BASEURL = 'https://cz.stnav.com'
VITE_SERVER_BASEURL = 'https://76458.com'
VITE_UPLOAD_BASEURL = 'https://cz.stnav.com/upload'
VITE_UPLOAD_BASEURL = 'https://76458.com/upload'
# h5是否需要配置代理
VITE_APP_PROXY=true
VITE_APP_PROXY_PREFIX = '/storeapi'
# 第二个请求地址 (目前alova中可以使用)
VITE_SERVER_BASEURL = 'https://cz.stnav.com'
VITE_SERVER_BASEURL = 'https://76458.com'
# 上传图片请求地址
VITE_UPLOAD_BASEURL = 'https://cz.stnav.com/storeapi/upload/image'
VITE_UPLOAD_IMAGE_URL = 'https://cz.stnav.com/'
VITE_UPLOAD_BASEURL = 'https://76458.com/storeapi/upload/image'
VITE_UPLOAD_IMAGE_URL = 'https://76458.com/'

View File

@ -652,7 +652,7 @@
return
}
// 将图片URL中的 https://cz.stnav.com/ 替换为空
// 将图片URL中的 https://76458.com/ 替换为空
formData.img = Add.fileList.map(item => {
if (typeof item.url === 'string') {
return item.url.replace(import.meta.env.VITE_UPLOAD_IMAGE_URL, '')

View File

@ -14,23 +14,23 @@
<view>
<view class="mt-20rpx mx-30rpx swiper">
<wd-swiper value-key="image" height="320rpx"
:indicator="{ type: 'dots-bar' }" :list="swiperList" mode="aspectFit">
<wd-swiper height="320rpx"
:indicator="{ type: 'dots-bar' }" :list="swiperList" v-model:current="current" mode="aspectFit">
</wd-swiper>
</view>
<view class="bg-white rounded-16rpx py-26rpx px-30rpx mt-24rpx mx-30rpx">
<view class="flex items-center justify-between">
<price-format color="#FF5951" :first-size="36" :second-size="36" :subscript-size="24" :price="teaRoom.room.price"></price-format>
<view class="font-400 text-22rpx text-[#6A6363] leading-32rpx">已售 {{ teaRoom.room.sold > 10 ? teaRoom.room.sold + '+': teaRoom.room.sold }} </view>
<view class="font-400 text-22rpx text-[#6A6363] leading-32rpx">已售 {{ teaRoom.room.sold > 10 ? '10+': teaRoom.room.sold }} </view>
</view>
<view class="font-bold text-36rpx text-[#303133] leading-50rpx mt-20rpx">{{ teaRoom.room.title }}</view>
<view class="mt-14rpx flex">
<template v-for="(label, labelIndex) in teaRoom.label" :key="labelIndex">
<view class="mr-20rpx flex items-start">
<wd-tag
:color="randomLabelColor(labelIndex)"
:bg-color="randomLabelColor(labelIndex)"
:color="randomLabelColor(Number(labelIndex))"
:bg-color="randomLabelColor(Number(labelIndex))"
plain
custom-class="!rounded-4rpx"
>{{ label.label_name }}</wd-tag>
@ -58,6 +58,7 @@
import { randomLabelColor } from '@/utils/tools'
const swiperList = ref<string[]>([])
const current = ref<number>(0)
const html: string = '<p>这里是富文本内容,需要后台传递</p>'
// 包间内容
@ -77,6 +78,7 @@
const res = await getStoreOrderDetails(roomId.value)
console.log("🚀 ~ res:", res)
teaRoom.value = res.details
console.log("🚀 ~ teaRoom.value:", teaRoom.value)
swiperList.value = teaRoom.value.img_arr
}
}

View File

@ -71,7 +71,7 @@
<view class="">
<view class="flex items-center">
<view class="mr-28rpx">
<wd-img width="200rpx" height="200rpx" :src="order.main_image"></wd-img>
<wd-img width="200rpx" height="200rpx" :src="order.main_image" radius="10rpx"></wd-img>
</view>
<view class="flex-1" @click="router.navigateTo(`/bundle/setmeal/detail?id=${order.id}`)">
<view class="flex items-center relative">
@ -147,7 +147,7 @@
<view class="mt-22rpx">
<view class="flex items-center">
<view class="mr-28rpx">
<wd-img width="200rpx" height="200rpx" :src="order.img"></wd-img>
<wd-img width="200rpx" height="200rpx" :src="order.img" radius="10rpx"></wd-img>
</view>
<view class="flex-1">
<view @click="ComboCard.handleToOrderDetail(order.id)">
@ -155,6 +155,7 @@
<view class="font-400 leading-36rpx text-26rpx text-[#606266] mt-34rpx">
<view>预约时间{{ order.day_title }} {{ order.start_time }}-{{ order.end_time }}</view>
<view class="mt-18rpx">预约时长{{ order.hours }}小时</view>
<view class="mt-18rpx">用户手机号{{ order.user_mobile }}</view>
</view>
</view>
</view>

View File

@ -26,7 +26,7 @@
<wd-radio checked-color="#4C9F44" size='large' shape="dot" :value="index"></wd-radio>
</view>
<view v-if="!isUseCoupon">
<view class="text-[#6A6363] text-22rpx leading-30rpx">已售 {{ item.buy_nums > 10 ? item.buy_nums + '+' : item.buy_nums }}</view>
<view class="text-[#6A6363] text-22rpx leading-30rpx">已售 {{ item.buy_nums > 10 ? '10+' : item.buy_nums }}</view>
<view
class="w-104rpx h-52rpx mt-16rpx text-26rpx font-400 text-[#4C9F44] leading-52rpx text-center border-[2rpx] border-[#4C9F44] rounded-10rpx"
@click="RoomList.handleToPage(ReserveServiceCategory.ReserveRoom, item.store_id, item.id, item.price)">
@ -58,7 +58,7 @@
</view>
</view>
<view class="absolute bottom-0 right-0">
<view class="text-[#6A6363] text-22rpx leading-30rpx">已售 {{ item.sold > 10 ? item.sold + '+' : item.sold }}</view>
<view class="text-[#6A6363] text-22rpx leading-30rpx">已售 {{ item.sold > 10 ? '10+' : item.sold }}</view>
<view
class="w-104rpx h-52rpx mt-16rpx text-26rpx font-400 text-[#4C9F44] leading-52rpx text-center border-[2rpx] border-[#4C9F44] rounded-10rpx"
@click="RoomList.handleToPage(ReserveServiceCategory.GroupBuying, item.store_id, item.id, item.price)">

View File

@ -46,7 +46,7 @@
},
"vueVersion": "3",
"default": {
"name": "茶址",
"name": "茶址管理端",
"appid": "__UNI__D1E5001",
"description": "",
"versionName": "1.0.0",

View File

@ -128,11 +128,12 @@
import { router } from '@/utils/tools'
import { getStoreList, getStoreDetails, getStoreStatistics, scanVerifyCoupon } from '@/api/store'
import { useStoreStore } from '@/store'
import { toast } from '@/utils/toast'
import { useToast } from 'wot-design-uni'
const OSS = inject('OSS')
const navbarHeight = inject('navbarHeight')
const useStore = useStoreStore()
const toast = useToast()
// 扫码验券弹出框
const showScanMenu = ref<boolean>(false)
@ -241,20 +242,22 @@ import { toast } from '@/utils/toast'
handleScanCode: () => {
uni.scanCode({
success: (res) => {
console.log('scanCode res:', res)
uni.showLoading({
title: '验券中...'
toast.loading({
msg: '验券中...'
})
try {
scanVerifyCoupon(res.result, useStore.defaultStore.id).then((res) => {
toast.info('验券成功')
uni.hideLoading()
toast.close()
toast.info({
msg: '验券成功',
duration: 1500
})
}).catch((error) => {
uni.hideLoading()
toast.close()
return false
})
} catch(e) {
uni.hideLoading()
toast.close()
return false
}
},

View File

@ -33,7 +33,7 @@
<view class="mt-40rpx">
<view class="font-400 text-30rpx text-[#606266] leading-44rpx">密码</view>
<view class="mt-20rpx password-input">
<wd-input v-model="model.passowrd" show-password placeholder="请输入密码" no-border
<wd-input v-model="model.passowrd" type="safe-password" placeholder="请输入密码" no-border
custom-class="!bg-[#F6F7F8] !rounded-16rpx"
custom-input-class="!px-32rpx !h-104rpx">
</wd-input>
@ -72,6 +72,16 @@
onLoad((args) => {
// 读取缓存的账号密码
const savedMobile = uni.getStorageSync('loginMobile')
const savedPassword = uni.getStorageSync('loginPassword')
if (savedMobile) {
model.mobile = savedMobile
}
if (savedPassword) {
model.passowrd = savedPassword
}
})
@ -98,13 +108,17 @@
const res = await userStore.mobileLogin(model.mobile, model.passowrd, 1, 1, 1)
uni.hideLoading()
// 这里记录用户账号密码,下次自动填充
uni.setStorageSync('loginMobile', model.mobile)
uni.setStorageSync('loginPassword', model.passowrd)
toast.success('登录成功')
setTimeout(() => {
router.reLaunch('/pages/index/index')
}, 1000)
} catch (error) {
toast.info('登录失败,请稍后重试')
uni.hideLoading
uni.hideLoading()
return
}

View File

@ -66,17 +66,17 @@
{{ storeInfo.name }}
</view>
<view class="mb-16rpx flex items-center text-24rpx text-[#606266] leading-40rpx">
<text class="w-140rpx" v-if="storeInfo.dy_uid">抖音uid:</text>
<text class="flex-1 text-[#000]">{{ storeInfo.dy_uid || '236598984587' }}</text>
<text class="w-140rpx">抖音uid:</text>
<text class="flex-1 text-[#000]">{{ storeInfo.dy_uid || '-' }}</text>
</view>
<view class="mb-16rpx flex items-center text-24rpx text-[#606266] leading-40rpx">
<text class="w-140rpx">门店地址:</text>
<text class="flex-1 text-[#000]">{{ storeInfo.address || '上海浦东新区新金桥路58号新银东大厦 15楼F室' }}</text>
<text class="flex-1 text-[#000]">{{ storeInfo.address || '-' }}</text>
</view>
<view class="relative mb-16rpx flex items-center">
<view class="flex items-center text-24rpx text-[#606266] leading-40rpx">
<text class="w-140rpx">营业时间:</text>
<text class="flex-1 text-[#000]">{{ `${storeInfo.start_time }-${storeInfo.end_time }` || '08:00-22:00' }}</text>
<text class="flex-1 text-[#000]">{{ `${storeInfo.start_time }-${storeInfo.end_time }` || '-' }}</text>
</view>
<view class="modify-btn absolute right-0 flex items-center px-20rpx py-8rpx"
:style="{ backgroundImage: `url('${OSS}images/store/my/image3.png')` }"
@ -87,7 +87,7 @@
</view>
<view class="flex items-center text-24rpx text-[#606266] leading-40rpx" @click="My.handleCall(storeInfo.contact_phone)">
<text class="w-140rpx">联系电话:</text>
<text class="flex-1 text-[#000]">{{ storeInfo.contact_phone || '021-8888888' }}</text>
<text class="flex-1 text-[#000]">{{ storeInfo.contact_phone || '-' }}</text>
</view>
</view>

View File

@ -20,7 +20,7 @@
<view class="mx-30rpx coupon-bg" >
<view class="flex items-center px-30rpx pt-30rpx pb-40rpx">
<view class="mr-30rpx">
<wd-img width="190rpx" height="190rpx" :src="order.room_msg.img" mode="scaleToFill"></wd-img>
<wd-img width="190rpx" height="190rpx" :src="order.room_msg.img" mode="scaleToFill" radius="10rpx"</wd-img>
</view>
<view class="flex-1">
<view class="flex justify-between items-center">

View File

@ -141,7 +141,7 @@
})
try {
uni.hideLoading
// await openLock(params)
await openLock(params)
Device.handleGetDeviceList()
toast.success('开锁成功')
} catch(e) {
@ -155,7 +155,7 @@
* @params event 事件参数
* @params item 设备项
*/
handleToggleSocket: (event: {value: boolean}, item: any) => {
handleToggleSocket: async (event: {value: boolean}, item: any) => {
let params = {
device_id: item.device_id,
state: Number(event.value),
@ -168,7 +168,7 @@
})
try {
uni.hideLoading
// await openPower(params)
await openPower(params)
Device.handleGetDeviceList()
toast.success('操作成功')
} catch(e) {

View File

@ -21,8 +21,8 @@
class="flex flex-col overflow-hidden rounded-16rpx bg-white"
@click="RoomManage.handleClickRoom(room)">
<!-- 房间图片 -->
<view class="relative aspect-[4/3] w-full">
<wd-img width="100%" height="100%" :src="room.img" mode="aspectFill" />
<view class="relative aspect-[4/3] w-full h-316rpx">
<wd-img width="100%" height="316rpx" :src="room.img" mode="aspectFill" />
<!-- 编辑图标覆盖层 -->
<view
class="absolute right-16rpx top-16rpx h-48rpx w-48rpx flex items-center justify-center rounded-24rpx bg-black bg-opacity-40"
@ -70,7 +70,9 @@
import { getRoomList, editRoom } from '@/api/store'
import { router } from '@/utils/tools'
import { toast } from '@/utils/toast'
import { useStoreStore } from '@/store'
const useStore = useStoreStore()
// 房间状态枚举
enum RoomStatus {
@ -159,7 +161,7 @@
const filter = {
page: mescroll.num,
size: mescroll.size,
store_id: 1,
store_id: useStore.defaultStore.id,
}
getRoomList(filter).then((res) => {

View File

@ -59,8 +59,9 @@ export const useUserStore = defineStore(
userInfo.value = { ...userInfoState }
userMoney.value = 0
// 清除所有缓存
uni.clearStorageSync()
// 清除缓存
uni.removeStorageSync('userInfo')
uni.removeStorageSync('token')
}
/**
* 获取用户信息