|
@@ -18,13 +18,10 @@
|
|
|
</van-radio-group>
|
|
|
</view>
|
|
|
<view class="tab-cont" v-if="radioSelect == 2 && isResult">
|
|
|
- <scroll-view scroll-x="true" scroll-with-animation class="scroll-tab" :scroll-into-view="'_' + tabIndex">
|
|
|
- <block v-for="item in tabBars" :key="item.mode">
|
|
|
- <view class="scroll-tab-item" :class="{ active: orderColumn === item.mode }" @click.stop="toggleTab(item)">
|
|
|
- {{ item.PermissionName }}
|
|
|
- </view>
|
|
|
- </block>
|
|
|
- </scroll-view>
|
|
|
+ <view :class="['item', item.mode == orderColumn && 'tabs-active text_twoLine']" v-for="item in tabBars" :key="item.mode" @click.stop="toggleTab(item)">
|
|
|
+ {{ item.PermissionName }}
|
|
|
+ <view class="active" v-if="orderColumn === item.mode"></view>
|
|
|
+ </view>
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="search-cont" v-if="!isResult">
|
|
@@ -68,15 +65,11 @@
|
|
|
</view>
|
|
|
<view class="item-content" v-else><u-parse :html="report.Body[0] + '...'"></u-parse></view>
|
|
|
<view class="line"></view>
|
|
|
- <view :class="['item-title', report.Source != 1 && 'chart-title']"><u-parse :html="report.Title"></u-parse></view>
|
|
|
- <view class="item-abstract" v-if="report.abstract">
|
|
|
- <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/report_ico.png" class="report_ico"></image>
|
|
|
- {{ report.abstract }}
|
|
|
- </view>
|
|
|
+ <view :class="['item-title', report.Source != 1 && 'chart-title text_twoLine']"><u-parse :html="report.Title"></u-parse></view>
|
|
|
<text class="item-createtime" v-if="report.Source == 1">{{ report.PublishDate }}</text>
|
|
|
<view class="item-createtime chart-tag" v-else>
|
|
|
- <text class="tag-item">{{ report.PtagName }}</text>
|
|
|
- <text class="tag-item">{{ report.CtagName }}</text>
|
|
|
+ <text class="tag-item" v-if="report.PtagName">{{ report.PtagName }}</text>
|
|
|
+ <text class="tag-item" v-if="report.CtagName">{{ report.CtagName }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -87,19 +80,16 @@
|
|
|
</view>
|
|
|
<view class="item-content" v-else><u-parse :html="report.Body[0] + '...'"></u-parse></view>
|
|
|
<view class="line"></view>
|
|
|
- <view :class="['item-title', report.Source != 1 && 'chart-title']"><u-parse :html="report.Title"></u-parse></view>
|
|
|
- <view class="item-abstract" v-if="report.ExpertBackground">
|
|
|
- <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/report_ico.png" class="report_ico"></image>
|
|
|
- {{ report.ExpertBackground }}
|
|
|
- </view>
|
|
|
+ <view :class="['item-title', report.Source != 1 && 'chart-title text_twoLine']"><u-parse :html="report.Title"></u-parse></view>
|
|
|
<text class="item-createtime" v-if="report.Source == 1">{{ report.PublishDate }}</text>
|
|
|
<view class="item-createtime chart-tag" v-else>
|
|
|
- <text class="tag-item">{{ report.PtagName }}</text>
|
|
|
- <text class="tag-item">{{ report.CtagName }}</text>
|
|
|
+ <text class="tag-item" v-if="report.PtagName">{{ report.PtagName }}</text>
|
|
|
+ <text class="tag-item" v-if="report.CtagName">{{ report.CtagName }}</text>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
+ <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="pageNum > 1" />
|
|
|
</block>
|
|
|
<view class="nodata" v-else>
|
|
|
<image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
|
|
@@ -126,8 +116,9 @@ export default {
|
|
|
chartWordList: [],
|
|
|
// 搜索结果列表
|
|
|
resultList: [],
|
|
|
+ resultDataList: [],
|
|
|
indList: [],
|
|
|
- page_no: 1,
|
|
|
+ pageNum: 1,
|
|
|
pageSize: 10,
|
|
|
totalPage: 0,
|
|
|
hotKeyWord: [],
|
|
@@ -147,6 +138,12 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
orderColumn: "Matching",
|
|
|
+ status: "loadmore",
|
|
|
+ loadText: {
|
|
|
+ loadmore: "上拉加载更多",
|
|
|
+ loading: "加载中",
|
|
|
+ nomore: "已经到底了",
|
|
|
+ },
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -171,6 +168,7 @@ export default {
|
|
|
onChangeRadio(value) {
|
|
|
this.radioSelect = value.detail;
|
|
|
this.orderColumn = "Matching";
|
|
|
+ this.dataInit();
|
|
|
this.clearIpt();
|
|
|
},
|
|
|
/* 获取关键词 */
|
|
@@ -185,7 +183,7 @@ export default {
|
|
|
chooseTarget(item) {
|
|
|
this.searchTxt = item;
|
|
|
this.SecName = item;
|
|
|
- this.resultList = [];
|
|
|
+ this.dataInit();
|
|
|
this.indList = [];
|
|
|
if (!this.historySearchList.includes(this.searchTxt)) {
|
|
|
this.historySearchList.unshift(this.searchTxt);
|
|
@@ -205,8 +203,8 @@ export default {
|
|
|
this.historySearchList.unshift(this.searchTxt);
|
|
|
this.$db.set("historySearchList", JSON.stringify(this.historySearchList));
|
|
|
}
|
|
|
- this.resultList = [];
|
|
|
this.indList = [];
|
|
|
+ this.dataInit();
|
|
|
this.getDataList();
|
|
|
} else {
|
|
|
this.$util.toast("请输入关键字");
|
|
@@ -221,14 +219,14 @@ export default {
|
|
|
ListType: this.radioSelect,
|
|
|
});
|
|
|
if (res.Ret === 200) {
|
|
|
+ this.totalPage = res.Data.Paging.Totals;
|
|
|
if (this.radioSelect == 1) {
|
|
|
- this.haveData = res.Data.List ? true : res.Data.ChartList ? true : false;
|
|
|
- if (!res.Data.List) {
|
|
|
- this.resultList = res.Data.ChartList;
|
|
|
- } else if (!res.Data.ChartList) {
|
|
|
- this.resultList = res.Data.List;
|
|
|
+ if (!res.Data.List.length) {
|
|
|
+ this.resultDataList = res.Data.ChartList || [];
|
|
|
+ } else if (!res.Data.ChartList.length) {
|
|
|
+ this.resultDataList = res.Data.List || [];
|
|
|
} else {
|
|
|
- this.resultList.push(res.Data.List.shift());
|
|
|
+ this.resultDataList.push(res.Data.List.shift());
|
|
|
let newArr = [];
|
|
|
let newArrTwo = [];
|
|
|
for (let i = 0; i < res.Data.List.length; i += 2) {
|
|
@@ -245,20 +243,23 @@ export default {
|
|
|
arr.push(item);
|
|
|
}
|
|
|
});
|
|
|
- this.resultList = this.resultList.concat(arr.flat(Infinity));
|
|
|
+ this.resultDataList = this.resultDataList.concat(arr.flat(Infinity));
|
|
|
}
|
|
|
+ this.haveResult = this.resultDataList.length ? true : false;
|
|
|
} else if (this.radioSelect == 2) {
|
|
|
- this.resultList = res.Data.List || [];
|
|
|
- this.haveResult = this.resultList.length ? true : false;
|
|
|
+ this.resultDataList = res.Data.List || [];
|
|
|
+ this.haveResult = this.resultDataList.length ? true : false;
|
|
|
} else {
|
|
|
- this.resultList = res.Data.ChartList || [];
|
|
|
- this.haveResult = this.resultList.length ? true : false;
|
|
|
+ this.resultDataList = res.Data.ChartList || [];
|
|
|
+ this.haveResult = this.resultDataList.length ? true : false;
|
|
|
}
|
|
|
+ this.resultList = this.haveResult ? this.resultDataList.slice((this.pageNum - 1) * this.pageSize, this.pageNum * this.pageSize) : [];
|
|
|
}
|
|
|
},
|
|
|
/* 表单清空 */
|
|
|
clearIpt() {
|
|
|
this.searchTxt = "";
|
|
|
+ this.dataInit();
|
|
|
this.isTabAct = false;
|
|
|
},
|
|
|
/* 进入详情 校验是否有该品种权限 */
|
|
@@ -276,9 +277,26 @@ export default {
|
|
|
this.historySearchList = [];
|
|
|
this.$db.del("historySearchList");
|
|
|
},
|
|
|
+ //获取数据的初始值
|
|
|
+ dataInit() {
|
|
|
+ this.pageNum = 1;
|
|
|
+ this.resultList = [];
|
|
|
+ this.resultDataList = [];
|
|
|
+ this.status = "loadmore";
|
|
|
+ uni.pageScrollTo({
|
|
|
+ scrollTop: 0,
|
|
|
+ duration: 0,
|
|
|
+ });
|
|
|
+ },
|
|
|
//tabs切换事件
|
|
|
toggleTab(item) {
|
|
|
this.orderColumn = item.mode;
|
|
|
+ this.pageNum = 1;
|
|
|
+ uni.pageScrollTo({
|
|
|
+ scrollTop: 0,
|
|
|
+ duration: 0,
|
|
|
+ });
|
|
|
+ this.resultList = [];
|
|
|
this.getDataList();
|
|
|
uni.pageScrollTo({
|
|
|
scrollTop: 0,
|
|
@@ -302,6 +320,16 @@ export default {
|
|
|
this.getKeyWord();
|
|
|
this.researchHotKeyWord();
|
|
|
},
|
|
|
+ // 上拉加载this.resultList
|
|
|
+ onReachBottom: Throttle(function () {
|
|
|
+ if (!this.resultList.length) return;
|
|
|
+ if (this.status === "nomore") return;
|
|
|
+ this.status = "loading";
|
|
|
+ this.pageNum++;
|
|
|
+ this.resultList = this.resultList.concat(this.resultDataList.slice((this.pageNum - 1) * this.pageSize, this.pageNum * this.pageSize));
|
|
|
+ this.status = this.pageNum * 10 < this.totalPage ? "loadmore" : "nomore";
|
|
|
+ console.log(this.status);
|
|
|
+ }),
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -473,6 +501,7 @@ export default {
|
|
|
}
|
|
|
.chart-title {
|
|
|
height: 72rpx;
|
|
|
+ padding-bottom: 10rpx;
|
|
|
}
|
|
|
.item-abstract {
|
|
|
font-size: 26rpx;
|
|
@@ -496,6 +525,7 @@ export default {
|
|
|
align-items: center;
|
|
|
justify-content: space-between;
|
|
|
padding-top: 1rpx;
|
|
|
+ height: 36rpx;
|
|
|
.tag-item {
|
|
|
width: 148rpx;
|
|
|
border-radius: 28rpx;
|
|
@@ -510,7 +540,7 @@ export default {
|
|
|
display: flex;
|
|
|
align-items: center;
|
|
|
width: 330rpx;
|
|
|
- margin-left: -6rpx;
|
|
|
+ margin-left: -15rpx;
|
|
|
margin-bottom: -20rpx;
|
|
|
image {
|
|
|
width: 100%;
|
|
@@ -522,38 +552,35 @@ export default {
|
|
|
}
|
|
|
.tab-cont {
|
|
|
width: 100%;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
padding: 20rpx 30rpx 0;
|
|
|
- background-color: #fff;
|
|
|
font-size: 32rpx;
|
|
|
- .scroll-tab {
|
|
|
- width: 100%;
|
|
|
- white-space: nowrap;
|
|
|
+ &::-webkit-scrollbar {
|
|
|
+ width: 0;
|
|
|
+ height: 0;
|
|
|
+ display: none;
|
|
|
}
|
|
|
- .scroll-tab-item {
|
|
|
- text-align: center;
|
|
|
- display: inline-block;
|
|
|
- padding-bottom: 20rpx;
|
|
|
- margin-right: 40rpx;
|
|
|
- border-bottom: 8rpx solid transparent;
|
|
|
+ .item {
|
|
|
position: relative;
|
|
|
- &:last-child {
|
|
|
- margin-right: 0;
|
|
|
- }
|
|
|
- &.active {
|
|
|
- border-bottom: none;
|
|
|
- color: #2c83ff;
|
|
|
- font-weight: 700;
|
|
|
- border-bottom: 2px solid;
|
|
|
- border-image: linear-gradient(to right, #2e85ff, #7eeaf6) 1;
|
|
|
- }
|
|
|
- .border_act {
|
|
|
- width: 100%;
|
|
|
- height: 8rpx;
|
|
|
+ padding-bottom: 16rpx;
|
|
|
+ margin-right: 50rpx;
|
|
|
+ flex-shrink: 0;
|
|
|
+ .active {
|
|
|
position: absolute;
|
|
|
- bottom: 0;
|
|
|
left: 0;
|
|
|
+ bottom: 0;
|
|
|
+ height: 4rpx;
|
|
|
+ width: 100%;
|
|
|
+ border-radius: 2rpx;
|
|
|
+
|
|
|
+ font-weight: 500;
|
|
|
+ background: linear-gradient(90deg, #2e85ff 0%, #7eeaf6 100%);
|
|
|
}
|
|
|
}
|
|
|
+ .tabs-active {
|
|
|
+ color: #3385ff;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
</style>
|