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