|
|
@@ -19,7 +19,7 @@
|
|
|
<swiper indicator-dots autoplay circular class="swiper">
|
|
|
<block v-for="(item,index) in swiperList" :key="index">
|
|
|
<swiper-item>
|
|
|
- <image mode="aspectFill" :src="item.imageUrl"></image>
|
|
|
+ <image mode="aspectFill" :src="item.imageUrl" @click="goBanner(item)"></image>
|
|
|
</swiper-item>
|
|
|
</block>
|
|
|
</swiper>
|
|
|
@@ -30,37 +30,40 @@
|
|
|
|
|
|
<div class="linearBg">
|
|
|
<!-- <homeCoupon></homeCoupon> -->
|
|
|
+ <div v-for="(item,index) in homeProductList" :key='index'>
|
|
|
|
|
|
- <div class="hot">
|
|
|
- <navigator url="/pages/productList/productList?serviceType=1&title=超值热卖" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
|
|
|
- <view class="weui-cell__bd">超值热卖</view>
|
|
|
- <view class="weui-cell__ft weui-cell__ft_in-access">查看更多</view>
|
|
|
- </navigator>
|
|
|
- <scroll-view scroll-x style="width: 100%">
|
|
|
- <div class="hotList">
|
|
|
- <hotItem v-for="(item,index) in hotList" :key="index" :info='item'></hotItem>
|
|
|
- <div class="right"></div>
|
|
|
- </div>
|
|
|
- </scroll-view>
|
|
|
+ <div class="hot" v-if="item.typeFlag==0">
|
|
|
+ <navigator :url="'/pages/productList/productList?homeProductId='+item.id+'&title='+item.typeName" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
|
|
|
+ <view class="weui-cell__bd">{{item.typeName}}</view>
|
|
|
+ <view class="weui-cell__ft weui-cell__ft_in-access">查看更多</view>
|
|
|
+ </navigator>
|
|
|
+ <scroll-view scroll-x style="width: 100%">
|
|
|
+ <div class="hotList">
|
|
|
+ <hotItem v-for="(todo,todoIndex) in item.homeProductList" :key="todoIndex" :info='todo.productInfo'></hotItem>
|
|
|
+ <div class="right"></div>
|
|
|
+ </div>
|
|
|
+ </scroll-view>
|
|
|
|
|
|
- </div>
|
|
|
+ </div>
|
|
|
|
|
|
- <div class="classics">
|
|
|
- <navigator url="/pages/productList/productList?serviceType=5&title=经典套餐" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
|
|
|
- <view class="weui-cell__bd">经典套餐</view>
|
|
|
- <view class="weui-cell__ft weui-cell__ft_in-access">查看更多</view>
|
|
|
- </navigator>
|
|
|
+ <div class="classics" v-else>
|
|
|
+ <navigator :url="'/pages/productList/productList?homeProductId='+item.id+'&title='+item.typeName" class="weui-cell weui-cell_access" hover-class="weui-cell_active">
|
|
|
+ <view class="weui-cell__bd">{{item.typeName}}</view>
|
|
|
+ <view class="weui-cell__ft weui-cell__ft_in-access">查看更多</view>
|
|
|
+ </navigator>
|
|
|
|
|
|
- <div class="classicsList">
|
|
|
- <productItem v-for="(item,index) in homeList" :key="index" :info='item'></productItem>
|
|
|
+ <div class="classicsList">
|
|
|
+ <productItem v-for="(todo,todoIndex) in item.homeProductList" :key="todoIndex" :info='todo.productInfo'></productItem>
|
|
|
+ </div>
|
|
|
+ <view class="weui-loadmore" v-if="isFinish">
|
|
|
+ <!-- <view class="weui-loadmore__tips">没有更多数据了</view> -->
|
|
|
+ </view>
|
|
|
+ <view class="weui-loadmore" v-else>
|
|
|
+ <view class="weui-loading"></view>
|
|
|
+ <view class="weui-loadmore__tips">正在加载</view>
|
|
|
+ </view>
|
|
|
</div>
|
|
|
- <view class="weui-loadmore" v-if="isFinish">
|
|
|
- <!-- <view class="weui-loadmore__tips">没有更多数据了</view> -->
|
|
|
- </view>
|
|
|
- <view class="weui-loadmore" v-else>
|
|
|
- <view class="weui-loading"></view>
|
|
|
- <view class="weui-loadmore__tips">正在加载</view>
|
|
|
- </view>
|
|
|
+
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
@@ -88,6 +91,7 @@ export default {
|
|
|
homeList: [],
|
|
|
homeFlag: false,
|
|
|
isFinish: false,
|
|
|
+ homeProductList: [],
|
|
|
};
|
|
|
},
|
|
|
onLoad() {
|
|
|
@@ -116,8 +120,20 @@ export default {
|
|
|
console.log(e);
|
|
|
});
|
|
|
|
|
|
- this.getHot();
|
|
|
- this.getHome();
|
|
|
+ // this.getHot();
|
|
|
+ // this.getHome();
|
|
|
+
|
|
|
+ this.$http
|
|
|
+ .get('/homeProductType/home')
|
|
|
+ .then(res => {
|
|
|
+ if (res.success) {
|
|
|
+ this.homeProductList = res.data;
|
|
|
+ this.isFinish=true
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(e => {
|
|
|
+ console.log(e);
|
|
|
+ });
|
|
|
},
|
|
|
onReachBottom() {
|
|
|
// if (this.homeFlag) {
|
|
|
@@ -168,14 +184,24 @@ export default {
|
|
|
.then(res => {
|
|
|
if (res.success) {
|
|
|
this.homeList = this.homeList.concat(res.data.pp);
|
|
|
- this.isFinish = true;
|
|
|
+ this.isFinish = true;
|
|
|
}
|
|
|
})
|
|
|
.catch(e => {
|
|
|
console.log(e);
|
|
|
});
|
|
|
},
|
|
|
-
|
|
|
+ goBanner(info) {
|
|
|
+ if (info.typeFlag == 0 && info.productId) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/pages/product/product?id=' + info.productId,
|
|
|
+ });
|
|
|
+ } else if (info.typeFlag == 1 && info.pathUrl) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: info.pathUrl,
|
|
|
+ });
|
|
|
+ }
|
|
|
+ },
|
|
|
},
|
|
|
components: {
|
|
|
menuList,
|