|
|
@@ -1,66 +1,86 @@
|
|
|
<template>
|
|
|
<!-- 顶部导航栏 -->
|
|
|
<!-- <TopNavigation/> -->
|
|
|
- <div
|
|
|
- class="explore_content"
|
|
|
- :class="
|
|
|
- (currentRecommendationList.length < 3 && hotCollectionList.length == 0) ||
|
|
|
- (currentRecommendationList.length == 0 && hotCollectionList.length < 3)
|
|
|
- ? 'shop_list_one'
|
|
|
- : ''
|
|
|
- "
|
|
|
+ <!-- 搜素 -->
|
|
|
+ <van-pull-refresh
|
|
|
+ success-text="加载成功"
|
|
|
+ success-duration="1000"
|
|
|
+ class="discover"
|
|
|
+ v-model="isLoading"
|
|
|
+ @refresh="onRefresh"
|
|
|
>
|
|
|
- <!-- 搜素 -->
|
|
|
- <div class="search" @click="$router.push('/productSearch')">
|
|
|
- <img src="@assets/icon-sosuo.png" alt="" class="search_img" />
|
|
|
- <span class="search_text">搜索你想要的</span>
|
|
|
- </div>
|
|
|
- <!-- 商品展示 -->
|
|
|
- <div class="commodity_display">
|
|
|
- <!-- <van-swipe :loop="false" :width="94" :height="90" :show-indicators="false">
|
|
|
+ <van-sticky :offset-top="0">
|
|
|
+ <div class="search_con">
|
|
|
+ <div class="search" @click="$router.push('/productSearch')">
|
|
|
+ <img src="@assets/icon-sosuo.png" alt="" class="search_img" />
|
|
|
+ <span class="search_text">搜索你想要的</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </van-sticky>
|
|
|
+ <div
|
|
|
+ class="explore_content"
|
|
|
+ :class="
|
|
|
+ (currentRecommendationList.length < 3 && hotCollectionList.length == 0) ||
|
|
|
+ (currentRecommendationList.length == 0 && hotCollectionList.length < 3)
|
|
|
+ ? 'shop_list_one'
|
|
|
+ : ''
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <!-- 商品展示 -->
|
|
|
+ <div class="commodity_display">
|
|
|
+ <!-- <van-swipe :loop="false" :width="94" :height="90" :show-indicators="false">
|
|
|
<van-swipe-item v-for="(item, index) in commodityDisplayList" :key="index">
|
|
|
<van-image width="94px" height="90px" :src="getImg(item.pic)" fit="cover" />
|
|
|
</van-swipe-item>
|
|
|
</van-swipe> -->
|
|
|
- <swiper v-if="commodityDisplayList.length > 0" slides-per-view="auto">
|
|
|
- <swiper-slide class="setting" v-for="item in commodityDisplayList" :key="item.id" style="width: 94px">
|
|
|
- <van-image width="94px" height="90px" radius="8" :src="getImg(item.pic)" fit="cover" />
|
|
|
- </swiper-slide>
|
|
|
- </swiper>
|
|
|
- </div>
|
|
|
- <!-- banner图展示 -->
|
|
|
- <div class="banner">
|
|
|
- <div class="banner_con" v-for="(item, index) in bannerList" :key="index" @click="showJump(index)">
|
|
|
- <img :src="item.img" alt="" class="banner_con_img" />
|
|
|
- <div class="banner_con_title">
|
|
|
- <div class="banner_con_titleone">{{ item.titleone }}</div>
|
|
|
- <div class="banner_con_titletwo">{{ item.titletwo }}</div>
|
|
|
- </div>
|
|
|
+ <swiper v-if="commodityDisplayList.length > 0" slides-per-view="auto">
|
|
|
+ <swiper-slide
|
|
|
+ class="setting"
|
|
|
+ v-for="item in commodityDisplayList"
|
|
|
+ :key="item.id"
|
|
|
+ style="width: 94px"
|
|
|
+ >
|
|
|
+ <van-image width="94px" height="90px" radius="8" :src="getImg(item.pic)" fit="cover" />
|
|
|
+ </swiper-slide>
|
|
|
+ </swiper>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="content_list">
|
|
|
- <!-- 本期推荐 -->
|
|
|
- <page-title title="本期推荐" :to="{ path: '/productList', query: { type: 'DEFAULT', title: '本期推荐' } }">
|
|
|
- </page-title>
|
|
|
- <div class="current_recommendation">
|
|
|
- <template v-for="(item, index) in currentRecommendationList" :key="item.id">
|
|
|
- <CollectionList v-model:info="currentRecommendationList[index]"></CollectionList
|
|
|
- ></template>
|
|
|
+ <!-- banner图展示 -->
|
|
|
+ <div class="banner">
|
|
|
+ <div class="banner_con" v-for="(item, index) in bannerList" :key="index" @click="showJump(index)">
|
|
|
+ <img :src="item.img" alt="" class="banner_con_img" />
|
|
|
+ <div class="banner_con_title">
|
|
|
+ <div class="banner_con_titleone">{{ item.titleone }}</div>
|
|
|
+ <div class="banner_con_titletwo">{{ item.titletwo }}</div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <!-- <List :dataList="currentRecommendationList"></List> -->
|
|
|
- <!-- 最HOT收藏品 -->
|
|
|
- <page-title
|
|
|
- title="最HOT收藏品"
|
|
|
- :to="{ path: '/productList', query: { type: 'DEFAULT', title: '最HOT收藏品' } }"
|
|
|
- >
|
|
|
- </page-title>
|
|
|
- <div class="current_recommendation">
|
|
|
- <template v-for="(item, index) in hotCollectionList" :key="item.id">
|
|
|
- <CollectionList v-model:info="hotCollectionList[index]"></CollectionList
|
|
|
- ></template>
|
|
|
+ <div class="content_list">
|
|
|
+ <!-- 本期推荐 -->
|
|
|
+ <page-title
|
|
|
+ title="本期推荐"
|
|
|
+ :to="{ path: '/productList', query: { type: 'DEFAULT', title: '本期推荐' } }"
|
|
|
+ >
|
|
|
+ </page-title>
|
|
|
+ <div class="current_recommendation">
|
|
|
+ <template v-for="(item, index) in currentRecommendationList" :key="item.id">
|
|
|
+ <CollectionList v-model:info="currentRecommendationList[index]"></CollectionList
|
|
|
+ ></template>
|
|
|
+ </div>
|
|
|
+ <!-- <List :dataList="currentRecommendationList"></List> -->
|
|
|
+ <!-- 最HOT收藏品 -->
|
|
|
+ <page-title
|
|
|
+ title="最HOT收藏品"
|
|
|
+ :to="{ path: '/productList', query: { type: 'DEFAULT', title: '最HOT收藏品' } }"
|
|
|
+ >
|
|
|
+ </page-title>
|
|
|
+ <div class="current_recommendation">
|
|
|
+ <template v-for="(item, index) in hotCollectionList" :key="item.id">
|
|
|
+ <CollectionList v-model:info="hotCollectionList[index]"></CollectionList
|
|
|
+ ></template>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
+ </van-pull-refresh>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
@@ -101,6 +121,7 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
page: 0,
|
|
|
+ isLoading: true,
|
|
|
bannerList: [
|
|
|
{
|
|
|
img: require('@assets/icon-jingxuan.png'),
|
|
|
@@ -150,8 +171,8 @@ export default {
|
|
|
if (index == 0) {
|
|
|
// this.$router.push( "/productList")
|
|
|
this.$router.push({ path: '/productList', query: { title: '精选推荐' } });
|
|
|
- }else{
|
|
|
- this.wait()
|
|
|
+ } else {
|
|
|
+ this.wait();
|
|
|
}
|
|
|
},
|
|
|
// 获取图片展示数据
|
|
|
@@ -212,6 +233,12 @@ export default {
|
|
|
// this.miners = res.content;
|
|
|
console.log('12354664', res.content);
|
|
|
});
|
|
|
+ },
|
|
|
+ onRefresh() {
|
|
|
+ this.page = 0;
|
|
|
+ Promise.all([this.getInit(), this.$store.dispatch('getUsedBuy')]).then(res => {
|
|
|
+ this.isLoading = false;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
activated() {
|
|
|
@@ -363,39 +390,19 @@ export default {
|
|
|
height: 100%;
|
|
|
position: absolute;
|
|
|
}
|
|
|
-.setting {
|
|
|
- height: 90px;
|
|
|
- margin-right: 16px;
|
|
|
-}
|
|
|
-.setting:last-child{
|
|
|
- margin-right: 0px;
|
|
|
-}
|
|
|
-.current_recommendation {
|
|
|
- width: 100%;
|
|
|
- display: flex;
|
|
|
- justify-content: space-between;
|
|
|
- flex-wrap: wrap;
|
|
|
-}
|
|
|
-.explore_content {
|
|
|
- width: 100%;
|
|
|
+.discover{
|
|
|
background: #0f0f27;
|
|
|
- padding: 12px 16px 16px 16px;
|
|
|
- // margin-top: 44px;
|
|
|
+}
|
|
|
+.search_con {
|
|
|
+ padding: 12px 16px 24px 16px;
|
|
|
box-sizing: border-box;
|
|
|
- /deep/ .van-cell__title span {
|
|
|
- color: #ffffff;
|
|
|
- }
|
|
|
- /deep/ .van-cell {
|
|
|
- padding: 4px 0px 8px 2px;
|
|
|
- box-sizing: border-box;
|
|
|
- }
|
|
|
+ background: #0f0f27;
|
|
|
.search {
|
|
|
width: 100%;
|
|
|
height: 32px;
|
|
|
background: #29293f;
|
|
|
border-radius: 4px;
|
|
|
padding: 5px 0 4px 33px;
|
|
|
- margin-bottom: 24px;
|
|
|
box-sizing: border-box;
|
|
|
position: relative;
|
|
|
.search_img {
|
|
|
@@ -412,6 +419,33 @@ export default {
|
|
|
color: #5f646f;
|
|
|
}
|
|
|
}
|
|
|
+}
|
|
|
+.setting {
|
|
|
+ height: 90px;
|
|
|
+ margin-right: 16px;
|
|
|
+}
|
|
|
+.setting:last-child {
|
|
|
+ margin-right: 0px;
|
|
|
+}
|
|
|
+.current_recommendation {
|
|
|
+ width: 100%;
|
|
|
+ display: flex;
|
|
|
+ justify-content: space-between;
|
|
|
+ flex-wrap: wrap;
|
|
|
+}
|
|
|
+.explore_content {
|
|
|
+ width: 100%;
|
|
|
+ background: #0f0f27;
|
|
|
+ padding: 0px 16px 16px 16px;
|
|
|
+ // margin-top: 44px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ /deep/ .van-cell__title span {
|
|
|
+ color: #ffffff;
|
|
|
+ }
|
|
|
+ /deep/ .van-cell {
|
|
|
+ padding: 4px 0px 8px 2px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ }
|
|
|
/deep/ .van-swipe__track {
|
|
|
width: 100%;
|
|
|
}
|