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>
<view class="row"> <view class="row">
<view>商品价格</view> <view>商品价格</view>
<view>¥ {{datas.price}}</view> <view>¥ {{datas.price || datas.sell}}</view>
</view> </view>
<view class="row"> <view class="row">
<view>小计</view> <view>小计</view>

View File

@ -206,15 +206,23 @@
// //
const addCart = (id, cart_num) => { // 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({ cartCreateApi({
cart_num: +cart_num, cart_num: +cart_num,
product_id: id, product_id: id,
store_id: 1 store_id: STORE_INFO.id
// store_id: // store_id:
}).then(res => { }).then(res => {
getcartList(); getcartList();
}) })
} }
}
const isAdmin = ref(false); // const isAdmin = ref(false); //
@ -245,6 +253,10 @@
} else { } else {
checkAll.value = 0 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; cartList.value = res.data.lists;
cartInfo.value = { cartInfo.value = {
total_price: res.data?.extend.total_price || '0.00', 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')"> <view class="nav-item" @click="navTo('/pagesOrder/order/order?type=0')">
<image src="@/static/tab/da.png"></image> <image src="@/static/tab/da.png"></image>
<text>我的订单</text> <text>我的订单</text>
<view class="badge">{{ userStore.userInfo.no_writeoff }}</view>
</view> </view>
<view class="nav-item" @click="navTo('/pages/my/my')"> <view class="nav-item" @click="navTo('/pages/my/my')">
<image src="@/static/tab/ca.png"></image> <image src="@/static/tab/ca.png"></image>
@ -658,11 +659,23 @@
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
position: relative;
image { image {
height: 40rpx; height: 40rpx;
width: 40rpx; width: 40rpx;
} }
.badge{
position: absolute;
top: -10rpx;
right: 0;
background-color: #FF0000;
color: #FFFFFF;
padding: 0 5rpx;
border-radius: 50rpx;
font-size: 18rpx;
}
} }
} }