This commit is contained in:
weipengfei 2024-06-22 19:14:59 +08:00
parent bbff5152a9
commit f852b67681
3 changed files with 34 additions and 9 deletions

View File

@ -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>

View File

@ -206,14 +206,22 @@
//
const addCart = (id, cart_num) => { //
cartCreateApi({
cart_num: +cart_num,
product_id: id,
store_id: 1
// store_id:
}).then(res => {
getcartList();
})
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: 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',

View File

@ -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;
}
}
}