jf 5 лет назад
Родитель
Сommit
dc70910fc9

+ 13 - 1
ghsApp/src/mixins/product.js

@@ -152,7 +152,7 @@ export default {
 				});
 				this.productInfo = data;
 				this.classIndex = 0;
-				this.scroll_into_view = 'class_'+0;
+				this.scroll_into_view = 'class_0';
 				this.scrollPushList();
 				// console.log(this.filterProductInfo)
 			} catch (error) {
@@ -528,6 +528,9 @@ export default {
 			if(cur!=0&&cur!=this.filterProductInfo.length-1){
 				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){
+					this.filterProductInfo[cur+2].isActive = true;
+				}
 			}
 			// clearInterval(this.timeFun)
 			this.scroll_into_view = '';
@@ -579,12 +582,18 @@ export default {
 					this.classIndex = i;
 					this.filterProductInfo[this.classIndex].isActive = true;
 					this.filterProductInfo[this.classIndex+1].isActive = true;
+					if(this.filterProductInfo[this.classIndex+1].child.length<5){
+						this.filterProductInfo[this.classIndex+2].isActive = true;
+					}
 					// this.scrollPushList();
 					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+1].child.length<5){
+						this.filterProductInfo[this.classIndex+2].isActive = true;
+					}
 					// this.scrollPushList();
 					break;
 				}
@@ -594,6 +603,9 @@ export default {
 		scroll_bottom(){
 			this.classIndex = this.filterProductInfo.length-1
 			this.filterProductInfo[this.classIndex].isActive = true;
+			if(this.filterProductInfo[this.classIndex+1].child.length<5){
+				this.filterProductInfo[this.classIndex+2].isActive = true;
+			}
 			// this.scrollPushList();
 		},
 		/**

+ 6 - 2
hdApp/src/components/module/app-commodity.vue

@@ -3,8 +3,8 @@
 		<!--		<view class="img_bx" @click="addEvents">-->
 		<!--			<app-img  :src="info.cover" alt="商品图" mode="aspectFit" :height="160" />-->
 		<!--		</view>-->
-		<view class="img_bx" >
-			<image :src="info.cover"></image>
+		<view class="img_bx" style="background:#eeeeee">
+			<image :src="info.cover" v-if="isImg"></image>
 		</view>
 		<view class="cmd-info_bx">
 			<view class="tit" >{{ info.itemName || "" }}</view>
@@ -111,6 +111,7 @@ export default {
 			COMMODITY_TYPE,
 			// isAllActive: false,
 			// isAllFocus: false,
+			isImg:false,
 			isAlterMoney:false,
 			isAloneAllActive: false,
 			isAloneAllFocus: false,
@@ -124,6 +125,9 @@ export default {
 	},
 	created() {},
 	mounted() {
+		setTimeout(()=>{
+			this.isImg = true;
+		},100)
 		if(this.info.priceLabel == 2){
 			this.changeAutoPrice = this.info.price
 		}

+ 7 - 5
hdApp/src/mixins/product.js

@@ -223,6 +223,7 @@ export default {
 				});
 				this.productInfo = data;
 				this.classIndex = 0;
+				this.scroll_into_view = 'class_0';
 				this.scrollPushList();
 			} catch (error) {
 			} finally {
@@ -353,9 +354,9 @@ export default {
 			}
 		},
 		scroll_bottom(){
-			this.classIndex = this.filterProductInfo.length-1
-			this.filterProductInfo[this.classIndex].isActive = true;
-			this.filterProductInfo[this.classIndex-1].isActive = true;
+				this.classIndex = this.filterProductInfo.length-1
+				this.filterProductInfo[this.classIndex].isActive = true;
+				this.filterProductInfo[this.classIndex-1].isActive = true;
 			// this.scrollPushList();
 		},
 		/**
@@ -895,15 +896,16 @@ export default {
 			*/
 		swichClass(cur) {
 			// clearInterval(this.timeFun)
+			console.log(cur,'---',this.filterProductInfo)
 			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){
+			if(cur!=0&&cur!=this.filterProductInfo.length-2){
 				this.filterProductInfo[cur-1].isActive = true;
 				this.filterProductInfo[cur+1].isActive = true;
-				if(this.filterProductInfo[cur+1].child.length<5){
+				if(this.filterProductInfo[cur+1].child.length<5&&cur<this.filterProductInfo.length-3){
 					this.filterProductInfo[cur+2].isActive = true;
 				}
 			}