|
@@ -18,7 +18,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="nav-list">
|
|
|
- <view class="nav-item" :class="{active: navActive === index}" v-for="(item, index) in navList" :key="index" @click="changeNavActive(index)">
|
|
|
+ <view class="nav-item" :class="{active: navActive === index}" v-for="(item, index) in navList"
|
|
|
+ :key="index" @click="changeNavActive(index)">
|
|
|
{{item.name}}
|
|
|
<view class="bar"></view>
|
|
|
</view>
|
|
@@ -37,7 +38,8 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="nav-list">
|
|
|
- <view class="nav-item" :class="{active: navActive === index}" v-for="(item, index) in navList" :key="index" @click="changeNavActive(index)">
|
|
|
+ <view class="nav-item" :class="{active: navActive === index}" v-for="(item, index) in navList"
|
|
|
+ :key="index" @click="changeNavActive(index)">
|
|
|
{{item.name}}
|
|
|
<view class="bar"></view>
|
|
|
</view>
|
|
@@ -55,13 +57,15 @@
|
|
|
@changeSwiper="changeRecommendSwiper">
|
|
|
</SwiperBanner1>
|
|
|
</view>
|
|
|
- <view class="category-swiper-box">
|
|
|
- <swiper class="category-swiper">
|
|
|
+ <view class="category-swiper-box" :class="{more: categoryList && categoryList.length > 5}">
|
|
|
+ <swiper class="category-swiper" :indicator-dots="true" indicator-color="#ffffff"
|
|
|
+ indicator-active-color="#6B95FF">
|
|
|
<swiper-item v-for="(item, index) in categoryFormatList" :key="index">
|
|
|
<view class="category-box">
|
|
|
- <view class="category-item" v-for="categoryItem in item" :key="categoryItem.id">
|
|
|
+ <view class="category-item" v-for="categoryItem in item" :key="categoryItem.id"
|
|
|
+ @click="handleCategoryItem(categoryItem)">
|
|
|
<image :src="categoryItem.pic" class="pic" mode="aspectFit"></image>
|
|
|
- {{categoryItem.name}}
|
|
|
+ {{categoryItem.labelName}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</swiper-item>
|
|
@@ -69,27 +73,30 @@
|
|
|
</view>
|
|
|
<view class="title-box">
|
|
|
<view class="left">
|
|
|
- <image :src="staticUrl ? staticUrl + 'front-01.png' : ''" class="pic" mode="heightFix"></image>
|
|
|
+ <image :src="staticUrl ? staticUrl + 'front-01.png' : ''" class="pic" mode="heightFix">
|
|
|
+ </image>
|
|
|
热门品牌
|
|
|
</view>
|
|
|
- <view class="more-btn">查看更多 ></view>
|
|
|
+ <view class="more-btn" @click="toPage('/packages/goods/brand-list')">查看更多 ></view>
|
|
|
</view>
|
|
|
<scroll-view class="brand-box" :scroll-x="true">
|
|
|
<view class="brand-list">
|
|
|
- <view class="brand-item" v-for="item in brandList" :key="item.id">
|
|
|
- <image :src="item.pic" class="pic" mode="aspectFit"></image>
|
|
|
- {{item.name}}
|
|
|
+ <view class="brand-item" v-for="item in brandList" :key="item.id"
|
|
|
+ @click="toPage('/packages/goods/brand-detail', { id: item.id })">
|
|
|
+ <image :src="item.logo" class="pic" mode="aspectFit"></image>
|
|
|
+ {{item.brandName}}
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
|
<view class="title-box">
|
|
|
<view class="left">
|
|
|
- <image :src="staticUrl ? staticUrl + 'front-02.png' : ''" class="pic" mode="heightFix"></image>
|
|
|
+ <image :src="staticUrl ? staticUrl + 'front-02.png' : ''" class="pic" mode="heightFix">
|
|
|
+ </image>
|
|
|
热门产品
|
|
|
</view>
|
|
|
- <view class="more-btn">查看更多 ></view>
|
|
|
+ <view class="more-btn" @click="toPage('/packages/goods/filter')">查看更多 ></view>
|
|
|
</view>
|
|
|
- <view class="goods-box">
|
|
|
+ <view class="goods-box" v-if="goodShow">
|
|
|
<!-- <view class="good-item" v-for="good in goodsList" :key="good.id">
|
|
|
<view class="good-name">{{good.name}}</view>
|
|
|
<view class="good-info-box">
|
|
@@ -115,15 +122,17 @@
|
|
|
</view>
|
|
|
<view class="btn">+ 加入对比</view>
|
|
|
</view> -->
|
|
|
- <GoodItem v-for="(good, index) in goodsList" :good="good" :key="index" style="width: 100%"></GoodItem>
|
|
|
+ <GoodItem v-for="(good, index) in goodsList" :good="good" :key="index" style="width: 100%">
|
|
|
+ </GoodItem>
|
|
|
</view>
|
|
|
<view class="article-list-box">
|
|
|
<view class="title-box">
|
|
|
<view class="left">
|
|
|
- <image :src="staticUrl ? staticUrl + 'front-03.png' : ''" class="pic" mode="heightFix"></image>
|
|
|
+ <image :src="staticUrl ? staticUrl + 'front-03.png' : ''" class="pic"
|
|
|
+ mode="heightFix"></image>
|
|
|
最新文章
|
|
|
</view>
|
|
|
- <view class="more-btn">查看更多 ></view>
|
|
|
+ <!-- <view class="more-btn">查看更多 ></view> -->
|
|
|
</view>
|
|
|
<view class="article-list">
|
|
|
<!-- <view class="article-item" v-for="item in articleList" :key="item.id">
|
|
@@ -141,7 +150,8 @@
|
|
|
<view class="date">6小时前</view>
|
|
|
</view>
|
|
|
</view> -->
|
|
|
- <ArticleItem v-for="(article, index) in articleList" :article="article" :key="index" style="width: 100%"></ArticleItem>
|
|
|
+ <ArticleItem v-for="(article, index) in recommendArticleList" :article="article"
|
|
|
+ :key="index" style="width: 100%"></ArticleItem>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -151,13 +161,14 @@
|
|
|
<scroll-view class="swiper-item" :scroll-y="true" @scrolltolower="loadEvaluatingArticle">
|
|
|
<view class="evaluating-box">
|
|
|
<view class="banner-box">
|
|
|
- <SwiperBanner1 class="banner" :bannerDetail="bannerList" indicatorColor="#7698FF"
|
|
|
+ <SwiperBanner1 class="banner" :bannerDetail="evaluatingBannerList" indicatorColor="#7698FF"
|
|
|
:bannerH="150" imgKey="pic" previousNext="0rpx" :imgWidth="355" radius="10"
|
|
|
@changeSwiper="changeRecommendSwiper">
|
|
|
</SwiperBanner1>
|
|
|
</view>
|
|
|
<view class="article-list">
|
|
|
- <ArticleItem v-for="(article, index) in articleList" :article="article" :key="index" style="width: 100%"></ArticleItem>
|
|
|
+ <ArticleItem v-for="(article, index) in evaluatingArticleList" :article="article"
|
|
|
+ :key="index" style="width: 100%"></ArticleItem>
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
@@ -166,13 +177,14 @@
|
|
|
<scroll-view class="swiper-item" :scroll-y="true" @scrolltolower="loadInformationArticle">
|
|
|
<view class="information-box">
|
|
|
<view class="banner-box">
|
|
|
- <SwiperBanner1 class="banner" :bannerDetail="bannerList" indicatorColor="#7698FF"
|
|
|
+ <SwiperBanner1 class="banner" :bannerDetail="informationBannerList" indicatorColor="#7698FF"
|
|
|
:bannerH="150" imgKey="pic" previousNext="0rpx" :imgWidth="355" radius="10"
|
|
|
@changeSwiper="changeRecommendSwiper">
|
|
|
</SwiperBanner1>
|
|
|
</view>
|
|
|
<view class="article-list">
|
|
|
- <ArticleItem v-for="(article, index) in articleList" :article="article" :key="index" style="width: 100%"></ArticleItem>
|
|
|
+ <ArticleItem v-for="(article, index) in informationArticleList" :article="article"
|
|
|
+ :key="index" style="width: 100%"></ArticleItem>
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
@@ -181,13 +193,14 @@
|
|
|
<scroll-view class="swiper-item" :scroll-y="true" @scrolltolower="loadKnowArticle">
|
|
|
<view class="know-box">
|
|
|
<view class="banner-box">
|
|
|
- <SwiperBanner1 class="banner" :bannerDetail="bannerList" indicatorColor="#7698FF"
|
|
|
+ <SwiperBanner1 class="banner" :bannerDetail="knowBannerList" indicatorColor="#7698FF"
|
|
|
:bannerH="150" imgKey="pic" previousNext="0rpx" :imgWidth="355" radius="10"
|
|
|
@changeSwiper="changeRecommendSwiper">
|
|
|
</SwiperBanner1>
|
|
|
</view>
|
|
|
<view class="article-list">
|
|
|
- <ArticleItem v-for="(article, index) in articleList" :article="article" :key="index" style="width: 100%"></ArticleItem>
|
|
|
+ <ArticleItem v-for="(article, index) in knowArticleList" :article="article" :key="index"
|
|
|
+ style="width: 100%"></ArticleItem>
|
|
|
</view>
|
|
|
</view>
|
|
|
</scroll-view>
|
|
@@ -216,6 +229,7 @@
|
|
|
@Component({})
|
|
|
export default class Front extends Mixins(loginMixin) {
|
|
|
@baseModule.Mutation(types.SET_TABBARINDEX) setTabBarIndex : any;
|
|
|
+ @baseModule.Mutation(types.SET_REFERRERID) setReferrerId : any;
|
|
|
bannerList : any = []; //轮播图列表
|
|
|
staticUrl : string = this.$oss_url; //oss地址
|
|
|
categoryList : any = []; //分类列表
|
|
@@ -231,8 +245,8 @@
|
|
|
articleList : any = []; //文章列表
|
|
|
brandList : any = []; //品牌列表
|
|
|
shareInfo : any = {}; //分享信息
|
|
|
- navActive: any = 0;
|
|
|
- navList: any = [
|
|
|
+ navActive : any = 0;
|
|
|
+ navList : any = [
|
|
|
{
|
|
|
name: '推荐',
|
|
|
},
|
|
@@ -246,29 +260,34 @@
|
|
|
name: '奶粉知道',
|
|
|
}
|
|
|
];
|
|
|
- recommendCurrent: any = 1;
|
|
|
- recommendFinish: any = false;
|
|
|
- recommendLoading: any = false;
|
|
|
- evaluatingCurrent: any = 1;
|
|
|
- evaluatingFinish: any = false;
|
|
|
- evaluatingLoading: any = false;
|
|
|
- informationCurrent: any = 1;
|
|
|
- informationFinish: any = false;
|
|
|
- informationLoading: any = false;
|
|
|
- knowCurrent: any = 1;
|
|
|
- knowFinish: any = false;
|
|
|
- knowLoading: any = false;
|
|
|
-
|
|
|
+ recommendCurrent : any = 1;
|
|
|
+ recommendFinish : any = false;
|
|
|
+ recommendLoading : any = false;
|
|
|
+ recommendArticleList : any = [];
|
|
|
+ evaluatingCurrent : any = 1;
|
|
|
+ evaluatingFinish : any = false;
|
|
|
+ evaluatingLoading : any = false;
|
|
|
+ evaluatingArticleList : any = [];
|
|
|
+ evaluatingBannerList : any = [];
|
|
|
+ informationCurrent : any = 1;
|
|
|
+ informationFinish : any = false;
|
|
|
+ informationLoading : any = false;
|
|
|
+ informationArticleList : any = [];
|
|
|
+ informationBannerList : any = [];
|
|
|
+ knowCurrent : any = 1;
|
|
|
+ knowFinish : any = false;
|
|
|
+ knowLoading : any = false;
|
|
|
+ knowArticleList : any = [];
|
|
|
+ knowBannerList : any = [];
|
|
|
+ timeStamp : any = +new Date();
|
|
|
+ goodShow: any = true;
|
|
|
+
|
|
|
async onPullDownRefresh() {
|
|
|
// console.log('下拉');
|
|
|
- // this.getBannerList();
|
|
|
- // this.getCategoryList();
|
|
|
- // this.getBrandList();
|
|
|
- // this.getGoodsList();
|
|
|
- this.current = 1;
|
|
|
- this.articleList = [];
|
|
|
- // this.getArticleList();
|
|
|
- // this.getShareInfo();
|
|
|
+ this.getCategoryList();
|
|
|
+ this.getHotBrandList();
|
|
|
+ this.getGoodsList();
|
|
|
+ this.getShareInfo();
|
|
|
uni.stopPullDownRefresh();
|
|
|
}
|
|
|
// onReachBottom() {
|
|
@@ -281,15 +300,11 @@
|
|
|
// @ts-ignore
|
|
|
this.$Router.forceGuardEach();
|
|
|
// #endif
|
|
|
- // this.getSuperior(opt);
|
|
|
- // this.getBannerList();
|
|
|
- // this.getCategoryList();
|
|
|
- // this.getBrandList();
|
|
|
- // this.getGoodsList();
|
|
|
- this.current = 1;
|
|
|
- this.articleList = [];
|
|
|
- // this.getArticleList();
|
|
|
- // this.getShareInfo();
|
|
|
+ this.getSuperior(opt);
|
|
|
+ this.getCategoryList();
|
|
|
+ this.getHotBrandList();
|
|
|
+ this.initList();
|
|
|
+ this.getShareInfo();
|
|
|
// #ifdef MP-WEIXIN
|
|
|
this.$nextTick(() => {
|
|
|
this.checkPrivacySetting();
|
|
@@ -299,33 +314,60 @@
|
|
|
|
|
|
onShow() {
|
|
|
this.setTabBarIndex(0);
|
|
|
+ this.getGoodsList();
|
|
|
this.$nextTick(() => {
|
|
|
uni.hideTabBar();
|
|
|
});
|
|
|
}
|
|
|
|
|
|
getSuperior(opt : any) {
|
|
|
+ // console.log(decodeURIComponent(opt.scene))
|
|
|
if (opt.scene) {
|
|
|
- let sceneArr = decodeURIComponent(opt.scene).split('&');
|
|
|
- let scene : any = {};
|
|
|
- sceneArr.forEach((item : any) => {
|
|
|
- let arr = item.split('=');
|
|
|
- if (arr[0]) scene[arr[0]] = arr[1];
|
|
|
- });
|
|
|
+ // let sceneArr = decodeURIComponent(opt.scene).split('&');
|
|
|
+ // let scene : any = {};
|
|
|
+ // sceneArr.forEach((item : any) => {
|
|
|
+ // let arr = item.split('=');
|
|
|
+ // if (arr[0]) scene[arr[0]] = arr[1];
|
|
|
+ // });
|
|
|
+ let arr = decodeURIComponent(opt.scene).split(',');
|
|
|
+ if (arr[0] === 'family') {
|
|
|
+ if (this._token) {
|
|
|
+ this.entranceFamily(arr[1]);
|
|
|
+ this.setReferrerId('');
|
|
|
+ uni.setStorageSync('referrerId', '');
|
|
|
+ } else {
|
|
|
+ this.setReferrerId(arr[1]);
|
|
|
+ uni.setStorageSync('referrerId', arr[1]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- if (opt.s === '1' && opt.uid) {
|
|
|
- // console.log(opt);
|
|
|
- uni.setStorageSync('referrerId', opt.uid);
|
|
|
+ if (opt.path) {
|
|
|
+ this.$Router.push({
|
|
|
+ path: opt.path,
|
|
|
+ query: opt.data && JSON.parse(opt.data)
|
|
|
+ })
|
|
|
}
|
|
|
+ // if (opt.s === '1' && opt.uid) {
|
|
|
+ // // console.log(opt);
|
|
|
+ // uni.setStorageSync('referrerId', opt.uid);
|
|
|
+ // }
|
|
|
}
|
|
|
+
|
|
|
onShareAppMessage() {
|
|
|
return {
|
|
|
title: '育百通',
|
|
|
- path: '/pages/front/front?s=1&uid=' + this._userInfo.uid,
|
|
|
+ path: '/pages/front/front',
|
|
|
imageUrl: this.shareInfo.pic
|
|
|
};
|
|
|
}
|
|
|
|
|
|
+ onShareTimeline() {
|
|
|
+ return {
|
|
|
+ title: '育百通', // 分享标题
|
|
|
+ imageUrl: this.shareInfo.pic, // 分享的图片路径,可选
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
checkPrivacySetting() {
|
|
|
// @ts-ignore
|
|
|
wx.getPrivacySetting({
|
|
@@ -358,6 +400,29 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ initList() {
|
|
|
+ this.recommendArticleList = [];
|
|
|
+ this.recommendCurrent = 1;
|
|
|
+ this.recommendFinish = false;
|
|
|
+ this.getRecommendArticleList();
|
|
|
+ this.getBannerList();
|
|
|
+ this.evaluatingArticleList = [];
|
|
|
+ this.evaluatingCurrent = 1;
|
|
|
+ this.evaluatingFinish = false;
|
|
|
+ this.getEvaluatingArticleList();
|
|
|
+ this.getEvaluatingBannerList();
|
|
|
+ this.informationArticleList = [];
|
|
|
+ this.informationCurrent = 1;
|
|
|
+ this.informationFinish = false;
|
|
|
+ this.getInformationArticleList();
|
|
|
+ this.getInformationBannerList();
|
|
|
+ this.knowArticleList = [];
|
|
|
+ this.knowCurrent = 1;
|
|
|
+ this.knowFinish = false;
|
|
|
+ this.getKnowArticleList();
|
|
|
+ this.getKnowBannerList();
|
|
|
+ }
|
|
|
+
|
|
|
getShareInfo() {
|
|
|
this.$http
|
|
|
.get({
|
|
@@ -383,12 +448,12 @@
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
- changeNavActive(index: any){
|
|
|
+
|
|
|
+ changeNavActive(index : any) {
|
|
|
this.navActive = index;
|
|
|
}
|
|
|
-
|
|
|
- changeSwiper(e: any){
|
|
|
+
|
|
|
+ changeSwiper(e : any) {
|
|
|
// console.log(e.detail);
|
|
|
this.navActive = e.detail.current;
|
|
|
}
|
|
@@ -407,6 +472,7 @@
|
|
|
}
|
|
|
|
|
|
changeRecommendSwiper(val : any) {
|
|
|
+ console.log(val)
|
|
|
if (val.way === 1) {
|
|
|
this.$Router.push({
|
|
|
path: '/packages/goods/good-detail',
|
|
@@ -414,11 +480,11 @@
|
|
|
id: val.link
|
|
|
}
|
|
|
});
|
|
|
- } else if (val.way === 2) {
|
|
|
+ } else if (val.way === 3) {
|
|
|
this.$Router.push({
|
|
|
- path: '/pages/front/article',
|
|
|
+ path: '/packages/goods/brand-detail',
|
|
|
query: {
|
|
|
- link: val.link
|
|
|
+ id: val.link
|
|
|
}
|
|
|
})
|
|
|
}
|
|
@@ -432,14 +498,20 @@
|
|
|
// });
|
|
|
return this.$http
|
|
|
.get({
|
|
|
- url: this.$api.getCategoryList
|
|
|
+ url: this.$api.getRecommendLabel
|
|
|
})
|
|
|
.then((res : any) => {
|
|
|
- this.categoryList = res.list;
|
|
|
- let length = Math.ceil(res.list.length / this.categorySize);
|
|
|
+ this.categoryList = [...res.list,
|
|
|
+ {
|
|
|
+ labelName: '全部',
|
|
|
+ id: 0,
|
|
|
+ fid: 0,
|
|
|
+ pic: this.staticUrl + 'all-category.png'
|
|
|
+ }];
|
|
|
+ let length = Math.ceil(this.categoryList.length / this.categorySize);
|
|
|
let categoryFormatList = Array.from({ length });
|
|
|
this.categoryFormatList = categoryFormatList.map((item : any, index : any) => {
|
|
|
- return res.list.slice(index * this.categorySize, (index + 1) * this.categorySize);
|
|
|
+ return this.categoryList.slice(index * this.categorySize, (index + 1) * this.categorySize);
|
|
|
});
|
|
|
// uni.hideLoading();
|
|
|
}, (err : any) => {
|
|
@@ -448,15 +520,27 @@
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ handleCategoryItem(item : any) {
|
|
|
+ // console.log(item)
|
|
|
+ this.$Router.push({
|
|
|
+ path: '/packages/goods/filter',
|
|
|
+ query: {
|
|
|
+ fid: item.fid || '',
|
|
|
+ id: item.id || '',
|
|
|
+ name: item.firstDataName || ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
//获取品牌分类
|
|
|
- getBrandList() {
|
|
|
+ getHotBrandList() {
|
|
|
this.categoryList = [];
|
|
|
// uni.showLoading({
|
|
|
// title: '加载中',
|
|
|
// });
|
|
|
return this.$http
|
|
|
.get({
|
|
|
- url: this.$api.getCategoryList
|
|
|
+ url: this.$api.getHotBrandList
|
|
|
})
|
|
|
.then((res : any) => {
|
|
|
this.brandList = res.list;
|
|
@@ -470,6 +554,7 @@
|
|
|
//获取商品列表
|
|
|
getGoodsList() {
|
|
|
this.loading = true;
|
|
|
+ this.goodShow = false;
|
|
|
// uni.showLoading({
|
|
|
// title: '加载中',
|
|
|
// });
|
|
@@ -477,13 +562,16 @@
|
|
|
.get({
|
|
|
url: this.$api.getGoodsList,
|
|
|
data: {
|
|
|
- size: 4,
|
|
|
+ size: 999,
|
|
|
page: 1,
|
|
|
status: '3',
|
|
|
+ isHot: 1,
|
|
|
}
|
|
|
})
|
|
|
.then((res : any) => {
|
|
|
this.goodsList = res.list;
|
|
|
+ this.goodShow = true;
|
|
|
+ this.timeStamp = +new Date();
|
|
|
// uni.hideLoading();
|
|
|
return res.list;
|
|
|
}, (err : any) => {
|
|
@@ -496,7 +584,7 @@
|
|
|
this.loading = true;
|
|
|
this.$http
|
|
|
.get({
|
|
|
- url: this.$api.getGoodsList,
|
|
|
+ url: this.$api.getArticleList,
|
|
|
data: {
|
|
|
page: this.current,
|
|
|
size: this.size
|
|
@@ -513,33 +601,170 @@
|
|
|
console.log(err);
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
- loadRecommendArticle(){
|
|
|
+
|
|
|
+ getRecommendArticleList() {
|
|
|
+ this.recommendLoading = true;
|
|
|
+ this.$http
|
|
|
+ .get({
|
|
|
+ url: this.$api.getArticleList,
|
|
|
+ data: {
|
|
|
+ page: this.recommendCurrent,
|
|
|
+ size: this.size,
|
|
|
+ articleTypeStr: '1,3'
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((res : any) => {
|
|
|
+ this.recommendArticleList = [...this.recommendArticleList, ...res.list];
|
|
|
+ this.recommendLoading = false;
|
|
|
+ if (res.list.length < this.size) {
|
|
|
+ this.recommendFinish = true;
|
|
|
+ }
|
|
|
+ }, (err : any) => {
|
|
|
+ this.recommendFinish = true;
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ loadRecommendArticle() {
|
|
|
console.log("loadRecommendArticle")
|
|
|
if (this.recommendFinish || this.recommendLoading) return;
|
|
|
this.recommendCurrent++;
|
|
|
- this.getArticleList();
|
|
|
+ this.getRecommendArticleList();
|
|
|
}
|
|
|
-
|
|
|
- loadEvaluatingArticle(){
|
|
|
+
|
|
|
+ getEvaluatingBannerList() {
|
|
|
+ return this.$http
|
|
|
+ .get({
|
|
|
+ url: this.$api.getPlatformBannerList,
|
|
|
+ data: {
|
|
|
+ bannerType: 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((res : any) => {
|
|
|
+ this.evaluatingBannerList = res.list;
|
|
|
+ }, (err : any) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ getEvaluatingArticleList() {
|
|
|
+ this.evaluatingLoading = true;
|
|
|
+ this.$http
|
|
|
+ .get({
|
|
|
+ url: this.$api.getArticleList,
|
|
|
+ data: {
|
|
|
+ page: this.evaluatingCurrent,
|
|
|
+ size: this.size,
|
|
|
+ articleType: 1
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((res : any) => {
|
|
|
+ this.evaluatingArticleList = [...this.evaluatingArticleList, ...res.list];
|
|
|
+ this.evaluatingLoading = false;
|
|
|
+ if (res.list.length < this.size) {
|
|
|
+ this.evaluatingFinish = true;
|
|
|
+ }
|
|
|
+ }, (err : any) => {
|
|
|
+ this.evaluatingFinish = true;
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ loadEvaluatingArticle() {
|
|
|
console.log("loadEvaluatingArticle")
|
|
|
if (this.evaluatingFinish || this.evaluatingLoading) return;
|
|
|
this.evaluatingCurrent++;
|
|
|
- this.getArticleList();
|
|
|
+ this.getEvaluatingArticleList();
|
|
|
+ }
|
|
|
+
|
|
|
+ getInformationBannerList() {
|
|
|
+ return this.$http
|
|
|
+ .get({
|
|
|
+ url: this.$api.getPlatformBannerList,
|
|
|
+ data: {
|
|
|
+ bannerType: 2
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((res : any) => {
|
|
|
+ this.informationBannerList = res.list;
|
|
|
+ }, (err : any) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
}
|
|
|
-
|
|
|
- loadInformationArticle(){
|
|
|
+
|
|
|
+ getInformationArticleList() {
|
|
|
+ this.informationLoading = true;
|
|
|
+ this.$http
|
|
|
+ .get({
|
|
|
+ url: this.$api.getArticleList,
|
|
|
+ data: {
|
|
|
+ page: this.informationCurrent,
|
|
|
+ size: this.size,
|
|
|
+ articleType: 2
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((res : any) => {
|
|
|
+ this.informationArticleList = [...this.informationArticleList, ...res.list];
|
|
|
+ this.informationLoading = false;
|
|
|
+ if (res.list.length < this.size) {
|
|
|
+ this.informationFinish = true;
|
|
|
+ }
|
|
|
+ }, (err : any) => {
|
|
|
+ this.informationFinish = true;
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ loadInformationArticle() {
|
|
|
console.log("loadInformationArticle")
|
|
|
if (this.informationFinish || this.informationLoading) return;
|
|
|
this.informationCurrent++;
|
|
|
- this.getArticleList();
|
|
|
+ this.getInformationArticleList();
|
|
|
}
|
|
|
-
|
|
|
- loadKnowArticle(){
|
|
|
+
|
|
|
+ getKnowBannerList() {
|
|
|
+ return this.$http
|
|
|
+ .get({
|
|
|
+ url: this.$api.getPlatformBannerList,
|
|
|
+ data: {
|
|
|
+ bannerType: 3
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((res : any) => {
|
|
|
+ this.knowBannerList = res.list;
|
|
|
+ }, (err : any) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ getKnowArticleList() {
|
|
|
+ this.knowLoading = true;
|
|
|
+ this.$http
|
|
|
+ .get({
|
|
|
+ url: this.$api.getArticleList,
|
|
|
+ data: {
|
|
|
+ page: this.knowCurrent,
|
|
|
+ size: this.size,
|
|
|
+ articleType: 3
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((res : any) => {
|
|
|
+ this.knowArticleList = [...this.knowArticleList, ...res.list];
|
|
|
+ this.knowLoading = false;
|
|
|
+ if (res.list.length < this.size) {
|
|
|
+ this.knowFinish = true;
|
|
|
+ }
|
|
|
+ }, (err : any) => {
|
|
|
+ this.knowFinish = true;
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ loadKnowArticle() {
|
|
|
console.log("loadKnowArticle")
|
|
|
if (this.knowFinish || this.knowLoading) return;
|
|
|
this.knowCurrent++;
|
|
|
- this.getArticleList();
|
|
|
+ this.getKnowArticleList();
|
|
|
}
|
|
|
|
|
|
toArticle(link : any) {
|
|
@@ -551,7 +776,7 @@
|
|
|
})
|
|
|
}
|
|
|
|
|
|
- toPage(path : any) {
|
|
|
+ toPage(path : any, data : any = {}) {
|
|
|
if (!path) {
|
|
|
uni.showToast({
|
|
|
title: '敬请期待',
|
|
@@ -560,7 +785,8 @@
|
|
|
return;
|
|
|
}
|
|
|
this.$Router.push({
|
|
|
- path: path
|
|
|
+ path: path,
|
|
|
+ query: data
|
|
|
})
|
|
|
}
|
|
|
|
|
@@ -578,6 +804,21 @@
|
|
|
});
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ entranceFamily(fid : any) {
|
|
|
+ this.$http
|
|
|
+ .post({
|
|
|
+ url: this.$api.entranceFamily,
|
|
|
+ data: {
|
|
|
+ fid: +fid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .then((res : any) => {
|
|
|
+
|
|
|
+ }, (err : any) => {
|
|
|
+ console.log(err);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
</script>
|
|
|
<style lang="scss" scoped>
|
|
@@ -588,9 +829,10 @@
|
|
|
|
|
|
.nav-bg {
|
|
|
width: 100%;
|
|
|
- background: linear-gradient(180deg, rgba(255, 217, 249, 1) 0%, rgba(241, 230, 255, 1) 67.19%, rgba(241, 233, 254, 1) 82.84%, rgba(251, 246, 252, 1) 100%);;
|
|
|
-
|
|
|
- &.dy{
|
|
|
+ background: linear-gradient(180deg, rgba(255, 217, 249, 1) 0%, rgba(241, 230, 255, 1) 67.19%, rgba(241, 233, 254, 1) 82.84%, rgba(251, 246, 252, 1) 100%);
|
|
|
+ ;
|
|
|
+
|
|
|
+ &.dy {
|
|
|
background: #fff;
|
|
|
}
|
|
|
|
|
@@ -603,7 +845,8 @@
|
|
|
height: 40px;
|
|
|
padding: 0 vw(18);
|
|
|
@include flex-x(flex-start);
|
|
|
- .pic{
|
|
|
+
|
|
|
+ .pic {
|
|
|
height: vw(28);
|
|
|
}
|
|
|
}
|
|
@@ -614,8 +857,8 @@
|
|
|
height: 36px;
|
|
|
padding: 0 vw(10);
|
|
|
box-sizing: border-box;
|
|
|
-
|
|
|
- &.dy{
|
|
|
+
|
|
|
+ &.dy {
|
|
|
height: 40px;
|
|
|
}
|
|
|
|
|
@@ -628,8 +871,8 @@
|
|
|
padding-left: vw(12);
|
|
|
padding-right: vw(4);
|
|
|
box-sizing: border-box;
|
|
|
-
|
|
|
- &.dy{
|
|
|
+
|
|
|
+ &.dy {
|
|
|
border: vw(1) solid #DEDEDE;
|
|
|
background: #F2F2F2;
|
|
|
}
|
|
@@ -637,7 +880,8 @@
|
|
|
.left {
|
|
|
@include word-vw(14, #C2C2C2);
|
|
|
@include flex-x(flex-start);
|
|
|
- .icon{
|
|
|
+
|
|
|
+ .icon {
|
|
|
margin-right: vw(8);
|
|
|
}
|
|
|
}
|
|
@@ -651,19 +895,23 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .nav-list{
|
|
|
+
|
|
|
+ .nav-list {
|
|
|
height: vw(36);
|
|
|
@include flex-x(flex-start);
|
|
|
padding: 0 vw(12);
|
|
|
box-sizing: border-box;
|
|
|
- .nav-item{
|
|
|
+
|
|
|
+ .nav-item {
|
|
|
padding: 0 vw(12);
|
|
|
@include flex-y(center, center);
|
|
|
position: relative;
|
|
|
@include word-vw(14, #2E2E2E);
|
|
|
- &.active{
|
|
|
+
|
|
|
+ &.active {
|
|
|
font-weight: bold;
|
|
|
- .bar{
|
|
|
+
|
|
|
+ .bar {
|
|
|
height: vw(3);
|
|
|
border-radius: vw(2);
|
|
|
width: vw(18);
|
|
@@ -707,10 +955,11 @@
|
|
|
@include flex-x();
|
|
|
@include word-vw(14, #333);
|
|
|
flex-shrink: 0;
|
|
|
-
|
|
|
- .left{
|
|
|
+
|
|
|
+ .left {
|
|
|
@include flex-x(flex-start);
|
|
|
- .pic{
|
|
|
+
|
|
|
+ .pic {
|
|
|
height: vw(20);
|
|
|
margin-right: vw(6);
|
|
|
}
|
|
@@ -727,23 +976,28 @@
|
|
|
|
|
|
.category-swiper-box {
|
|
|
width: vw(355);
|
|
|
- height: vw(160);
|
|
|
+ height: vw(100);
|
|
|
margin-top: vw(5);
|
|
|
+
|
|
|
+ &.more{
|
|
|
+ height: vw(170);
|
|
|
+ }
|
|
|
|
|
|
.category-swiper {
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ // padding-bottom: vw(12);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
.category-box {
|
|
|
width: 100%;
|
|
|
- height: vw(160);
|
|
|
+ height: vw(180);
|
|
|
border-radius: vw(10);
|
|
|
background: #fff;
|
|
|
@include flex-x(flex-start, flex-start);
|
|
|
flex-wrap: wrap;
|
|
|
- padding: vw(10) vw(5);
|
|
|
+ padding: vw(10) vw(5) vw(30);
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
.category-item {
|
|
@@ -880,7 +1134,7 @@
|
|
|
|
|
|
.article-list {
|
|
|
width: 100%;
|
|
|
- padding: 0 vw(15);
|
|
|
+ padding: 0 vw(15) vw(15);
|
|
|
box-sizing: border-box;
|
|
|
margin-top: vw(6);
|
|
|
|
|
@@ -894,10 +1148,12 @@
|
|
|
|
|
|
.article-info {
|
|
|
@include flex-x();
|
|
|
- .pic{
|
|
|
+
|
|
|
+ .pic {
|
|
|
@include wh(104, 65);
|
|
|
}
|
|
|
- .article-name{
|
|
|
+
|
|
|
+ .article-name {
|
|
|
flex: 1;
|
|
|
height: vw(65);
|
|
|
margin-left: vw(10);
|
|
@@ -910,18 +1166,22 @@
|
|
|
.article-bottom {
|
|
|
@include flex-x();
|
|
|
margin-top: vw(5);
|
|
|
- .left{
|
|
|
+
|
|
|
+ .left {
|
|
|
@include word-vw(10, #333);
|
|
|
@include flex-x(flex-start);
|
|
|
- view{
|
|
|
+
|
|
|
+ view {
|
|
|
margin-right: vw(8);
|
|
|
- text{
|
|
|
+
|
|
|
+ text {
|
|
|
@include word-vw(12, #FF7E33);
|
|
|
margin-right: vw(1);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- .date{
|
|
|
+
|
|
|
+ .date {
|
|
|
@include word-vw(10, #999);
|
|
|
}
|
|
|
}
|
|
@@ -929,46 +1189,55 @@
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .evaluating-box{
|
|
|
+
|
|
|
+ .evaluating-box {
|
|
|
@include flex-y(flex-start);
|
|
|
- .banner-box{
|
|
|
+ padding-bottom: vw(100);
|
|
|
+
|
|
|
+ .banner-box {
|
|
|
width: vw(355);
|
|
|
}
|
|
|
- .article-list{
|
|
|
+
|
|
|
+ .article-list {
|
|
|
margin-top: vw(10);
|
|
|
width: 100%;
|
|
|
- padding: 0 vw(15);
|
|
|
+ padding: 0 vw(15) vw(15);
|
|
|
box-sizing: border-box;
|
|
|
background: #fff;
|
|
|
border-radius: vw(6);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .information-box{
|
|
|
+
|
|
|
+ .information-box {
|
|
|
@include flex-y(flex-start);
|
|
|
- .banner-box{
|
|
|
+ padding-bottom: vw(100);
|
|
|
+
|
|
|
+ .banner-box {
|
|
|
width: vw(355);
|
|
|
}
|
|
|
- .article-list{
|
|
|
+
|
|
|
+ .article-list {
|
|
|
margin-top: vw(10);
|
|
|
width: 100%;
|
|
|
- padding: 0 vw(15);
|
|
|
+ padding: 0 vw(15) vw(15);
|
|
|
box-sizing: border-box;
|
|
|
background: #fff;
|
|
|
border-radius: vw(6);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- .know-box{
|
|
|
+
|
|
|
+ .know-box {
|
|
|
@include flex-y(flex-start);
|
|
|
- .banner-box{
|
|
|
+ padding-bottom: vw(100);
|
|
|
+
|
|
|
+ .banner-box {
|
|
|
width: vw(355);
|
|
|
}
|
|
|
- .article-list{
|
|
|
+
|
|
|
+ .article-list {
|
|
|
margin-top: vw(10);
|
|
|
width: 100%;
|
|
|
- padding: 0 vw(15);
|
|
|
+ padding: 0 vw(15) vw(15);
|
|
|
box-sizing: border-box;
|
|
|
background: #fff;
|
|
|
border-radius: vw(6);
|