Browse Source

2022-1-20

cmy 3 years ago
parent
commit
9018db8487
3 changed files with 14 additions and 8 deletions
  1. 9 5
      pages/index/hot.vue
  2. 1 1
      pages/index/index.vue
  3. 4 2
      pages/index/shopList.vue

+ 9 - 5
pages/index/hot.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="content">
-		<view class="box" v-for=" item in shopList" @click="navTo()">
+		<view class="box" v-for=" item in shopList" @click="navTo(item)">
 			<view class="img">
 				<image :src=item.img mode=""></image>
 			</view>
@@ -26,19 +26,23 @@
 				shopList:[
 					{
 						title:'商家推荐',
-						img:'../../static/error/missing-face.png'
+						img:'../../static/error/missing-face.png',
+						id:6
 					},
 					{
 						title:'特优促销',
-						img:'../../static/error/missing-face.png'
+						img:'../../static/error/missing-face.png',
+						id:7
 					},
 					{
 						title:'订单预售',
-						img:'../../static/error/missing-face.png'
+						img:'../../static/error/missing-face.png',
+						id:8
 					},
 					{
 						title:'拼团抢购',
-						img:'../../static/error/missing-face.png'
+						img:'../../static/error/missing-face.png',
+						id:9
 					}
 				]
 			}

+ 1 - 1
pages/index/index.vue

@@ -50,7 +50,7 @@
 				<view class="cate-font">热销推荐</view>
 			</view>
 			<view class="cate-item">
-				<image src="/static/icon/in7.png" @click="nav('/pages/index/shopList')"></image>
+				<image src="/static/icon/in7.png" @click="nav('/pages/index/shopList?vip=1&tit=' + encodeURI('会员中心'))"></image>
 				<view class="cate-font">会员中心</view>
 			</view>
 			<view class="cate-item" @click="nav('/pages/index/classify')">

+ 4 - 2
pages/index/shopList.vue

@@ -29,14 +29,16 @@
 				limit: 10,
 				loadingType: 'more',
 				cid: 0,
+				vip:0
 			}
 		},
 		onLoad(opt) {
-			this.cid = opt.cid
+			this.cid = opt.cid||''
 			this.tit = decodeURI(opt.tit)
 			uni.setNavigationBarTitle({
 				title: this.tit 
 			})
+			this.vip = +opt.vip||0
 			this.getArticleList()
 		},
 		methods: {
@@ -54,7 +56,7 @@
 				getProducts({
 					page: obj.page,
 					limit: obj.limit,
-					can_up_level:1//设置是否vip商品
+					can_up_level:this.vip//设置是否vip商品
 				},obj.cid).then(({data}) => {
 					obj.list = obj.list.concat(data)
 					obj.page++