|
|
@@ -361,9 +361,34 @@ export default {
|
|
|
pagePath: `admin/ghsProduct/detail?id=${id}&shopId=${shopId}`
|
|
|
};
|
|
|
that.jweixinFn(shareParams)
|
|
|
+
|
|
|
+ // 此时 option.ghsId 已由 init 用 shopId 换成当前客户自己的供货商 ID
|
|
|
+ // 从本地恢复该供货商购物车,避免分享逐个打开商品时以空列表覆盖已选
|
|
|
+ that.restoreCartByCurrentGhs()
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 按当前客户 ghsId 恢复本地购物车到 Vuex(须在 ghsId 就绪后调用)
|
|
|
+ */
|
|
|
+ restoreCartByCurrentGhs() {
|
|
|
+ const ghsId = this.getGhsId()
|
|
|
+ if (ghsId <= 0) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ // Vuex 里已有数据则不覆盖,防止同页重复拉取把进行中的选择冲掉
|
|
|
+ if (!this.$util.isEmpty(this.selectList)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const currentInfo = uni.getStorageSync('selectList' + this.pageType + '_ghs_' + ghsId)
|
|
|
+ if (this.$util.isEmpty(currentInfo)) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const mergedInfo = this._mergeDuplicateSelectRows
|
|
|
+ ? this._mergeDuplicateSelectRows(currentInfo)
|
|
|
+ : currentInfo
|
|
|
+ this.setSelectInfoByType({ type: this.pageType, info: mergedInfo })
|
|
|
+ },
|
|
|
onShareAppMessage(res) {
|
|
|
return {
|
|
|
title: this.title,
|