IndustryReport.vue 15 KB

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