guhongwei 2 tahun lalu
induk
melakukan
d7aae72021
1 mengubah file dengan 5 tambahan dan 57 penghapusan
  1. 5 57
      pages/home/index.vue

+ 5 - 57
pages/home/index.vue

@@ -26,7 +26,7 @@
 							<view class="title">
 								<text>{{tag.title||'&nbsp;'}}</text>
 							</view>
-							<image class="image" :src="tag.url" mode=""></image>
+							<image class="image" :src="tag.url&&tag.url.length>0?tag.url[0].url:''" mode=""></image>
 							<view class="textOver name">
 								{{tag.name}}
 							</view>
@@ -73,62 +73,6 @@
 				btnList: [ //功能按钮
 				],
 				recomList: [ //推荐好物
-					{
-						list: [ //商品
-							{
-								title: '新品上架',
-								url: require('@/static/test.png'),
-								name: '商品名称'
-							},
-							{
-								title: '',
-								url: require('@/static/test.png'),
-								name: '商品名称'
-							},
-						]
-					},
-					{
-						list: [ //商品
-							{
-								title: '发现好货',
-								url: require('@/static/test.png'),
-								name: '商品名称'
-							},
-							{
-								title: '热销爆款',
-								url: require('@/static/test.png'),
-								name: '商品名称'
-							},
-						]
-					},
-					{
-						list: [ //商品
-							{
-								title: '天恩精选',
-								url: require('@/static/test.png'),
-								name: '商品名称'
-							},
-							{
-								title: '居家常备',
-								url: require('@/static/test.png'),
-								name: '商品名称'
-							},
-						]
-					},
-					{
-						list: [ //商品
-							{
-								title: '人气单品',
-								url: require('@/static/test.png'),
-								name: '商品名称'
-							},
-							{
-								title: '夏季畅销',
-								url: require('@/static/test.png'),
-								name: '商品名称'
-							},
-						]
-					}
 				],
 				marketList: [ //商品列表
 				],
@@ -161,6 +105,10 @@
 					});
 					that.$set(that, `btnList`, data);
 				}
+				// 推荐好货
+				res = await that.$api(`/viewGoods/iatg`, 'GET', {});
+				console.log(res);
+				if (res.errcode == '0') that.$set(that, `recomList`, res.data);
 				// 首页产品列表
 				res = await that.$api(`/viewGoods/indexGoodsList`, `GET`, {
 					limit: 20