shish hace 2 años
padre
commit
fcba862b60
Se han modificado 1 ficheros con 33 adiciones y 12 borrados
  1. 33 12
      hdApp/src/mixins/cgProduct.js

+ 33 - 12
hdApp/src/mixins/cgProduct.js

@@ -348,18 +348,30 @@ export default {
 				let node2 = this.top_list[i+1];
 				if(node2 && top_page >= node1 && top_page < node2){
 					this.classIndex = i;
-					this.filterProductInfo[this.classIndex].isActive = true;
-					this.filterProductInfo[this.classIndex+1].isActive = true;
+					if(this.filterProductInfo[this.classIndex]){
+						this.filterProductInfo[this.classIndex].isActive = true;
+					}
+					if(this.filterProductInfo[this.classIndex+1]){
+						this.filterProductInfo[this.classIndex+1].isActive = true;
+					}
 					if(this.filterProductInfo[this.classIndex+1].child.length<5){
-						this.filterProductInfo[this.classIndex+2].isActive = true;
+						if(this.filterProductInfo[this.classIndex+2]){
+							this.filterProductInfo[this.classIndex+2].isActive = true;
+						}
 					}
 					break;
 				}else if(node2 && top_page === node2){
 					this.classIndex = i + 1;
-					this.filterProductInfo[this.classIndex].isActive = true;
-					this.filterProductInfo[this.classIndex+1].isActive = true;
+					if(this.filterProductInfo[this.classIndex]){
+						this.filterProductInfo[this.classIndex].isActive = true;
+					}
+					if(this.filterProductInfo[this.classIndex+1]){
+						this.filterProductInfo[this.classIndex+1].isActive = true;
+					}
 					if(this.filterProductInfo[this.classIndex+1].child.length<5){
-						this.filterProductInfo[this.classIndex+2].isActive = true;
+						if(this.filterProductInfo[this.classIndex+2]){
+							this.filterProductInfo[this.classIndex+2].isActive = true;
+						}
 					}
 					break;
 				}
@@ -897,20 +909,27 @@ export default {
 		suit_async_detail_msg(options){
 			//options  为滚动信息。  options.detail.scrollTop  值为相对于scroll-view。
 			let top_page = options.detail.scrollTop + this.suit_top_list[0];
-
 			for(let i = 0;i < this.suit_top_list.length; i++){
 				let node1 = this.suit_top_list[i];
 				let node2 = this.suit_top_list[i+1];
 				if(node2 && top_page >= node1 && top_page < node2){
 					this.suitClassIndex = i;
-					this.suitFilterProductInfo[this.suitClassIndex].isActive = true;
-					this.suitFilterProductInfo[this.suitClassIndex+1].isActive = true;
+					if(this.suitFilterProductInfo[this.suitClassIndex]){
+						this.suitFilterProductInfo[this.suitClassIndex].isActive = true;
+					}
+					if(this.suitFilterProductInfo[this.suitClassIndex+1]){
+						this.suitFilterProductInfo[this.suitClassIndex+1].isActive = true;
+					}
 					// this.suitScrollPushList();
 					break;
 				}else if(node2 && top_page === node2){
 					this.suitClassIndex = i + 1;
-					this.suitFilterProductInfo[this.suitClassIndex].isActive = true;
-					this.suitFilterProductInfo[this.suitClassIndex+1].isActive = true;
+					if(this.suitFilterProductInfo[this.suitClassIndex]){
+						this.suitFilterProductInfo[this.suitClassIndex].isActive = true;
+					}
+					if(this.suitFilterProductInfo[this.suitClassIndex+1]){
+						this.suitFilterProductInfo[this.suitClassIndex+1].isActive = true;
+					}
 					// this.suitScrollPushList();
 					break;
 				}
@@ -918,7 +937,9 @@ export default {
 		},
 		suit_scroll_bottom(){
 			this.suitClassIndex = this.suitFilterProductInfo.length-1
-			this.suitFilterProductInfo[this.suitClassIndex].isActive = true;
+			if(this.suitFilterProductInfo[this.suitClassIndex]){
+				this.suitFilterProductInfo[this.suitClassIndex].isActive = true;
+			}
 			// this.suitScrollPushList();
 		},
 		//搜索对应花材