diff --git a/components/goodPopup.vue b/components/goodPopup.vue index 6736a34..d35056a 100644 --- a/components/goodPopup.vue +++ b/components/goodPopup.vue @@ -14,7 +14,9 @@ 商品价格 - ¥ {{ datas.price || datas.sell }} / {{ datas.unit_name }} + ¥ {{priceKey.off_activity==1? datas[priceKey.price]: datas[priceKey.op_price] }} / + {{ datas.unit_name }} + 起批量 @@ -30,20 +32,14 @@ 购买重量* - - + + 购买数量* - - - - + + @@ -80,13 +76,22 @@ }, }) + + let priceKey = ref({}) + if (uni.getStorageSync('PRICE_KEY')) { + priceKey.value = JSON.parse(uni.getStorageSync('PRICE_KEY')); + } else { + priceKey.value = {}; + } + + const datas = ref({ cart_num: '' }); const setData = (e) => { datas.value = e; if (Number(e.batch) > 0) datas.value.cart_num = e.batch; - else datas.value.cart_num = ''; + else datas.value.cart_num = 1; } @@ -107,13 +112,16 @@ } const subtotal = computed(() => { - let num = +datas.value.cart_num || 0; - let sell = +datas.value.sell || +datas.value.price; + let num = +datas.value.cart_num || 1; + let sell = +datas.value[priceKey.value.off_activity == 1 ? priceKey.value.price : priceKey.value.op_price]; return Number(num * sell * 100 / 100).toFixed(2) }) + + + defineExpose({ setData, // founcsFn diff --git a/pageQuota/vipUser/index.vue b/pageQuota/vipUser/index.vue index 581c460..6a8f541 100644 --- a/pageQuota/vipUser/index.vue +++ b/pageQuota/vipUser/index.vue @@ -424,7 +424,7 @@ // 支付相关 // scoket - let timer = null + let timerInvol = null const userInfo = useUserStore().userInfo; const connection = new Push({ url: config.WSS_URL, // websocket地址 @@ -434,9 +434,8 @@ // 浏览器监听user-1 const user_channel = connection.subscribe(`wechat_mmp_${userInfo.id}`); user_channel.on('message', function(data) { - console.log("收到消息--", data); try { - if (timer) clearTimeout(timer); + if (timerInvol) clearTimeout(timerInvol); paySuccessToTabs2() } catch (error) {} }); @@ -461,7 +460,7 @@ formData.recharge_type = 'INDUSTRYMEMBERS' formData.user_ship = 1 vipRechargeApi(formData).then(res => { - timer = setTimeout(() => { + timerInvol = setTimeout(() => { uni.hideLoading(); uni.$u.toast('支付超时'); }, 30000) @@ -507,7 +506,7 @@ id: item.id, auth_code: res.result }).then(res => { - timer = setTimeout(() => { + timerInvol = setTimeout(() => { uni.hideLoading(); uni.$u.toast('支付超时'); }, 30000) diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue index 471900a..08b170f 100644 --- a/pages/cart/cart.vue +++ b/pages/cart/cart.vue @@ -264,6 +264,9 @@ pay_price: res.data?.extend.pay_price || '0.00', count: res.data?.count || 0 } + + + console.log(cartInfo.value) setTimeout(() => { triggered.value = false; }, 300) @@ -275,7 +278,7 @@ return price.split('.')[0] || '0'; }) const c_price1 = computed(() => { - let price = cartInfo.value.total_price + ''; + let price = cartInfo.value.pay_price + ''; return price.split('.')[1] || '00'; }) diff --git a/pages/index/index.vue b/pages/index/index.vue index 4e0e4fa..6af51d2 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -160,8 +160,7 @@ - + 活动价 {{item[priceKey.price]}}/{{ item.unit_name }} @@ -172,12 +171,12 @@ - 原   价 + 原价 ¥{{item[priceKey.op_price]}} - 售   价 + 售价 {{item[priceKey.op_price]}} @@ -185,7 +184,7 @@ - 规   格 + 规格 {{ item.unit+item.unit_name }}/份 @@ -1101,12 +1100,14 @@ .shop-content-li-l { font-size: 22rpx; width: 70rpx; + text-align-last: justify; + margin-right: 6rpx; } } .tag { - font-size: 18rpx; + font-size: 16rpx; color: #A17C3A; background-color: #F3E7C0; padding: 8rpx 4rpx; @@ -1122,7 +1123,6 @@ // height: 14rpx; // background-size: 100% 100%; // margin: 5rpx; - // } } diff --git a/pages/my/my.vue b/pages/my/my.vue index 69ef55d..273ac6e 100644 --- a/pages/my/my.vue +++ b/pages/my/my.vue @@ -1,7 +1,7 @@