调试接口

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

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) => {