|
@@ -27,7 +27,11 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
onShow(){
|
|
onShow(){
|
|
|
- if(this.option.modifyProductKey){
|
|
|
|
|
|
|
+ if(this.pageType == 'kd' && !this.$util.isEmpty(this.option.customId)){
|
|
|
|
|
+ if(uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId)){
|
|
|
|
|
+ this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId) })
|
|
|
|
|
+ }
|
|
|
|
|
+ }else if(this.option.modifyProductKey){
|
|
|
if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
|
|
if(uni.getStorageSync('selectList'+this.option.modifyProductKey)){
|
|
|
this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.option.modifyProductKey) })
|
|
this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.option.modifyProductKey) })
|
|
|
uni.removeStorageSync('selectList'+this.option.modifyProductKey)
|
|
uni.removeStorageSync('selectList'+this.option.modifyProductKey)
|
|
@@ -37,7 +41,6 @@ export default {
|
|
|
this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType) })
|
|
this.setSelectInfoByType({ type: this.pageType, info: uni.getStorageSync('selectList'+this.pageType) })
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
if (this.autoLoad) {
|
|
if (this.autoLoad) {
|
|
|
this.initData();
|
|
this.initData();
|
|
|
}
|
|
}
|
|
@@ -346,12 +349,26 @@ export default {
|
|
|
console.log('this.selectList',this.selectList)
|
|
console.log('this.selectList',this.selectList)
|
|
|
|
|
|
|
|
//记忆已经选择的花材
|
|
//记忆已经选择的花材
|
|
|
- uni.setStorageSync('selectList'+this.pageType, this.selectList)
|
|
|
|
|
|
|
+ this.rememberProduct()
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
//记忆已选的花材
|
|
//记忆已选的花材
|
|
|
rememberProduct(){
|
|
rememberProduct(){
|
|
|
- uni.setStorageSync('selectList'+this.pageType, this.selectList)
|
|
|
|
|
|
|
+ if(this.pageType == 'kd' && !this.$util.isEmpty(this.option.customId)){
|
|
|
|
|
+ //开单根据客户记住已选的花材
|
|
|
|
|
+ uni.setStorageSync('selectList'+this.pageType+'_custom_'+this.option.customId, this.selectList)
|
|
|
|
|
+ }else{
|
|
|
|
|
+ uni.setStorageSync('selectList'+this.pageType, this.selectList)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ //清除已记忆花材
|
|
|
|
|
+ removeMemory(customId){
|
|
|
|
|
+ if(customId){
|
|
|
|
|
+ uni.removeStorageSync('selectList'+this.pageType+'_custom_'+customId);
|
|
|
|
|
+ }else{
|
|
|
|
|
+ uni.removeStorageSync('selectList'+this.pageType);
|
|
|
|
|
+ }
|
|
|
|
|
+ this.resetSelectInfoByType(this.pageType);
|
|
|
},
|
|
},
|
|
|
addCustomNumEvent(item,params1,type) {
|
|
addCustomNumEvent(item,params1,type) {
|
|
|
const list = this.selectList;
|
|
const list = this.selectList;
|
|
@@ -386,7 +403,7 @@ export default {
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
//记忆已经选择的花材
|
|
//记忆已经选择的花材
|
|
|
- uni.setStorageSync('selectList'+this.pageType, this.selectList)
|
|
|
|
|
|
|
+ this.rememberProduct()
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -424,7 +441,7 @@ export default {
|
|
|
this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
|
|
|
|
|
|
//记忆已经选择的花材
|
|
//记忆已经选择的花材
|
|
|
- uni.setStorageSync('selectList'+this.pageType, this.selectList)
|
|
|
|
|
|
|
+ this.rememberProduct()
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
//减去某个花材的数量,不是全部花材的意思 shish 20210803(方法名用All需要优化)
|
|
//减去某个花材的数量,不是全部花材的意思 shish 20210803(方法名用All需要优化)
|
|
@@ -449,7 +466,7 @@ export default {
|
|
|
console.log('this.selectList','减少花材之后:',this.selectList)
|
|
console.log('this.selectList','减少花材之后:',this.selectList)
|
|
|
|
|
|
|
|
//记忆已经选择的花材
|
|
//记忆已经选择的花材
|
|
|
- uni.setStorageSync('selectList'+this.pageType, this.selectList)
|
|
|
|
|
|
|
+ this.rememberProduct()
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
@@ -492,14 +509,9 @@ export default {
|
|
|
this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
|
|
|
|
|
|
//记忆已经选择的花材
|
|
//记忆已经选择的花材
|
|
|
- uni.setStorageSync('selectList'+this.pageType, this.selectList)
|
|
|
|
|
|
|
+ this.rememberProduct()
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
- //清除已记忆花材
|
|
|
|
|
- removeMemory(){
|
|
|
|
|
- uni.removeStorageSync('selectList'+this.pageType);
|
|
|
|
|
- this.resetSelectInfoByType(this.pageType);
|
|
|
|
|
- },
|
|
|
|
|
/**
|
|
/**
|
|
|
* 切换左侧商品类别
|
|
* 切换左侧商品类别
|
|
|
*/
|
|
*/
|