hotList.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. <template>
  2. <view class="container container-hot-list">
  3. <is-track-follow />
  4. <view class="top-content">
  5. <view class="tab-content">
  6. <view v-for="item in tabList" :key="item.Source" :class="['item', tabsActive == item.Source && 'tab-active']" @click="tabsHandler(item)">
  7. {{ item.Name }}
  8. <image v-if="tabsActive == item.Source" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/border_act.png"></image>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="content">
  13. <view class="content-ul" v-if="hotList.length && tabsActive == 1">
  14. <view class="hot-li" v-for="(item, index) in hotList" :key="item.IndustrialManagementId">
  15. <view class="li-item hot-item">
  16. <view style="display: flex" class="text_oneLine hot-new" @click="themeDetails(item)">
  17. <text class="li-serial serial-number" :style="{ background: serialBackground(index) }">
  18. {{ index + 1 }}
  19. </text>
  20. <text class="title-text text_oneLine" style="display: inline"> # {{ item.IndustryName }} </text>
  21. <view class="industry-color" :style="[classifyColor(item.PermissionName)]">{{ item.PermissionName }}</view>
  22. <image class="new-img" v-if="item.IsNew" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/new_icon.png"></image>
  23. </view>
  24. <text :class="item.IsFollow ? 'cancel-attention' : 'attention'" @click="isAttention(item, '主题')">{{ item.IsFollow ? "取消关注" : "+ 关注" }}</text>
  25. </view>
  26. <view class="li-item read-more">
  27. <view class="industry-video-item" @click.stop="handelVideoPlay(item)" :style="{ 'background-image': 'url(' + item.IndustryVideo.BackgroundImg + ')' }" v-if="item.IndustryVideo">
  28. 5min
  29. <br />
  30. 逻辑解析
  31. <view class="industry-video-icon">
  32. <image src="https://hzstatic.hzinsights.com/cygx/video-right-top-icon.svg"></image>
  33. </view>
  34. </view>
  35. <block v-if="item.IndustrialSubjectList">
  36. <view v-if="item.IndustryVideo" style="display: flex; flex-wrap: wrap; width: 420rpx">
  37. <view v-for="val in item.IndustrialSubjectList.slice(0, 4)" :key="val.IndustrialSubjectId" class="text-box">{{ val.SubjectName }}</view>
  38. </view>
  39. <block v-if="item.IndustryVideo && item.IndustrialSubjectList.length > 4">
  40. <view v-for="val in item.IndustrialSubjectList.slice(4)" :key="val.IndustrialSubjectId" class="text-box">{{ val.SubjectName }}</view>
  41. </block>
  42. <block v-if="!item.IndustryVideo">
  43. <view v-for="val in item.IndustrialSubjectList" :key="val.IndustrialSubjectId" class="text-box">{{ val.SubjectName }}</view>
  44. </block>
  45. </block>
  46. </view>
  47. </view>
  48. </view>
  49. <view class="content-ul" v-if="kolList.length && tabsActive != 1">
  50. <view class="user-li" v-for="(item, index) in kolList" :key="item.ArticleId">
  51. <view class="li-item">
  52. <text class="li-serial" :style="{ background: serialBackground(index) }">
  53. {{ index + 1 }}
  54. </text>
  55. <view>
  56. <text @click="goDetail(item)" style="display: inline; margin-right: 20rpx">{{ item.Title }}</text>
  57. <text class="li-industry" @click="themeDetails(key)" v-for="key in item.List" :key="key.IndustrialManagementId"> # {{ key.IndustryName }} </text>
  58. </view>
  59. </view>
  60. <view class="li-item li-bottom" style="color: #999999">
  61. <view class="li-user text_oneLine">
  62. {{ item.PublishDate }}
  63. <view class="industry-color" :style="[classifyColor(item.PermissionName)]">{{ item.PermissionName }}</view>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. </view>
  69. <view class="content-bottom">最新榜单您已掌握,明天再刷刷看~</view>
  70. <u-modal
  71. v-model="goFollowShow"
  72. :content-style="{ fontSize: '32rpx' }"
  73. @confirm="goFollowShowBtn"
  74. :show-cancel-button="isCancelBtn"
  75. :confirm-text="confirmText"
  76. @cancel="isCancelBtn = false"
  77. :show-title="false"
  78. :cancel-style="{ borderRight: '1rpx solid #EBEBEB' }"
  79. :confirm-style="{ fontWeight: '700' }"
  80. >
  81. <view class="slot-content">
  82. <rich-text :nodes="accounts"></rich-text>
  83. </view>
  84. </u-modal>
  85. <videoModule :showVideoPop="showVideoPop" :videoPopList="videoPopList" />
  86. <modalDialog :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow" :jurisdictionList="jurisdictionList" :hasPermission="hasPermission" />
  87. </view>
  88. </template>
  89. <script>
  90. import { Reports } from "@/config/api.js";
  91. import { color_word_bg } from "@/utils/styleClassify";
  92. import videoModule from "@/components/videoModule/index";
  93. import modalDialog from "@/components/modalDialog.vue";
  94. import IsTrackFollow from '@/components/isTrackFollow.vue';
  95. export default {
  96. data() {
  97. return {
  98. tabList: [], //tab
  99. tabsActive: 1,
  100. hotList: [],
  101. kolList: [],
  102. confirmText: "知道了",
  103. accounts: "",
  104. isCancelBtn: false,
  105. goFollowShow: false,
  106. showVideoPop: false, //视频弹窗显示控制
  107. videoPopList: {}, // 视频信息
  108. isShowhasPermission: false, // 联系销售的提交申请
  109. applyForIsShow: false, // 提交申请
  110. jurisdictionList: {},
  111. hasPermission: "", //权限
  112. labelListData: [],
  113. };
  114. },
  115. components: { modalDialog, videoModule,IsTrackFollow },
  116. methods: {
  117. /* 获取tab*/
  118. async getTabList() {
  119. const res = await Reports.getHotTableList();
  120. if (res.Ret === 200) {
  121. this.tabList = res.Data.List || [];
  122. this.tabsActive = this.tabList.length ? this.tabList[0].Source : 1;
  123. this.researchHotList();
  124. }
  125. },
  126. /* 点击一级的tabs*/
  127. tabsHandler(item) {
  128. this.tabsActive = item.Source;
  129. this.$store.commit("setRouterReport", item.Name);
  130. this.listInit();
  131. this.researchHotList();
  132. },
  133. //产业关注 阅读、报告收藏
  134. async researchHotList() {
  135. const res = this.tabsActive == 1 ? await Reports.getIndustryFllowList() : await Reports.getIndustryReadList({ Source: this.tabsActive });
  136. if (res.Ret === 200) {
  137. if (this.tabsActive == 1) {
  138. this.hotList = res.Data.List || [];
  139. } else {
  140. this.kolList = res.Data.List || [];
  141. }
  142. }
  143. },
  144. listInit() {
  145. if (this.tabsActive == 1) {
  146. this.hotList = [];
  147. } else {
  148. this.kolList = [];
  149. }
  150. },
  151. //去往作者详情
  152. authorDetails(item) {
  153. uni.navigateTo({
  154. url: "/reportPages/authorPages/authorPages?id=" + item.DepartmentId,
  155. });
  156. },
  157. //去往主题详情
  158. themeDetails(item) {
  159. this.$store.dispatch("checkHandle", "/reportPages/IndustryReport/IndustryReport?id=" + item.IndustrialManagementId);
  160. },
  161. //计算遍历的颜色
  162. serialBackground(index) {
  163. index += 1;
  164. return index == 1 ? "#D7584F" : index == 2 ? "#E98033" : index == 3 ? "#FDD367" : "#D3D3D3";
  165. },
  166. //关注
  167. async isAttention(item, val) {
  168. const res =
  169. val === "主题"
  170. ? await Reports.reportFllow({ IndustrialManagementId: item.IndustrialManagementId, PageRouter: "榜单产业关注榜" })
  171. : await Reports.reportFllowDepartment({ DepartmentId: item.DepartmentId });
  172. if (res.Ret === 200) {
  173. item.IsFollow = !item.IsFollow;
  174. if (res.Data.Status == 1) {
  175. this.goFollowShow = true;
  176. this.confirmText = res.Data.GoFollow ? "去关注" : "知道了";
  177. if (res.Data.GoFollow) {
  178. this.accounts = `${val == "主题" ? "产业" : "作者"}关注成功 <br> 想要及时获取该${val === "主题" ? "产业内容的更新推送" : "作者的报告更新提示"},请关注【查研观向小助手】公众号`;
  179. this.isCancelBtn = true;
  180. } else {
  181. this.accounts = `${val == "主题" ? "产业" : "作者"}` + `关注成功<br>请关注【查研观向小助手】公众号,及时获取${val === "主题" ? "产业" : "作者"}报告更新提醒`;
  182. }
  183. } else {
  184. uni.showToast({
  185. title: "已取消关注",
  186. icon: "none",
  187. duration: 2000,
  188. });
  189. }
  190. }
  191. },
  192. //去关注
  193. goFollowShowBtn() {
  194. if (this.confirmText == "去关注") {
  195. uni.navigateTo({
  196. url: "/activityPages/accountsOfficial/accountsOfficial",
  197. });
  198. }
  199. this.goFollowShow = false;
  200. },
  201. goDetail(item) {
  202. uni.navigateTo({
  203. url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
  204. });
  205. },
  206. // 视频播放权限判断
  207. handelVideoPlay(item) {
  208. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  209. if (item.AuthInfo.HasPermission == 1) {
  210. this.playVideo(item);
  211. } else {
  212. this.hasPermission = item.AuthInfo.HasPermission;
  213. this.jurisdictionList.ActivityId = item.IndustryVideo.Id;
  214. this.jurisdictionList.isAudioVideo = 3;
  215. if (this.hasPermission == 2) {
  216. this.jurisdictionList.SellerMobile = item.AuthInfo.SellerMobile;
  217. this.jurisdictionList.SellerName = item.AuthInfo.SellerName;
  218. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  219. this.isShowhasPermission = true;
  220. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  221. this.jurisdictionList.PopupMsg = item.AuthInfo.PopupMsg;
  222. this.applyForIsShow = true;
  223. }
  224. }
  225. } else {
  226. this.$store.dispatch("checkHandle");
  227. }
  228. },
  229. playVideo(item) {
  230. let params = {
  231. Id: item.IndustryVideo.Id,
  232. ResourceUrl: item.IndustryVideo.ResourceUrl,
  233. BackgroundImg: item.IndustryVideo.BackgroundImg,
  234. Title: `5min【${item.IndustryName}】逻辑解析`,
  235. };
  236. if (this.$store.state.videoPlay.playVideoId != item.Id) {
  237. this.$store.commit("videoPlay/palyTimeUpdate", 0);
  238. this.$store.commit("videoPlay/playVideo", item.Id);
  239. }
  240. this.globalBgAudioManager.stop();
  241. this.videoPopList = params;
  242. this.showVideoPop = true;
  243. },
  244. classifyColor(item) {
  245. let text_color = color_word_bg.color_word.find((key) => key.name == item).color;
  246. let back_ground = color_word_bg.color_bg.find((key) => key.name == item).color;
  247. let _isColor = { color: text_color, border: ` 1px solid ${text_color}`, "background-color": back_ground };
  248. return _isColor;
  249. },
  250. },
  251. onLoad() {
  252. this.$store.commit("setRouterReport", '产业关注榜');
  253. this.getTabList();
  254. },
  255. };
  256. </script>
  257. <style lang="scss" scoped>
  258. .container-hot-list {
  259. padding: 30rpx;
  260. .top-content {
  261. position: sticky;
  262. top: -1rpx;
  263. left: 0;
  264. z-index: 99;
  265. background-color: #fff;
  266. padding-bottom: 10rpx;
  267. }
  268. .tab-content {
  269. display: flex;
  270. .item {
  271. position: relative;
  272. display: inline-block;
  273. padding-bottom: 10rpx;
  274. font-size: 32rpx;
  275. color: #999999;
  276. margin-right: 50rpx;
  277. font-weight: 400;
  278. image {
  279. position: absolute;
  280. bottom: 0;
  281. left: 50%;
  282. transform: translateX(-50%);
  283. width: 100rpx;
  284. height: 4rpx;
  285. }
  286. }
  287. .tab-active {
  288. color: #333333;
  289. font-weight: 500;
  290. }
  291. }
  292. .children-tabs {
  293. margin-top: 30rpx;
  294. width: 100%;
  295. display: flex;
  296. overflow: hidden;
  297. overflow-x: auto;
  298. .children-item {
  299. padding: 10rpx 20rpx;
  300. background: #f9f9f9;
  301. border-radius: 4px;
  302. margin-right: 40rpx;
  303. }
  304. .children-tab-active {
  305. background-color: #3385ff;
  306. color: #fff;
  307. }
  308. }
  309. .content-ul {
  310. margin: 20rpx 0 0;
  311. border-top: 1px solid #f6f6f6;
  312. .user-li,
  313. .hot-li {
  314. padding: 30rpx 0 20rpx;
  315. border-bottom: 1px solid #f6f6f6;
  316. }
  317. .li-serial {
  318. width: 26rpx;
  319. height: 26rpx;
  320. line-height: 26rpx;
  321. color: #fff;
  322. font-size: 20rpx;
  323. text-align: center;
  324. border-radius: 4rpx 4rpx 4rpx 4rpx;
  325. margin: 7rpx 10rpx 0 20rpx;
  326. flex-shrink: 0;
  327. }
  328. .serial-number {
  329. margin-top: 0 !important;
  330. }
  331. .li-item {
  332. display: flex;
  333. .li-industry {
  334. color: #3385ff;
  335. margin-right: 20rpx;
  336. display: inline-block;
  337. }
  338. .li-user {
  339. margin-left: 46rpx;
  340. display: flex;
  341. align-items: center;
  342. }
  343. .li-title {
  344. display: flex;
  345. }
  346. }
  347. .li-bottom {
  348. display: flex;
  349. justify-content: space-between;
  350. align-items: center;
  351. margin-top: 30rpx;
  352. width: 100%;
  353. image {
  354. width: 23rpx;
  355. height: 26rpx;
  356. margin-right: 10rpx;
  357. }
  358. }
  359. .read-more {
  360. margin-left: 30rpx;
  361. margin-top: 20rpx;
  362. display: flex;
  363. flex-wrap: wrap;
  364. .text-box {
  365. margin-bottom: 27rpx;
  366. margin-right: 40rpx;
  367. padding: 0;
  368. font-size: 24rpx;
  369. color: #408fff;
  370. width: 170rpx;
  371. height: 46rpx;
  372. line-height: 46rpx;
  373. text-align: center !important;
  374. background: url(~@/static/img/report_bg.png) no-repeat;
  375. background-size: 100% 100%;
  376. text-indent: 0em;
  377. }
  378. .industry-video-item {
  379. height: 126rpx;
  380. width: 170rpx;
  381. margin: 0 40rpx 27rpx 0;
  382. border-radius: 8rpx;
  383. background-size: cover;
  384. background-position: center;
  385. background-repeat: no-repeat;
  386. font-weight: 500;
  387. font-size: 32rpx;
  388. color: white;
  389. line-height: 45rpx;
  390. padding: 20rpx;
  391. position: relative;
  392. overflow: hidden;
  393. .industry-video-icon {
  394. height: 0rpx;
  395. width: 0rpx;
  396. border-style: solid;
  397. border-color: #3385ff #3385ff transparent transparent;
  398. border-width: 28rpx;
  399. position: absolute;
  400. right: 0;
  401. top: 0;
  402. image {
  403. position: absolute;
  404. right: -24rpx;
  405. bottom: 0;
  406. height: 20rpx;
  407. width: 20rpx;
  408. }
  409. }
  410. }
  411. }
  412. .attention {
  413. flex-shrink: 0;
  414. padding: 5rpx 28rpx;
  415. border-radius: 37rpx 37rpx 37rpx 37rpx;
  416. color: #fff;
  417. background: #3385ff;
  418. font-weight: 400;
  419. font-size: 24rpx;
  420. }
  421. .hot-item {
  422. justify-content: space-between;
  423. align-items: center;
  424. .hot-new {
  425. align-items: center;
  426. flex: 1;
  427. padding-right: 20rpx;
  428. }
  429. .new-img {
  430. width: 26rpx;
  431. height: 28rpx;
  432. margin-left: 15rpx;
  433. flex-shrink: 0;
  434. }
  435. }
  436. }
  437. .content-bottom {
  438. background-color: #fff;
  439. text-align: center;
  440. line-height: 100rpx;
  441. color: #c4c4c4;
  442. font-size: 20rpx;
  443. }
  444. .industry-color {
  445. font-size: 26rpx;
  446. padding: 0rpx 20rpx;
  447. border-radius: 4rpx;
  448. margin-left: 20rpx;
  449. }
  450. .title-text {
  451. font-size: 28rpx;
  452. font-weight: 500;
  453. }
  454. }
  455. </style>