IndustryReport.vue 15 KB

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