调试接口

This commit is contained in:
wangxiaowei
2025-12-23 17:55:14 +08:00
parent 3af440cd21
commit 716160c113
13 changed files with 133 additions and 50 deletions

View File

@ -144,7 +144,7 @@
<view class="text-[#606266] text-right mt-26rpx" v-if="orderStatus !== TeaRoomOrderStatus.Pending">
<text class="text-24rpx leading-34rpx mr-12rpx">实付</text>
<text class="tetx-32rpx leading-36rpx">{{ order.order_amount }}</text>
<wd-icon name="chevron-right" size="32rpx"></wd-icon>
<!-- <wd-icon name="chevron-right" size="32rpx"></wd-icon> -->
</view>
</view>
</view>
@ -164,20 +164,10 @@
一键续订
</view>
</view>
<!-- <view class="mt-20rpx px-30rpx" >续订时长1小时</view> -->
<!-- <view class="mb-20rpx px-30rpx" v-if="order.renew_hour">续订时长{{ order?.renew_hour }}小时</view> -->
</view>
</view>
</view>
<view class="bg-white rounded-16rpx px-30rpx py-34rpx mx-30rpx mt-20rpx" v-if="order.renew_hour">
<view class="text-[#303133] text-32rpx leading-44rpx">续订信息</view>
<view class="text-28rpx leading-40rpx text-[#606266] flex items-center justify-between mt-22rpx">
<view>续订时长</view>
<view>{{ order.renew_hour }} 小时</view>
</view>
</view>
<!-- 已预约和消费中显示开门锁 -->
<view class="bg-white rounded-16rpx mx-30rpx mt-20rpx" v-if="orderStatus === TeaRoomOrderStatus.Pay || orderStatus === TeaRoomOrderStatus.Consumption">
<view class="pt-32rpx text-[#303133] text-32rpx leading-44rpx px-30rpx">开门锁</view>
@ -187,7 +177,7 @@
<view class="">
<view class="flex justify-between items-center mt-18rpx pb-18rpx px-62rpx">
<view class="w-224rpx">
<view class="relative h-64rpx">
<view class="relative h-64rpx" @click="OrderDetail.handleOpenDoorLock('door')">
<wd-img width="224rpx" height="64rpx" :src="`${OSS}images/reserve_room/reserve_room_image5.png`"/>
<view class="text-[#4C9F44] font-bold text-32rpx leading-44rpx absolute top-[50%] transform translate-y-[-50%] right-22rpx">点击开锁</view>
</view>
@ -195,7 +185,7 @@
<view class="text-[#606266] text-26rpx leading-48rpx mt-4rpx text-center font-500">手动输入 1052 32#</view>
</view>
<view class="border-r-2rpx border-r-solid border-r-[#F6F7F9] h-224rpx"></view>
<view class="w-224rpx">
<view class="w-224rpx" @click="OrderDetail.handleOpenDoorLock('room')">
<view class="relative h-64rpx">
<wd-img width="224rpx" height="64rpx" :src="`${OSS}images/reserve_room/reserve_room_image6.png`"/>
<view class="text-[#4C9F44] font-bold text-32rpx leading-44rpx absolute top-[50%] transform translate-y-[-50%] right-22rpx">点击开锁</view>
@ -310,6 +300,7 @@
import { toTimes, copy } from '@/utils/tools'
import { useUserStore } from '@/store'
import { PayOrderType } from '@/utils/pay'
import { openLock } from '@/api/user'
const OSS = inject('OSS')
@ -703,6 +694,23 @@
}
}
}).catch(() => {})
},
/**
* 开锁
* @param type 锁的类型 room-房间锁 door-大门锁
*/
handleOpenDoorLock: async (lockType: string) => {
uni.showLoading({ title: '开锁中...', mask: true })
try {
const type = lockType === 'door' ? 1 : 2
await openLock(orderId.value, type)
uni.hideLoading()
toast.info('开锁成功')
} catch(e) {
uni.hideLoading()
return false
}
}
}
</script>