hotList.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456
  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 = val === "主题" ? await Reports.reportFllow({ IndustrialManagementId: item.IndustrialManagementId }) : 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.getTabList();
  253. },
  254. };
  255. </script>
  256. <style lang="scss" scoped>
  257. .container-hot-list {
  258. padding: 30rpx;
  259. .top-content {
  260. position: sticky;
  261. top: -1rpx;
  262. left: 0;
  263. z-index: 99;
  264. background-color: #fff;
  265. padding-bottom: 10rpx;
  266. }
  267. .tab-content {
  268. display: flex;
  269. .item {
  270. position: relative;
  271. display: inline-block;
  272. padding-bottom: 10rpx;
  273. font-size: 32rpx;
  274. color: #999999;
  275. margin-right: 50rpx;
  276. font-weight: 400;
  277. image {
  278. position: absolute;
  279. bottom: 0;
  280. left: 50%;
  281. transform: translateX(-50%);
  282. width: 100rpx;
  283. height: 4rpx;
  284. }
  285. }
  286. .tab-active {
  287. color: #333333;
  288. font-weight: 500;
  289. }
  290. }
  291. .children-tabs {
  292. margin-top: 30rpx;
  293. width: 100%;
  294. display: flex;
  295. overflow: hidden;
  296. overflow-x: auto;
  297. .children-item {
  298. padding: 10rpx 20rpx;
  299. background: #f9f9f9;
  300. border-radius: 4px;
  301. margin-right: 40rpx;
  302. }
  303. .children-tab-active {
  304. background-color: #3385ff;
  305. color: #fff;
  306. }
  307. }
  308. .content-ul {
  309. margin: 20rpx 0 0;
  310. border-top: 1px solid #f6f6f6;
  311. .user-li,
  312. .hot-li {
  313. padding: 30rpx 0 20rpx;
  314. border-bottom: 1px solid #f6f6f6;
  315. }
  316. .li-serial {
  317. width: 26rpx;
  318. height: 26rpx;
  319. line-height: 26rpx;
  320. color: #fff;
  321. font-size: 20rpx;
  322. text-align: center;
  323. border-radius: 4rpx 4rpx 4rpx 4rpx;
  324. margin: 7rpx 10rpx 0 20rpx;
  325. flex-shrink: 0;
  326. }
  327. .serial-number {
  328. margin-top: 0 !important;
  329. }
  330. .li-item {
  331. display: flex;
  332. .li-industry {
  333. color: #3385ff;
  334. margin-right: 20rpx;
  335. display: inline-block;
  336. }
  337. .li-user {
  338. margin-left: 46rpx;
  339. display: flex;
  340. align-items: center;
  341. }
  342. .li-title {
  343. display: flex;
  344. }
  345. }
  346. .li-bottom {
  347. display: flex;
  348. justify-content: space-between;
  349. align-items: center;
  350. margin-top: 30rpx;
  351. width: 100%;
  352. image {
  353. width: 23rpx;
  354. height: 26rpx;
  355. margin-right: 10rpx;
  356. }
  357. }
  358. .read-more {
  359. margin-left: 30rpx;
  360. margin-top: 20rpx;
  361. display: flex;
  362. flex-wrap: wrap;
  363. .text-box {
  364. margin-bottom: 27rpx;
  365. margin-right: 40rpx;
  366. padding: 0;
  367. font-size: 24rpx;
  368. color: #408fff;
  369. width: 170rpx;
  370. height: 46rpx;
  371. line-height: 46rpx;
  372. text-align: center !important;
  373. background: url(~@/static/img/report_bg.png) no-repeat;
  374. background-size: 100% 100%;
  375. text-indent: 0em;
  376. }
  377. .industry-video-item {
  378. height: 126rpx;
  379. width: 170rpx;
  380. margin: 0 40rpx 27rpx 0;
  381. border-radius: 8rpx;
  382. background-size: cover;
  383. background-position: center;
  384. background-repeat: no-repeat;
  385. font-weight: 500;
  386. font-size: 32rpx;
  387. color: white;
  388. line-height: 45rpx;
  389. padding: 20rpx;
  390. position: relative;
  391. overflow: hidden;
  392. .industry-video-icon {
  393. height: 0rpx;
  394. width: 0rpx;
  395. border-style: solid;
  396. border-color: #3385ff #3385ff transparent transparent;
  397. border-width: 28rpx;
  398. position: absolute;
  399. right: 0;
  400. top: 0;
  401. image {
  402. position: absolute;
  403. right: -24rpx;
  404. bottom: 0;
  405. height: 20rpx;
  406. width: 20rpx;
  407. }
  408. }
  409. }
  410. }
  411. .attention {
  412. flex-shrink: 0;
  413. padding: 5rpx 28rpx;
  414. border-radius: 37rpx 37rpx 37rpx 37rpx;
  415. color: #fff;
  416. background: #3385ff;
  417. font-weight: 400;
  418. font-size: 24rpx;
  419. }
  420. .hot-item {
  421. justify-content: space-between;
  422. align-items: center;
  423. .hot-new {
  424. align-items: center;
  425. flex: 1;
  426. padding-right: 20rpx;
  427. }
  428. .new-img {
  429. width: 26rpx;
  430. height: 28rpx;
  431. margin-left: 15rpx;
  432. flex-shrink: 0;
  433. }
  434. }
  435. }
  436. .content-bottom {
  437. background-color: #fff;
  438. text-align: center;
  439. line-height: 100rpx;
  440. color: #c4c4c4;
  441. font-size: 20rpx;
  442. }
  443. .industry-color {
  444. font-size: 26rpx;
  445. padding: 0rpx 20rpx;
  446. border-radius: 4rpx;
  447. margin-left: 20rpx;
  448. }
  449. .title-text {
  450. font-size: 28rpx;
  451. font-weight: 500;
  452. }
  453. }
  454. </style>