diff --git a/pages/index/index.vue b/pages/index/index.vue index 3d28e27..4886571 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -8,8 +8,11 @@ - - {{userInfo.tel}} + + {{ userInfo.tel }} + + + 请登录 @@ -28,12 +31,39 @@ --> - - + + - + + + + + + + + + + 站长推荐 + + + + + + + + + + + + + + + + @@ -50,9 +80,6 @@ data() { return { avatarSrc: "", //头像地址 - bannerList: [{ //banner - url: '/static/banner1.png' - }], } }, computed: { @@ -62,8 +89,21 @@ //订单列表 过滤出 已付款的状态订单 orderList() { return this.$store.state.orderList.filter(item => item.main_status === '已付款') + }, + //推荐的商品spu列表 + recommendList() { + return this.$store.state.spuList.filter(item => item.recommend === '1') + }, + //获取首页banner列表 + bannerList() { + return this.$store.state.bannerList + .filter(item => item.type === 'index') + .map(item => ({ + url: item.photo + })) } }, + watch: {}, created() { //检查token 没有则进行无感登录 this.checkUserInfo() @@ -87,4 +127,36 @@ transform: translateX(-50%); top: 494rpx; } + + .recommendBox { + width: 702rpx; + margin-top: 48rpx; + } + + .recommendTit { + height: 90rpx; + } + + .recommendTitBut { + width: 252rpx; + height: 72rpx; + background-color: $uni-color-error; + } + + .recommendTitButTiao { + width: 8rpx; + height: 4rpx; + background-color: $uni-text-color-inverse; + } + + .recommendSwiper { + width: 702rpx; + height: 224rpx; + } + + .recommendSwiper-item { + background-color: $uni-bg-color; + width: 680rpx; + height: 184rpx; + } \ No newline at end of file