From a77a7ab716b227d24b9008a5900baa2dfa41c82e Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Fri, 27 Sep 2024 10:12:32 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E9=80=BB=E8=BE=91=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=EF=BC=8C=E6=94=AF=E4=BB=98=E5=AE=9D=E5=85=BC=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/member/components/registermember.vue | 1 + pages/member/list.vue | 6 +- pages/user/coupon.vue | 4 +- pagesOrder/components/paymentMethod.vue | 18 ++--- pagesOrder/confirm_order/index.vue | 83 +++++++++++++++++----- pagesOrder/orderAMeal/index.vue | 25 +++++-- pagesOrder/order_detail/index.vue | 11 ++- 7 files changed, 103 insertions(+), 45 deletions(-) diff --git a/pages/member/components/registermember.vue b/pages/member/components/registermember.vue index 2f0909b..09fa87f 100644 --- a/pages/member/components/registermember.vue +++ b/pages/member/components/registermember.vue @@ -251,6 +251,7 @@ }) this.phonetitle = res.data.substr(0, 3) + "****" + res.data.substr(7) this.mobile = res.data; + console.log(this.phonetitle) } }); } diff --git a/pages/member/list.vue b/pages/member/list.vue index 6005a9c..004b591 100644 --- a/pages/member/list.vue +++ b/pages/member/list.vue @@ -109,12 +109,10 @@ type: 'index', }) } else { - // uni.pro.navigateTo('member/memberdetails', { - // shopId: item.shopId - // }) - uni.pro.navigateTo('/pages/order_food/order_food', { + uni.pro.navigateTo('member/memberdetails', { shopId: item.shopId }) + } } diff --git a/pages/user/coupon.vue b/pages/user/coupon.vue index ac7cba0..e60afef 100644 --- a/pages/user/coupon.vue +++ b/pages/user/coupon.vue @@ -133,7 +133,9 @@ */ navigatorGo ( item ) { if ( item.type == 2 ) { - + uni.pro.navigateTo('/pages/order_food/order_food', { + shopId: item.shopId + }) } }, } diff --git a/pagesOrder/components/paymentMethod.vue b/pagesOrder/components/paymentMethod.vue index e7ef70c..702efae 100644 --- a/pagesOrder/components/paymentMethod.vue +++ b/pagesOrder/components/paymentMethod.vue @@ -6,7 +6,7 @@ - + @@ -18,7 +18,7 @@ - + @@ -36,12 +36,12 @@ data() { return { paymentMethodList:[ - { name: "余额支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"}, + { name: "余额支付", type: 1, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"}, // #ifdef MP-WEIXIN - { name: "微信支付", type: "2", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"}, + { name: "微信支付", type: 2, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"}, // #endif // #ifdef MP-ALIPAY - { name: "支付宝支付", type: "3", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png"}, + { name: "支付宝支付", type: 3, url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png"}, // #endif ], radiovalue: 1, // 支付方式 @@ -61,11 +61,11 @@ methods: { /** * 监听支付方式切换 - * @param {Object} n + * @param {Object} */ - groupChange(n) { - this.radiovalue = n; - this.$emit("groupChange",n) + groupChange(type,name) { + this.radiovalue = type; + this.$emit("groupChange",{type:type ,name:name }) }, diff --git a/pagesOrder/confirm_order/index.vue b/pagesOrder/confirm_order/index.vue index 6ca90e4..f4db364 100644 --- a/pagesOrder/confirm_order/index.vue +++ b/pagesOrder/confirm_order/index.vue @@ -74,6 +74,10 @@ ¥{{ item.totalAmount || item.priceAmount || 0}} + + 餐位费 + X{{dinersNum}}X{{dinersNum*storeInfo.tableFee}} + - + @@ -193,15 +197,6 @@ { name: "优惠券", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/coupon.png"}, { name: "团购优惠", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/groupOffer.png"}, ], - paymentMethodList:[ - { name: "余额支付", type: "1", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/drder/wechat.png"}, - // #ifdef MP-WEIXIN - { name: "微信支付", type: "2", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/weChat.png"}, - // #endif - // #ifdef MP-ALIPAY - { name: "支付宝支付", type: "3", url: "https://czg-qr-order.oss-cn-beijing.aliyuncs.com/confirmOrder/alipay.png"}, - // #endif - ], order: { phone: "", }, @@ -255,10 +250,14 @@ console.log(this.storeInfo) this.shopId =this.storeInfo.shopId; this.listinfo.name = this.storeInfo.shopName; - if ( e.tableCode ) { this.tableCode = e.tableCode; } - if ( e.dinersNum ) { this.dinersNum = e.dinersNum; } this.listinfo.details = JSON.parse(e.cartLists).data; this.listinfo.payAmount = JSON.parse(e.cartLists).amount; + if ( e.tableCode ) { this.tableCode = e.tableCode; } + if ( e.dinersNum ) { + this.dinersNum = e.dinersNum; + this.listinfo.payAmount = (this.listinfo.payAmount + this.dinersNum * this.storeInfo.tableFee).toFixed(2); + } + if ( this.storeInfo.eatModel.indexOf("dine-in") != -1 ) { this.eatModel = ["dine-in"] } else { @@ -364,6 +363,9 @@ this.listinfoid = msg.data.id this.listinfo.details = msg.data.detailList; this.listinfo.payAmount = msg.data.amount; + if ( this.dinersNum ) { + this.listinfo.payAmount = (this.listinfo.payAmount + this.dinersNum * this.storeInfo.tableFee).toFixed(2); + } uni.$off('getMessage') this.orderorderInfo(1) break; @@ -375,6 +377,9 @@ } else { this.listinfo.details = msg.data; this.listinfo.payAmount = msg.amount; + if ( this.dinersNum ) { + this.listinfo.payAmount = (this.listinfo.payAmount + this.dinersNum * this.storeInfo.tableFee).toFixed(2); + } } break; case 'order': @@ -391,6 +396,9 @@ } else { this.listinfo.details = msg.data; this.listinfo.payAmount = msg.amount; + if ( this.dinersNum ) { + this.listinfo.payAmount = (this.listinfo.payAmount + this.dinersNum * this.storeInfo.tableFee).toFixed(2); + } } this.isSocket = true; break; @@ -406,6 +414,7 @@ */ tabClick ( index,val ) { this.is_type = index; + this.eatModel = []; this.eatModel.push(val); }, @@ -413,9 +422,10 @@ * 监听支付方式切换 * @param {Object} n */ - groupChange(n) { - this.radiovalue = n; - this.paymentBtnText = n==1?'余额支付':'微信支付' + groupChange(e) { + console.log(e) + this.radiovalue = e.type; + this.paymentBtnText = e.name; }, /** @@ -518,6 +528,7 @@ "isYhq": 0, // 是否使用优惠券( 1: 使用, 0: 不使用), "isBuyYhq": 0, // 是否购买优惠券( 1: 购买, 0: 不够买) "productId": '', //商品id + "tableId": this.tableCode , //商品id "dinersNum": this.dinersNum, //就餐人数 "eatModel": this.eatModel, //就餐模式 "shopId": uni.cache.get('shopId'), @@ -531,7 +542,7 @@ */ showpopupclickdd() { console.log(this.radiovalue) - if ( this.radiovalue == 2 && this.listinfo.payAmount <= 0 ) { + if ( this.radiovalue == 2 || this.radiovalue == 3 && this.listinfo.payAmount <= 0 ) { uni.showToast({ title: "支付金额必须大于0", icon: 'none' @@ -543,7 +554,7 @@ mask: true }) // radiovalue为2是微信支付 - if (this.radiovalue == 2) { + if (this.radiovalue == 2||this.radiovalue == 3) { this.showpopupclickdds() //微信支付 } else { // 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码 @@ -577,7 +588,14 @@ async showpopupclickdds() { let res = await this.api.payorderPay({ - orderId: this.listinfoid + orderId: this.listinfoid, + // #ifdef MP-WEIXIN + payType: 'wechatPay', + // #endif + // #ifdef MP-ALIPAY + payType: 'aliPay', + // #endif + // payType: this.radiovalue == 2 ? 'wechatPay' : 'aliPay' }) //判断是否支付成功 if (res.code == 0) { @@ -617,7 +635,7 @@ // #ifdef MP-ALIPAY uni.requestPayment({ provider: 'alipay', //支付类型-固定值 - orderInfo: res.data.appId, // 微信支付商户号 + orderInfo: res.data.tradeNo, // 微信支付商户号 success: (res) => { let _this = this @@ -1036,6 +1054,33 @@ font-weight: 500; } } + .cell_item{ + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 32rpx; + padding: 0 30rpx; + .lable{ + font-weight: 500; + font-size: 28rpx; + color: #333333; + } + .value{ + display: flex; + align-items: flex-end; + view:nth-child(1){ + font-weight: 400; + font-size: 24rpx; + color: #999999; + margin-right: 16rpx; + } + view:nth-child(2){ + font-weight: bold; + font-size: 28rpx; + color: #333333; + } + } + } .favorable{ display: flex; align-items: center; diff --git a/pagesOrder/orderAMeal/index.vue b/pagesOrder/orderAMeal/index.vue index d3717ee..4c9d08e 100644 --- a/pagesOrder/orderAMeal/index.vue +++ b/pagesOrder/orderAMeal/index.vue @@ -8,9 +8,13 @@ 桌号A2 - {{item+1}} + + {{index+1}} + + + + - 开始点餐 @@ -109,7 +113,7 @@ z-index: 2; display: flex; flex-direction: column; - padding: 48rpx 32rpx 32rpx 32rpx; + padding: 48rpx 0 32rpx 32rpx; background: #FFFFFF; border-radius: 44rpx 44rpx 44rpx 44rpx; .title{ @@ -117,6 +121,7 @@ align-items: center; justify-content: space-between; margin-bottom: 48rpx; + padding-right: 32rpx; .title_text{ font-weight: bold; font-size: 32rpx; @@ -131,8 +136,12 @@ .num{ display: flex; flex-wrap: wrap; + .item{ + width: 20%; + padding-right: 32rpx; + } .num_item{ - width: 104rpx; + width: 100%; height: 56rpx; line-height: 56rpx; text-align: center; @@ -148,7 +157,7 @@ margin-right: 0; } ::v-deep .u-input{ - width: 104rpx; + width: 100%; height: 56rpx; line-height: 56rpx; text-align: center; @@ -159,9 +168,11 @@ } ::v-deep input{ font-weight: 400; + border-radius: 12rpx; font-size: 28rpx!important; color: #333333!important; text-align: center!important; + background-color: #FEF4EB!important; } .active{ color: #fff; @@ -170,7 +181,7 @@ } ::v-deep .num.active .u-input{ - width: 104rpx; + width: 100%; height: 56rpx; line-height: 56rpx; text-align: center; @@ -180,6 +191,8 @@ } ::v-deep .num.active input{ color: #fff!important; + border-radius: 12rpx; + background-color: #E8AD7B!important; } } diff --git a/pagesOrder/order_detail/index.vue b/pagesOrder/order_detail/index.vue index 04ad2b1..1dbcc62 100644 --- a/pagesOrder/order_detail/index.vue +++ b/pagesOrder/order_detail/index.vue @@ -94,10 +94,9 @@ } }, - groupChange (n) { - console.log(n) - this.radiovalue = n; - this.paymentBtnText = n==1?'余额支付':'微信支付' + groupChange (e) { + this.radiovalue = e.type; + this.paymentBtnText = e.name; }, /** * 获取订单信息 @@ -133,14 +132,14 @@ * 去支付 */ goToPay(){ - if ( this.radiovalue == 2 && this.listinfo.payAmount <= 0 ) { + if ( this.radiovalue == 2 || this.radiovalue == 3 && this.listinfo.payAmount <= 0 ) { uni.showToast({ title: "支付金额必须大于0", icon: 'none' }) return; } - if (this.radiovalue == 2) { + if (this.radiovalue == 2 || this.radiovalue == 3) { this.wechatPay() //微信支付 } else { // 先判断是否设置支付密码。0是没设置。没设置的情况下跳转到设置页面。有的话输入支付密码