add
This commit is contained in:
parent
03657673fb
commit
317ad7c192
|
@ -34,13 +34,12 @@
|
|||
<view class="title">
|
||||
<view class="name u-line-2">{{item.goods_name}}</view>
|
||||
<view class="tip u-line-1">{{item.unit_name}}</view>
|
||||
<view class="tip u-line-1">原价:<text
|
||||
style="text-decoration: line-through;">¥{{item.unit_name}}</text>
|
||||
<view v-if="priceKey.off_activity==1" class="tip u-line-1">原价:<text
|
||||
style="text-decoration: line-through;">¥{{item[priceKey.op_price]}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="price-btn">
|
||||
<view class="price">¥{{item.sell}}</view>
|
||||
<view class="price">¥{{item[priceKey.price]}}</view>
|
||||
<view class="btn">
|
||||
<view class="num">{{item.cart_num}}</view>
|
||||
<u--icon name="plus-circle-fill" size="20" color="#20b128"></u--icon>
|
||||
|
@ -54,7 +53,6 @@
|
|||
icon="https://lihai001.oss-cn-chengdu.aliyuncs.com/def/29955202404260944367594.png">
|
||||
</up-empty>
|
||||
</view>
|
||||
{{priceKey}}
|
||||
<view style="width: 100%;height: 200rpx;"></view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
@ -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 = {};
|
||||
}
|
||||
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<up-search placeholder="请输入商品" @search="searchKeyword" @clear="searchKeyword" v-model="keyword"
|
||||
:showAction="false"></up-search>
|
||||
</view>
|
||||
<view class="nav-item" @click="navTo(`/pages/cart/cart?priceKey=${JSON.stringify(priceKey) }`)">
|
||||
<view class="nav-item" @click="navTo(`/pages/cart/cart`)">
|
||||
<image src="@/static/tab/ba.png"></image>
|
||||
<text>购物车</text>
|
||||
</view>
|
||||
|
@ -222,7 +222,7 @@
|
|||
<view class="btn">
|
||||
<up-button color="#20b128" :disabled="cartInfo.pay_price<=0" @click="settleAccounts"> 结算</up-button>
|
||||
</view>
|
||||
<view class="cart" @click="navTo(`/pages/cart/cart?priceKey=${JSON.stringify(priceKey)}`)">
|
||||
<view class="cart" @click="navTo(`/pages/cart/cart`)">
|
||||
<image src="@/static/icon/cart.png"></image>
|
||||
<view class="badge">{{ cartInfo.count }}</view>
|
||||
</view>
|
||||
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue