IndustryReport.vue 15 KB

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