From 317ad7c192d33c4580e81dfe24e618fdb8ea2637 Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Wed, 26 Jun 2024 14:21:00 +0800
Subject: [PATCH] add
---
pages/cart/cart.vue | 17 +++++++++--------
pages/index/index.vue | 5 +++--
2 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/pages/cart/cart.vue b/pages/cart/cart.vue
index e1881db..471900a 100644
--- a/pages/cart/cart.vue
+++ b/pages/cart/cart.vue
@@ -34,13 +34,12 @@
{{item.goods_name}}
{{item.unit_name}}
- 原价:¥{{item.unit_name}}
+ 原价:¥{{item[priceKey.op_price]}}
-
- ¥{{item.sell}}
+ ¥{{item[priceKey.price]}}
{{item.cart_num}}
@@ -54,7 +53,6 @@
icon="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/29955202404260944367594.png">
- {{priceKey}}
@@ -337,10 +335,13 @@
getcartList();
})
let priceKey = ref({})
- onLoad(opt => {
- if (opt.priceKey) {
- priceKey.value = JSON.parse(opt.priceKey)
+ onLoad(() => {
+ if (uni.getStorageSync('PRICE_KEY')) {
+ priceKey.value = JSON.parse(uni.getStorageSync('PRICE_KEY'));
+ } else {
+ priceKey.value = {};
}
+
})
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 529337b..4e0e4fa 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -44,7 +44,7 @@
-
+
购物车
@@ -222,7 +222,7 @@
结算
-
+
{{ cartInfo.count }}
@@ -465,6 +465,7 @@
for (let key in res.data.extend) {
priceKey[key] = res.data.extend[key]
}
+ uni.setStorageSync("PRICE_KEY", JSON.stringify(priceKey))
console.log(priceKey)
if (loadmore) goodList.value.push(...res.data.lists);
else goodList.value = res.data.lists;