hotList.vue 15 KB

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