From 69151ca3f4044f01dd8b4d7fa76c06a826e6fc6a Mon Sep 17 00:00:00 2001 From: GaoHao <1210693421@qq.com> Date: Mon, 18 Nov 2024 16:41:32 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=88=E4=B8=8B=E5=8D=95=E5=90=8E=E6=94=AF?= =?UTF-8?q?=E4=BB=98=E4=BC=98=E6=83=A0=E5=88=B8=E7=9B=B8=E5=85=B3=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- framework/0-conf.js | 8 +++--- pages/member/index.vue | 20 +++++++++++-- pages/order_food/order_food.vue | 13 ++++----- pagesOrder/components/orderInfoAfter.vue | 36 +++++++++++++++++------- pagesOrder/order_detail/index.vue | 6 +++- 5 files changed, 57 insertions(+), 26 deletions(-) diff --git a/framework/0-conf.js b/framework/0-conf.js index d002bd2..2cc2c99 100644 --- a/framework/0-conf.js +++ b/framework/0-conf.js @@ -6,10 +6,10 @@ const proxyApi = "/api" // const proxyApi = 'http://192.168.1.15:9888/cashierService' // 王伟 // const proxyApi = 'http://192.168.1.27:9888/cashierService' // 帆哥 // const proxyApiwws = 'ws://192.168.1.15:9888/netty' // 测试 -// const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试 -// const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试 -const proxyApi = 'https://pre-cashier.sxczgkj.cn/cashierService' // 预发布 -const proxyApiwws = 'wss://pre-cashier.sxczgkj.cn/netty' // 预发布 +const proxyApi = 'https://wxcashiertest.sxczgkj.cn/cashierService' // 测试 +const proxyApiwws = 'wss://wxcashiertest.sxczgkj.cn/netty' // 测试 +// const proxyApi = 'https://pre-cashier.sxczgkj.cn/cashierService' // 预发布 +// const proxyApiwws = 'wss://pre-cashier.sxczgkj.cn/netty' // 预发布 // const proxyApi = 'https://cashier.sxczgkj.cn/cashierService' // 线上 // const proxyApiwws = 'wss://cashier.sxczgkj.cn/netty' // 线上 // #endif diff --git a/pages/member/index.vue b/pages/member/index.vue index 5ac6740..84ff3c9 100644 --- a/pages/member/index.vue +++ b/pages/member/index.vue @@ -387,12 +387,16 @@ orderInfo: res.data.tradeNo, // 微信支付商户号 // #endif success: (res) => { - uni.showToast({ - title: "支付成功" - }) + // resultCode 9000 + console.log(res) + console.log(2) + uni.hideLoading() let pages = getCurrentPages() // #ifdef MP-WEIXIN + uni.showToast({ + title: "支付成功" + }) uni.requestSubscribeMessage({ tmplIds:["AV-KybUHaK3KtFVLqpy6PHccHBS7XeX__mOM4RbufnQ"], complete() { @@ -414,6 +418,16 @@ }) // #endif // #ifdef MP-ALIPAY + if ( res.resultCode == '9000') { + uni.showToast({ + title: "支付成功" + }) + } else { + uni.showToast({ + title: "支付失败" + }) + } + if ( _this.type && _this.type == "topUpActivity") { uni.pro.navigateBack() } else { diff --git a/pages/order_food/order_food.vue b/pages/order_food/order_food.vue index fd80e6f..33e0231 100644 --- a/pages/order_food/order_food.vue +++ b/pages/order_food/order_food.vue @@ -662,7 +662,7 @@ if (b == '单规格') { //没有规格为空 this.skuidname = [] } - if ( a == "+" && item.isVip == 1 && item.cartNumber >= item.limitNumber){ + if ( a == "+" && item.cartNumber >= item.limitNumber){ uni.showToast({ title: '当前商品已达到最大赠送数量', icon: 'none' @@ -685,7 +685,7 @@ */ shopAdd(item, index, index1, a, b) { if (a == "+") { - if ( item.isVip == 1 && this.amountcartNumber >= item.limitNumber){ + if ( this.amountcartNumber >= item.limitNumber){ uni.showToast({ title: '当前商品已达到最大赠送数量', icon: 'none' @@ -717,7 +717,7 @@ return; } let num = 0; - if ( item.isVip == 1 && item.cartNumber >= item.limitNumber){ + if (item.cartNumber >= item.limitNumber){ uni.showToast({ title: '当前商品已达到最大赠送数量', icon: 'none' @@ -733,7 +733,6 @@ "skuId": this.skuId, "num": num, //数量 "type": a == '+' ? 1 : 0, - "isVip": item.isVip, "productId": item.id, //商品id "shopId": this.shopId, "note": item.note, @@ -775,7 +774,7 @@ setNumber() { // 处理购物车相同id的情况下 数量相加 var summedArray = this.cartLists.data.reduce((acc, current) => { - const existing = acc.find(item => item.productId === current.productId && item.isVip === current.isVip); + const existing = acc.find(item => item.productId === current.productId); if (existing) { existing.number += current.number; } else { @@ -790,7 +789,7 @@ return item.products.filter(e => { e.cartNumber = 0; return summedArray.find(i => { - if (e.id == i.productId && e.isVip == i.isVip) { + if (e.id == i.productId) { e.cartNumber = i.number } }) @@ -986,7 +985,6 @@ code: this.tableCode, shopId: this.shopId, productId: item.id, //商品id - isVip: item.isVip, //商品id spec_tag: this.skuidname.join(","), }) this.salePrice = res.data.salePrice // 价格 @@ -997,7 +995,6 @@ "num": num, //数量 "type": c == '+' ? 1 : 0, "productId": item.id, //商品id - "isVip": item.isVip, "note": item.note, "shopId": this.shopId, "userId": uni.cache.get('userInfo').id, diff --git a/pagesOrder/components/orderInfoAfter.vue b/pagesOrder/components/orderInfoAfter.vue index f9ca335..4dbd630 100644 --- a/pagesOrder/components/orderInfoAfter.vue +++ b/pagesOrder/components/orderInfoAfter.vue @@ -150,10 +150,23 @@ type: Object }, }, + watch :{ + listinfo:{ + immediate: true, + handler (newVal) { + console.log(newVal) + this.$forceUpdate() + } + }, + }, mounted() { console.log(this.listinfo.shopId) + uni.$on('couponItem',this.changeCoupon) this.getCalcUsablePoints() }, + onShow() { + // uni.$on('couponItem',this.changeCoupon) + }, methods: { /** * 监听优惠券/商品券选择 @@ -190,11 +203,12 @@ num: couponData.type == 1 ? 1 : couponData.num, }) } - if ( _this.isPointsChecked) { + console.log(_this.listinfo.payAmount) + // if ( _this.isPointsChecked ) { _this.pointsChange() _this.getCalcUsablePoints() - } - + // } + this.$emit("setPayAmount",_this.listinfo.payAmount) } else { uni.showToast({ title: "优惠券满减金额大于订单金额不可使用", @@ -202,7 +216,7 @@ }) } } else { //商品券 - // this.listinfo.details + // 筛选选中商品券商品列表 let couponList = _this.listinfo.details.filter(v => v.productId == couponData.proId); //金额从小到大排序 @@ -216,7 +230,7 @@ productTicketList.map((item,index) => { productTicketNum += item.num }) - console.log(productTicketNum) + console.log(minCouponList) minCouponList.map((item,index) => { productNumber += item.number if ( productNum > 0 && productNumber > productTicketNum) { @@ -227,7 +241,6 @@ productPayAmount = productPayAmount + (num*(item.memberPrice > 0 ? item.memberPrice : item.salePrice)) } }) - console.log(minCouponList) _this.userCouponInfos.push({ userCouponId: couponData.id, type: couponData.type, @@ -243,11 +256,13 @@ discountAmount: productPayAmount, num: productNum == 0 ? couponData.num : (couponData.num - productNum), }) - - if ( _this.isPointsChecked) { + console.log(productNum) + console.log(_this.favorable) + // if ( _this.isPointsChecked) { _this.pointsChange() _this.getCalcUsablePoints() - } + // } + this.$emit("setPayAmount",_this.listinfo.payAmount) } uni.$off('couponItem') }, @@ -267,6 +282,7 @@ this.freeDisabled = false this.listinfo.payAmount = (Number(this.listinfo.payAmount)+(this.calcUsablePointsData.pointsNum/this.calcUsablePointsData.equivalentPoints)).toFixed(2); } + this.$emit("setPayAmount",_this.listinfo.payAmount) }, goUrl(item){ switch (item.type){ @@ -544,7 +560,7 @@ display: flex; align-items: center; justify-content: space-between; - // padding: 0 30rpx; + padding: 0 30rpx; box-sizing: border-box; padding-bottom: 26rpx; padding-top: 26rpx; diff --git a/pagesOrder/order_detail/index.vue b/pagesOrder/order_detail/index.vue index f1ca626..fc4f6f9 100644 --- a/pagesOrder/order_detail/index.vue +++ b/pagesOrder/order_detail/index.vue @@ -27,7 +27,7 @@ - + @@ -115,6 +115,10 @@ console.log(e) }, methods: { + setPayAmount(payAmount) { + this.listinfo.payAmount = payAmount + this.$forceUpdate() + }, saveImage (url) { uni.saveImage({ url: url,