hotList.vue 15 KB

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