fix(cartBtmList): 修复购物车空态展示问题及结算按钮disable状态问题

This commit is contained in:
ywk 2025-04-09 18:11:24 +08:00
parent 076038ea73
commit 506f0226ce
2 changed files with 17 additions and 3 deletions

View File

@ -86,7 +86,7 @@
<!-- </u-checkbox-group> -->
</view>
</view>
<view class="kong_t" v-show="shopCarList.length == 0">
<view class="kong_t" v-show="cartEmpty">
<img class="kong" src="@/static/images/kong.png" alt=""
/></view>
<view class="zhan"></view>
@ -112,7 +112,7 @@
:loading="isLoading"
:loadingText="'购买中'"
@tap="goBuy"
:disabled="shopCarList.length == 0"
:disabled="submitDisabled"
color="#FB3024"
>{{ '去结算' }}
</u-button>
@ -159,6 +159,7 @@
<script>
import * as api from "@/config/goods";
export default {
data() {
return {
@ -183,6 +184,17 @@ export default {
// content:''
};
},
computed: {
submitDisabled() {
if (this.goodsCheck[0]?.orderItemsParams) {
return this.goodsCheck[0]?.orderItemsParams?.length === 0
}
return true
},
cartEmpty () {
return this.shopCarList.length === 0 || this.shopCarList[0]?.shoppingCartList?.length === 0
}
},
watch: {
selTable: {
handler(n, o) {
@ -332,6 +344,8 @@ export default {
});
},
goBuy() {
console.log(this.goodsCheck, '....goodsCheck')
return
let shoppArr = this.goodsCheck[0].orderItemsParams.map((item) => {
return item.shoppingId;
});

View File

@ -82,7 +82,7 @@ export default {
waresCodeList: arr,
})
.then((res) => {
this.agreementList = res.data
this.agreementList = res.data || []
this.readTime = res.data.alertTime
if (this.readTime > 0) {
this.centerDialogVisible = true