IndustryReport.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419
  1. <template>
  2. <view class="container industry-content" id="industry-content">
  3. <view v-if="haveData">
  4. <view class="content-top">
  5. <view class="top-bg">
  6. <!-- 详情封面图 -->
  7. <image :src="industryVideo.DetailImgUrl" class="industry-video-poster"
  8. v-show="industryVideo.Id && industryVideo.DetailImgUrl && !havePlayed"
  9. @click="handelVideoPlay"></image>
  10. <!-- 视频 -->
  11. <video :src="industryVideo.ResourceUrl" class="industry-video" id="industry-video"
  12. v-show="industryVideo.ResourceUrl && (havePlayed || (!industryVideo.DetailImgUrl))" controls></video>
  13. <view class="top-bg-title"
  14. :style="{'height':industryVideo.Id?'70rpx':'99rpx',
  15. 'background-color':industryVideo.Id?'white':'#d1ebff'}">产业赛道布局于{{ layoutTime }}</view>
  16. </view>
  17. <!-- industryVideo.ResourceUrl -- 视频url -->
  18. <view class="top-box" :style="{'top':industryVideo.Id?'418rpx':'99rpx'}">
  19. <view class="top-tab-cont">
  20. <view class="tab-cont">
  21. <scroll-view scroll-x="true" scroll-with-animation class="scroll-tab" :scroll-into-view="'_' + tabIndex">
  22. <block v-for="(item, index) in tabBars" :key="item.CategoryId">
  23. <view :id="'_' + index" class="scroll-tab-item" :class="{ active: tabAct_id == item.CategoryId }" @click.stop="toggleTab(item, index)">
  24. {{ item.MatchTypeName }}
  25. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/border_act.png" mode="" class="border_act" v-if="tabAct_id == item.CategoryId"></image>
  26. <text class="reg-hint" v-if="item.IsRed"></text>
  27. </view>
  28. </block>
  29. </scroll-view>
  30. </view>
  31. <view class="lucency" v-if="tabBars.length > 6"></view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="collect-ul" :style="{'padding-top':industryVideo.ResourceUrl?'528rpx':'210rpx'}">
  36. <view class="collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item, index)">
  37. <view class="item-left">
  38. <text class="title text_twoLine"
  39. >{{ item.Title }}
  40. <text class="reg-text" v-if="item.IsRed"></text>
  41. </text>
  42. <text class="text_twoLine desc">{{ item.PublishDate }}</text>
  43. </view>
  44. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  45. </view>
  46. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  47. </view>
  48. </view>
  49. <view class="nodata" v-else>
  50. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  51. <text>暂时没有报告的内容</text>
  52. </view>
  53. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree"/>
  54. <!-- 权限弹窗 -->
  55. <modalDialog :isShowhasPermission="isShowhasPermission" :applyForIsShow="applyForIsShow" :jurisdictionList="jurisdictionList" :hasPermission="hasPermission" />
  56. </view>
  57. </template>
  58. <script>
  59. import { Mine } from "@/config/api.js"; //模拟
  60. import { Reports } from "@/config/api.js"; //模拟
  61. import { Throttle } from "@/config/util.js";
  62. import freeCharge from '@/components/freeCharge'
  63. import modalDialog from "@/components/modalDialog.vue";
  64. let app = getApp({ allowDefault: true });
  65. export default {
  66. data() {
  67. return {
  68. tabAct_id: "",
  69. tabBars: [],
  70. industrialManagementId: "",
  71. layoutTime: "",
  72. refresh: false, //正在下拉
  73. page_no: 1,
  74. pageSize: 10,
  75. categoryId: "",
  76. collectList: [],
  77. isShow: false,
  78. haveData: true,
  79. status: "loadmore",
  80. loadText: {
  81. loadmore: "上拉加载更多",
  82. loading: "加载中",
  83. nomore: "已经到底了",
  84. },
  85. totalPage: "",
  86. toggleTabIndex: 0,
  87. titleReport: "",
  88. industryVideo:{},
  89. authInfo:{},
  90. havePlayed:false,
  91. isShowhasPermission: false, // 联系销售的提交申请
  92. applyForIsShow: false, // 提交申请
  93. jurisdictionList: {},
  94. hasPermission: "", //权限
  95. };
  96. },
  97. onLoad(option) {
  98. this.industrialManagementId = option.id;
  99. this.tabAct_id = option.tab;
  100. this.toArticleCategoryList();
  101. },
  102. onShow() {
  103. this.$store.dispatch("statistics", { PageType: "IndustryList", IndustrialManagementId: this.industrialManagementId });
  104. },
  105. components: {
  106. freeCharge,
  107. modalDialog
  108. },
  109. watch: {
  110. //监听tabs的变化
  111. tabAct_id: {
  112. handler() {
  113. if (this.tabAct_id) {
  114. (this.page_no = 1), (this.collectList = []);
  115. this.getCollectList();
  116. }
  117. },
  118. immediate: true,
  119. },
  120. },
  121. methods: {
  122. //tabs切换事件
  123. toggleTab(item, index) {
  124. this.toggleTabIndex = index;
  125. if (this.tabAct_id !== item.CategoryId) {
  126. this.tabAct_id = item.CategoryId;
  127. this.pageNum = 1;
  128. uni.pageScrollTo({
  129. scrollTop: 0,
  130. duration: 0,
  131. });
  132. }
  133. },
  134. toArticleCategoryList() {
  135. Reports.toArticleCategoryList({
  136. IndustrialManagementId: this.industrialManagementId,
  137. }).then((res) => {
  138. if (res.Ret == 200) {
  139. uni.setNavigationBarTitle({
  140. title: res.Data.IndustryName,
  141. });
  142. this.titleReport = res.Data.IndustryName;
  143. this.layoutTime = res.Data.LayoutTime;
  144. this.industryVideo = res.Data.IndustryVideo
  145. this.authInfo = res.Data.AuthInfo
  146. if (res.Data.List) {
  147. this.tabAct_id = res.Data.List[0].CategoryId;
  148. this.tabBars = res.Data.List;
  149. }
  150. }
  151. });
  152. },
  153. /* 获取列表 */
  154. getCollectList() {
  155. Reports.getArticleList({
  156. PageSize: this.pageSize,
  157. CurrentIndex: this.page_no,
  158. CategoryId: this.tabAct_id,
  159. IndustrialManagementId: this.industrialManagementId,
  160. }).then((res) => {
  161. if (res.Ret === 200) {
  162. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  163. this.totalPage = res.Data.Paging.Pages; //总页数
  164. if (this.page_no === 1) {
  165. this.collectList = res.Data.List || [];
  166. this.haveData = this.collectList.length ? true : false;
  167. if (this.refresh) {
  168. uni.stopPullDownRefresh();
  169. this.refresh = false;
  170. }
  171. } else {
  172. this.collectList = this.collectList.concat(res.Data.List);
  173. }
  174. }
  175. });
  176. },
  177. async goDetail(item, index) {
  178. /* 无需授权且已绑定 检验是或否有权限 */
  179. if (index == 0) {
  180. this.tabBars[this.toggleTabIndex].IsRed = false;
  181. }
  182. this.collectList[index].IsRed = false;
  183. await this.$store.dispatch("checkHandle");
  184. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  185. // 已授权已绑定
  186. if (item.IsHaveVideo) {
  187. //跳转路演精华
  188. uni.navigateTo({
  189. url: "/reportPages/roadEssence/roadEssence?id=" + item.ArticleId,
  190. });
  191. } else {
  192. uni.navigateTo({
  193. url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
  194. });
  195. }
  196. }
  197. },
  198. // 视频播放权限判断
  199. handelVideoPlay(){
  200. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  201. if (this.authInfo.HasPermission == 1) {
  202. this.playVideo()
  203. } else {
  204. this.hasPermission = this.authInfo.HasPermission;
  205. this.jurisdictionList.ActivityId = this.industryVideo.Id;
  206. this.jurisdictionList.isAudioVideo = 3;
  207. if (this.hasPermission == 2) {
  208. this.jurisdictionList.SellerMobile = this.authInfo.SellerMobile;
  209. this.jurisdictionList.SellerName = this.authInfo.SellerName;
  210. this.jurisdictionList.PopupMsg = this.authInfo.PopupMsg;
  211. this.isShowhasPermission = true;
  212. } else if (this.hasPermission == 3 || this.hasPermission == 4 || this.hasPermission == 5) {
  213. this.jurisdictionList.PopupMsg = this.authInfo.PopupMsg;
  214. this.applyForIsShow = true;
  215. }
  216. }
  217. } else {
  218. this.$store.dispatch("checkHandle");
  219. }
  220. },
  221. // 播放视频
  222. playVideo(){
  223. const query = uni.createSelectorQuery().in(this)
  224. query.select("#industry-video").context(data =>{
  225. data.context.play()
  226. setTimeout(()=>{
  227. this.havePlayed=true
  228. },10)
  229. }).exec()
  230. }
  231. },
  232. /* 触底 */
  233. onReachBottom: Throttle(function () {
  234. if (this.status === "nomore") return;
  235. this.status = "loading";
  236. this.page_no++;
  237. if (this.tabAct_id) {
  238. this.getCollectList();
  239. }
  240. }),
  241. /* 下拉刷新 */
  242. onPullDownRefresh: Throttle(function () {
  243. if (this.tabAct_id) {
  244. this.page_no = 1;
  245. this.refresh = true;
  246. this.getCollectList();
  247. }
  248. }),
  249. /**
  250. * 用户点击分享
  251. */
  252. onShareAppMessage: function (res) {
  253. return {
  254. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.titleReport,
  255. path: "/reportPages/IndustryReport/IndustryReport?id=" + this.industrialManagementId + "&tab=" + this.tabAct_id,
  256. success: (res) => {},
  257. fail: (err) => {},
  258. };
  259. },
  260. };
  261. </script>
  262. <style lang="scss">
  263. .industry-content {
  264. background-color: #f7f7f7;
  265. // height: 100vh;
  266. .top-bg {
  267. position: fixed;
  268. top: 0;
  269. left: 0;
  270. width: 100%;
  271. z-index: 100;
  272. background-color: white;
  273. text-align: center;
  274. .industry-video-poster{
  275. border-radius: 8rpx 8rpx 0 0;
  276. height: 340rpx;
  277. width: 728rpx;
  278. }
  279. .industry-video{
  280. height: 340rpx;
  281. width: 728rpx;
  282. }
  283. .top-bg-title{
  284. height: 99rpx;
  285. color: #2c83ff;
  286. background-color: #d1ebff;
  287. font-size: 28rpx;
  288. display: flex;
  289. align-items: center;
  290. justify-content: center;
  291. }
  292. .test{
  293. position: relative;
  294. span{
  295. position: absolute;
  296. left: 30rpx;
  297. bottom: 30rpx;
  298. color: white;
  299. }
  300. }
  301. }
  302. .top-box {
  303. position: fixed;
  304. width: 100%;
  305. top: 99rpx;
  306. left: 0;
  307. z-index: 100;
  308. }
  309. .top-tab-cont {
  310. .lucency {
  311. position: absolute;
  312. top: 0;
  313. right: 0;
  314. width: 32px;
  315. height: 30px;
  316. opacity: 0.9;
  317. background-color: #fff;
  318. }
  319. .tab-cont {
  320. padding: retu;
  321. padding: 30rpx 26rpx 0;
  322. background-color: #fff;
  323. font-size: 32rpx;
  324. box-shadow: 0 3rpx 6rpx rgba(187, 216, 255, 0.2);
  325. .scroll-tab {
  326. width: 100%;
  327. white-space: nowrap;
  328. }
  329. .scroll-tab-item {
  330. // flex-grow: 1;
  331. text-align: center;
  332. display: inline-block;
  333. padding: 0rpx 8rpx 30rpx 8rpx;
  334. margin-right: 60rpx;
  335. border-bottom: 8rpx solid transparent;
  336. position: relative;
  337. &:last-child {
  338. margin-right: 0;
  339. }
  340. &.active {
  341. border-bottom: none;
  342. color: #2c83ff;
  343. font-weight: 700;
  344. }
  345. .border_act {
  346. width: 100%;
  347. height: 8rpx;
  348. position: absolute;
  349. bottom: 0;
  350. left: 0;
  351. }
  352. .reg-hint {
  353. position: absolute;
  354. top: 0rpx;
  355. right: -10rpx;
  356. width: 14rpx;
  357. height: 14rpx;
  358. background-color: #ff0000;
  359. border-radius: 50%;
  360. }
  361. }
  362. }
  363. }
  364. .collect-ul {
  365. // margin-top: 30rpx;s
  366. padding-top: 210rpx;
  367. // padding-top: 4rpx;
  368. .collect-ltem {
  369. display: flex;
  370. padding: 30rpx 34rpx;
  371. background: #fff;
  372. margin-bottom: 4rpx;
  373. align-items: center;
  374. justify-content: space-between;
  375. .title {
  376. position: relative;
  377. max-width: 625rpx;
  378. color: #4a4a4a;
  379. font-size: 34rpx;
  380. padding-left: 28rpx;
  381. .reg-text {
  382. position: absolute;
  383. top: 15rpx;
  384. left: 0rpx;
  385. width: 14rpx;
  386. height: 14rpx;
  387. background-color: #ff0000;
  388. border-radius: 50%;
  389. z-index: 9;
  390. }
  391. }
  392. .desc {
  393. margin-top: 17rpx;
  394. padding-left: 28rpx;
  395. width: 625rpx;
  396. color: #999;
  397. }
  398. }
  399. }
  400. }
  401. #industry-content{
  402. .industry-video-module{
  403. .global-video-box{
  404. .video-content{
  405. top: 400rpx!important;
  406. }
  407. .close-icon{
  408. top: 330rpx!important;
  409. }
  410. }
  411. }
  412. }
  413. </style>