|
@@ -230,7 +230,16 @@ export default {
|
|
|
* **/
|
|
* **/
|
|
|
scrollPushList(){
|
|
scrollPushList(){
|
|
|
let list = copyObject(this.productInfo);
|
|
let list = copyObject(this.productInfo);
|
|
|
-
|
|
|
|
|
|
|
+ let classList = [];
|
|
|
|
|
+ for (let i=0;i<list.length;i++){
|
|
|
|
|
+ if(i<2){
|
|
|
|
|
+ classList.push({...list[i],isActive:true});
|
|
|
|
|
+ }else{
|
|
|
|
|
+ classList.push({...list[i],isActive:false});
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.filterProductInfo = classList
|
|
|
|
|
+ return
|
|
|
if(this.$util.isEmpty(this.filterProductInfo)){ //第一次进入无数据
|
|
if(this.$util.isEmpty(this.filterProductInfo)){ //第一次进入无数据
|
|
|
let classList = [];
|
|
let classList = [];
|
|
|
list.forEach(ele=>{
|
|
list.forEach(ele=>{
|
|
@@ -294,18 +303,23 @@ export default {
|
|
|
let node2 = this.top_list[i+1];
|
|
let node2 = this.top_list[i+1];
|
|
|
if(node2 && top_page >= node1 && top_page < node2){
|
|
if(node2 && top_page >= node1 && top_page < node2){
|
|
|
this.classIndex = i;
|
|
this.classIndex = i;
|
|
|
- this.scrollPushList();
|
|
|
|
|
|
|
+ this.filterProductInfo[this.classIndex].isActive = true;
|
|
|
|
|
+ this.filterProductInfo[this.classIndex+1].isActive = true;
|
|
|
|
|
+ // this.scrollPushList();
|
|
|
break;
|
|
break;
|
|
|
}else if(node2 && top_page === node2){
|
|
}else if(node2 && top_page === node2){
|
|
|
this.classIndex = i + 1;
|
|
this.classIndex = i + 1;
|
|
|
- this.scrollPushList();
|
|
|
|
|
|
|
+ this.filterProductInfo[this.classIndex].isActive = true;
|
|
|
|
|
+ this.filterProductInfo[this.classIndex+1].isActive = true;
|
|
|
|
|
+ // this.scrollPushList();
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
scroll_bottom(){
|
|
scroll_bottom(){
|
|
|
this.classIndex = this.filterProductInfo.length-1
|
|
this.classIndex = this.filterProductInfo.length-1
|
|
|
- this.scrollPushList();
|
|
|
|
|
|
|
+ this.filterProductInfo[this.classIndex].isActive = true;
|
|
|
|
|
+ // this.scrollPushList();
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 获取当前选中商品总价
|
|
* 获取当前选中商品总价
|
|
@@ -353,7 +367,16 @@ export default {
|
|
|
* **/
|
|
* **/
|
|
|
suitScrollPushList(){
|
|
suitScrollPushList(){
|
|
|
let list = copyObject(this.suitInfo);
|
|
let list = copyObject(this.suitInfo);
|
|
|
-
|
|
|
|
|
|
|
+ let classList = [];
|
|
|
|
|
+ for (let i=0;i<list.length;i++){
|
|
|
|
|
+ if(i<2){
|
|
|
|
|
+ classList.push({...list[i],isActive:true});
|
|
|
|
|
+ }else{
|
|
|
|
|
+ classList.push({...list[i],isActive:false});
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ this.suitFilterProductInfo = classList
|
|
|
|
|
+ return
|
|
|
if(this.$util.isEmpty(this.suitFilterProductInfo)){ //第一次进入无数据
|
|
if(this.$util.isEmpty(this.suitFilterProductInfo)){ //第一次进入无数据
|
|
|
let classList = [];
|
|
let classList = [];
|
|
|
list.forEach(ele=>{
|
|
list.forEach(ele=>{
|
|
@@ -834,11 +857,19 @@ export default {
|
|
|
* 切换左侧商品类别
|
|
* 切换左侧商品类别
|
|
|
*/
|
|
*/
|
|
|
swichClass(cur) {
|
|
swichClass(cur) {
|
|
|
- clearInterval(this.timeFun)
|
|
|
|
|
|
|
+ // clearInterval(this.timeFun)
|
|
|
this.classIndex = cur;
|
|
this.classIndex = cur;
|
|
|
|
|
+ this.filterProductInfo[cur].isActive = true;
|
|
|
|
|
+ if(cur==this.filterProductInfo.length-1){
|
|
|
|
|
+ this.filterProductInfo[cur-1].isActive = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(cur!=0&&cur!=this.filterProductInfo.length-1){
|
|
|
|
|
+ this.filterProductInfo[cur-1].isActive = true;
|
|
|
|
|
+ this.filterProductInfo[cur+1].isActive = true;
|
|
|
|
|
+ }
|
|
|
this.scroll_into_view = '';
|
|
this.scroll_into_view = '';
|
|
|
this.$nextTick(()=>{this.scroll_into_view = 'class_'+cur;})
|
|
this.$nextTick(()=>{this.scroll_into_view = 'class_'+cur;})
|
|
|
- this.scrollPushList();
|
|
|
|
|
|
|
+ // this.scrollPushList();
|
|
|
//解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
|
|
//解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
|
|
|
uni.setStorageSync("resolve","last");
|
|
uni.setStorageSync("resolve","last");
|
|
|
setTimeout(()=>{
|
|
setTimeout(()=>{
|
|
@@ -850,11 +881,21 @@ export default {
|
|
|
* 成品(多风格)-切换左侧商品类别
|
|
* 成品(多风格)-切换左侧商品类别
|
|
|
*/
|
|
*/
|
|
|
suitSwichClass(cur) {
|
|
suitSwichClass(cur) {
|
|
|
- clearInterval(this.suitTimeFun)
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ // clearInterval(this.suitTimeFun)
|
|
|
this.suitClassIndex = cur;
|
|
this.suitClassIndex = cur;
|
|
|
|
|
+ this.suitFilterProductInfo[cur].isActive = true;
|
|
|
|
|
+ if(cur==this.suitFilterProductInfo.length-1){
|
|
|
|
|
+ this.suitFilterProductInfo[cur-1].isActive = true;
|
|
|
|
|
+ }
|
|
|
|
|
+ if(cur!=0&&cur!=this.suitFilterProductInfo.length-1){
|
|
|
|
|
+ this.suitFilterProductInfo[cur-1].isActive = true;
|
|
|
|
|
+ this.suitFilterProductInfo[cur+1].isActive = true;
|
|
|
|
|
+ }
|
|
|
this.suit_scroll_into_view = '';
|
|
this.suit_scroll_into_view = '';
|
|
|
this.$nextTick(()=>{this.suit_scroll_into_view = 'class_'+cur;})
|
|
this.$nextTick(()=>{this.suit_scroll_into_view = 'class_'+cur;})
|
|
|
- this.suitScrollPushList();
|
|
|
|
|
|
|
+ // this.suitScrollPushList();
|
|
|
// this.scrollPushList();
|
|
// this.scrollPushList();
|
|
|
//解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
|
|
//解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
|
|
|
uni.setStorageSync("resolve","last");
|
|
uni.setStorageSync("resolve","last");
|
|
@@ -894,18 +935,23 @@ export default {
|
|
|
let node2 = this.suit_top_list[i+1];
|
|
let node2 = this.suit_top_list[i+1];
|
|
|
if(node2 && top_page >= node1 && top_page < node2){
|
|
if(node2 && top_page >= node1 && top_page < node2){
|
|
|
this.suitClassIndex = i;
|
|
this.suitClassIndex = i;
|
|
|
- this.suitScrollPushList();
|
|
|
|
|
|
|
+ this.suitFilterProductInfo[this.suitClassIndex].isActive = true;
|
|
|
|
|
+ this.suitFilterProductInfo[this.suitClassIndex+1].isActive = true;
|
|
|
|
|
+ // this.suitScrollPushList();
|
|
|
break;
|
|
break;
|
|
|
}else if(node2 && top_page === node2){
|
|
}else if(node2 && top_page === node2){
|
|
|
this.suitClassIndex = i + 1;
|
|
this.suitClassIndex = i + 1;
|
|
|
- this.suitScrollPushList();
|
|
|
|
|
|
|
+ this.suitFilterProductInfo[this.suitClassIndex].isActive = true;
|
|
|
|
|
+ this.suitFilterProductInfo[this.suitClassIndex+1].isActive = true;
|
|
|
|
|
+ // this.suitScrollPushList();
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
suit_scroll_bottom(){
|
|
suit_scroll_bottom(){
|
|
|
this.suitClassIndex = this.suitFilterProductInfo.length-1
|
|
this.suitClassIndex = this.suitFilterProductInfo.length-1
|
|
|
- this.suitScrollPushList();
|
|
|
|
|
|
|
+ this.suitFilterProductInfo[this.suitClassIndex].isActive = true;
|
|
|
|
|
+ // this.suitScrollPushList();
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 搜索对应花材
|
|
* 搜索对应花材
|
|
@@ -925,13 +971,13 @@ export default {
|
|
|
let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0;
|
|
let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) >= 0;
|
|
|
if (hasName || hasPy) {
|
|
if (hasName || hasPy) {
|
|
|
if(this.$util.isEmpty(commonChildList)){
|
|
if(this.$util.isEmpty(commonChildList)){
|
|
|
- commonChildList = [...commonChildList,{classId: ele.classId, className: ele.className,child:[obj]}];
|
|
|
|
|
|
|
+ commonChildList = [...commonChildList,{classId: ele.classId, className: ele.className,isActive:true,child:[obj]}];
|
|
|
}else{
|
|
}else{
|
|
|
commonChildList.forEach(res => {
|
|
commonChildList.forEach(res => {
|
|
|
if(res.classId==ele.classId){
|
|
if(res.classId==ele.classId){
|
|
|
res.child.push(obj)
|
|
res.child.push(obj)
|
|
|
}else{
|
|
}else{
|
|
|
- commonChildList.push({classId: ele.classId, className: ele.className,child:[obj]});
|
|
|
|
|
|
|
+ commonChildList.push({classId: ele.classId, className: ele.className,isActive:true,child:[obj]});
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -944,9 +990,11 @@ export default {
|
|
|
list = this.$util.unique(commonChildList)
|
|
list = this.$util.unique(commonChildList)
|
|
|
this.suitFilterProductInfo = list;
|
|
this.suitFilterProductInfo = list;
|
|
|
this.suitClassIndex = 0;
|
|
this.suitClassIndex = 0;
|
|
|
|
|
+ this.suit_scroll_into_view = 'class_'+0;
|
|
|
}else{
|
|
}else{
|
|
|
this.suitFilterProductInfo = '';
|
|
this.suitFilterProductInfo = '';
|
|
|
this.suitClassIndex = 0;
|
|
this.suitClassIndex = 0;
|
|
|
|
|
+ this.suit_scroll_into_view = 'class_'+0;
|
|
|
this.suitScrollPushList();
|
|
this.suitScrollPushList();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
@@ -972,13 +1020,13 @@ export default {
|
|
|
let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) == 0;
|
|
let hasPy = elePy.indexOf(this.py.toLocaleUpperCase()) == 0;
|
|
|
if (hasName || hasPy) {
|
|
if (hasName || hasPy) {
|
|
|
if(this.$util.isEmpty(commonChildList)){
|
|
if(this.$util.isEmpty(commonChildList)){
|
|
|
- commonChildList = [...commonChildList,{classId: ele.classId, className: ele.className,child:[obj]}];
|
|
|
|
|
|
|
+ commonChildList = [...commonChildList,{classId: ele.classId, className: ele.className,isActive:true,child:[obj]}];
|
|
|
}else{
|
|
}else{
|
|
|
commonChildList.forEach(res => {
|
|
commonChildList.forEach(res => {
|
|
|
if(res.classId==ele.classId){
|
|
if(res.classId==ele.classId){
|
|
|
res.child.push(obj)
|
|
res.child.push(obj)
|
|
|
}else{
|
|
}else{
|
|
|
- commonChildList.push({classId: ele.classId, className: ele.className,child:[obj]});
|
|
|
|
|
|
|
+ commonChildList.push({classId: ele.classId, className: ele.className,isActive:true,child:[obj]});
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
@@ -990,10 +1038,12 @@ export default {
|
|
|
});
|
|
});
|
|
|
list = this.$util.unique(commonChildList)
|
|
list = this.$util.unique(commonChildList)
|
|
|
this.filterProductInfo = list;
|
|
this.filterProductInfo = list;
|
|
|
- this.suitClassIndex = 0;
|
|
|
|
|
|
|
+ this.classIndex = 0;
|
|
|
|
|
+ this.scroll_into_view = 'class_'+0;
|
|
|
}else{
|
|
}else{
|
|
|
this.filterProductInfo = '';
|
|
this.filterProductInfo = '';
|
|
|
this.classIndex = 0;
|
|
this.classIndex = 0;
|
|
|
|
|
+ this.scroll_into_view = 'class_'+0;
|
|
|
this.scrollPushList();
|
|
this.scrollPushList();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|