fixbug: 修改页面改造bug

This commit is contained in:
2026-07-14 23:08:25 +08:00
parent fd25002ab3
commit 45176d7d22
7 changed files with 243 additions and 291 deletions
+40 -130
View File
@@ -1,102 +1,46 @@
<template>
<view>
<view
:calss="[
isDataNull ? 'isDataNull-calss' : 'isDataNull-active',
platformType ? '' : 'iosplatformType',
]"
class="shopping_cart_warp"
>
<view :calss="[
isDataNull ? 'isDataNull-calss' : 'isDataNull-active',
platformType ? '' : 'iosplatformType',
]" class="shopping_cart_warp">
<view class="shopping_cart_header">
<view class="cart">购物车({{ shoppingTotal }})</view>
<view
class="enit_but"
@click="isEdit = true"
v-if="!isEdit"
v-show="!isDataNull"
>编辑</view
>
<view
class="enit_but"
@click="isEdit = false"
v-else
v-show="isDataNull"
>取消</view
>
<view class="enit_but" @click="isEdit = true" v-if="!isEdit" v-show="!isDataNull">编辑</view>
<view class="enit_but" @click="isEdit = false" v-else>取消</view>
</view>
<!-- 购物车列表 -->
<up-loading-page :loading="listLoading"></up-loading-page>
<view class="shopping_cart_content">
<view
v-if="!isDataNull"
class="shopping_cart_content_item"
v-for="(item, index) in shoppingList"
:key="item.id"
>
<view v-if="!isDataNull" class="shopping_cart_content_item" v-for="(item, index) in shoppingList"
:key="item.id">
<!-- 店铺头部 -->
<up-checkbox
:customStyle="{ marginBottom: '8px' }"
name="isCheck"
usedAlone
v-model:checked="item.isCheck"
shape="circle"
activeColor="#7934F6"
size="19"
iconSize="18"
@change="(event) => shoppingChange(event, index)"
>
<up-checkbox :customStyle="{ marginBottom: '8px' }" name="isCheck" usedAlone v-model:checked="item.isCheck"
shape="circle" activeColor="#7934F6" size="19" iconSize="18"
@change="(event) => shoppingChange(event, index)">
<template #label>
<view class="content_item_header">
<up-image
:src="
item.shopLogo ? item.shopLogo : '/static/shopping/store.png'
"
width="22"
height="22"
bgColor="#f1f6ff00"
shape="circle"
></up-image>
<view class="order_product_title"
>{{ item.shopName }}{{ item.id }}</view
>
<up-image :src="item.shopLogo ? item.shopLogo : '/static/shopping/store.png'
" width="22" height="22" bgColor="#f1f6ff00" shape="circle"></up-image>
<view class="order_product_title">{{ item.shopName }}{{ item.id }}</view>
</view>
</template>
</up-checkbox>
<view>
<view
class="content_item_info"
v-for="(pItem, pIndex) in item.product"
:key="pItem.id"
>
<view class="content_item_info" v-for="(pItem, pIndex) in item.product" :key="pItem.id">
<!-- 单个商品 -->
<up-checkbox
:customStyle="{ marginBottom: '8px' }"
name="isCheck"
usedAlone
v-model:checked="pItem.isCheck"
shape="circle"
activeColor="#7934F6"
size="19"
iconSize="18"
<up-checkbox :customStyle="{ marginBottom: '8px' }" name="isCheck" usedAlone
v-model:checked="pItem.isCheck" shape="circle" activeColor="#7934F6" size="19" iconSize="18"
:disabled="!isEdit && [1, 2].includes(pItem.goodsStatus)"
@change="(event) => productChange(event, index, pIndex)"
>
@change="(event) => productChange(event, index, pIndex)">
</up-checkbox>
<view class="info_item">
<up-image
:src="pItem.mainGraph"
width="100"
height="100"
bgColor="#f1f6ff00"
@click="jumpInfo(pItem)"
></up-image>
<up-image :src="pItem.mainGraph" width="100" height="100" bgColor="#f1f6ff00"
@click="jumpInfo(pItem)"></up-image>
<view class="content_info">
<view
class="shopping_content_info_title"
@click="jumpInfo(pItem)"
>{{ pItem.name }}</view
>
<view class="shopping_content_info_title" @click="jumpInfo(pItem)">{{ pItem.name }}</view>
<view class="content_info_description">
{{ pItem.goodsSpece }}
</view>
@@ -108,34 +52,16 @@
pItem.unitPrice
}}</text>
</view>
<view class="shopping_info_amount_original"
>¥{{ pItem.unitPrice }}</view
>
<view class="shopping_info_amount_original">¥{{ pItem.unitPrice }}</view>
</view>
<view>
<view class="shopping_info_quantity">
<view
class="quantity_but"
@click="quantityFun('minus', index, pIndex, pItem.id)"
>-</view
>
<view class="quantity_but" @click="quantityFun('minus', index, pIndex, pItem.id)">-</view>
<view class="quantity_value">{{ pItem.buyNum }}</view>
<view
class="quantity_but"
@click="quantityFun('add', index, pIndex, pItem.id)"
>+</view
>
<view class="quantity_but" @click="quantityFun('add', index, pIndex, pItem.id)">+</view>
</view>
<view
v-if="[1].includes(pItem.goodsStatus)"
class="insufficient_stock"
>库存不足</view
>
<view
v-if="[2].includes(pItem.goodsStatus)"
class="insufficient_stock"
>商品已下架</view
>
<view v-if="[1].includes(pItem.goodsStatus)" class="insufficient_stock">库存不足</view>
<view v-if="[2].includes(pItem.goodsStatus)" class="insufficient_stock">商品已下架</view>
</view>
</view>
</view>
@@ -144,12 +70,8 @@
</view>
</view>
<view v-else class="not_order_warp">
<up-image
src="https://static.tbmall.xin/static/not_shopping.png"
width="80"
height="80"
bgColor="#f1f6ff00"
></up-image>
<up-image src="https://static.tbmall.xin/static/not_shopping.png" width="80" height="80"
bgColor="#f1f6ff00"></up-image>
<view class="not_order_msg_warp">购物车是空的</view>
</view>
<choiceness />
@@ -159,25 +81,13 @@
<view class="shopping_cart_but">
<!-- 全选 -->
<view class="shopping_cart_but_total">
<up-checkbox
name="isAll"
usedAlone
v-model:checked="isAll"
shape="circle"
activeColor="#7934F6"
size="19"
iconSize="18"
@change="isAllChange"
>
<up-checkbox name="isAll" usedAlone v-model:checked="isAll" shape="circle" activeColor="#7934F6" size="19"
iconSize="18" @change="isAllChange">
<template #label>
<text style="font-size: 26rpx; color: #444444">全选</text>
</template>
</up-checkbox>
<text
style="margin-left: 20rpx; font-size: 24rpx; color: #444444"
v-if="!isEdit"
>合计:</text
>
<text style="margin-left: 20rpx; font-size: 24rpx; color: #444444" v-if="!isEdit">合计:</text>
<text style="font-size: 24rpx" v-if="!isEdit">¥</text>
<text style="font-size: 32rpx" v-if="!isEdit">{{ total }}</text>
</view>
@@ -231,7 +141,7 @@ export default {
/*#endif*/
this.getCartList();
},
onLoad() {},
onLoad() { },
methods: {
/**
* 查询购物车列表
@@ -532,12 +442,15 @@ export default {
background-color: $app-bj;
padding: 104rpx 30rpx 30rpx;
overflow: hidden;
&.isDataNull-calss {
height: calc(100vh - 100rpx - env(safe-area-inset-bottom));
}
&.isDataNull-active {
height: calc(100vh - 100rpx - env(safe-area-inset-bottom) - 100rpx);
}
&.iosplatformType {
height: calc(100vh - 100rpx - 50rpx) !important;
@@ -545,9 +458,9 @@ export default {
height: calc(100vh - 104rpx - 30rpx - 30rpx - 100rpx - 10rpx) !important;
}
.shopping_cart_but{
bottom: 90rpx !important;
}
.shopping_cart_but {
bottom: 90rpx !important;
}
}
}
@@ -569,10 +482,7 @@ export default {
.shopping_cart_content {
margin-top: 30rpx;
height: calc(
100vh - 104rpx - 30rpx - 30rpx - 100rpx - env(safe-area-inset-bottom) -
10rpx
);
height: calc(100vh - 104rpx - 30rpx - 30rpx - 100rpx - env(safe-area-inset-bottom) - 10rpx);
overflow-y: auto;
.shopping_cart_content_item {