zs 2 سال پیش
والد
کامیت
1deb2483b6
1فایلهای تغییر یافته به همراه24 افزوده شده و 9 حذف شده
  1. 24 9
      pagesHome/market/type.vue

+ 24 - 9
pagesHome/market/type.vue

@@ -2,13 +2,15 @@
 	<mobile-frame>
 		<view class="main">
 			<view class="one">
-				<input type="text" placeholder="寻找您喜爱的商品" @tap="toCommon('pagesHome/market/search')" placeholder-class="placss">
+				<input type="text" placeholder="寻找您喜爱的商品" @tap="toCommon('pagesHome/market/search')"
+					placeholder-class="placss">
 			</view>
 			<view class="two">
 				<view class="two_1">
 					<scroll-view scroll-y="true" class="scroll-view">
 						<view class="list-scroll-view">
-							<view class="list" :class="[active==index?'listActive':'']" v-for="(item,index) in typeList" :key="index" @tap="toChange(index,item)">
+							<view class="list" :class="[active==index?'listActive':'']" v-for="(item,index) in typeList"
+								:key="index" @tap="toChange(index,item)">
 								<text>{{item.label}}</text>
 							</view>
 						</view>
@@ -17,18 +19,30 @@
 				<view class="two_2">
 					<scroll-view scroll-y="true" class="scroll-view">
 						<view class="list-scroll-view">
-							<view class="list" v-for="(item,index) in list" :key="index" @tap="toCommon('pagesHome/market/search')">
+							<view class="list" v-for="(item,index) in list" :key="index"
+								@tap="toCommon('pagesHome/market/search',item)">
 								<view class="title">
 									{{item.label}}
 								</view>
-								<view class="market">
-									<view class="marketList" v-for="(tag,indexs) in item.children" :key="indexs">
-										<image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:''" mode=""></image>
+								<view class="market" v-if="item.children&&item.children.length>0">
+									<view class="marketList" v-for="(tag,indexs) in item.children" :key="indexs"
+										@tap.stop="toCommon('pagesHome/market/search',tag)">
+										<image class="image" :src="tag.file&&tag.file.length>0?tag.file[0].url:''"
+											mode=""></image>
 										<view class="name">
 											{{tag.label}}
 										</view>
 									</view>
 								</view>
+								<view class="market" v-else>
+									<view class="marketList" @tap.stop="toCommon('pagesHome/market/search',item)">
+										<image class="image" :src="item.file&&item.file.length>0?item.file[0].url:''"
+											mode=""></image>
+										<view class="name">
+											{{item.label}}
+										</view>
+									</view>
+								</view>
 							</view>
 						</view>
 					</scroll-view>
@@ -47,7 +61,7 @@
 				list: []
 			};
 		},
-		onShow: function() {
+		onLoad: function() {
 			const that = this;
 			that.searchOther();
 
@@ -66,6 +80,7 @@
 			},
 			toChange(index, e) {
 				const that = this;
+				that.$set(that, `list`, []);
 				that.$set(that, `active`, index);
 				that.searchRight(e);
 			},
@@ -82,9 +97,9 @@
 				}
 			},
 			// 公共跳转
-			toCommon(e) {
+			toCommon(e, code) {
 				uni.navigateTo({
-					url: `/${e}`
+					url: `/${e}?tags=${code.code}`
 				})
 			},
 		},