hotList.vue 14 KB

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