This commit is contained in:
parent
bbff5152a9
commit
f852b67681
|
@ -14,7 +14,7 @@
|
|||
</view>
|
||||
<view class="row">
|
||||
<view>商品价格</view>
|
||||
<view>¥ {{datas.price}}</view>
|
||||
<view>¥ {{datas.price || datas.sell}}</view>
|
||||
</view>
|
||||
<view class="row">
|
||||
<view>小计</view>
|
||||
|
|
|
@ -206,15 +206,23 @@
|
|||
|
||||
// 购物车相关
|
||||
const addCart = (id, cart_num) => { //加入购物车
|
||||
if (uni.getStorageSync('STORE_INFO').length) {
|
||||
let data = JSON.parse(uni.getStorageSync('STORE_INFO'))
|
||||
let STORE_INFO = {};
|
||||
for (let key in data) {
|
||||
STORE_INFO[key] = data[key]
|
||||
}
|
||||
cartCreateApi({
|
||||
cart_num: +cart_num,
|
||||
product_id: id,
|
||||
store_id: 1
|
||||
store_id: STORE_INFO.id
|
||||
// store_id:
|
||||
}).then(res => {
|
||||
getcartList();
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
const isAdmin = ref(false); //是否管理
|
||||
|
||||
|
||||
|
@ -245,6 +253,10 @@
|
|||
} else {
|
||||
checkAll.value = 0
|
||||
}
|
||||
res.data.lists = res.data.lists.map(item => {
|
||||
if(!item.price) item.price = item.sell; // 兼容旧数据,新数据已经添加了price字段
|
||||
return item;
|
||||
})
|
||||
cartList.value = res.data.lists;
|
||||
cartInfo.value = {
|
||||
total_price: res.data?.extend.total_price || '0.00',
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
<view class="nav-item" @click="navTo('/pagesOrder/order/order?type=0')">
|
||||
<image src="@/static/tab/da.png"></image>
|
||||
<text>我的订单</text>
|
||||
<view class="badge">{{ userStore.userInfo.no_writeoff }}</view>
|
||||
</view>
|
||||
<view class="nav-item" @click="navTo('/pages/my/my')">
|
||||
<image src="@/static/tab/ca.png"></image>
|
||||
|
@ -658,11 +659,23 @@
|
|||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
position: relative;
|
||||
|
||||
image {
|
||||
height: 40rpx;
|
||||
width: 40rpx;
|
||||
}
|
||||
|
||||
.badge{
|
||||
position: absolute;
|
||||
top: -10rpx;
|
||||
right: 0;
|
||||
background-color: #FF0000;
|
||||
color: #FFFFFF;
|
||||
padding: 0 5rpx;
|
||||
border-radius: 50rpx;
|
||||
font-size: 18rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue