IndustryReport.vue 15 KB

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