IndustryReport.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543
  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. {
  110. date: "不重要",
  111. Content: "<p>hello,world</p><p>hello,world</p><p>hello,world</p>",
  112. }, //第一项是为了获取当前手机下,三行是多少相对高度
  113. ],
  114. dataFollow: {},
  115. isSendWx: "",
  116. chapterId: 0,
  117. };
  118. },
  119. onLoad(option) {
  120. this.industrialManagementId = option.id;
  121. this.isSendWx = option.IsSendWx || "";
  122. this.tabAct_id = +option.tab || "";
  123. this.chapterId = Number(option.ChapterId) || 0;
  124. this.toArticleCategoryList();
  125. },
  126. onShow() {
  127. this.$store.dispatch("statistics", { PageType: "IndustryList", IndustrialManagementId: this.industrialManagementId });
  128. },
  129. components: {
  130. freeCharge,
  131. modalDialog,
  132. IsTrackFollow,
  133. TimeLine,
  134. },
  135. watch: {
  136. //监听tabs的变化
  137. tabAct_id: {
  138. handler(newVal) {
  139. if (newVal) {
  140. this.page_no = 1;
  141. this.collectList = [];
  142. this.getCollectList();
  143. }
  144. },
  145. immediate: true,
  146. },
  147. },
  148. methods: {
  149. //tabs切换事件
  150. toggleTab(item, index) {
  151. this.toggleTabIndex = index;
  152. if (this.tabAct_id !== item.CategoryId) {
  153. this.tabAct_id = item.CategoryId;
  154. this.pageNum = 1;
  155. this.timeLine = [];
  156. this.totalPage = "";
  157. uni.pageScrollTo({
  158. scrollTop: 0,
  159. duration: 0,
  160. });
  161. }
  162. },
  163. toArticleCategoryList() {
  164. Reports.toArticleCategoryList({
  165. IndustrialManagementId: this.industrialManagementId,
  166. ShowTimeLine: 1,
  167. PageRouter: this.$store.state.pageRouterReport,
  168. IsSendWx: this.isSendWx,
  169. ChapterId: this.chapterId,
  170. }).then((res) => {
  171. if (res.Ret == 200) {
  172. uni.setNavigationBarTitle({
  173. title: res.Data.IndustryName,
  174. });
  175. this.dataFollow = res.Data;
  176. this.titleReport = res.Data.IndustryName;
  177. this.layoutTime = res.Data.LayoutTime;
  178. this.industryVideo = res.Data.IndustryVideo;
  179. this.authInfo = res.Data.AuthInfo;
  180. if (res.Data.List) {
  181. this.tabAct_id = res.Data.List[0].CategoryId;
  182. this.tabBars = res.Data.List;
  183. }
  184. }
  185. });
  186. },
  187. /* 获取列表 */
  188. getCollectList() {
  189. //just for test
  190. if (this.tabAct_id === 99999) {
  191. Reports.getArticleList({
  192. PageSize: this.pageSize,
  193. CurrentIndex: this.page_no,
  194. CategoryId: 99999,
  195. IndustrialManagementId: this.industrialManagementId,
  196. }).then((res) => {
  197. if (res.Ret === 200) {
  198. this.$refs.timeChild.loadTimeLine = true;
  199. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  200. this.totalPage = res.Data.Paging.Pages;
  201. let list = res.Data.List || [];
  202. list = list.map((item) => {
  203. let temp = item;
  204. temp.date = item.PublishTime.split(" ")[0];
  205. if (item.Content.length) {
  206. temp.isExpand = true;
  207. temp.isShowBtn = true;
  208. }
  209. return temp;
  210. });
  211. if (this.page_no === 1) {
  212. this.timeLine = list;
  213. this.haveData = this.timeLine.length ? true : false;
  214. if (this.refresh) {
  215. uni.stopPullDownRefresh();
  216. this.refresh = false;
  217. }
  218. } else {
  219. this.timeLine = this.timeLine.concat(list);
  220. }
  221. }
  222. this.timeLine.unshift(this.mockTimeLine[0]);
  223. //在获取高度前把所有的晨会展开,收起的话无法获取正确高度
  224. this.timeLine.forEach((item) => {
  225. if (item.Content.length) {
  226. item.isExpand = true;
  227. item.isShowBtn = true;
  228. }
  229. });
  230. setTimeout(() => {
  231. this.$refs.timeChild.getConentsHeight();
  232. }, 0);
  233. });
  234. return;
  235. }
  236. Reports.getArticleList({
  237. PageSize: this.pageSize,
  238. CurrentIndex: this.page_no,
  239. CategoryId: this.tabAct_id,
  240. IndustrialManagementId: this.industrialManagementId,
  241. }).then((res) => {
  242. if (res.Ret === 200) {
  243. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  244. this.totalPage = res.Data.Paging.Pages; //总页数
  245. if (this.page_no === 1) {
  246. this.pcTabActive = res.Data.ChartPermissionId;
  247. this.collectList = res.Data.List || [];
  248. this.haveData = this.collectList.length ? true : false;
  249. if (this.refresh) {
  250. uni.stopPullDownRefresh();
  251. this.refresh = false;
  252. }
  253. } else {
  254. this.collectList = this.collectList.concat(res.Data.List);
  255. }
  256. }
  257. });
  258. },
  259. async goDetail(item, index) {
  260. if (item.SubCategoryName === "路演精华") {
  261. //跳转路演精华
  262. uni.navigateTo({
  263. url: "/reportPages/roadEssence/roadEssence?id=" + item.ArticleId,
  264. });
  265. } else if (item.Resource === 2) {
  266. // 跳转产品内测详情
  267. uni.navigateTo({
  268. url: "/reportPages/internalDetials/internalDetials?id=" + item.ArticleId,
  269. });
  270. } else if (item.Resource === 1) {
  271. this.setRouter();
  272. uni.navigateTo({
  273. url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
  274. });
  275. }
  276. },
  277. // 视频播放权限判断
  278. async handelVideoPlay() {
  279. await this.$store.dispatch("showLoginModal");
  280. this.$store.commit("setRouterReport", "资源包详情页");
  281. if (this.authInfo.HasPermission == 1) {
  282. this.playVideo();
  283. } else {
  284. this.hasPermission = this.authInfo.HasPermission;
  285. this.jurisdictionList.ActivityId = this.industryVideo.Id;
  286. this.jurisdictionList.isAudioVideo = 3;
  287. if (this.hasPermission == 2) {
  288. this.jurisdictionList.SellerMobile = this.authInfo.SellerMobile;
  289. this.jurisdictionList.SellerName = this.authInfo.SellerName;
  290. this.jurisdictionList.PopupMsg = this.authInfo.PopupMsg;
  291. this.isShowhasPermission = true;
  292. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  293. this.jurisdictionList.PopupMsg = this.authInfo.PopupMsg;
  294. this.applyForIsShow = true;
  295. }
  296. }
  297. },
  298. // 播放视频
  299. playVideo() {
  300. const query = uni.createSelectorQuery().in(this);
  301. query
  302. .select("#industry-video")
  303. .context((data) => {
  304. data.context.play();
  305. this.handelVideoBindplay();
  306. setTimeout(() => {
  307. this.havePlayed = true;
  308. }, 10);
  309. })
  310. .exec();
  311. },
  312. //
  313. async handelVideoBindplay() {
  314. const res = await Home.microAideoHistoryAdd({ SourceId: this.industryVideo.Id, SourceType: this.industryVideo.Type, PageRouter: this.$store.state.pageRouterReport });
  315. },
  316. //展开收起晨会内容
  317. handleExpand(item, index) {
  318. this.getRecordTracking("展开收起", { Id: item.Id });
  319. item.isExpand = !item.isExpand;
  320. this.timeLine.splice(index, 1, item);
  321. },
  322. async goDetailFromTimeLine(item, index) {
  323. if (item.Content.length !== 0) return;
  324. // 已授权已绑定
  325. if (item.SubCategoryName === "路演精华") {
  326. //跳转路演精华
  327. uni.navigateTo({
  328. url: "/reportPages/roadEssence/roadEssence?id=" + item.Id,
  329. });
  330. } else {
  331. this.setRouter();
  332. uni.navigateTo({
  333. url: "/pageMy/reportDetail/reportDetail?id=" + item.Id,
  334. });
  335. }
  336. },
  337. getNode(content, isExpand) {
  338. return `<div style='-webkit-line-clamp: ${isExpand ? 9999 : 3};-webkit-box-orient: vertical;display: -webkit-box;overflow: hidden;text-overflow: ellipsis;'>${content}</div>`;
  339. },
  340. // 去往文章详情的
  341. setRouter() {
  342. this.tabBars.forEach((item) => {
  343. if (this.tabAct_id == item.CategoryId) {
  344. this.$store.commit("setRouterReport", item.MatchTypeName);
  345. }
  346. });
  347. },
  348. // 收藏
  349. async collectClick(item) {
  350. const res = await Report.collectRpt({ ArticleId: item.ArticleId, PageRouter: this.$store.state.pageRouterReport });
  351. if (res.Ret === 200) {
  352. item.IsCollect = !item.IsCollect;
  353. item.IsCollect
  354. ? (item.CollectNum += 1) &&
  355. uni.showToast({
  356. title: "收藏成功",
  357. icon: "none",
  358. duration: 2000,
  359. })
  360. : (item.CollectNum -= 1);
  361. !item.IsCollect &&
  362. uni.showToast({
  363. title: "已取消收藏",
  364. icon: "none",
  365. duration: 2000,
  366. });
  367. }
  368. },
  369. },
  370. /* 触底 */
  371. onReachBottom() {
  372. if (this.status === "nomore") return;
  373. this.status = "loading";
  374. this.page_no++;
  375. if (this.tabAct_id) {
  376. this.getCollectList();
  377. }
  378. },
  379. /* 下拉刷新 */
  380. onPullDownRefresh() {
  381. if (this.tabAct_id) {
  382. this.page_no = 1;
  383. this.refresh = true;
  384. this.getCollectList();
  385. }
  386. },
  387. /**
  388. * 用户点击分享
  389. */
  390. onShareAppMessage() {
  391. return {
  392. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.titleReport,
  393. path: "/reportPages/IndustryReport/IndustryReport?id=" + this.industrialManagementId + "&tab=" + this.tabAct_id + "&tabs=" + this.pcTabActive,
  394. };
  395. },
  396. };
  397. </script>
  398. <style lang="scss">
  399. .industry-content {
  400. background-color: $uni-bg-color;
  401. .top-video-content {
  402. width: 100%;
  403. background-color: white;
  404. text-align: center;
  405. .industry-video-poster {
  406. border-radius: 8rpx 8rpx 0 0;
  407. height: 340rpx;
  408. width: 728rpx;
  409. }
  410. .industry-video {
  411. height: 340rpx;
  412. width: 728rpx;
  413. }
  414. .test {
  415. position: relative;
  416. span {
  417. position: absolute;
  418. left: 30rpx;
  419. bottom: 30rpx;
  420. color: white;
  421. }
  422. }
  423. }
  424. .title-tabs-content {
  425. position: sticky;
  426. top: 60rpx;
  427. left: 0;
  428. z-index: 99;
  429. margin-bottom: 20rpx;
  430. .top-bg-title {
  431. height: 60rpx;
  432. color: $uni-color-new;
  433. background-color: #edf4ff;
  434. font-size: 24rpx;
  435. display: flex;
  436. align-items: center;
  437. justify-content: center;
  438. }
  439. .tab-content {
  440. width: 100%;
  441. background-color: #fff;
  442. display: flex;
  443. flex-wrap: wrap;
  444. padding: 30rpx 20rpx 0;
  445. .scroll-tab-item {
  446. position: relative;
  447. display: inline-block;
  448. height: 54rpx;
  449. line-height: 54rpx;
  450. padding: 0 23rpx;
  451. background: #f8f8fa;
  452. border-radius: 27px;
  453. color: #333;
  454. margin: 0rpx 20rpx 20rpx 0;
  455. .reg-text {
  456. position: absolute;
  457. top: -6rpx;
  458. right: -8rpx;
  459. width: 14rpx;
  460. height: 14rpx;
  461. background-color: #ff0000;
  462. border-radius: 50%;
  463. }
  464. }
  465. .active {
  466. color: $uni-color-new !important;
  467. background-color: #e5efff !important;
  468. font-weight: 600;
  469. }
  470. }
  471. }
  472. .collect-ul {
  473. padding-bottom: 50rpx;
  474. padding: 0 25rpx;
  475. .collect-ltem {
  476. display: flex;
  477. background: #fff;
  478. align-items: center;
  479. justify-content: space-between;
  480. margin-bottom: 20rpx;
  481. border-top: 4rpx solid $uni-color-new;
  482. .title {
  483. position: relative;
  484. max-width: 625rpx;
  485. color: #4a4a4a;
  486. font-size: 34rpx;
  487. padding-left: 28rpx;
  488. .reg-text {
  489. position: absolute;
  490. top: 15rpx;
  491. left: 0rpx;
  492. width: 14rpx;
  493. height: 14rpx;
  494. background-color: #ff0000;
  495. border-radius: 50%;
  496. z-index: 9;
  497. }
  498. }
  499. .item-more {
  500. width: 626rpx;
  501. padding: 0 10rpx 0 20rpx;
  502. display: flex;
  503. align-items: center;
  504. justify-content: space-between;
  505. color: #cecece;
  506. margin-top: 20rpx;
  507. }
  508. }
  509. }
  510. .is-track-follow {
  511. height: 60rpx;
  512. position: sticky;
  513. width: 100%;
  514. top: 0rpx;
  515. left: 0;
  516. z-index: 99;
  517. }
  518. }
  519. #industry-content {
  520. .industry-video-module {
  521. .global-video-box {
  522. .video-content {
  523. top: 400rpx !important;
  524. }
  525. .close-icon {
  526. top: 330rpx !important;
  527. }
  528. }
  529. }
  530. }
  531. .item-left {
  532. flex: 1;
  533. .item-more {
  534. padding-left: 20rpx;
  535. }
  536. }
  537. </style>