feat: 购物车为空时底部不显示“去结算”

This commit is contained in:
2026-06-05 17:20:49 +08:00
parent 70cbccbb52
commit 2449d67e53
7 changed files with 104 additions and 73 deletions
+3 -2
View File
@@ -9,8 +9,9 @@
- 添加商城订单列type为5(开通ai店铺订单)详情接口api
- 首页`会员优选`分类兜底(已开通ai店铺不展示)
- 首页`会员优选`分类点击购买直接跳转到购买页、支付完成返回首页
- 我的社员ui重构
- 我的社员、我的订单ui重构
- 粉色卡默认false所有页面统一调整
- 选品广场结算返回到我的店铺页
- 点底部 tab 的`AI店铺`时没开通就不跳转并提示
- `会员优选`商品卡片点击不再跳转到商品详情页
- `会员优选`商品卡片点击不再跳转到商品详情页
- 购物车为空时:底部不显示“去结算”
+10 -16
View File
@@ -1,6 +1,10 @@
<template>
<view>
<view class="card_payment flex-center ju-between bg16 h_128 p-l-34 p-r-40" :style="{ bottom: props.bottomOffset + 'px' }">
<view
v-if="barVisible"
class="card_payment flex-center ju-between bg16 h_128 p-l-34 p-r-40"
:style="{ bottom: props.bottomOffset + 'px' }"
>
<view class="flex-center ju-flex-start flex1" @click="showPopup">
<uni-badge :text="num" absolute="rightTop" :offset="[13, 6]">
<view class="w_80 h_80 m-r-24">
@@ -120,14 +124,9 @@
const cartList = ref([]);
let price = ref(0);
let num = ref(0);
let addShow1 = ref(false)
watch(() => props.addShow, () => {
addShow1.value = props.addShow
}, {
immediate: true,
deep: true
})
const getCartList = (val : any = true) => {
const barVisible = computed(() => Array.isArray(cartList.value) && cartList.value.length > 0);
const getCartList = () => {
num.value = 0;
price.value = 0;
SpuApi.getShopCartList({}).then((res) => {
@@ -146,14 +145,9 @@
});
price.value += e.discountedPrice;
});
addShow1.value = true
} else {
if (!val) {
addShow1.value = false
}
}
cartList.value = list;
proxy.$emit('updatePrice', addShow1.value);
proxy.$emit('updatePrice', list.length > 0);
});
};
@@ -252,7 +246,7 @@
// 删除接口
SpuApi.deleteShopCart({ id: v.id }).then((res) => {
if (res.code === 0) {
getCartList(false);
getCartList();
proxy.$emit('updataList');
}
});
+1 -1
View File
@@ -1,5 +1,5 @@
<template>
<s-pages title="我的收益" :pink_bg="true">
<s-pages title="我的收益" :blue_bg="true" navPreset="float">
<view class="pages">
<!-- 1 -->
+9 -15
View File
@@ -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() {
+1 -1
View File
@@ -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 {
+79 -38
View File
@@ -1,6 +1,6 @@
<!-- 订单列表 -->
<template>
<s-layout title="我的订单">
<s-layout title="我的订单" navPreset="blue">
<card_pages
ref="cardPages"
:navList="tabMaps"
@@ -22,7 +22,9 @@
>
<view
class="type-tab-text size32"
:class="{ activeTypeItem: state.currentType === i, activeTypeUnderline: state.currentType === i }"
:class="{
activeTypeItem: state.currentType === i,
}"
>
{{ v.name }}
</view>
@@ -43,17 +45,23 @@
</view>
</view>
</scroll-view>
<view class="search flex-center">
<view class="flex1" style="background-color: #fff; border-radius: 32rpx"
><uni-easyinput
prefixIcon="search"
v-model="state.obj.keyWord"
placeholder="搜索商品名称/订单编号"
@iconClick="iconClick"
>
</uni-easyinput
></view>
<view class="searchBtn size32 c0" @click="downCallback(state.currentTab)">搜索</view>
<view class="search">
<view class="searchInput flex-center">
<view class="searchField flex-center flex1">
<image class="searchFieldIcon" src="/static/icon/search.svg" mode="aspectFit" />
<uni-easyinput
class="flex1"
v-model="state.obj.keyWord"
placeholder="搜索商品名称/订单编号"
:inputBorder="false"
@iconClick="iconClick"
>
</uni-easyinput>
</view>
<view class="searchBtn flex-center" @click="downCallback(state.currentTab)">
<image class="searchBtnIcon" src="/static/icon/search.svg" mode="aspectFit" />
</view>
</view>
</view>
</view>
</template>
@@ -168,8 +176,13 @@
return;
}
const pageData = dataList.value?.[mescroll.dataObj.i] || {};
const list = Array.isArray(pageData?.list) ? pageData.list : Array.isArray(pageData) ? pageData : [];
const nextList = state.currentType === 1 ? list.map((o) => ({ ...o, __source: 'aishop' })) : list;
const list = Array.isArray(pageData?.list)
? pageData.list
: Array.isArray(pageData)
? pageData
: [];
const nextList =
state.currentType === 1 ? list.map((o) => ({ ...o, __source: 'aishop' })) : list;
nextList.forEach((order) => handleOrderButtons(order));
if (mescroll.num == 1) state.list[mescroll.dataObj.i] = [];
state.list[mescroll.dataObj.i] = state.list[mescroll.dataObj.i].concat(nextList);
@@ -228,24 +241,29 @@
.navItem {
padding: 18rpx 0;
color: rgba(255, 255, 255, 0.85);
}
.activeItem {
color: #ff3c48;
border-bottom: 6rpx solid #ff3c48;
color: #ffffff;
border-bottom: 6rpx solid rgba(255, 255, 255, 0.95);
}
.nav {
height: 320rpx;
background-color: #fff;
background-color: #2556ec;
background-image: url('/static/index/logIn_bg.png');
background-size: 100% auto;
background-repeat: no-repeat;
background-position: top center;
border-radius: 0 0 30rpx 30rpx;
}
.order-list-nav-top {
height: 100rpx;
display: flex;
align-items: center;
border-bottom: 1rpx solid #ffe1d9;
background-color: #fff5f2;
background-color: transparent;
}
.type-tabs {
@@ -265,17 +283,14 @@
.type-tab-text {
position: relative;
padding: 18rpx 0;
font-weight: 500;
color: #333;
padding: 0 25rpx;
color: rgba(255, 255, 255, 0.85);
border-radius: 10rpx;
}
.activeTypeItem {
color: #ff3c48;
}
.activeTypeUnderline {
border-bottom: 6rpx solid #ff3c48;
color: #ffffff;
background: linear-gradient(135deg, var(--countdown-grad-start), var(--countdown-grad-end));
}
.search {
@@ -285,19 +300,45 @@
margin-bottom: 16rpx;
}
.searchBtn {
margin-left: 16rpx;
}
:deep(.is-input-border) {
.searchInput {
background-color: #ffffff;
border-radius: 44rpx;
overflow: hidden;
height: 72rpx;
border-radius: 36rpx;
background-color: #f7f8fa;
border: none;
}
:deep(.is-input-border) {
background: rgba(255, 255, 255, 0.34);
.searchField {
height: 72rpx;
padding-left: 28rpx;
box-sizing: border-box;
}
.searchFieldIcon {
width: 32rpx;
height: 32rpx;
margin-right: 16rpx;
flex: 0 0 auto;
}
.searchBtn {
width: 96rpx;
height: 62rpx;
padding: 0 10rpx;
margin: 5rpx;
border-radius: 44rpx;
background: linear-gradient(135deg, var(--primary-grad-start), var(--primary-grad-end));
border: 2rpx solid rgba(255, 255, 255, 0.95);
}
:deep(.uni-easyinput__content) {
background-color: transparent;
height: 72rpx;
}
.searchBtnIcon {
width: 32rpx;
height: 32rpx;
filter: brightness(0) invert(1);
}
.orderCon {
+1
View File
@@ -0,0 +1 @@
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1780650159343" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1657" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200"><path d="M703.873 232.437c-130.172-130.232-341.269-130.232-471.502 0s-130.233 341.33 0 471.502c60.328 60.346 143.68 97.672 235.751 97.672 92.07 0 175.422-37.327 235.75-97.672 60.347-60.329 97.673-143.681 97.673-235.751s-37.327-175.422-97.672-235.75zM159.787 776.525C80.843 697.601 32.014 588.557 32.014 468.109 32.014 227.253 227.267 32 468.123 32s436.109 195.253 436.109 436.109c0 120.448-48.83 229.492-127.773 308.415-78.917 78.897-187.928 127.694-308.336 127.694-120.409 0-229.419-48.797-308.336-127.694z m814.631 197.959c-10.772 10.789-25.662 17.463-42.112 17.463s-31.34-6.674-42.111-17.462l-84.163-84.223c-10.77-10.77-17.431-25.648-17.431-42.082 0-32.868 26.645-59.512 59.512-59.512 16.433 0 31.312 6.661 42.082 17.43l84.222 84.163c10.818 10.759 17.512 25.653 17.512 42.111s-6.695 31.353-17.51 42.109z" fill="#BFBFBF" p-id="1658"></path></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB