|
@@ -75,7 +75,7 @@ async function getCartCategorList() {
|
|
|
Apis.xsb.myShoppingCartCategory({
|
|
Apis.xsb.myShoppingCartCategory({
|
|
|
data: {
|
|
data: {
|
|
|
businessType: 'XSB',
|
|
businessType: 'XSB',
|
|
|
- channelId: unref(userInfo).channelTopId,
|
|
|
|
|
|
|
+ channelId: unref(userInfo).channelId,
|
|
|
shopId: unref(SelectShopInfo).shopId,
|
|
shopId: unref(SelectShopInfo).shopId,
|
|
|
},
|
|
},
|
|
|
}).then((res) => {
|
|
}).then((res) => {
|
|
@@ -98,7 +98,7 @@ async function getProductList() {
|
|
|
data: {
|
|
data: {
|
|
|
categoryId: Number(categoriesId.value),
|
|
categoryId: Number(categoriesId.value),
|
|
|
shopId: Number(SelectShopInfo.value?.shopId) || 1,
|
|
shopId: Number(SelectShopInfo.value?.shopId) || 1,
|
|
|
- channelId: unref(userInfo).channelTopId || 1,
|
|
|
|
|
|
|
+ channelId: unref(userInfo).channelId || 1,
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
productList.value = res.data
|
|
productList.value = res.data
|
|
@@ -144,8 +144,11 @@ async function handleAddCart(event: WechatMiniprogram.TouchEvent, item: Api.xsbC
|
|
|
getCartCategorList()
|
|
getCartCategorList()
|
|
|
}
|
|
}
|
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
|
- topNavActive.value = props.categoryList[0].code || ''
|
|
|
|
|
- leftActive.value = props.categoryList[0].children[0].code || ''
|
|
|
|
|
|
|
+ if (!topNavActive.value || !leftActive.value) {
|
|
|
|
|
+ topNavActive.value = props.categoryList[0].code || ''
|
|
|
|
|
+ leftActive.value = props.categoryList[0].children[0].code || ''
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (leftActive.value) {
|
|
if (leftActive.value) {
|
|
|
handleChange({ value: leftActive.value })
|
|
handleChange({ value: leftActive.value })
|
|
|
}
|
|
}
|
|
@@ -191,7 +194,9 @@ async function handleSub(item: Api.xsbCategoriesCartList) {
|
|
|
useGlobalMessage().confirm({
|
|
useGlobalMessage().confirm({
|
|
|
msg: '是否删除该商品?',
|
|
msg: '是否删除该商品?',
|
|
|
success: async () => {
|
|
success: async () => {
|
|
|
|
|
+ cartPopup.value = false
|
|
|
await useSmqjhCartStore().addCart(item.skuId, -1, item.shopId, 'XSB')
|
|
await useSmqjhCartStore().addCart(item.skuId, -1, item.shopId, 'XSB')
|
|
|
|
|
+ await getCartCategorList()
|
|
|
},
|
|
},
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -206,6 +211,11 @@ async function handleAdd(item: Api.xsbCategoriesCartList) {
|
|
|
getGoodsPrice()
|
|
getGoodsPrice()
|
|
|
await getCartCategorList()
|
|
await getCartCategorList()
|
|
|
}
|
|
}
|
|
|
|
|
+onUnmounted(() => {
|
|
|
|
|
+ console.log('组件卸载')
|
|
|
|
|
+ topNavActive.value = ''
|
|
|
|
|
+ leftActive.value = ''
|
|
|
|
|
+})
|
|
|
</script>
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
@@ -417,7 +427,7 @@ async function handleAdd(item: Api.xsbCategoriesCartList) {
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
- <Zpopup v-model="cartPopup">
|
|
|
|
|
|
|
+ <Zpopup v-model="cartPopup" :zindex="99">
|
|
|
<view class="ios h800rpx overflow-y-scroll">
|
|
<view class="ios h800rpx overflow-y-scroll">
|
|
|
<view class="p24rpx">
|
|
<view class="p24rpx">
|
|
|
<view
|
|
<view
|