购物车和订单中心以及优惠券相关功能初版

This commit is contained in:
xiaowang
2026-02-27 16:44:41 +08:00
parent 3529a73d84
commit 43f31eed53
36 changed files with 1785 additions and 24 deletions
+8 -1
View File
@@ -217,6 +217,7 @@
placeholder="请选择优惠券"
style="width: 100%"
:loading="loadingCoupons"
:disabled="!isShopOwner()"
>
<a-select-option
v-if="coupons.length === 0"
@@ -331,6 +332,11 @@ const getCurrentUserInfo = () => {
return null
}
const isShopOwner = () => {
const userInfo = getCurrentUserInfo()
return userInfo && userInfo.type === 2
}
const fetchShops = async () => {
loadingShops.value = true
try {
@@ -397,7 +403,8 @@ const fetchCoupons = async () => {
loadingCoupons.value = true
try {
const res = await adminCouponApi.listAllCoupons()
coupons.value = res || []
// 处理后端返回的分页数据结构
coupons.value = res?.list || []
} catch (error) {
console.error('获取优惠券列表失败', error)
message.error('获取优惠券列表失败')