IndustryReport.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. <template>
  2. <view class="container industry-content" id="industry-content">
  3. <block v-if="haveData">
  4. <view class="is-track-follow" v-if="dataFollow.IsShowFollowButton">
  5. <is-track-follow :isShowFollowButton.sync="dataFollow.IsShowFollowButton" source="resources" :sourceId="industrialManagementId" :isFollowData.sync="dataFollow.IsFollowButton" />
  6. </view>
  7. <view class="top-video-content">
  8. <!-- 详情封面图 -->
  9. <image :src="industryVideo.DetailImgUrl" class="industry-video-poster" v-show="industryVideo.Id && industryVideo.DetailImgUrl && !havePlayed" @click="handelVideoPlay"></image>
  10. <!-- 视频 -->
  11. <video :src="industryVideo.ResourceUrl" class="industry-video" id="industry-video" v-show="industryVideo.ResourceUrl && (havePlayed || !industryVideo.DetailImgUrl)" controls></video>
  12. </view>
  13. <view class="title-tabs-content" :style="{ top: dataFollow.IsShowFollowButton ? '60rpx' : 0 }">
  14. <view class="top-bg-title">产业赛道布局于{{ layoutTime }}</view>
  15. <view class="tab-content">
  16. <block v-for="(item, index) in tabBars" :key="item.CategoryId">
  17. <view :id="'__' + index" class="scroll-tab-item" :class="{ active: tabAct_id == item.CategoryId }" @click.stop="toggleTab(item, index)">
  18. {{ item.MatchTypeName }}
  19. <text class="reg-text" v-if="item.IsRed"></text>
  20. </view>
  21. </block>
  22. </view>
  23. </view>
  24. <view class="collect-ul">
  25. <!-- 其他tab -->
  26. <block v-if="tabAct_id !== 99999">
  27. <view class="global_card_content collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item, index)">
  28. <view>
  29. <view class="item-left">
  30. <text class="title global_title text_twoLine">
  31. {{ item.Title }}
  32. <text class="reg-text" v-if="item.IsRed"></text>
  33. </text>
  34. </view>
  35. <view class="item-more">
  36. <text>{{ item.PublishDate }}</text>
  37. <view class="global_pv-ollect">
  38. <view>
  39. <image class="pv" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/examine_icon.png"></image>
  40. {{ item.Pv }}
  41. </view>
  42. <view @click.stop="collectClick(item)">
  43. <image v-if="item.IsCollect" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collect_act.png"></image>
  44. <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collect_ico.png"></image>
  45. {{ item.CollectNum }}
  46. </view>
  47. </view>
  48. </view>
  49. </view>
  50. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  51. </view>
  52. </block>
  53. <!-- 时间线 -->
  54. <block v-if="tabAct_id === 99999">
  55. <time-line ref="timeChild" :dataList="timeLine" @setRouter="setRouter" />
  56. </block>
  57. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  58. </view>
  59. </block>
  60. <view class="nodata" v-else>
  61. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  62. <text>暂时没有报告的内容</text>
  63. </view>
  64. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  65. <!-- 权限弹窗 -->
  66. <modalDialog :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow" :jurisdictionList="jurisdictionList" :hasPermission="hasPermission" />
  67. <Loading />
  68. </view>
  69. </template>
  70. <script>
  71. import { Mine, Home, Reports, Report } from "@/config/api.js";
  72. import freeCharge from "@/components/freeCharge";
  73. import modalDialog from "@/components/modalDialog.vue";
  74. import IsTrackFollow from "@/components/isTrackFollow.vue";
  75. import TimeLine from "@/components/report/timeLine.vue";
  76. export default {
  77. data() {
  78. return {
  79. tabAct_id: "",
  80. tabBars: [],
  81. industrialManagementId: "",
  82. layoutTime: "",
  83. refresh: false, //正在下拉
  84. page_no: 1,
  85. pageSize: 10,
  86. categoryId: "",
  87. collectList: [],
  88. isShow: false,
  89. haveData: true,
  90. status: "loadmore",
  91. loadText: {
  92. loadmore: "上拉加载更多",
  93. loading: "加载中",
  94. nomore: "已经到底了",
  95. },
  96. totalPage: "",
  97. toggleTabIndex: 0,
  98. titleReport: "",
  99. pcTabActive: "",
  100. industryVideo: {},
  101. authInfo: {},
  102. havePlayed: false,
  103. isShowhasPermission: false, // 联系销售的提交申请
  104. applyForIsShow: false, // 提交申请
  105. jurisdictionList: {},
  106. hasPermission: "", //权限
  107. timeLine: [], //时间线数据
  108. mockTimeLine: [],
  109. dataFollow: {},
  110. isSendWx: "",
  111. chapterId: 0,
  112. };
  113. },
  114. onLoad(option) {
  115. this.industrialManagementId = option.id;
  116. this.isSendWx = option.IsSendWx || "";
  117. this.tabAct_id = +option.tab || "";
  118. this.chapterId = Number(option.ChapterId) || 0;
  119. this.toArticleCategoryList();
  120. },
  121. onShow() {
  122. this.$store.dispatch("statistics", { PageType: "IndustryList", IndustrialManagementId: this.industrialManagementId });
  123. },
  124. components: {
  125. freeCharge,
  126. modalDialog,
  127. IsTrackFollow,
  128. TimeLine,
  129. },
  130. watch: {
  131. //监听tabs的变化
  132. tabAct_id: {
  133. handler(newVal) {
  134. if (newVal) {
  135. this.page_no = 1;
  136. this.collectList = [];
  137. this.getCollectList();
  138. }
  139. },
  140. immediate: true,
  141. },
  142. },
  143. methods: {
  144. //tabs切换事件
  145. toggleTab(item, index) {
  146. this.toggleTabIndex = index;
  147. if (this.tabAct_id !== item.CategoryId) {
  148. this.tabAct_id = item.CategoryId;
  149. this.pageNum = 1;
  150. this.timeLine = [];
  151. this.totalPage = "";
  152. uni.pageScrollTo({
  153. scrollTop: 0,
  154. duration: 0,
  155. });
  156. }
  157. },
  158. toArticleCategoryList() {
  159. Reports.toArticleCategoryList({
  160. IndustrialManagementId: this.industrialManagementId,
  161. ShowTimeLine: 1,
  162. PageRouter: this.$store.state.pageRouterReport,
  163. IsSendWx: this.isSendWx,
  164. ChapterId: this.chapterId,
  165. }).then((res) => {
  166. if (res.Ret == 200) {
  167. uni.setNavigationBarTitle({
  168. title: res.Data.IndustryName,
  169. });
  170. this.dataFollow = res.Data;
  171. this.titleReport = res.Data.IndustryName;
  172. this.layoutTime = res.Data.LayoutTime;
  173. this.industryVideo = res.Data.IndustryVideo;
  174. this.authInfo = res.Data.AuthInfo;
  175. if (res.Data.List) {
  176. this.tabAct_id = res.Data.List[0].CategoryId;
  177. this.tabBars = res.Data.List;
  178. }
  179. }
  180. });
  181. },
  182. /* 获取列表 */
  183. getCollectList() {
  184. //just for test
  185. if (this.tabAct_id === 99999) {
  186. Reports.getArticleList({
  187. PageSize: this.pageSize,
  188. CurrentIndex: this.page_no,
  189. CategoryId: 99999,
  190. IndustrialManagementId: this.industrialManagementId,
  191. }).then((res) => {
  192. if (res.Ret === 200) {
  193. this.$refs.timeChild.loadTimeLine = true;
  194. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  195. this.totalPage = res.Data.Paging.Pages;
  196. let list = res.Data.List || [];
  197. list = list.map((item) => {
  198. let temp = item;
  199. temp.date = item.PublishTime.split(" ")[0];
  200. if (item.Content.length) {
  201. item.isShowBtn = item.Content.length > 60 ? true : false;
  202. item.isExpand = item.Content.length > 60 ? false : true;
  203. }
  204. return temp;
  205. });
  206. if (this.page_no === 1) {
  207. this.timeLine = list;
  208. this.haveData = this.timeLine.length ? true : false;
  209. if (this.refresh) {
  210. uni.stopPullDownRefresh();
  211. this.refresh = false;
  212. }
  213. } else {
  214. this.timeLine = this.timeLine.concat(list);
  215. }
  216. }
  217. setTimeout(() => {
  218. this.$refs.timeChild.getConentsHeight();
  219. }, 0);
  220. });
  221. return;
  222. }
  223. Reports.getArticleList({
  224. PageSize: this.pageSize,
  225. CurrentIndex: this.page_no,
  226. CategoryId: this.tabAct_id,
  227. IndustrialManagementId: this.industrialManagementId,
  228. }).then((res) => {
  229. if (res.Ret === 200) {
  230. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  231. this.totalPage = res.Data.Paging.Pages; //总页数
  232. if (this.page_no === 1) {
  233. this.pcTabActive = res.Data.ChartPermissionId;
  234. this.collectList = res.Data.List || [];
  235. this.haveData = this.collectList.length ? true : false;
  236. if (this.refresh) {
  237. uni.stopPullDownRefresh();
  238. this.refresh = false;
  239. }
  240. } else {
  241. this.collectList = this.collectList.concat(res.Data.List);
  242. }
  243. }
  244. });
  245. },
  246. async goDetail(item, index) {
  247. if (item.SubCategoryName === "路演精华") {
  248. //跳转路演精华
  249. uni.navigateTo({
  250. url: "/reportPages/roadEssence/roadEssence?id=" + item.ArticleId,
  251. });
  252. } else if (item.Resource === 2) {
  253. // 跳转产品内测详情
  254. uni.navigateTo({
  255. url: "/reportPages/internalDetials/internalDetials?id=" + item.ArticleId,
  256. });
  257. } else if (item.Resource === 1) {
  258. this.setRouter();
  259. uni.navigateTo({
  260. url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
  261. });
  262. }
  263. },
  264. // 视频播放权限判断
  265. async handelVideoPlay() {
  266. await this.$store.dispatch("showLoginModal");
  267. this.$store.commit("setRouterReport", "资源包详情页");
  268. if (this.authInfo.HasPermission == 1) {
  269. this.playVideo();
  270. } else {
  271. this.hasPermission = this.authInfo.HasPermission;
  272. this.jurisdictionList.ActivityId = this.industryVideo.Id;
  273. this.jurisdictionList.isAudioVideo = 3;
  274. if (this.hasPermission == 2) {
  275. this.jurisdictionList.SellerMobile = this.authInfo.SellerMobile;
  276. this.jurisdictionList.SellerName = this.authInfo.SellerName;
  277. this.jurisdictionList.PopupMsg = this.authInfo.PopupMsg;
  278. this.isShowhasPermission = true;
  279. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  280. this.jurisdictionList.PopupMsg = this.authInfo.PopupMsg;
  281. this.applyForIsShow = true;
  282. }
  283. }
  284. },
  285. // 播放视频
  286. playVideo() {
  287. const query = uni.createSelectorQuery().in(this);
  288. query
  289. .select("#industry-video")
  290. .context((data) => {
  291. data.context.play();
  292. this.handelVideoBindplay();
  293. setTimeout(() => {
  294. this.havePlayed = true;
  295. }, 10);
  296. })
  297. .exec();
  298. },
  299. //
  300. async handelVideoBindplay() {
  301. const res = await Home.microAideoHistoryAdd({ SourceId: this.industryVideo.Id, SourceType: this.industryVideo.Type, PageRouter: this.$store.state.pageRouterReport });
  302. },
  303. //展开收起晨会内容
  304. handleExpand(item, index) {
  305. this.getRecordTracking("展开收起", { Id: item.Id });
  306. item.isExpand = !item.isExpand;
  307. this.timeLine.splice(index, 1, item);
  308. },
  309. async goDetailFromTimeLine(item, index) {
  310. if (item.Content.length !== 0) return;
  311. // 已授权已绑定
  312. if (item.SubCategoryName === "路演精华") {
  313. //跳转路演精华
  314. uni.navigateTo({
  315. url: "/reportPages/roadEssence/roadEssence?id=" + item.Id,
  316. });
  317. } else {
  318. this.setRouter();
  319. uni.navigateTo({
  320. url: "/pageMy/reportDetail/reportDetail?id=" + item.Id,
  321. });
  322. }
  323. },
  324. getNode(content, isExpand) {
  325. return `<div style='-webkit-line-clamp: ${isExpand ? 9999 : 3};-webkit-box-orient: vertical;display: -webkit-box;overflow: hidden;text-overflow: ellipsis;'>${content}</div>`;
  326. },
  327. // 去往文章详情的
  328. setRouter() {
  329. this.tabBars.forEach((item) => {
  330. if (this.tabAct_id == item.CategoryId) {
  331. this.$store.commit("setRouterReport", item.MatchTypeName);
  332. }
  333. });
  334. },
  335. // 收藏
  336. async collectClick(item) {
  337. const res = await Report.collectRpt({ ArticleId: item.ArticleId, PageRouter: this.$store.state.pageRouterReport });
  338. if (res.Ret === 200) {
  339. item.IsCollect = !item.IsCollect;
  340. item.IsCollect
  341. ? (item.CollectNum += 1) &&
  342. uni.showToast({
  343. title: "收藏成功",
  344. icon: "none",
  345. duration: 2000,
  346. })
  347. : (item.CollectNum -= 1);
  348. !item.IsCollect &&
  349. uni.showToast({
  350. title: "已取消收藏",
  351. icon: "none",
  352. duration: 2000,
  353. });
  354. }
  355. },
  356. },
  357. /* 触底 */
  358. onReachBottom() {
  359. if (this.status === "nomore") return;
  360. this.status = "loading";
  361. this.page_no++;
  362. if (this.tabAct_id) {
  363. this.getCollectList();
  364. }
  365. },
  366. /* 下拉刷新 */
  367. onPullDownRefresh() {
  368. if (this.tabAct_id) {
  369. this.page_no = 1;
  370. this.refresh = true;
  371. this.getCollectList();
  372. }
  373. },
  374. /**
  375. * 用户点击分享
  376. */
  377. onShareAppMessage() {
  378. return {
  379. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.titleReport,
  380. path: "/reportPages/IndustryReport/IndustryReport?id=" + this.industrialManagementId + "&tab=" + this.tabAct_id + "&tabs=" + this.pcTabActive,
  381. };
  382. },
  383. };
  384. </script>
  385. <style lang="scss">
  386. .industry-content {
  387. background-color: $uni-bg-color;
  388. .top-video-content {
  389. width: 100%;
  390. background-color: white;
  391. text-align: center;
  392. .industry-video-poster {
  393. border-radius: 8rpx 8rpx 0 0;
  394. height: 340rpx;
  395. width: 728rpx;
  396. }
  397. .industry-video {
  398. height: 340rpx;
  399. width: 728rpx;
  400. }
  401. .test {
  402. position: relative;
  403. span {
  404. position: absolute;
  405. left: 30rpx;
  406. bottom: 30rpx;
  407. color: white;
  408. }
  409. }
  410. }
  411. .title-tabs-content {
  412. position: sticky;
  413. top: 60rpx;
  414. left: 0;
  415. z-index: 99;
  416. margin-bottom: 20rpx;
  417. .top-bg-title {
  418. height: 60rpx;
  419. color: $uni-color-new;
  420. background-color: #edf4ff;
  421. font-size: 24rpx;
  422. display: flex;
  423. align-items: center;
  424. justify-content: center;
  425. }
  426. .tab-content {
  427. width: 100%;
  428. background-color: #fff;
  429. display: flex;
  430. flex-wrap: wrap;
  431. padding: 30rpx 20rpx 0;
  432. .scroll-tab-item {
  433. position: relative;
  434. display: inline-block;
  435. height: 54rpx;
  436. line-height: 54rpx;
  437. padding: 0 23rpx;
  438. background: #f8f8fa;
  439. border-radius: 27px;
  440. color: #333;
  441. margin: 0rpx 20rpx 20rpx 0;
  442. .reg-text {
  443. position: absolute;
  444. top: -6rpx;
  445. right: -8rpx;
  446. width: 14rpx;
  447. height: 14rpx;
  448. background-color: #ff0000;
  449. border-radius: 50%;
  450. }
  451. }
  452. .active {
  453. color: $uni-color-new !important;
  454. background-color: #e5efff !important;
  455. font-weight: 600;
  456. }
  457. }
  458. }
  459. .collect-ul {
  460. padding-bottom: 50rpx;
  461. padding: 0 25rpx;
  462. .collect-ltem {
  463. display: flex;
  464. background: #fff;
  465. align-items: center;
  466. justify-content: space-between;
  467. margin-bottom: 20rpx;
  468. border-top: 4rpx solid $uni-color-new;
  469. .title {
  470. position: relative;
  471. max-width: 625rpx;
  472. color: #4a4a4a;
  473. font-size: 34rpx;
  474. padding-left: 28rpx;
  475. .reg-text {
  476. position: absolute;
  477. top: 15rpx;
  478. left: 0rpx;
  479. width: 14rpx;
  480. height: 14rpx;
  481. background-color: #ff0000;
  482. border-radius: 50%;
  483. z-index: 9;
  484. }
  485. }
  486. .item-more {
  487. width: 626rpx;
  488. padding: 0 10rpx 0 20rpx;
  489. display: flex;
  490. align-items: center;
  491. justify-content: space-between;
  492. color: #cecece;
  493. margin-top: 20rpx;
  494. }
  495. }
  496. }
  497. .is-track-follow {
  498. height: 60rpx;
  499. position: sticky;
  500. width: 100%;
  501. top: 0rpx;
  502. left: 0;
  503. z-index: 99;
  504. }
  505. }
  506. #industry-content {
  507. .industry-video-module {
  508. .global-video-box {
  509. .video-content {
  510. top: 400rpx !important;
  511. }
  512. .close-icon {
  513. top: 330rpx !important;
  514. }
  515. }
  516. }
  517. }
  518. .item-left {
  519. flex: 1;
  520. .item-more {
  521. padding-left: 20rpx;
  522. }
  523. }
  524. </style>