123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240 |
- <template>
- <!-- 季度策略 -->
- <view class="container industrial-container">
- <view class="collect-ul" v-if="haveData">
- <view class="global_card_content collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item, index)">
- <view class="item-left">
- <text class="title global_title text_twoLine">
- {{ item.Title }}
- <text class="reg-text" v-if="item.IsRed"></text>
- </text>
- <view v-if="isShowAbstract" class="abstract-box text_twoLine">摘要:{{ item.Abstract }} </view>
- <view class="item-more">
- <text :class="item.IsResearch ? 'publishDate' : ''">{{ item.PublishDate }}</text>
- <view class="global_pv-ollect">
- <view>
- <image class="pv" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/examine_icon.png"></image>
- {{ item.Pv }}
- </view>
- <view @click.stop="collectClick(item)" v-if="item.Resource == 1">
- <image v-if="item.IsCollect" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collect_act.png"></image>
- <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collect_ico.png"></image>
- {{ item.CollectNum }}
- </view>
- </view>
- <text v-if="item.IsResearch" class="text_oneLine text-name">{{ item.IndustryName }}</text>
- </view>
- </view>
- <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
- </view>
- <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
- </view>
- <view class="nodata" v-else>
- <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
- <text>暂时没有报告的内容</text>
- </view>
- <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
- <Loading />
- </view>
- </template>
- <script>
- import { Reports, Report } from "@/config/api.js";
- import { Throttle } from "@/config/util.js";
- import freeCharge from "@/components/freeCharge";
- let app = getApp({ allowDefault: true });
- export default {
- data() {
- return {
- refresh: false, //正在下拉
- page_no: 1,
- pageSize: 10,
- categoryId: null,
- collectList: [],
- haveData: true,
- status: "loadmore",
- loadText: {
- loadmore: "上拉加载更多",
- loading: "加载中",
- nomore: "已经到底了",
- },
- typeIsPost: "", //
- genreIs: "", //作者还是文章
- totalPage: "",
- titleReport: "",
- idGenre: "",
- articleId: "",
- isShowAbstract: false,
- };
- },
- onLoad(option) {
- this.categoryId = Number(option.id) || "";
- this.idGenre = Number(option.idGenre) || "";
- this.articleId = Number(option.idArticle) || "";
- this.typeIsPost = option.type || "";
- this.genreIs = option.isGenre || "";
- this.getCollectList();
- },
- onShow() {
- this.$store.commit("setRouterReport", "行业综述");
- },
- methods: {
- /* 获取列表 */
- async getCollectList() {
- const res =
- this.typeIsPost == "研选" && this.genreIs !== "标的"
- ? await Reports.industryReportList({
- PageSize: this.pageSize,
- CurrentIndex: this.page_no,
- DepartmentId: this.idGenre,
- IndustrialManagementId: this.categoryId,
- ArticleId: this.articleId,
- })
- : this.genreIs === "标的"
- ? await Reports.reportListNew({
- PageSize: this.pageSize,
- CurrentIndex: this.page_no,
- ArticleId: this.articleId,
- })
- : await Reports.getTactics({
- PageSize: this.pageSize,
- CurrentIndex: this.page_no,
- CategoryId: this.categoryId,
- });
- if (res.Ret === 200) {
- if (!res.Data.HaveResearch && this.typeIsPost == "研选") {
- this.$util.modalShow("", "您暂无查看研选权限", "", () => {
- uni.reLaunch({
- url: "/pages/index/index",
- });
- });
- }
- uni.setNavigationBarTitle({
- title: this.genreIs == "作者" ? res.Data.NickName : this.genreIs === "标的" ? res.Data.IndustryName : res.Data.IndustryName ? res.Data.IndustryName : res.Data.MatchTypeName,
- });
- this.titleReport = this.genreIs == "作者" ? res.Data.NickName : this.genreIs === "标的" ? res.Data.IndustryName : res.Data.IndustryName ? res.Data.IndustryName : res.Data.MatchTypeName;
- this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
- this.totalPage = res.Data.Paging.Pages; //总页数
- this.isShowAbstract = res.Data.IsShowAbstract;
- if (res.Data.List.length > 0) {
- res.Data.List.forEach((item) => {
- if (item.IsResearch) {
- item.PublishDate = item.PublishDate.slice(0, 10);
- }
- });
- }
- if (this.page_no === 1) {
- this.collectList = res.Data.List || [];
- this.haveData = this.collectList.length ? true : false;
- if (this.refresh) {
- uni.stopPullDownRefresh();
- this.refresh = false;
- }
- } else {
- this.collectList = this.collectList.concat(res.Data.List);
- }
- }
- },
- goDetail(item, index) {
- /* 无需授权且已绑定 检验是或否有权限 */
- this.collectList[index].IsRed = false;
- if (item.Resource === 2) {
- // 跳转产品内测详情
- uni.navigateTo({
- url: "/reportPages/internalDetials/internalDetials?id=" + item.ArticleId,
- });
- } else if (item.Resource === 1) {
- uni.navigateTo({
- url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
- });
- }
- },
- // 收藏
- async collectClick(item) {
- const res = await Report.collectRpt({ ArticleId: item.ArticleId, PageRouter: this.$store.state.pageRouterReport });
- if (res.Ret === 200) {
- item.IsCollect = !item.IsCollect;
- item.IsCollect
- ? (item.CollectNum += 1) &&
- uni.showToast({
- title: "收藏成功",
- icon: "none",
- duration: 2000,
- })
- : (item.CollectNum -= 1);
- !item.IsCollect &&
- uni.showToast({
- title: "已取消收藏",
- icon: "none",
- duration: 2000,
- });
- }
- },
- },
- components: {
- freeCharge,
- },
- /* 触底 */
- onReachBottom: Throttle(function () {
- if (this.status === "nomore") return;
- this.status = "loading";
- this.page_no++;
- this.getCollectList();
- }),
- /* 下拉刷新 */
- onPullDownRefresh: Throttle(function () {
- this.page_no = 1;
- this.refresh = true;
- this.getCollectList();
- }),
- /**
- * 用户点击分享
- */
- onShareAppMessage: function (res) {
- return {
- title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.titleReport,
- path:
- "/reportPages/industrialReport/industrialReport?id=" + this.categoryId + "&type=" + this.typeIsPost + "&isGenre=" + this.genreIs + "&idGenre=" + this.idGenre + "&idArticle=" + this.articleId,
- success: (res) => {},
- fail: (err) => {},
- };
- },
- };
- </script>
- <style scoped lang="scss">
- @import "../index.scss";
- .industrial-container {
- background-color: $uni-bg-color;
- padding: 30rpx 25rpx;
- .abstract-box {
- margin-top: 10rpx;
- padding: 0 20rpx 0 28rpx;
- color: #666666;
- font-size: 28rpx;
- }
- }
- .collect-ltem {
- border-top: 4rpx solid $uni-color-new;
- margin-bottom: 20rpx !important;
- padding: 22rpx 12rpx !important;
- }
- .item-examine {
- display: flex;
- align-items: center;
- margin-right: 30rpx;
- image {
- width: 30rpx;
- height: 30rpx;
- margin: 0 10rpx 0 15rpx;
- }
- }
- .item-left {
- flex: 1;
- .item-more {
- padding-left: 20rpx;
- }
- }
- </style>
|