123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402 |
- <template>
- <view class="container myCollection-container">
- <view class="global_one_tabs top-tabs">
- <view :class="['item', item.id == tabsActive && 'tabs-active']" v-for="item in tabsList" :key="item.id" @click="handleClickTopSub(item)">
- {{ item.name }}
- </view>
- </view>
- <view class="collect-ul" v-if="haveData">
- <view class="audio-video-content" v-if="tabsActive == 2">
- <view class="audio-item" v-for="item in collectList" :key="item.Id">
- <RoadshowItem :list="item" @isCollectionHandeler="isCollectionHandeler" />
- </view>
- </view>
- <blok v-else-if="tabsActive == 3">
- <viwe class="chart-ul">
- <view style="width: 49%" v-for="item in collectList" :key="item.Id">
- <ChartItem class="chart-item" :isMyChartCollection="true" :list="item" @myChartIsTop="myChartIsTop" @myChartCollect="myChartCollect" />
- </view>
- </viwe>
- </blok>
- <block v-else>
- <view class="global_card_content content-item" v-for="item in collectList" :key="item.ArticleId">
- <blok v-if="item.NickName">
- <view class="item-user" v-if="item.Source == 2 || item.IsSpecial == 1">
- <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/user_report.png"></image>
- <text> {{ item.NickName }}</text>
- </view>
- </blok>
- <view class="title-content-box">
- <view v-if="item.ArticleTypeName" class="tag global_content_center">{{ item.ArticleTypeName }}</view>
- <view class="item-title global_title" @click="goDetailReport(item)">
- {{ item.Title }}
- <block v-if="item.SpecialTags && item.IsSpecial == 1">
- <text @click.stop="themeDetails(item, val)" style="color: #90aeda" v-for="it in item.SpecialTags.split(',')" class="item-industry" :key="it">#{{ it }}</text>
- </block>
- <text @click.stop="themeDetails(item, val)" class="item-industry" v-for="val in item.List" :key="val.IndustrialManagementId"> # {{ val.IndustryName }} </text>
- </view>
- </view>
- <view class="item-more">
- <text>{{ item.PublishDate }}</text>
- <view class="global_pv-ollect" v-if="item.Source == 2 || item.IsSpecial == 1">
- <view>
- <image class="pv" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/examine_icon.png"></image>
- {{ item.Pv }}
- </view>
- <view @click="collectClick(item)">
- <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>
- </view>
- </view>
- </block>
- <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 v-if="showAudioBox">
- <audioModule :showAudioPop.sync="showAudioPop" />
- </view>
- </view>
- </template>
- <script>
- import { Mine, Report, Home, User, Chart, purchaserApi } from "@/config/api.js";
- import RoadshowItem from "@/components/ItemComponent/roadshowItem.vue";
- import freeCharge from "@/components/freeCharge";
- import ChartItem from "@/components/ItemComponent/chartItem.vue";
- import audioModule from "@/components/audioModule/index";
- export default {
- data() {
- return {
- page_no: 1,
- pageSize: 10,
- collectList: [],
- videoAudioList: [],
- status: "loadmore",
- totalPage: "",
- loadText: {
- loadmore: "上拉加载更多",
- loading: "加载中",
- nomore: "已经到底了",
- },
- haveData: true, //是否有数据
- refresh: false, //正在下拉
- tabsList: [
- { name: "报告", id: 1 },
- { name: "微路演", id: 2 },
- { name: "图表", id: 3 },
- ],
- tabsActive: 1,
- showAudioPop:false
- };
- },
- onLoad() {
- uni.hideShareMenu();
- this.getCollectList();
- },
- components: {
- freeCharge,
- RoadshowItem,
- ChartItem,
- audioModule
- },
- methods: {
- /* 获取列表 */
- async getCollectList() {
- const res =
- this.tabsActive == 1
- ? await Mine.getCollect({
- PageSize: this.pageSize,
- CurrentIndex: this.page_no,
- })
- : this.tabsActive == 3
- ? await Chart.getChartcollection({
- PageSize: this.pageSize,
- CurrentIndex: this.pageNum,
- })
- : this.getrroadshowList();
- if (res.Ret === 200) {
- this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
- this.totalPage = res.Data.Paging.Pages; //总页数
- 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);
- }
- }
- },
- async getrroadshowList() {
- const res = await User.getListMicroRoadshow();
- if (res.Ret === 200) {
- this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
- this.totalPage = res.Data.Paging.Pages; //总页数
- 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);
- }
- }
- },
- // 去往文章详情页面
- goDetailReport(item) {
- if (item.IsSpecial == 1) {
- uni.navigateTo({ url: "/pages-purchaser/noteAndViewpoint/noteAndViewpoint?id=" + item.ArticleId });
- return;
- }
- if (item.IsRoadShow) {
- //跳转路演精华
- uni.navigateTo({
- url: "/reportPages/roadEssence/roadEssence?id=" + item.ArticleId,
- });
- } else {
- uni.navigateTo({ url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId });
- }
- },
- // 去往主题详情
- themeDetails(item, val) {
- if (item.IsSpecial == 1) return;
- if (item.Source === 1) {
- //非严选
- uni.navigateTo({ url: "/reportPages/IndustryReport/IndustryReport?id=" + val.IndustrialManagementId });
- } else {
- //严选
- uni.navigateTo({ url: "/reportPages/researchTheme/researchTheme?id=" + val.IndustrialManagementId });
- }
- },
- // 收藏
- async collectClick(item) {
- const res =
- item.IsSpecial == 1
- ? await purchaserApi.yanxuanSpecialCollect({
- Id: item.ArticleId,
- Status: item.IsCollect ? 2 : 1,
- })
- : await Report.collectRpt({ ArticleId: item.ArticleId });
- 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,
- });
- }
- },
- // 点击top tabs
- handleClickTopSub(item) {
- this.tabsActive = item.id;
- this.page_no = 1;
- this.collectList = [];
- this.getCollectList();
- },
- // 微路演收藏
- async isCollectionHandeler(item) {
- await this.$store.dispatch("showLoginModal");
- const res = await Home.microRoadshowCollect({
- SourceId: item.SourceId,
- SourceType: item.Type,
- PageRouter: this.$store.state.pageRouterReport,
- });
- if (res.Ret === 200) {
- let index = this.collectList.findIndex((key) => key.SourceId == item.SourceId && key.Type == item.Type);
- this.collectList.splice(index, 1);
- uni.showToast({
- title: res.Msg,
- duration: 2000,
- });
- }
- },
- //我的收藏的删除
- myChartCollect(id) {
- uni.showModal({
- content: "确认要将该图表移除我的收藏吗?",
- confirmColor: "#376cbb",
- cancelColor: "#606266",
- success: async (res) => {
- if (res.confirm) {
- const res = await Chart.myChartCollect({
- ChartId: id,
- });
- if (res.Ret === 200) {
- this.page_no = 1;
- this.getCollectList();
- this.$util.toast("已取消收藏");
- }
- }
- },
- });
- },
- //我的收藏 置顶
- async myChartIsTop(id) {
- const res = await Chart.myChartTop({
- ChartId: id,
- });
- if (res.Ret === 200) {
- this.page_no = 1;
- this.getCollectList();
- this.$util.toast(res.Msg);
- }
- },
- },
- computed: {
- curVoiceId() {
- //当前正在播放的音频id
- return this.$store.state.audioBg.indexId;
- },
- curAudioPaused() {
- //当前音频是否暂停状态
- return this.$store.state.audioBg.paused;
- },
- showAudioBox() {
- return this.$store.state.audioBg.parseIntShow;
- },
- },
- onShow() {
- this.$store.commit("audioBg/parseIntAudio", true);
- this.$store.commit("setRouterReport", "收藏");
- },
- onHide() {
- this.$store.commit("audioBg/parseIntAudio", false);
- this.curVideoId = 0;
- },
- /* 触底 */
- onReachBottom() {
- if (this.status === "nomore") return;
- this.status = "loading";
- this.page_no++;
- this.getCollectList();
- },
- /* 下拉刷新 */
- onPullDownRefresh() {
- this.page_no = 1;
- this.refresh = true;
- this.getCollectList();
- },
- /** 用户点击分享*/
- onShareAppMessage: function ({ from, target }) {
- if (from === "button") {
- let item = target.dataset.item;
- let audio_id = item.Type == 1 || item.AudioType == 1 ? item.Id : "";
- // type=2 -- 活动视频 type=3 -- 产业视频
- let video_id = item.Type == 2 || item.Type == 3 ? item.Id : "";
- let activity_id = item.Type == 2 && item.ActivityId > 0 ? item.ActivityId : "";
- let title_share = item.AudioTitle || item.Title;
- this.getRecordTracking("我的收藏转发", { ActivityId: item.ActivityId, Id: item.Id, Type: item.Type });
- return {
- title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : title_share,
- path: "/pages/material/material?topTabsActive=4" + "&audioShareId=" + audio_id + "&videoShareId=" + video_id + "&activityId=" + activity_id,
- imageUrl: item.AudioShareImg || item.ShareImg,
- };
- }
- },
- };
- </script>
- <style lang="scss">
- .myCollection-container {
- background-color: $uni-bg-color;
- .top-tabs {
- .item {
- flex: 1;
- }
- }
- .collect-ul {
- padding: 4rpx 25rpx 20rpx;
- .content-item {
- background-color: #fff;
- margin-top: 20rpx;
- padding: 35rpx 20rpx 0;
- border-top: 4rpx solid #376cbb;
- .title-content-box {
- display: flex;
- .tag {
- width: 126rpx;
- height: 42rpx;
- color: #928563;
- font-size: 24rpx;
- font-weight: 500;
- border-radius: 38rpx;
- background-color: #f2e8cc;
- flex-shrink: 0;
- margin-right: 10rpx;
- }
- }
- .item-title {
- font-weight: 500;
- position: relative;
- .item-industry {
- font-size: 28rpx;
- text-indent: 0;
- margin-left: 10rpx;
- color: $uni-color-new;
- display: inline-block;
- }
- }
- .item-user {
- display: flex;
- align-items: center;
- color: #999999;
- font-size: 28rpx;
- margin-bottom: 20rpx;
- image {
- width: 23rpx;
- height: 26rpx;
- margin-right: 20rpx;
- }
- }
- .item-more {
- display: flex;
- justify-content: space-between;
- color: #cecece;
- margin: 20rpx 0 0;
- padding-bottom: 30rpx;
- }
- }
- }
- .audio-video-content {
- display: flex;
- flex-wrap: wrap;
- justify-content: space-between;
- padding-top: 20rpx;
- .audio-item {
- width: 49%;
- }
- }
- .chart-ul {
- display: flex;
- flex-wrap: wrap;
- padding-top: 20rpx;
- justify-content: space-between;
- }
- }
- </style>
|