shish 4 лет назад
Родитель
Сommit
6a362e7894

+ 11 - 2
ghsApp/src/mixins/globalMixins.js

@@ -232,10 +232,19 @@ export default {
 
       //涉及记住花材的代码和流程,请全项目搜索关键词remember_item
 			if(uni.getStorageSync('selectList_'+pageType+'_target_'+currentCustomId)){
+        //console.log(this.getSelectInfo[pageType])
+        //console.log(uni.getStorageSync('selectList_'+pageType+'_target_'+currentCustomId))
 				this.setSelectInfoByType({ type: pageType, info: uni.getStorageSync('selectList_'+pageType+'_target_'+currentCustomId)})
-			}
+        //console.log(this.getSelectInfo[pageType])
+			}else{
+        // this.$store.commit('flushSelectItem',{})
+        // uni.removeStorageSync('selectList_'+pageType+'_target_'+currentCustomId)
+        // console.log(this.getSelectInfo)
+        // console.log(this.getSelectInfo[pageType])
+        // console.log(uni.getStorageSync('selectList_'+pageType+'_target_'+currentCustomId))
+      }
 
-      let currentList = this.getSelectInfo[this.pageType] || [];
+      let currentList = this.getSelectInfo[pageType] || [];
 
       let index = this.allProduct.findIndex(ele => Number(ele.id) == Number(productIdCode))
       if(index == -1){

+ 1 - 1
ghsApp/src/mixins/product.js

@@ -150,7 +150,7 @@ export default {
 			that.$util.confirmModal({content:'确认清除花材?'},() => {
 				that.removeMemoryDirect(customId)
 				that.$msg('已清除')
-              })
+            })
 
 		},
 		//直接清除记忆花材不提示

+ 4 - 1
ghsApp/src/store/modules/product.js

@@ -20,6 +20,9 @@ export default {
 	mutations: {
 		["SET_SELECTINFO_BY_TYPE"](state, { type, info }) {
 			state.selectInfo = { ...state.selectInfo, [type]: info }
-		}
+		},
+		flushSelectItem(state, payload) {
+			state.selectInfo = payload
+		},
 	}
 };