From c6c26809933c188e817989971db1101850c59e4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Tue, 28 May 2024 15:57:18 +0800 Subject: [PATCH 1/3] 1 --- pages/order_food/order_food.vue | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue index b64ea8d..c3e2d1a 100644 --- a/pages/order_food/order_food.vue +++ b/pages/order_food/order_food.vue @@ -282,9 +282,6 @@ uni.reLaunch({ url: '/pages/login/login?type=' + 0 }); - // uni.pro.navigateTo('login/login', { - // type: 0 - // }) } uni.$on('message', this.getMessage) this.$nextTick(() => { @@ -296,9 +293,11 @@ uni.$off('message') }, onShow() { - if (uni.cache.get('token') && uni.cache.get('tableCode')) { - this.productqueryShopIdByTableCode() //获取shop User id - } + setTimeout(() => { + if (uni.cache.get('token') && uni.cache.get('tableCode')) { + this.productqueryShopIdByTableCode() //获取shop User id + } + }, 1000) }, methods: { // 单独获取他的shopUserid From 219dce9b2ff257ac86ee46a1acccd860bdb7f82b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Tue, 28 May 2024 16:24:42 +0800 Subject: [PATCH 2/3] 11 --- pages/order_food/order_food.vue | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue index c3e2d1a..6ae8f2f 100644 --- a/pages/order_food/order_food.vue +++ b/pages/order_food/order_food.vue @@ -289,6 +289,9 @@ }); }, onUnload() { + this.socketSendMsg({ //定义socket数据传参 + "type": "close", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”, + }) this.socketTicket.Close() uni.$off('message') }, @@ -297,7 +300,7 @@ if (uni.cache.get('token') && uni.cache.get('tableCode')) { this.productqueryShopIdByTableCode() //获取shop User id } - }, 1000) + }, 500) }, methods: { // 单独获取他的shopUserid @@ -321,6 +324,9 @@ icon: "none", }) if (msg.msg == '桌码不存在') { //卓码不存在直接退出 + this.socketSendMsg({ //定义socket数据传参 + "type": "close", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”, + }) this.socketTicket.Close() uni.$off('message') uni.navigateBack() From 407a5c7e5222ccd5e1c3ee99014586b90bb5d7fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=95=BE?= <1144797966@qq.com> Date: Tue, 28 May 2024 16:40:02 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E8=B0=83=E6=94=AF=E4=BB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order_detail/order_detail.vue | 65 +++++++++++++---------------- 1 file changed, 30 insertions(+), 35 deletions(-) diff --git a/pages/order_detail/order_detail.vue b/pages/order_detail/order_detail.vue index 2acb8ec..b8291d7 100644 --- a/pages/order_detail/order_detail.vue +++ b/pages/order_detail/order_detail.vue @@ -171,7 +171,7 @@ 以优惠¥{{emitorderfoodform.couponsPrice}} - + 立即付款 @@ -210,7 +210,6 @@ // 输入支付密码 123 passwordArr: [], ispws: false, - numValue: 0 }; }, @@ -222,7 +221,7 @@ // }) }, onLoad(e) { - + // console.log(e, 140) let res = JSON.parse(e.tableId) this.listinfo.detailList = res @@ -255,11 +254,11 @@ }) }, methods: { - fangdouevent() { - this.$u.debounce(() => { - this.showpopupclick() - }, 1000) - }, + // fangdouevent() { + // this.$u.debounce(() => { + // this.showpopupclick() + // }, 1000) + // }, async getcoupon() { let res = await this.api.userCoupon({ "orderNum": this.listinfo.amount, @@ -320,7 +319,7 @@ orderfoodindex() { uni.pro.navigateTo('index/coupons/index', { orderfood: 0, - orderId :this.listinfoid, + orderId: this.listinfoid, amount: this.listinfo.amounts }) }, @@ -342,24 +341,19 @@ }, // 去结算 showpopupclick() { - if (this.numValue == 0) { - let data = { //定义socket数据传参 - "skuId": '', - "num": '', //数量 - "type": "createOrder", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”, - "couponsId": this.emitorderfoodform.id ? this.emitorderfoodform.id : '', //优惠券ID, - "isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1: 使用, 0: 不使用), - "isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1: 购买, 0: 不够买) - "productId": '', //商品id - "shopId": uni.cache.get('shopUser'), - "userId": uni.cache.get('userInfo').id, - // tableId:uni.cache.get('tableCode') - } - this.numValue = 1 - uni.$u.debounce(this.socketSendMsg(data), 500) - } else { - this.showpopupclickdd() + let data = { //定义socket数据传参 + "skuId": '', + "num": '', //数量 + "type": "createOrder", //“addcart:添加购物车,create0rder:生成订单,clearCart:庆康购物车”, + "couponsId": this.emitorderfoodform.id ? this.emitorderfoodform.id : '', //优惠券ID, + "isYhq": this.emitorderfoodform.id ? 1 : 0, // 是否使用优惠券( 1: 使用, 0: 不使用), + "isBuyYhq": this.emitorderfoodform.clickiconone == 1 ? 1 : 0, // 是否购买优惠券( 1: 购买, 0: 不够买) + "productId": '', //商品id + "shopId": uni.cache.get('shopUser'), + "userId": uni.cache.get('userInfo').id, + // tableId:uni.cache.get('tableCode') } + this.socketSendMsg(data) }, // 去充值 goRecharge() { @@ -369,7 +363,6 @@ }, async showpopupclickdd(i) { - if (this.radiovalue1 == 1) { let res = await this.api.payorderPay({ orderId: this.listinfoid @@ -399,7 +392,8 @@ uni.redirectTo({ url: '/pages/order/successful?orderId=' + this .listinfoid + '&orderInfo=' + JSON.stringify( - this.orderInfo) + '&payType' + this.radiovalue1 + this.orderInfo) + '&payType' + this + .radiovalue1 }); }, 1000) // uni.redirectTo({ @@ -408,11 +402,11 @@ // }); }, fail: (err) => { - uni.showToast({ - icon: 'none', - title: '支付失败' - }) - uni.hideLoading() + uni.showToast({ + icon: 'none', + title: '支付失败' + }) + uni.hideLoading() // uni.redirectTo({ // url: '/pages/order/order_detail?orderId=' + this.listinfoid // }); @@ -426,7 +420,7 @@ } else { // 判断是否有绑定支付密码 // 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码 - let isVip = uni.cache.get('userInfo').isPwd + let isVip = uni.cache.get('userInfo').isPwd if (isVip == 0) { uni.pro.navigateTo('/pages/user/repairpassword', { shopId_id: uni.cache.get('shopUser') @@ -456,7 +450,8 @@ uni.redirectTo({ url: '/pages/order/successful?orderId=' + this .listinfoid + '&orderInfo=' + JSON.stringify( - this.orderInfo)+ '&radiovalue1=' + this.radiovalue1 + this.orderInfo) + '&radiovalue1=' + this + .radiovalue1 }); }, 1000)