IndustryReport.vue 11 KB

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