|
|
@@ -651,17 +651,22 @@ export default {
|
|
|
if (element.id == item.id && element.classId == item.classId) {
|
|
|
has = true;
|
|
|
if (element.bigCount > 0) {
|
|
|
- if(!this.isSmallCount){list[index] = { ...element, bigCount: --element.bigCount };}
|
|
|
+ if (!this.isSmallCount) {
|
|
|
+ list[index] = {...element, bigCount: --element.bigCount};
|
|
|
+ }
|
|
|
}
|
|
|
if (element.smallCount > 0) {
|
|
|
- if(this.isSmallCount){list[index] = { ...element, smallCount: --element.smallCount };}
|
|
|
+ if (this.isSmallCount) {
|
|
|
+ list[index] = {...element, smallCount: --element.smallCount};
|
|
|
+ }
|
|
|
}
|
|
|
if (element.bigCount == 0 && element.smallCount == 0) {
|
|
|
list.splice(index, 1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
|
+ this.setSelectInfoByType({type: this.pageType, info: list});
|
|
|
+ },
|
|
|
|
|
|
// const list = this.selectList;
|
|
|
// let has = false;
|
|
|
@@ -722,18 +727,16 @@ export default {
|
|
|
// // this.$forceUpdate();
|
|
|
// },
|
|
|
// //减去所有商品
|
|
|
- // delAllEvent(item) {
|
|
|
- // const list = this.selectList;
|
|
|
- // for (let index = 0; index < list.length; index++) {
|
|
|
- // const element = list[index];
|
|
|
- // if (element.id == item.id ) {
|
|
|
- //
|
|
|
- // list.splice(index, 1);
|
|
|
- //
|
|
|
- // break;
|
|
|
- // }
|
|
|
- // }
|
|
|
- // this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
|
+ delAllEvent(item) {
|
|
|
+ const list = this.selectList;
|
|
|
+ for (let index = 0; index < list.length; index++) {
|
|
|
+ const element = list[index];
|
|
|
+ if (element.id == item.id ) {
|
|
|
+ list.splice(index, 1);
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setSelectInfoByType({ type: this.pageType, info: list });
|
|
|
},
|
|
|
/**
|
|
|
* 通过id获取当前选中的商品类别信息 左边菜单角标 当前选中该类别商品多少件
|
|
|
@@ -903,8 +906,10 @@ export default {
|
|
|
* 切换左侧商品类别
|
|
|
*/
|
|
|
swichClass(cur) {
|
|
|
+ clearInterval(this.timeFun)
|
|
|
this.classIndex = cur;
|
|
|
- this.scroll_into_view = 'class_'+cur;
|
|
|
+ this.scroll_into_view = '';
|
|
|
+ this.$nextTick(()=>{this.scroll_into_view = 'class_'+cur;})
|
|
|
this.scrollPushList();
|
|
|
//解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
|
|
|
uni.setStorageSync("resolve","last");
|
|
|
@@ -917,8 +922,10 @@ export default {
|
|
|
* 成品(多风格)-切换左侧商品类别
|
|
|
*/
|
|
|
suitSwichClass(cur) {
|
|
|
+ clearInterval(this.suitTimeFun)
|
|
|
this.suitClassIndex = cur;
|
|
|
- this.suit_scroll_into_view = 'class_'+cur;
|
|
|
+ this.suit_scroll_into_view = '';
|
|
|
+ this.$nextTick(()=>{this.suit_scroll_into_view = 'class_'+cur;})
|
|
|
this.suitScrollPushList();
|
|
|
// this.scrollPushList();
|
|
|
//解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
|