修改首页搜索商品的数量不实时更新的bug
This commit is contained in:
parent
a139ec38c9
commit
884b7e5b38
@ -185,7 +185,7 @@ export default {
|
|||||||
},
|
},
|
||||||
// 获取购物车数据
|
// 获取购物车数据
|
||||||
getShopCarList() {
|
getShopCarList() {
|
||||||
request(apiArr.getCar, "POST").then((res) => {
|
return request(apiArr.getCar, "POST").then((res) => {
|
||||||
this.value = res.total;
|
this.value = res.total;
|
||||||
// 合并当日达和普通商品数据
|
// 合并当日达和普通商品数据
|
||||||
this.goodsDetail = [].concat(res.same_day_cart_list || [], res.normal_cart_list || [])
|
this.goodsDetail = [].concat(res.same_day_cart_list || [], res.normal_cart_list || [])
|
||||||
@ -408,7 +408,12 @@ export default {
|
|||||||
this.isSearched = false;
|
this.isSearched = false;
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getShopCarList();
|
this.getShopCarList().then(() => {
|
||||||
|
// 延迟一小段时间确保购物车数据已完全更新,然后同步商品数量
|
||||||
|
setTimeout(() => {
|
||||||
|
this.syncGoodsQuantities();
|
||||||
|
}, 100);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onReachBottom() {
|
onReachBottom() {
|
||||||
if (this.flag) {
|
if (this.flag) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user