123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621 |
- <template>
- <view class="container resear-container">
- <view class="nav-bar-wrap" :style="{ height: navBarStyle.height, paddingTop: navBarStyle.paddingTop, paddingBottom: navBarStyle.paddingBottom }">
- <view class="content" @click="goSearch">
- <icon type="search" size="15" class="search_ico" />
- <text class="sea_ipt"> {{ searchPlaceholderList.YanXuanSearch || "" }}</text>
- </view>
- </view>
- <view class="notice-content" v-if="wholeShowListData.YanXuan_Explain">
- <view class="notice">
- <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/placard_icon.png"></image>
- <view class="notice-bar">
- <van-notice-bar color="#3385FF" background="#DFECFF" text="买方研选内容试行阶段,限时免费。也欢迎您向我们提宝贵建议。" />
- </view>
- </view>
- </view>
- <view class="theme">
- <view class="theme-top">
- <text class="title"> 近期更新主题: </text>
- <view class="" @click="goRecent">
- 更多
- <u-icon name="arrow-right" color="#BDBDBD" size="28"></u-icon>
- </view>
- </view>
- <view class="theme-content">
- <view class="theme-ul" v-for="item in themeNewList" :key="item.IndustrialManagementId">
- <text class="text_oneLine" @click="themeDetails(item, '近期主题更新')"> # {{ item.IndustryName }}</text>
- <image v-if="item.IsHot" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/hot_report.png"></image>
- </view>
- </view>
- </view>
- <view class="announcement">
- <view class="tab-cont">
- <scroll-view scroll-x="true" @scroll="scrollMove" :scroll-left="scrollLeft" scroll-with-animation class="scroll-tab" :scroll-into-view="'_' + tabIndex">
- <block v-for="(item, index) in tabBars" :key="index">
- <view class="scroll-tab-item" :class="{ active: tagActive == item.name }" @click.stop="typeChange(item)">
- {{ item.titel }}
- <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/border_act.png" mode="" class="border_act" v-if="tagActive == item.name"></image>
- </view>
- </block>
- </scroll-view>
- </view>
- <view class="content-ul" v-if="collectionList.length && tagActive == '用户'">
- <view class="user-li" v-for="(item, index) in collectionList" :key="item.ArticleId">
- <view class="li-item">
- <text class="li-serial" :style="{ background: serialBackground(index) }">
- {{ index + 1 }}
- </text>
- <view>
- <text @click="goDetail(item)" style="display: inline">{{ item.Title }}</text>
- <text class="li-industry" @click="themeDetails(item, '月度收藏榜')"> # {{ item.IndustryName }} </text>
- </view>
- </view>
- <view class="li-item li-bottom" style="color: #999999">
- <view class="li-user text_oneLine" @click="authorDetails(item)">
- <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/user_report.png"></image>
- {{ item.NickName }}
- </view>
- <view class="li-item user-img">
- <view class="img-box">
- <image class="user-pv" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/examine_icon.png"></image>
- <text>
- {{ item.Pv }}
- </text>
- </view>
- <view class="img-box" @click="collectClick(item)">
- <image v-if="item.IsCollect" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_act.png"></image>
- <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_ico.png"></image>
- <text class=""> {{ item.CollectNum }}人收藏 </text>
- </view>
- </view>
- </view>
- </view>
- </view>
- <view class="content-ul" v-if="hotList.length && tagActive == '主题'">
- <view class="hot-li" v-for="(item, index) in hotList" :key="item.IndustrialManagementId">
- <view class="li-item hot-item">
- <view style="display: flex" class="text_oneLine hot-new" @click="themeDetails(item, '主题热度榜')">
- <text class="li-serial serial-number" :style="{ background: serialBackground(index) }">
- {{ index + 1 }}
- </text>
- <text class="text_oneLine" style="display: inline"> # {{ item.IndustryName }} </text>
- <image class="new-img" v-if="item.IsNew" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/new_report.png"></image>
- </view>
- <text :class="item.IsFollw ? 'cancel-attention' : 'attention'" @click="isAttention(item, '主题')">{{ item.IsFollw ? "取消关注" : "+ 关注" }}</text>
- </view>
- <view class="li-item read-more" @click="themeDetails(item, '主题热度榜')">
- <text class="text-box text_oneLine" v-for="val in item.IndustrialSubjectList" :key="val.IndustrialSubjectId">
- {{ val.SubjectName }}
- </text>
- </view>
- </view>
- </view>
- <view class="content-ul" v-if="kolList.length && tagActive == '专家'">
- <view class="kol-li" v-for="(item, index) in kolList" :key="item.DepartmentId">
- <text class="li-serial serial-number" :style="{ background: serialBackground(index) }">
- {{ index + 1 }}
- </text>
- <image @click="authorDetails(item)" :src="item.ImgUrl" v-if="item.ImgUrl"></image>
- <view class="li-item kol-item">
- <view class="item-top">
- <text @click="authorDetails(item)">
- {{ item.NickName }}
- </text>
- <text :class="item.IsFollw ? 'cancel-attention' : 'attention'" @click="isAttention(item, '专家')">{{ item.IsFollw ? "取消关注" : "+ 关注" }}</text>
- </view>
- <text @click="themeDetails(val, 'KOL榜')" class="kol-text text_oneLine" v-for="val in item.List" :key="val.IndustrialManagementId"> # {{ val.IndustryName }} </text>
- </view>
- </view>
- </view>
- </view>
- <view class="content-bottom">最新榜单您已掌握,明天再刷刷看~</view>
- <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
- <u-modal
- v-model="goFollowShow"
- :content-style="{ fontSize: '32rpx' }"
- @confirm="goFollowShowBtn"
- :show-cancel-button="isCancelBtn"
- :confirm-text="confirmText"
- @cancel="isCancelBtn = false"
- :show-title="false"
- :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
- :confirm-style="{ fontWeight: '700' }"
- >
- <view class="slot-content">
- <rich-text :nodes="accounts"></rich-text>
- </view>
- </u-modal>
- </view>
- </template>
- <script>
- import { Reports, Research, Report } from "@/config/api.js";
- import freeCharge from "@/components/freeCharge";
- import { Throttle } from "@/config/util.js";
- export default {
- components: { freeCharge },
- data() {
- return {
- themeNewList: [],
- tagActive: "用户",
- collectionList: [], //用户收藏
- hotList: [],
- kolList: [],
- tabBars: [
- { titel: "月度收藏榜", name: "用户" },
- { titel: "主题热度榜", name: "主题" },
- { titel: "KOL榜", name: "专家" },
- ],
- confirmText: "知道了",
- accounts: "",
- isCancelBtn: false,
- goFollowShow: false,
- };
- },
- mounted() {
- // 处理数据 列表同步详情
- uni.$on("updateFllowTheme", (data) => {
- this.hotList.forEach((item) => {
- if (item.IndustrialManagementId == data.id) {
- item.IsFollw = data.isFollw;
- }
- });
- });
- // 处理数据 列表同步详情
- uni.$on("updateFllowAuthor", (data) => {
- this.kolList.forEach((item) => {
- if (item.DepartmentId == data.id) {
- item.IsFollw = data.isFollw;
- }
- });
- });
- },
- watch: {
- tagActive: {
- handler(val) {
- val == "用户" ? this.researchCollectionList() : val == "主题" ? this.researchHotList() : this.researchKolList();
- },
- immediate: true,
- },
- },
- methods: {
- //获取胶囊位置
- initNavBar() {
- let menuButtonInfo = uni.getMenuButtonBoundingClientRect();
- this.navBarStyle = {
- height: menuButtonInfo.height + menuButtonInfo.top + 20 + "px",
- paddingTop: menuButtonInfo.top + "px",
- paddingBottom: "4px",
- };
- },
- //近期更新主题
- async researchNewList() {
- const res = await Research.researchNewList({ ChartPermissionId: 31 });
- if (res.Ret === 200) {
- this.themeNewList = res.Data.List || [];
- }
- },
- //用户收藏榜
- async researchCollectionList() {
- const res = await Research.researchCollectionList({ ChartPermissionId: 31 });
- if (res.Ret === 200) {
- this.collectionList = res.Data.List || [];
- }
- },
- //主题热度/近期更新更多
- async researchHotList() {
- const res = await Research.researchHotList({ ChartPermissionId: 31, ThemeType: 1 });
- if (res.Ret === 200) {
- this.hotList = res.Data.List || [];
- }
- },
- //KOL榜列表接口
- async researchKolList() {
- const res = await Research.researchKolList({ ChartPermissionId: 31 });
- if (res.Ret === 200) {
- this.kolList = res.Data.List || [];
- }
- },
- //tabs切换
- typeChange(item) {
- this.tagActive = item.name;
- },
- //关注
- async isAttention(item, val) {
- const res =
- val === "主题"
- ? await Reports.reportFllow({ IndustrialManagementId: item.IndustrialManagementId, PageRouter: this.$store.state.pageRouterReport })
- : await Reports.reportFllowDepartment({ DepartmentId: item.DepartmentId });
- if (res.Ret === 200) {
- item.IsFollw = !item.IsFollw;
- if (res.Data.Status == 1) {
- this.goFollowShow = true;
- this.confirmText = res.Data.GoFollow ? "去关注" : "知道了";
- if (res.Data.GoFollow) {
- this.accounts = `${val == "主题" ? "产业" : "作者"}关注成功 <br> 想要及时获取该${val === "主题" ? "产业内容的更新推送" : "作者的报告更新提示"},请关注【查研观向小助手】公众号`;
- this.isCancelBtn = true;
- } else {
- this.accounts = `${val == "主题" ? "产业" : "作者"}` + `关注成功<br>请关注【查研观向小助手】公众号,及时获取${val === "主题" ? "产业" : "作者"}报告更新提醒`;
- }
- } else {
- uni.showToast({
- title: "已取消关注",
- icon: "none",
- duration: 2000,
- });
- }
- }
- },
- //去关注
- goFollowShowBtn() {
- if (this.confirmText == "去关注") {
- uni.navigateTo({
- url: "/activityPages/accountsOfficial/accountsOfficial",
- });
- }
- this.goFollowShow = false;
- },
- //去往更多主题
- goRecent() {
- uni.navigateTo({
- url: "/reportPages/recentPages/recentPages?id=31",
- });
- },
- //收藏
- async collectClick(item) {
- const res = 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,
- });
- }
- },
- //去往作者详情
- authorDetails(item) {
- uni.navigateTo({
- url: "/reportPages/authorPages/authorPages?id=" + item.DepartmentId,
- });
- },
- //去往文章详情页面
- goDetail(item) {
- this.$store.dispatch("checkHandle", "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId);
- },
- //去往主题详情
- themeDetails(item, source) {
- this.$store.dispatch("checkHandle", "/reportPages/researchTheme/researchTheme?id=" + item.IndustrialManagementId + "&pageRouter=" + source);
- },
- //计算遍历的颜色
- serialBackground(index) {
- index += 1;
- return index == 1 ? "#D7584F" : index == 2 ? "#E98033" : index == 3 ? "#FDD367" : "#D3D3D3";
- },
- /* 搜索 */
- async goSearch() {
- await this.$store.dispatch("checkHandle", "/pages-search/indedxSearch/indedxSearch?id=研选" + "&source=买方研选页面");
- },
- },
- onLoad() {
- this.researchNewList();
- this.initNavBar();
- },
- onShow() {
- this.$store.commit("setRouterReport", "买方研选");
- this.getRecordTracking("买方研选");
- },
- /* 下拉刷新 */
- onPullDownRefresh: Throttle(function () {
- wx.stopPullDownRefresh();
- }),
- /**
- * 用户点击分享
- */
- onShareAppMessage: function (res) {
- return {
- title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "买方研选",
- path: "pages/purchaser/purchaser",
- success: (res) => {},
- fail: (err) => {},
- };
- },
- };
- </script>
- <style lang="scss">
- .nav-bar-wrap {
- background-color: #fff;
- color: #fff;
- position: sticky;
- top: 0;
- left: 0;
- width: 100%;
- z-index: 999;
- padding-left: 30rpx;
- .content {
- position: relative;
- display: flex;
- align-items: center;
- width: 70%;
- height: 63rpx;
- font-size: 30rpx;
- color: #8d8d8d;
- background-color: #f3f3f3;
- padding-left: 33rpx;
- border-radius: 70rpx;
- // border: 1rpx solid #e5e5e5;
- .sea_ipt {
- padding-left: 15rpx;
- }
- }
- }
- </style>
- <style lang="scss">
- .resear-container {
- background-color: #f7f7f7;
- .notice-content {
- position: sticky;
- left: 0;
- top: 200rpx;
- z-index: 99;
- width: 100%;
- background-color: #fff;
- padding-bottom: 20rpx;
- }
- .notice {
- height: 56rpx;
- overflow: hidden;
- background-color: #dfecff;
- display: flex;
- align-items: center;
- padding-left: 30rpx;
- image {
- width: 30rpx;
- height: 30rpx;
- }
- .notice-bar {
- flex: 1;
- }
- .van-notice-bar {
- height: 56rpx;
- }
- }
- .theme {
- margin-top: 4rpx;
- background-color: #fff;
- padding: 0 30rpx 15rpx;
- margin-bottom: 8rpx;
- .theme-top {
- display: flex;
- color: #999999;
- align-items: center;
- font-size: 28rpx;
- height: 95rpx;
- justify-content: space-between;
- .title {
- color: #333;
- font-size: 32rpx;
- font-weight: 500;
- }
- }
- .theme-content {
- display: flex;
- flex-wrap: wrap;
- .theme-ul {
- width: 50%;
- display: flex;
- align-items: center;
- padding-right: 15rpx;
- line-height: 59rpx;
- image {
- width: 26rpx;
- height: 28rpx;
- margin-left: 8rpx;
- flex-shrink: 0;
- }
- }
- }
- }
- .content-ul {
- margin: 20rpx 0 0;
- border-top: 1px solid #f6f6f6;
- .user-li,
- .hot-li,
- .kol-li {
- padding: 30rpx 0 20rpx;
- border-bottom: 1px solid #f6f6f6;
- }
- .user-img {
- width: 40%;
- justify-content: space-between;
- .img-box {
- display: flex;
- align-items: center;
- }
- .user-pv {
- width: 21rpx;
- height: 16rpx;
- }
- }
- .kol-li {
- display: flex;
- align-items: center;
- padding-bottom: 30rpx;
- image {
- width: 120rpx;
- height: 120rpx;
- border-radius: 8rpx;
- margin: 0 20rpx 0 15rpx;
- overflow: hidden;
- flex-shrink: 0;
- }
- }
- .kol-item {
- display: flex;
- flex-wrap: wrap;
- width: 480rpx;
- height: 120rpx;
- align-items: baseline;
- margin-bottom: 20rpx;
- .item-top {
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: space-between;
- font-size: 29rpx;
- font-weight: 700;
- }
- .kol-text {
- width: 50%;
- margin-top: 10rpx;
- flex-shrink: 0;
- }
- }
- .li-serial {
- width: 26rpx;
- height: 26rpx;
- line-height: 26rpx;
- color: #fff;
- font-size: 20rpx;
- text-align: center;
- border-radius: 4rpx 4rpx 4rpx 4rpx;
- margin: 7rpx 10rpx 0 20rpx;
- flex-shrink: 0;
- }
- .serial-number {
- margin-top: 0 !important;
- }
- .li-item {
- display: flex;
- .li-industry {
- color: #3385ff;
- margin-left: 20rpx;
- display: inline-block;
- }
- .li-user {
- margin-left: 46rpx;
- }
- .li-title {
- display: flex;
- }
- }
- .li-bottom {
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-top: 30rpx;
- width: 100%;
- image {
- width: 23rpx;
- height: 26rpx;
- margin-right: 10rpx;
- }
- }
- .read-more {
- margin-left: 30rpx;
- margin-top: 20rpx;
- display: flex;
- flex-wrap: wrap;
- .text-box {
- margin-bottom: 27rpx;
- margin-right: 40rpx;
- padding: 0;
- font-size: 24rpx;
- color: #408fff;
- width: 170rpx;
- height: 46rpx;
- line-height: 46rpx;
- text-align: center !important;
- background: url(~@/static/img/report_bg.png) no-repeat;
- background-size: 100% 100%;
- text-indent: 0em;
- }
- }
- .attention {
- flex-shrink: 0;
- padding: 5rpx 28rpx;
- border-radius: 37rpx 37rpx 37rpx 37rpx;
- color: #fff;
- background: #3385ff;
- font-weight: 400;
- font-size: 24rpx;
- }
- .hot-item {
- justify-content: space-between;
- align-items: center;
- .hot-new {
- align-items: center;
- flex: 1;
- padding-right: 20rpx;
- }
- .new-img {
- width: 60rpx;
- height: 30rpx;
- margin-left: 15rpx;
- flex-shrink: 0;
- }
- }
- }
- .announcement {
- background: #fff;
- padding: 0 30rpx;
- .tab-cont {
- height: 115rpx;
- background-color: #fff;
- font-size: 32rpx;
- .scroll-tab {
- position: relative;
- width: 100%;
- white-space: nowrap;
- display: flex;
- justify-content: space-around;
- }
- .scroll-tab-item {
- text-align: center;
- display: inline-block;
- padding: 32rpx 8rpx 30rpx 8rpx;
- border-bottom: 8rpx solid transparent;
- margin-right: 60rpx;
- position: relative;
- color: #999999;
- font-size: 32rpx;
- &:last-child {
- margin-right: 0;
- }
- &.active {
- border-bottom: none;
- color: #333;
- font-weight: 500;
- }
- .border_act {
- width: 80%;
- height: 8rpx;
- position: absolute;
- bottom: 0;
- left: 50%;
- transform: translateX(-50%);
- }
- }
- }
- }
- .content-bottom {
- background-color: #fff;
- text-align: center;
- line-height: 100rpx;
- color: #c4c4c4;
- font-size: 20rpx;
- }
- }
- </style>
|