hotList.vue 15 KB

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