From 5edf9029fd64fd5ea358e9d321555456784e3a21 Mon Sep 17 00:00:00 2001 From: THK3121 Date: Tue, 12 Sep 2023 14:40:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=AD=E7=89=A9=E8=BD=A6=E7=BB=93=E7=AE=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/nongKe/cloud_entrepot/index.vue | 28 ++++++-- pages/nongKe/cloud_entrepot/indexa.vue | 92 ++++++++++++++++++++++---- pages/order_addcart/order_addcart.vue | 1 + 3 files changed, 101 insertions(+), 20 deletions(-) diff --git a/pages/nongKe/cloud_entrepot/index.vue b/pages/nongKe/cloud_entrepot/index.vue index a04503e..ff287b0 100644 --- a/pages/nongKe/cloud_entrepot/index.vue +++ b/pages/nongKe/cloud_entrepot/index.vue @@ -318,6 +318,9 @@ this.getCloundShop() // console.log(this.appInfo, "手机信息") }, + onShow() { + this.cartFn() + }, // 分页 // onReachBottom() { // if (this.flag) return @@ -374,10 +377,10 @@ }, onPullDownRefresh() { - uni.stopPullDownRefresh() this.getCloundShop() this.getList() this.cartFn() + uni.stopPullDownRefresh() }, // onReachBottom() { // console.log("daidi") @@ -390,14 +393,13 @@ this.totalMoney = 0 this.cartList = res.data.list this.cartList.forEach(e => { - this.totalMoney += e.list[0].cart_num * e.list[0].productAttr.price - // console.log(e.list[0].cart_num, e.list[0].productAttr.price) - // return - // console.log(e.list[0].cart_num, e.productAttr[0].price) - // this.totalMoney = this.totalMoney + Number(e.productAttr.price) * e.cart_num - // console.log(e.productAttr.price, e.cart_num) + e.list.forEach(item => { + this.totalMoney += item.productAttr.price * item.cart_num + }) }) + this.totalMoney = this.totalMoney.toFixed(2); }) + // this. getCartCounts().then(res => { this.goodsNum = res.data[0].count }) @@ -542,6 +544,18 @@