|
|
@@ -520,6 +520,20 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ // 立即同步恢复或重置当前供货商的购物车,防止上一个供货商的购物车数据残留导致串线
|
|
|
+ let initialGhsId = this.option && this.option.id ? Number(this.option.id) : 0;
|
|
|
+ if (initialGhsId > 0) {
|
|
|
+ let currentInfo = uni.getStorageSync('selectList' + this.pageType + '_ghs_' + initialGhsId);
|
|
|
+ if (!this.$util.isEmpty(currentInfo)) {
|
|
|
+ const mergedInfo = this._mergeDuplicateSelectRows ? this._mergeDuplicateSelectRows(currentInfo) : currentInfo;
|
|
|
+ this.setSelectInfoByType({ type: this.pageType, info: mergedInfo });
|
|
|
+ } else {
|
|
|
+ this.resetSelectInfoByType(this.pageType);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.resetSelectInfoByType(this.pageType);
|
|
|
+ }
|
|
|
+
|
|
|
const { shopId,id} = this.option;
|
|
|
|
|
|
if(this.option.id == 0) {
|
|
|
@@ -532,6 +546,15 @@ export default {
|
|
|
if(this.buyNotice == 1){
|
|
|
this.myClass = 'fadeIn'
|
|
|
}
|
|
|
+ this.option.id = res.data.id;
|
|
|
+ // 扫码/分享进入时,在解析出真实 ghsId 后立即恢复对应购物车,防止异步加载延迟
|
|
|
+ if (id > 0) {
|
|
|
+ let currentInfo = uni.getStorageSync('selectList' + this.pageType + '_ghs_' + id);
|
|
|
+ if (!this.$util.isEmpty(currentInfo)) {
|
|
|
+ const mergedInfo = this._mergeDuplicateSelectRows ? this._mergeDuplicateSelectRows(currentInfo) : currentInfo;
|
|
|
+ this.setSelectInfoByType({ type: this.pageType, info: mergedInfo });
|
|
|
+ }
|
|
|
+ }
|
|
|
//获取供货商花材
|
|
|
if(id>0){
|
|
|
this.visitMall(id)
|
|
|
@@ -545,7 +568,6 @@ export default {
|
|
|
this.tjFl = res.data.tjFl
|
|
|
}
|
|
|
uni.setNavigationBarTitle({title: this.ghsInfo.name})
|
|
|
- this.option.id = res.data.id;
|
|
|
this.newCustomGift.xrFlAmount = res.data.xrFlAmount
|
|
|
}).catch(err => {})
|
|
|
} else {
|