|
@@ -550,9 +550,7 @@ export default {
|
|
|
this.rememberProduct()
|
|
this.rememberProduct()
|
|
|
|
|
|
|
|
},
|
|
},
|
|
|
- /**
|
|
|
|
|
- * 切换左侧商品类别
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ //切换左侧商品类别
|
|
|
swichClass(cur) {
|
|
swichClass(cur) {
|
|
|
this.isCut = true;
|
|
this.isCut = true;
|
|
|
this.filterProductInfo[cur].isActive = true;
|
|
this.filterProductInfo[cur].isActive = true;
|
|
@@ -562,40 +560,38 @@ export default {
|
|
|
if(cur!=0&&cur!=this.filterProductInfo.length-1){
|
|
if(cur!=0&&cur!=this.filterProductInfo.length-1){
|
|
|
this.filterProductInfo[cur-1].isActive = true;
|
|
this.filterProductInfo[cur-1].isActive = true;
|
|
|
this.filterProductInfo[cur+1].isActive = true;
|
|
this.filterProductInfo[cur+1].isActive = true;
|
|
|
- if(this.filterProductInfo[cur+1].child.length<5&&cur<this.filterProductInfo.length-3){
|
|
|
|
|
|
|
+ if(this.filterProductInfo[cur+1].child.length<5 && cur<this.filterProductInfo.length-3){
|
|
|
this.filterProductInfo[cur+2].isActive = true;
|
|
this.filterProductInfo[cur+2].isActive = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- // clearInterval(this.timeFun)
|
|
|
|
|
this.scroll_into_view = '';
|
|
this.scroll_into_view = '';
|
|
|
this.$nextTick(()=>{
|
|
this.$nextTick(()=>{
|
|
|
this.scroll_into_view = 'class_'+cur;
|
|
this.scroll_into_view = 'class_'+cur;
|
|
|
this.classIndex = cur;
|
|
this.classIndex = cur;
|
|
|
})
|
|
})
|
|
|
|
|
|
|
|
- // this.scrollPushList();
|
|
|
|
|
- //解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
|
|
|
|
|
- uni.setStorageSync("resolve","last");
|
|
|
|
|
- setTimeout(()=>{
|
|
|
|
|
- uni.removeStorageSync("resolve")
|
|
|
|
|
- },400);
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ //解决最后一个 ***来回*** 问题 (由于点击左侧导航,右侧锚点位置信息变化,此时滚动事件也随之滚动。)
|
|
|
|
|
+ uni.setStorageSync("resolve","last");
|
|
|
|
|
+ setTimeout(()=>{
|
|
|
|
|
+ uni.removeStorageSync("resolve")
|
|
|
|
|
+ },400);
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
- /**
|
|
|
|
|
- * 滚动商品监听
|
|
|
|
|
- * **/
|
|
|
|
|
|
|
+ //滚动商品监听
|
|
|
scroll_detail(options){
|
|
scroll_detail(options){
|
|
|
- if(this.isCut) {this.isCut = false; return;}
|
|
|
|
|
- //options 为滚动信息。 options.detail.scrollTop 值为相对于scroll-view。
|
|
|
|
|
|
|
+ if(this.isCut) {
|
|
|
|
|
+ this.isCut = false
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ //options为滚动信息,options.detail.scrollTop 值为相对于scroll-view。
|
|
|
if(!uni.getStorageSync("resolve")){
|
|
if(!uni.getStorageSync("resolve")){
|
|
|
this.get_node_details(options);
|
|
this.get_node_details(options);
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
- /**
|
|
|
|
|
- * 获取商品节点信息
|
|
|
|
|
- * **/
|
|
|
|
|
|
|
+ //获取商品节点信息
|
|
|
get_node_details(options){
|
|
get_node_details(options){
|
|
|
- const query = uni.createSelectorQuery().in(this); //获得实力
|
|
|
|
|
|
|
+ //获得实例
|
|
|
|
|
+ const query = uni.createSelectorQuery().in(this);
|
|
|
//获取多个节点方式
|
|
//获取多个节点方式
|
|
|
query.selectAll(".selectAll").boundingClientRect(data=>{
|
|
query.selectAll(".selectAll").boundingClientRect(data=>{
|
|
|
this.top_list = data.map(item=>{
|
|
this.top_list = data.map(item=>{
|
|
@@ -605,9 +601,8 @@ export default {
|
|
|
}).exec();
|
|
}).exec();
|
|
|
},
|
|
},
|
|
|
async_detail_msg(options){
|
|
async_detail_msg(options){
|
|
|
- //options 为滚动信息。 options.detail.scrollTop 值为相对于scroll-view。
|
|
|
|
|
|
|
+ //options为滚动信息,options.detail.scrollTop 值为相对于scroll-view
|
|
|
let top_page = options.detail.scrollTop + this.top_list[0];
|
|
let top_page = options.detail.scrollTop + this.top_list[0];
|
|
|
-
|
|
|
|
|
for(let i = 0;i < this.top_list.length; i++){
|
|
for(let i = 0;i < this.top_list.length; i++){
|
|
|
let node1 = this.top_list[i];
|
|
let node1 = this.top_list[i];
|
|
|
let node2 = this.top_list[i+1];
|
|
let node2 = this.top_list[i+1];
|
|
@@ -618,7 +613,6 @@ export default {
|
|
|
if(this.filterProductInfo[this.classIndex+1].child.length<5){
|
|
if(this.filterProductInfo[this.classIndex+1].child.length<5){
|
|
|
this.filterProductInfo[this.classIndex+2].isActive = true;
|
|
this.filterProductInfo[this.classIndex+2].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;
|
|
@@ -627,7 +621,6 @@ export default {
|
|
|
if(this.filterProductInfo[this.classIndex+1].child.length<5){
|
|
if(this.filterProductInfo[this.classIndex+1].child.length<5){
|
|
|
this.filterProductInfo[this.classIndex+2].isActive = true;
|
|
this.filterProductInfo[this.classIndex+2].isActive = true;
|
|
|
}
|
|
}
|
|
|
- // this.scrollPushList();
|
|
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -638,11 +631,8 @@ export default {
|
|
|
if(this.filterProductInfo[this.classIndex+1].child.length<5){
|
|
if(this.filterProductInfo[this.classIndex+1].child.length<5){
|
|
|
this.filterProductInfo[this.classIndex+2].isActive = true;
|
|
this.filterProductInfo[this.classIndex+2].isActive = true;
|
|
|
}
|
|
}
|
|
|
- // this.scrollPushList();
|
|
|
|
|
},
|
|
},
|
|
|
- /**
|
|
|
|
|
- * 搜索对应花材
|
|
|
|
|
- */
|
|
|
|
|
|
|
+ //搜索对应花材
|
|
|
searchFn() {
|
|
searchFn() {
|
|
|
let list = copyObject(this.productInfo);
|
|
let list = copyObject(this.productInfo);
|
|
|
if(!this.$util.isEmpty(this.py)){
|
|
if(!this.$util.isEmpty(this.py)){
|