diff --git a/src/api/login.ts b/src/api/login.ts index 2d8c49e..d229080 100644 --- a/src/api/login.ts +++ b/src/api/login.ts @@ -71,13 +71,6 @@ export function updateInfo(data: IUpdateInfo) { return http.Get('/user/updateInfo', data) } -/** - * 修改用户密码 - */ -export function updateUserPassword(data: IUpdatePassword) { - return http.Get('/user/updatePassword', data) -} - /** * 获取微信登录凭证 * @returns Promise 包含微信登录凭证(code) diff --git a/src/api/user.ts b/src/api/user.ts index 4d369b8..752a922 100644 --- a/src/api/user.ts +++ b/src/api/user.ts @@ -184,4 +184,11 @@ export function transferOrder(order_id: number) { */ export function getMobileByMnp(code: string) { return http.Post('/api/user/getMobileByMnp', {code}) +} + +/** + * 用户开门 + */ +export function openLock(order_id: number, type: number) { + return http.Post('/api/Common/ce_ttlock', {order_id, type}) } \ No newline at end of file diff --git a/src/bundle/coupon/coupon.vue b/src/bundle/coupon/coupon.vue index 6881328..eefe96d 100644 --- a/src/bundle/coupon/coupon.vue +++ b/src/bundle/coupon/coupon.vue @@ -198,6 +198,8 @@ } else { coupon = groupCouponList.value.find(item => item.id === checkedId.value) } + console.log("🚀 ~ coupon:", coupon) + uni.$emit('chooseCoupon', { coupon }) router.navigateBack() } diff --git a/src/bundle/order/platform/order-detail.vue b/src/bundle/order/platform/order-detail.vue index 7036b14..c7e6be2 100644 --- a/src/bundle/order/platform/order-detail.vue +++ b/src/bundle/order/platform/order-detail.vue @@ -49,7 +49,7 @@ 实付 ¥{{ order.order_amount }} - + @@ -67,7 +67,8 @@ - + + 券码 {{ order.user_group.qr_sn }} diff --git a/src/bundle/order/tea-room/order-detail.vue b/src/bundle/order/tea-room/order-detail.vue index cacd691..be42614 100644 --- a/src/bundle/order/tea-room/order-detail.vue +++ b/src/bundle/order/tea-room/order-detail.vue @@ -144,7 +144,7 @@ 实付 ¥{{ order.order_amount }} - + @@ -164,20 +164,10 @@ 一键续订 - - - - 续订信息 - - 续订时长 - {{ order.renew_hour }} 小时 - - - 开门锁 @@ -187,7 +177,7 @@ - + 点击开锁 @@ -195,7 +185,7 @@ 手动输入 1052 32# - + 点击开锁 @@ -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 + } } } diff --git a/src/bundle/profile/profile.vue b/src/bundle/profile/profile.vue index 445a7f5..87a21e7 100644 --- a/src/bundle/profile/profile.vue +++ b/src/bundle/profile/profile.vue @@ -223,6 +223,7 @@ */ handleToEditMobile: async (e: any) => { const res = await getMobileByMnp(e.code) + Profile.handleInit() }, /** diff --git a/src/bundle/tea-room/detail.vue b/src/bundle/tea-room/detail.vue index 6796d74..c89a490 100644 --- a/src/bundle/tea-room/detail.vue +++ b/src/bundle/tea-room/detail.vue @@ -398,6 +398,7 @@ }) }) + // 防止重复提交 const Detail = { @@ -494,15 +495,18 @@ return } + + uni.$off('chooseCoupon'); uni.$on('chooseCoupon', params => { - console.log("🚀 ~ params:", params) + console.log(12312312) uni.$off('chooseCoupon') - + console.log("🚀 ~ type:", type) if (type === CouponType.Discount) { selectedCoupon.value = {id: params.coupon.id, name: `${params.coupon.name}减${params.coupon.coupon_price}` } bill.value.coupon = params.coupon.coupon_price selectCouponId.value = params.coupon.id // 这里的ID是在数据表自增的ID,保存下来是为了回显列表的,没有其他作用 } else { + console.log('gropu') selectedGroupCoupon.value = {id: params.coupon.id, name: `团购券-${params.coupon?.title}` } bill.value.groupCoupon = params.coupon.coupon_price selectGroupCouponId.value = params.coupon.id // 这里的ID是在数据表自增的ID,保存下来是为了回显列表的,没有其他作用 diff --git a/src/bundle/tea-room/room.vue b/src/bundle/tea-room/room.vue index f0b573d..6b69407 100644 --- a/src/bundle/tea-room/room.vue +++ b/src/bundle/tea-room/room.vue @@ -12,14 +12,14 @@