feat: 购物车为空时底部不显示“去结算”
This commit is contained in:
+9
-15
@@ -154,12 +154,12 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="payShow">
|
||||
<view v-if="index === 0">
|
||||
<card_payment
|
||||
ref="paymentRef"
|
||||
@updataList="clearSearch"
|
||||
@updatePrice="updatePrice"
|
||||
:addShow="addShow"
|
||||
:addShow="hasPaymentBar"
|
||||
:minSalesCountShow="navName === '折扣区'"
|
||||
:bottomOffset="tabbarBottomOffset"
|
||||
/>
|
||||
@@ -216,7 +216,7 @@
|
||||
const getCartList = async () => {
|
||||
const res = await api.getShopCartList({});
|
||||
if (res.code === 0) {
|
||||
payShow.value = index.value === 0 && Boolean(res.data.length || addShow.value);
|
||||
hasPaymentBar.value = index.value === 0 && Boolean(res.data.length);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -255,13 +255,12 @@
|
||||
|
||||
const index = ref(0);
|
||||
const height = ref(`${baseHeight}px`);
|
||||
const payShow = ref(false);
|
||||
const addShow = ref(false);
|
||||
const hasPaymentBar = ref(false);
|
||||
|
||||
watch(
|
||||
() => payShow.value,
|
||||
() => hasPaymentBar.value,
|
||||
() => {
|
||||
const extra = payShow.value ? paymentBarReserve : 0;
|
||||
const extra = hasPaymentBar.value ? paymentBarReserve : 0;
|
||||
height.value = `${baseHeight - extra}px`;
|
||||
},
|
||||
{ immediate: true },
|
||||
@@ -342,11 +341,7 @@
|
||||
|
||||
const paymentRef = ref(null);
|
||||
const addCar = (data) => {
|
||||
payShow.value = index.value === 0;
|
||||
addShow.value = true;
|
||||
setTimeout(() => {
|
||||
paymentRef.value?.addCar(data);
|
||||
}, 500);
|
||||
paymentRef.value?.addCar(data);
|
||||
};
|
||||
|
||||
const navChange = (i) => {
|
||||
@@ -356,13 +351,12 @@
|
||||
if (index.value === 0) {
|
||||
getCartList();
|
||||
} else {
|
||||
payShow.value = false;
|
||||
hasPaymentBar.value = false;
|
||||
}
|
||||
};
|
||||
|
||||
const updatePrice = (val) => {
|
||||
addShow.value = val;
|
||||
getCartList();
|
||||
hasPaymentBar.value = Boolean(val);
|
||||
};
|
||||
|
||||
function shipment() {
|
||||
|
||||
@@ -326,7 +326,7 @@
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: v-bind('headerBgHeight');
|
||||
background: #00f;
|
||||
background: url('@/static/index/login_bg.png') no-repeat 100%;
|
||||
border-radius: 0 0 30rpx 30rpx;
|
||||
|
||||
image {
|
||||
|
||||
Reference in New Issue
Block a user