|
@@ -22,6 +22,7 @@
|
|
<template #top>
|
|
<template #top>
|
|
<page-navbar>
|
|
<page-navbar>
|
|
<template #navCenter>
|
|
<template #navCenter>
|
|
|
|
+ <view>
|
|
<view class="top" style="display: flex">
|
|
<view class="top" style="display: flex">
|
|
<!-- 手动选择城市功能隐藏 -->
|
|
<!-- 手动选择城市功能隐藏 -->
|
|
<!-- <view class="topBox" @click="lhSelectCityFun"> -->
|
|
<!-- <view class="topBox" @click="lhSelectCityFun"> -->
|
|
@@ -34,17 +35,17 @@
|
|
">
|
|
">
|
|
{{ currentCity }}
|
|
{{ currentCity }}
|
|
</text>
|
|
</text>
|
|
- <!-- <image src="@/static/home/home-bom.png"
|
|
|
|
- style="width: 36rpx; height: 36rpx;margin-left: 15rpx;margin-right: 30rpx;"></image> -->
|
|
|
|
|
|
+ <image src="@/static/icon/loacltion.png"
|
|
|
|
+ style="width: 36rpx; height: 36rpx;margin-left: 15rpx;margin-right: 30rpx;"></image>
|
|
</view>
|
|
</view>
|
|
- <view class="weather">
|
|
|
|
|
|
+ <!-- <view class="weather">
|
|
<p>
|
|
<p>
|
|
{{ weather.weather }}<i :class="'qi-' + weather.icon"></i>️{{
|
|
{{ weather.weather }}<i :class="'qi-' + weather.icon"></i>️{{
|
|
weather.temp
|
|
weather.temp
|
|
}}
|
|
}}
|
|
</p>
|
|
</p>
|
|
<p>{{ getDayOfWeek }}</p>
|
|
<p>{{ getDayOfWeek }}</p>
|
|
- </view>
|
|
|
|
|
|
+ </view> -->
|
|
</view>
|
|
</view>
|
|
<view class="search" @click="goPage('/pages/index/Search')">
|
|
<view class="search" @click="goPage('/pages/index/Search')">
|
|
<uv-input placeholder="🔥 潮玩大作战 派对季重磅开启!" border="none"
|
|
<uv-input placeholder="🔥 潮玩大作战 派对季重磅开启!" border="none"
|
|
@@ -61,6 +62,7 @@
|
|
</template>
|
|
</template>
|
|
</uv-input>
|
|
</uv-input>
|
|
</view>
|
|
</view>
|
|
|
|
+ </view>
|
|
</template>
|
|
</template>
|
|
</page-navbar>
|
|
</page-navbar>
|
|
</template>
|
|
</template>
|
|
@@ -77,8 +79,10 @@
|
|
|
|
|
|
<template #classModel>
|
|
<template #classModel>
|
|
<view class="classModel-box">
|
|
<view class="classModel-box">
|
|
- <image @click="goPage('/pages/my/job')" src="@/static/home/task.png" class="benner-iconBom scale-tap" mode=""></image>
|
|
|
|
- <image @click="goPage('/pages/crowdFunding/crowdFunding')" src="@/static/home/crowdFunding.png" class="benner-icontop scale-tap" mode=""></image>
|
|
|
|
|
|
+ <image @click="goPage('/pages/my/job')" src="@/static/home/task.png"
|
|
|
|
+ class="benner-iconBom scale-tap" mode=""></image>
|
|
|
|
+ <image @click="goPage('/pages/crowdFunding/crowdFunding')"
|
|
|
|
+ src="@/static/home/crowdFunding.png" class="benner-icontop scale-tap" mode=""></image>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
</template>
|
|
</sortble>
|
|
</sortble>
|
|
@@ -96,7 +100,7 @@
|
|
<!-- 关注列表 -->
|
|
<!-- 关注列表 -->
|
|
<swiper-item>
|
|
<swiper-item>
|
|
<view class="follow-list">
|
|
<view class="follow-list">
|
|
- <block v-if="currentTab === 0 && followList.length > 0">
|
|
|
|
|
|
+ <block v-if="followList.length > 0">
|
|
<w-waterfall :data="followList">
|
|
<w-waterfall :data="followList">
|
|
<template v-slot:content="{ item, width }">
|
|
<template v-slot:content="{ item, width }">
|
|
<card :item="formatItem(item)" :width="width"
|
|
<card :item="formatItem(item)" :width="width"
|
|
@@ -106,34 +110,16 @@
|
|
</template>
|
|
</template>
|
|
</w-waterfall>
|
|
</w-waterfall>
|
|
</block>
|
|
</block>
|
|
- <view class="no-data"
|
|
|
|
- v-else-if="currentTab === 0 && !isLoadingFollow && followList.length === 0">
|
|
|
|
|
|
+ <view class="no-data" v-else-if="!isLoadingFollow && followList.length === 0">
|
|
<text>暂无关注数据</text>
|
|
<text>暂无关注数据</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</swiper-item>
|
|
</swiper-item>
|
|
|
|
|
|
- <!-- 推荐列表 -->
|
|
|
|
- <swiper-item>
|
|
|
|
- <view class="recommend-list">
|
|
|
|
- <w-waterfall v-if="currentTab === 1 && recommendList.length > 0" :data="recommendList">
|
|
|
|
- <template v-slot:content="{ item, width }">
|
|
|
|
- <card :item="formatItem(item)" :width="width" :custom-style="{ background: '#fff' }"
|
|
|
|
- textColor="#000" @imageLoad="onImageLoaded">
|
|
|
|
- </card>
|
|
|
|
- </template>
|
|
|
|
- </w-waterfall>
|
|
|
|
- <view class="no-data"
|
|
|
|
- v-if="currentTab === 1 && recommendList.length === 0 && !isLoadingRecommend">
|
|
|
|
- <text>暂无推荐数据</text>
|
|
|
|
- </view>
|
|
|
|
- </view>
|
|
|
|
- </swiper-item>
|
|
|
|
-
|
|
|
|
<!-- 探索列表 -->
|
|
<!-- 探索列表 -->
|
|
<swiper-item>
|
|
<swiper-item>
|
|
<view class="explore-list">
|
|
<view class="explore-list">
|
|
- <view class="hot-topics" v-if="currentTab === 2">
|
|
|
|
|
|
+ <view class="hot-topics">
|
|
<view class="hot-topics-header">
|
|
<view class="hot-topics-header">
|
|
<image class="hot-topics-title" src="@/static/home/hot-topics-title.png"
|
|
<image class="hot-topics-title" src="@/static/home/hot-topics-title.png"
|
|
mode="aspectFit">
|
|
mode="aspectFit">
|
|
@@ -144,7 +130,7 @@
|
|
<swiper-item v-for="(page, pageIndex) in topicPages" :key="pageIndex">
|
|
<swiper-item v-for="(page, pageIndex) in topicPages" :key="pageIndex">
|
|
<view class="hot-topics-list">
|
|
<view class="hot-topics-list">
|
|
<view v-for="(topic, index) in page" :key="index" class="topic-item"
|
|
<view v-for="(topic, index) in page" :key="index" class="topic-item"
|
|
- @click="goToArticleDetail(topic.id)">
|
|
|
|
|
|
+ @click="goToArticleDetail(topic.id, topic)">
|
|
<view class="hot-topics-left">
|
|
<view class="hot-topics-left">
|
|
<image v-if="pageIndex * 4 + index == 0"
|
|
<image v-if="pageIndex * 4 + index == 0"
|
|
src="@/static/icon/icon-first.png"
|
|
src="@/static/icon/icon-first.png"
|
|
@@ -176,7 +162,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<view class="news-list">
|
|
<view class="news-list">
|
|
- <w-waterfall v-if="currentTab === 2 && newsList.length > 0" :data="newsList">
|
|
|
|
|
|
+ <w-waterfall v-if="newsList.length > 0" :data="newsList">
|
|
<template v-slot:content="{ item, width }">
|
|
<template v-slot:content="{ item, width }">
|
|
<card :item="formatItem(item)" :width="width"
|
|
<card :item="formatItem(item)" :width="width"
|
|
goLink="/pages/index/articleDetail?id="
|
|
goLink="/pages/index/articleDetail?id="
|
|
@@ -185,7 +171,7 @@
|
|
</template>
|
|
</template>
|
|
</w-waterfall>
|
|
</w-waterfall>
|
|
</view>
|
|
</view>
|
|
- <view class="no-data" v-if="currentTab === 2 && newsList.length === 0 && !isLoadingNews">
|
|
|
|
|
|
+ <view class="no-data" v-if="newsList.length === 0 && !isLoadingNews">
|
|
<text>暂无新闻数据</text>
|
|
<text>暂无新闻数据</text>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
@@ -197,7 +183,7 @@
|
|
<tabbar-vue :tabbars="tabbars" :currentIndex="0" ref="tabbar"></tabbar-vue>
|
|
<tabbar-vue :tabbars="tabbars" :currentIndex="0" ref="tabbar"></tabbar-vue>
|
|
|
|
|
|
<!-- 添加浮动按钮 -->
|
|
<!-- 添加浮动按钮 -->
|
|
- <view v-if="currentTab === 2" class="float-btn" @click="goToMake">
|
|
|
|
|
|
+ <view v-if="currentTab === 1" class="float-btn" @click="goToMake">
|
|
<image src="/static/home/release-btn.png" class="float-btn-icon"></image>
|
|
<image src="/static/home/release-btn.png" class="float-btn-icon"></image>
|
|
</view>
|
|
</view>
|
|
|
|
|
|
@@ -280,6 +266,10 @@ export default {
|
|
},
|
|
},
|
|
windowHeight: uni.getWindowInfo().windowHeight,
|
|
windowHeight: uni.getWindowInfo().windowHeight,
|
|
bannerList: [
|
|
bannerList: [
|
|
|
|
+ {
|
|
|
|
+ image: "../../static/home/home-swper3.png",
|
|
|
|
+ url: "/pages/crowdFunding/crowdFunding",
|
|
|
|
+ },
|
|
{
|
|
{
|
|
image: "../../static/home/home-swper.png",
|
|
image: "../../static/home/home-swper.png",
|
|
url: "/pages/makedetail/makeImgDetail",
|
|
url: "/pages/makedetail/makeImgDetail",
|
|
@@ -292,24 +282,20 @@ export default {
|
|
cardList: [],
|
|
cardList: [],
|
|
list: [], // 瀑布流全部数据
|
|
list: [], // 瀑布流全部数据
|
|
dataList: [],
|
|
dataList: [],
|
|
- tabs: ["关注", "推荐", "探索"],
|
|
|
|
|
|
+ tabs: ["关注", "探索"],
|
|
currentTab: 1,
|
|
currentTab: 1,
|
|
currentTopicPage: 0,
|
|
currentTopicPage: 0,
|
|
followList: [], // 关注列表数据
|
|
followList: [], // 关注列表数据
|
|
- recommendList: [], // 推荐列表数据
|
|
|
|
exploreList: [], // 探索列表数据
|
|
exploreList: [], // 探索列表数据
|
|
hotNewsList: [], // 热点新闻数据
|
|
hotNewsList: [], // 热点新闻数据
|
|
newsList: [], // 新闻列表数据
|
|
newsList: [], // 新闻列表数据
|
|
followOffset: 0, // 关注列表偏移量
|
|
followOffset: 0, // 关注列表偏移量
|
|
- recommendOffset: 0, // 推荐列表偏移量
|
|
|
|
exploreOffset: 0, // 探索列表偏移量
|
|
exploreOffset: 0, // 探索列表偏移量
|
|
newsOffset: 0, // 新闻列表偏移量
|
|
newsOffset: 0, // 新闻列表偏移量
|
|
hasMoreFollow: true, // 是否有更多关注列表数据
|
|
hasMoreFollow: true, // 是否有更多关注列表数据
|
|
- hasMoreRecommend: true, // 是否有更多推荐列表数据
|
|
|
|
hasMoreExplore: true, // 是否有更多探索列表数据
|
|
hasMoreExplore: true, // 是否有更多探索列表数据
|
|
hasMoreNews: true, // 是否有更多新闻列表数据
|
|
hasMoreNews: true, // 是否有更多新闻列表数据
|
|
isLoadingFollow: false, // 是否正在加载关注列表
|
|
isLoadingFollow: false, // 是否正在加载关注列表
|
|
- isLoadingRecommend: false, // 是否正在加载推荐列表
|
|
|
|
isLoadingExplore: false, // 是否正在加载探索列表
|
|
isLoadingExplore: false, // 是否正在加载探索列表
|
|
isLoadingNews: false, // 是否正在加载新闻列表
|
|
isLoadingNews: false, // 是否正在加载新闻列表
|
|
hotTopics: [],
|
|
hotTopics: [],
|
|
@@ -360,8 +346,6 @@ export default {
|
|
case 0:
|
|
case 0:
|
|
return this.followList;
|
|
return this.followList;
|
|
case 1:
|
|
case 1:
|
|
- return this.recommendList; // 使用专门的推荐列表
|
|
|
|
- case 2:
|
|
|
|
return this.exploreList;
|
|
return this.exploreList;
|
|
default:
|
|
default:
|
|
return [];
|
|
return [];
|
|
@@ -401,10 +385,10 @@ export default {
|
|
this.currentTab = 0;
|
|
this.currentTab = 0;
|
|
this.queryList();
|
|
this.queryList();
|
|
} else {
|
|
} else {
|
|
- this.tabs = ["关注", "推荐", "探索"];
|
|
|
|
|
|
+ this.tabs = ["关注", "探索"];
|
|
// this.currentTab = 1;
|
|
// this.currentTab = 1;
|
|
// 如果数据为空,加载初始数据
|
|
// 如果数据为空,加载初始数据
|
|
- if (this.recommendList.length === 0) {
|
|
|
|
|
|
+ if (this.followList.length === 0) {
|
|
this.initialLoad();
|
|
this.initialLoad();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -421,11 +405,6 @@ export default {
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- if (this.hasMoreRecommend && !this.isLoadingRecommend) {
|
|
|
|
- this.loadRecommendList();
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
if (this.hasMoreNews && !this.isLoadingNews) {
|
|
if (this.hasMoreNews && !this.isLoadingNews) {
|
|
this.loadNewsList();
|
|
this.loadNewsList();
|
|
}
|
|
}
|
|
@@ -435,24 +414,7 @@ export default {
|
|
|
|
|
|
// 下拉刷新数据
|
|
// 下拉刷新数据
|
|
methods: {
|
|
methods: {
|
|
- swipeRight() {
|
|
|
|
- let index = this.currentTab
|
|
|
|
- index--
|
|
|
|
- if (index < 0) {
|
|
|
|
- index = this.tabs.length - 1
|
|
|
|
- }
|
|
|
|
- this.switchTab(index)
|
|
|
|
- console.log('向右滑动')
|
|
|
|
- },
|
|
|
|
- swipeLeft() {
|
|
|
|
- let index = this.currentTab
|
|
|
|
- index++
|
|
|
|
- if (index > this.tabs.length - 1) {
|
|
|
|
- index = 0
|
|
|
|
- }
|
|
|
|
- this.switchTab(index)
|
|
|
|
- console.log('向左滑动')
|
|
|
|
- },
|
|
|
|
|
|
+
|
|
getWeather(city) {
|
|
getWeather(city) {
|
|
uni.request({
|
|
uni.request({
|
|
url: this.$apiHost + "/Index/getAreaInfo",
|
|
url: this.$apiHost + "/Index/getAreaInfo",
|
|
@@ -504,13 +466,6 @@ export default {
|
|
this.loadFollowList();
|
|
this.loadFollowList();
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- // 重置推荐列表
|
|
|
|
- this.recommendList = [];
|
|
|
|
- this.recommendOffset = 0;
|
|
|
|
- this.hasMoreRecommend = true;
|
|
|
|
- this.loadRecommendList();
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
// 重置热点新闻和新闻列表
|
|
// 重置热点新闻和新闻列表
|
|
this.hotNewsList = [];
|
|
this.hotNewsList = [];
|
|
this.newsList = [];
|
|
this.newsList = [];
|
|
@@ -530,10 +485,6 @@ export default {
|
|
this.loadFollowList();
|
|
this.loadFollowList();
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- // 重置推荐列表
|
|
|
|
- this.loadRecommendList();
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
// 重置热点新闻和新闻列表
|
|
// 重置热点新闻和新闻列表
|
|
// 加载热点新闻和新闻列表
|
|
// 加载热点新闻和新闻列表
|
|
this.loadHotNews();
|
|
this.loadHotNews();
|
|
@@ -556,11 +507,6 @@ export default {
|
|
this.hasMoreFollow = true;
|
|
this.hasMoreFollow = true;
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- this.recommendList = [];
|
|
|
|
- this.recommendOffset = 0;
|
|
|
|
- this.hasMoreRecommend = true;
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
this.newsList = [];
|
|
this.newsList = [];
|
|
this.hotTopics = [];
|
|
this.hotTopics = [];
|
|
this.newsOffset = 0;
|
|
this.newsOffset = 0;
|
|
@@ -583,9 +529,6 @@ export default {
|
|
this.loadFollowList();
|
|
this.loadFollowList();
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- this.loadRecommendList();
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
this.loadHotNews();
|
|
this.loadHotNews();
|
|
this.loadNewsList();
|
|
this.loadNewsList();
|
|
break;
|
|
break;
|
|
@@ -602,52 +545,39 @@ export default {
|
|
// offset设置为当前列表长度
|
|
// offset设置为当前列表长度
|
|
this.followOffset = currentList.length;
|
|
this.followOffset = currentList.length;
|
|
console.log('请求关注列表数据,当前offset =', this.followOffset);
|
|
console.log('请求关注列表数据,当前offset =', this.followOffset);
|
|
-
|
|
|
|
- category
|
|
|
|
- },
|
|
|
|
- // 修改推荐列表加载方法
|
|
|
|
- loadRecommendList() {
|
|
|
|
- if (this.isLoadingRecommend) return;
|
|
|
|
- this.isLoadingRecommend = true;
|
|
|
|
-
|
|
|
|
- // 保存当前列表数据
|
|
|
|
- const currentList = [...this.recommendList];
|
|
|
|
-
|
|
|
|
- // offset设置为当前列表长度
|
|
|
|
- this.recommendOffset = currentList.length;
|
|
|
|
- console.log('请求推荐列表数据,当前offset =', this.recommendOffset);
|
|
|
|
-
|
|
|
|
uni.request({
|
|
uni.request({
|
|
url: this.$apiHost + "/Work/getlist",
|
|
url: this.$apiHost + "/Work/getlist",
|
|
data: {
|
|
data: {
|
|
uuid: getApp().globalData.uuid,
|
|
uuid: getApp().globalData.uuid,
|
|
skey: getApp().globalData.skey,
|
|
skey: getApp().globalData.skey,
|
|
- type: "recommend",
|
|
|
|
- offset: this.recommendOffset,
|
|
|
|
|
|
+ type: "attention",
|
|
|
|
+ offset: this.followOffset,
|
|
},
|
|
},
|
|
header: {
|
|
header: {
|
|
"content-type": "application/json",
|
|
"content-type": "application/json",
|
|
sign: getApp().globalData.headerSign,
|
|
sign: getApp().globalData.headerSign,
|
|
},
|
|
},
|
|
success: (res) => {
|
|
success: (res) => {
|
|
- console.log("推荐列表数据:", res.data);
|
|
|
|
|
|
+ console.log("关注列表数据:", res.data);
|
|
if (res.data.success == "yes" && res.data.list && res.data.list.length > 0) {
|
|
if (res.data.success == "yes" && res.data.list && res.data.list.length > 0) {
|
|
// 追加新数据到列表
|
|
// 追加新数据到列表
|
|
- this.recommendList = [...currentList, ...res.data.list];
|
|
|
|
- console.log('推荐列表加载成功,当前列表长度:', this.recommendList.length);
|
|
|
|
- this.hasMoreRecommend = res.data.list.length >= 20;
|
|
|
|
|
|
+ this.followList = [...currentList, ...res.data.list];
|
|
|
|
+ console.log('关注列表加载成功,当前列表长度:', this.followList.length);
|
|
|
|
+ this.hasMoreFollow = res.data.list.length >= 20;
|
|
} else {
|
|
} else {
|
|
- this.hasMoreRecommend = false;
|
|
|
|
- this.showNoMoreDataToast("没有更多推荐内容了");
|
|
|
|
|
|
+ this.hasMoreFollow = false;
|
|
|
|
+ this.showNoMoreDataToast("没有更多关注内容了");
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // 使用 nextTick 确保数据更新后再通知组件
|
|
this.$nextTick(() => {
|
|
this.$nextTick(() => {
|
|
if (this.$refs.paging) {
|
|
if (this.$refs.paging) {
|
|
// 第一个参数需要是数组,将当前列表传入
|
|
// 第一个参数需要是数组,将当前列表传入
|
|
- this.$refs.paging.complete(this.recommendList);
|
|
|
|
|
|
+ this.$refs.paging.complete(this.followList);
|
|
}
|
|
}
|
|
// 数据加载完成后更新swiper高度
|
|
// 数据加载完成后更新swiper高度
|
|
- if (this.currentTab === 1) {
|
|
|
|
|
|
+ if (this.currentTab === 0) {
|
|
|
|
+ // 使用setTimeout确保数据渲染完成后再更新高度
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.updateSwiperHeight();
|
|
this.updateSwiperHeight();
|
|
}, 300);
|
|
}, 300);
|
|
@@ -658,11 +588,11 @@ export default {
|
|
});
|
|
});
|
|
},
|
|
},
|
|
complete: () => {
|
|
complete: () => {
|
|
- this.isLoadingRecommend = false;
|
|
|
|
|
|
+ this.isLoadingFollow = false;
|
|
},
|
|
},
|
|
fail: (e) => {
|
|
fail: (e) => {
|
|
- console.log("请求推荐列表失败:", e);
|
|
|
|
- this.isLoadingRecommend = false;
|
|
|
|
|
|
+ console.log("请求关注列表失败:", e);
|
|
|
|
+ this.isLoadingFollow = false;
|
|
if (this.$refs.paging) {
|
|
if (this.$refs.paging) {
|
|
// 加载失败时提供空数组
|
|
// 加载失败时提供空数组
|
|
this.$refs.paging.complete([]);
|
|
this.$refs.paging.complete([]);
|
|
@@ -749,7 +679,7 @@ export default {
|
|
this.$refs.paging.complete(this.newsList);
|
|
this.$refs.paging.complete(this.newsList);
|
|
}
|
|
}
|
|
// 数据加载完成后更新swiper高度
|
|
// 数据加载完成后更新swiper高度
|
|
- if (this.currentTab === 2) {
|
|
|
|
|
|
+ if (this.currentTab === 1) {
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
this.updateSwiperHeight();
|
|
this.updateSwiperHeight();
|
|
}, 300);
|
|
}, 300);
|
|
@@ -779,6 +709,7 @@ export default {
|
|
formatItem(item) {
|
|
formatItem(item) {
|
|
// console.log("item:", item);
|
|
// console.log("item:", item);
|
|
|
|
|
|
|
|
+
|
|
let img = "";
|
|
let img = "";
|
|
if (item.images) {
|
|
if (item.images) {
|
|
img = item.images.split("|")[0];
|
|
img = item.images.split("|")[0];
|
|
@@ -799,10 +730,11 @@ export default {
|
|
desc: item.desc || "",
|
|
desc: item.desc || "",
|
|
userID: item.userID || 0,
|
|
userID: item.userID || 0,
|
|
backgroundColor: "#f6f6f6",
|
|
backgroundColor: "#f6f6f6",
|
|
|
|
+ type: item.type || "",
|
|
};
|
|
};
|
|
},
|
|
},
|
|
|
|
|
|
- goToArticleDetail(id) {
|
|
|
|
|
|
+ goToArticleDetail(id, item) {
|
|
if (!id) {
|
|
if (!id) {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
title: "文章ID不存在",
|
|
title: "文章ID不存在",
|
|
@@ -810,14 +742,14 @@ export default {
|
|
});
|
|
});
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+
|
|
// uni.$emit("check_login", () => {
|
|
// uni.$emit("check_login", () => {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
url: "/pages/index/articleDetail?id=" + id,
|
|
url: "/pages/index/articleDetail?id=" + id,
|
|
});
|
|
});
|
|
// });
|
|
// });
|
|
},
|
|
},
|
|
- goWo
|
|
|
|
-rk(item) {
|
|
|
|
|
|
+ goWork(item) {
|
|
console.log("skeylogin", "xxx");
|
|
console.log("skeylogin", "xxx");
|
|
uni.$emit("check_login", () => {
|
|
uni.$emit("check_login", () => {
|
|
uni.navigateTo({
|
|
uni.navigateTo({
|
|
@@ -847,18 +779,15 @@ rk(item) {
|
|
console.log('下拉刷新开始');
|
|
console.log('下拉刷新开始');
|
|
// 重置所有数据
|
|
// 重置所有数据
|
|
this.followList = [];
|
|
this.followList = [];
|
|
- this.recommendList = [];
|
|
|
|
this.newsList = [];
|
|
this.newsList = [];
|
|
this.hotTopics = [];
|
|
this.hotTopics = [];
|
|
|
|
|
|
// 重置偏移量
|
|
// 重置偏移量
|
|
this.followOffset = 0;
|
|
this.followOffset = 0;
|
|
- this.recommendOffset = 0;
|
|
|
|
this.newsOffset = 0;
|
|
this.newsOffset = 0;
|
|
|
|
|
|
// 重置加载状态
|
|
// 重置加载状态
|
|
this.hasMoreFollow = true;
|
|
this.hasMoreFollow = true;
|
|
- this.hasMoreRecommend = true;
|
|
|
|
this.hasMoreNews = true;
|
|
this.hasMoreNews = true;
|
|
|
|
|
|
// 根据当前标签页加载数据
|
|
// 根据当前标签页加载数据
|
|
@@ -896,27 +825,6 @@ rk(item) {
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- if (this.hasMoreRecommend && !this.isLoadingRecommend) {
|
|
|
|
- this.loadRecommendList();
|
|
|
|
- } else if (!this.hasMoreRecommend && !this.isLoadingRecommend && this.recommendList.length > 0) {
|
|
|
|
- this.showNoMoreDataToast("没有更多推荐内容了");
|
|
|
|
- // 通知组件加载完毕且没有更多数据
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- if (this.$refs.paging) {
|
|
|
|
- this.$refs.paging.complete(this.recommendList);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- } else if (this.recommendList.length === 0 && !this.isLoadingRecommend) {
|
|
|
|
- this.showNoMoreDataToast("暂无推荐内容");
|
|
|
|
- // 通知组件加载完毕且没有数据
|
|
|
|
- this.$nextTick(() => {
|
|
|
|
- if (this.$refs.paging) {
|
|
|
|
- this.$refs.paging.complete([]);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
- }
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
if (this.hasMoreNews && !this.isLoadingNews) {
|
|
if (this.hasMoreNews && !this.isLoadingNews) {
|
|
this.loadNewsList();
|
|
this.loadNewsList();
|
|
} else if (!this.hasMoreNews && !this.isLoadingNews && this.newsList.length > 0) {
|
|
} else if (!this.hasMoreNews && !this.isLoadingNews && this.newsList.length > 0) {
|
|
@@ -956,8 +864,6 @@ rk(item) {
|
|
// 根据当前选中的标签页查询内容高度
|
|
// 根据当前选中的标签页查询内容高度
|
|
let selector = '.follow-list';
|
|
let selector = '.follow-list';
|
|
if (this.currentTab === 1) {
|
|
if (this.currentTab === 1) {
|
|
- selector = '.recommend-list';
|
|
|
|
- } else if (this.currentTab === 2) {
|
|
|
|
selector = '.explore-list';
|
|
selector = '.explore-list';
|
|
}
|
|
}
|
|
|
|
|
|
@@ -983,13 +889,6 @@ rk(item) {
|
|
this.loadFollowList();
|
|
this.loadFollowList();
|
|
break;
|
|
break;
|
|
case 1:
|
|
case 1:
|
|
- // 重置推荐列表
|
|
|
|
- this.recommendList = [];
|
|
|
|
- this.recommendOffset = 0;
|
|
|
|
- this.hasMoreRecommend = true;
|
|
|
|
- this.loadRecommendList();
|
|
|
|
- break;
|
|
|
|
- case 2:
|
|
|
|
// 重置热点新闻和新闻列表
|
|
// 重置热点新闻和新闻列表
|
|
this.hotNewsList = [];
|
|
this.hotNewsList = [];
|
|
this.newsList = [];
|
|
this.newsList = [];
|
|
@@ -1081,20 +980,21 @@ rk(item) {
|
|
}
|
|
}
|
|
|
|
|
|
.follow-list,
|
|
.follow-list,
|
|
-.recommend-list,
|
|
|
|
.explore-list {
|
|
.explore-list {
|
|
min-height: 300px;
|
|
min-height: 300px;
|
|
}
|
|
}
|
|
-.classModel-box{
|
|
|
|
|
|
+
|
|
|
|
+.classModel-box {
|
|
width: 100%;
|
|
width: 100%;
|
|
-
|
|
|
|
|
|
+
|
|
display: flex;
|
|
display: flex;
|
|
align-items: center;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
justify-content: space-between;
|
|
- image{
|
|
|
|
- width:50%;
|
|
|
|
- height:160rpx;
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ image {
|
|
|
|
+ width: 50%;
|
|
|
|
+ height: 160rpx;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</style>
|
|
</style>
|
|
<style>
|
|
<style>
|