覆盖11.20的代码
This commit is contained in:
@@ -561,9 +561,9 @@
|
||||
uni.$u.debounce(store.scrollTop = res.scrollTop, 500)
|
||||
uni.$u.debounce(navScroll.value = res.scrollTop, 500)
|
||||
uni.$u.debounce(mainScroll(res), 500)
|
||||
if(res.scrollTop >= 44){
|
||||
if (res.scrollTop >= 44) {
|
||||
store.showSearch = true
|
||||
}else{
|
||||
} else {
|
||||
store.showSearch = false
|
||||
}
|
||||
});
|
||||
@@ -583,13 +583,6 @@
|
||||
goods: []
|
||||
}
|
||||
})
|
||||
|
||||
/* 价格 */
|
||||
const salePrice = computed(() => {
|
||||
// return shopInfo.isVip == 1 && memberPrice > 0 ? res.data.memberPrice : res.data.salePrice
|
||||
return 0
|
||||
})
|
||||
|
||||
// 用于判断接口数据是否加载完成
|
||||
const isDataLoaded = ref(false);
|
||||
|
||||
@@ -942,10 +935,25 @@
|
||||
}
|
||||
})
|
||||
|
||||
// 更新购物车数据
|
||||
// 更新购物车数据shopProductList.hots
|
||||
const matchedProducts = computed(() => {
|
||||
if (!cartList.value) {
|
||||
return false;
|
||||
}
|
||||
let Specialstop = null
|
||||
|
||||
try {
|
||||
Specialstop = [...[{
|
||||
id: "",
|
||||
name: "",
|
||||
productList: shopProductList.hots
|
||||
}], ...shopProductList.productInfo]
|
||||
} catch (error) {
|
||||
Specialstop = shopProductList.productInfo
|
||||
//TODO handle the exception
|
||||
}
|
||||
return cartList.value.map((cartItem) => {
|
||||
for (const group of shopProductList.productInfo) {
|
||||
for (const group of Specialstop) {
|
||||
for (const product of group.productList) {
|
||||
if (product.id == cartItem.product_id) {
|
||||
// 多规格
|
||||
@@ -986,23 +994,6 @@
|
||||
}, 0);
|
||||
});
|
||||
|
||||
// 计算购物车商品费用
|
||||
// const totalPrices = ref(0);
|
||||
|
||||
// watchEffect(() => {
|
||||
// if (matchedProducts.value.length > 0) {
|
||||
// totalPrices.value = cartStore.getTotalTotalPrices(matchedProducts.value).value;
|
||||
// }
|
||||
// });
|
||||
|
||||
// matchedProducts 变化时,更新总打包费用
|
||||
// watch(() => matchedProducts.value, () => {
|
||||
// if (matchedProducts.value.length > 0) {
|
||||
// totalPrices.value = cartStore.getTotalTotalPrices(matchedProducts.value).value;
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
// 计算购物车商品总价格
|
||||
const totalPrices = computed(() => {
|
||||
// 购物车总数价格
|
||||
@@ -1091,22 +1082,27 @@
|
||||
|
||||
// 列表请求
|
||||
const productqueryProduct = async () => {
|
||||
shopProductList.hots = await productminiApphotsquery()
|
||||
shopProductList.productInfo = await APIgroupquery()
|
||||
//第一步:将所有商品的 cartNumber 初始化为 0
|
||||
shopProductList.productInfo.forEach((group) => {
|
||||
group.productList.forEach((product) => {
|
||||
product.cartNumber = 0;
|
||||
try {
|
||||
shopProductList.hots = await productminiApphotsquery()
|
||||
shopProductList.productInfo = await APIgroupquery()
|
||||
//第一步:将所有商品的 cartNumber 初始化为 0
|
||||
shopProductList.productInfo.forEach((group) => {
|
||||
group.productList.forEach((product) => {
|
||||
product.cartNumber = 0;
|
||||
});
|
||||
});
|
||||
});
|
||||
shopProductList.hots.forEach((i) => {
|
||||
i.cartNumber = 0
|
||||
})
|
||||
scrollTopSize.value = 0
|
||||
topArr.value = []
|
||||
userStore.actionsAPIuser()
|
||||
// 数据可以更新
|
||||
isDataLoaded.value = true;
|
||||
shopProductList.hots.forEach((i) => {
|
||||
i.cartNumber = 0
|
||||
})
|
||||
scrollTopSize.value = 0
|
||||
topArr.value = []
|
||||
userStore.actionsAPIuser()
|
||||
// 数据可以更新
|
||||
isDataLoaded.value = true;
|
||||
} catch (error) {
|
||||
uni.navigateBack()
|
||||
//TODO handle the exception
|
||||
}
|
||||
}
|
||||
|
||||
onLoad(async (e) => {
|
||||
|
||||
Reference in New Issue
Block a user