hotList.vue 15 KB

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