IndustryReport.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <template>
  2. <view class="container industry-content">
  3. <view v-if="layoutTime">
  4. <view class="content-top">
  5. <view class="top-bg">产业赛道布局于{{ layoutTime }}</view>
  6. <view class="top-box">
  7. <view class="top-tab-cont">
  8. <view class="tab-cont">
  9. <scroll-view scroll-x="true" scroll-with-animation class="scroll-tab" :scroll-into-view="'_' + tabIndex">
  10. <block v-for="(item, index) in tabBars" :key="item.CategoryId">
  11. <view :id="'_' + index" class="scroll-tab-item" :class="{ active: tabAct_id == item.CategoryId }" @click.stop="toggleTab(item, index)">
  12. {{ item.MatchTypeName }}
  13. <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>
  14. <text class="reg-hint" v-if="item.IsRed"></text>
  15. </view>
  16. </block>
  17. </scroll-view>
  18. </view>
  19. <view class="lucency" v-if="tabBars.length > 6"></view>
  20. </view>
  21. </view>
  22. </view>
  23. <view class="collect-ul">
  24. <view class="collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item, index)">
  25. <view class="item-left">
  26. <text class="title text_twoLine"
  27. >{{ item.Title }}
  28. <text class="reg-text" v-if="item.IsRed"></text>
  29. </text>
  30. <text class="text_twoLine desc">{{ item.PublishDate }}</text>
  31. </view>
  32. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  33. </view>
  34. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  35. </view>
  36. </view>
  37. <view class="nodata" v-else>
  38. <image src="@/static/img/nodata.png" mode="" class="nodata_ico"></image>
  39. <text>暂时没有报告的内容</text>
  40. </view>
  41. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree"/>
  42. </view>
  43. </template>
  44. <script>
  45. import { Mine } from "@/config/api.js"; //模拟
  46. import { Reports } from "@/config/api.js"; //模拟
  47. import { Throttle } from "@/config/util.js";
  48. import freeCharge from '@/components/freeCharge'
  49. let app = getApp({ allowDefault: true });
  50. export default {
  51. data() {
  52. return {
  53. tabAct_id: "",
  54. tabBars: [],
  55. industrialManagementId: "",
  56. layoutTime: "",
  57. refresh: false, //正在下拉
  58. page_no: 1,
  59. pageSize: 10,
  60. categoryId: "",
  61. collectList: [],
  62. isShow: false,
  63. haveDatas: true,
  64. haveData: true,
  65. status: "loadmore",
  66. loadText: {
  67. loadmore: "上拉加载更多",
  68. loading: "加载中",
  69. nomore: "已经到底了",
  70. },
  71. totalPage: "",
  72. toggleTabIndex: 0,
  73. titleReport: "",
  74. };
  75. },
  76. onLoad(option) {
  77. this.industrialManagementId = option.id;
  78. this.tabAct_id = option.tab;
  79. this.toArticleCategoryList();
  80. },
  81. onShow() {
  82. this.$store.dispatch("statistics", { PageType: "IndustryList", IndustrialManagementId: this.industrialManagementId });
  83. },
  84. components: {
  85. freeCharge
  86. },
  87. watch: {
  88. //监听tabs的变化
  89. tabAct_id: {
  90. handler() {
  91. if (this.tabAct_id) {
  92. (this.page_no = 1), (this.collectList = []);
  93. this.getCollectList();
  94. }
  95. },
  96. immediate: true,
  97. },
  98. },
  99. methods: {
  100. //tabs切换事件
  101. toggleTab(item, index) {
  102. this.toggleTabIndex = index;
  103. if (this.tabAct_id !== item.CategoryId) {
  104. this.tabAct_id = item.CategoryId;
  105. this.pageNum = 1;
  106. uni.pageScrollTo({
  107. scrollTop: 0,
  108. duration: 0,
  109. });
  110. }
  111. },
  112. toArticleCategoryList() {
  113. Reports.toArticleCategoryList({
  114. IndustrialManagementId: this.industrialManagementId,
  115. }).then((res) => {
  116. if (res.Ret == 200) {
  117. uni.setNavigationBarTitle({
  118. title: res.Data.IndustryName,
  119. });
  120. this.titleReport = res.Data.IndustryName;
  121. this.layoutTime = res.Data.LayoutTime;
  122. if (res.Data.List) {
  123. this.tabAct_id = res.Data.List[0].CategoryId;
  124. this.tabBars = res.Data.List;
  125. } else {
  126. this.haveDatas = false;
  127. }
  128. }
  129. });
  130. },
  131. /* 获取列表 */
  132. getCollectList() {
  133. Reports.getArticleList({
  134. PageSize: this.pageSize,
  135. CurrentIndex: this.page_no,
  136. CategoryId: this.tabAct_id,
  137. IndustrialManagementId: this.industrialManagementId,
  138. }).then((res) => {
  139. if (res.Ret === 200) {
  140. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  141. this.totalPage = res.Data.Paging.Pages; //总页数
  142. if (this.page_no === 1) {
  143. this.collectList = res.Data.List || [];
  144. this.haveData = this.collectList.length ? true : false;
  145. if (this.refresh) {
  146. uni.stopPullDownRefresh();
  147. this.refresh = false;
  148. }
  149. } else {
  150. this.collectList = this.collectList.concat(res.Data.List);
  151. }
  152. }
  153. });
  154. },
  155. async goDetail(item, index) {
  156. /* 无需授权且已绑定 检验是或否有权限 */
  157. if (index == 0) {
  158. this.tabBars[this.toggleTabIndex].IsRed = false;
  159. }
  160. this.collectList[index].IsRed = false;
  161. await this.$store.dispatch("checkHandle");
  162. if (!this.$store.state.isAuth && !this.$store.state.isBind) {
  163. // 已授权已绑定
  164. if (item.IsHaveVideo) {
  165. //跳转路演精华
  166. uni.navigateTo({
  167. url: "/reportPages/roadEssence/roadEssence?id=" + item.ArticleId,
  168. });
  169. } else {
  170. uni.navigateTo({
  171. url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId,
  172. });
  173. }
  174. }
  175. },
  176. },
  177. /* 触底 */
  178. onReachBottom: Throttle(function () {
  179. if (this.status === "nomore") return;
  180. this.status = "loading";
  181. this.page_no++;
  182. if (this.tabAct_id) {
  183. this.getCollectList();
  184. }
  185. }),
  186. /* 下拉刷新 */
  187. onPullDownRefresh: Throttle(function () {
  188. if (this.tabAct_id) {
  189. this.page_no = 1;
  190. this.refresh = true;
  191. this.getCollectList();
  192. }
  193. }),
  194. /**
  195. * 用户点击分享
  196. */
  197. onShareAppMessage: function (res) {
  198. return {
  199. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费试用月卡!" : this.titleReport,
  200. path: "/reportPages/IndustryReport/IndustryReport?id=" + this.industrialManagementId + "&tab=" + this.tabAct_id,
  201. success: (res) => {},
  202. fail: (err) => {},
  203. };
  204. },
  205. };
  206. </script>
  207. <style lang="scss">
  208. .industry-content {
  209. background-color: #f7f7f7;
  210. // height: 100vh;
  211. .top-bg {
  212. position: fixed;
  213. top: 0;
  214. left: 0;
  215. width: 100%;
  216. z-index: 999;
  217. background-color: #d1ebff;
  218. height: 73rpx;
  219. color: #2c83ff;
  220. font-size: 24rpx;
  221. line-height: 73rpx;
  222. text-align: center;
  223. }
  224. .top-box {
  225. position: fixed;
  226. width: 100%;
  227. top: 73rpx;
  228. left: 0;
  229. z-index: 999;
  230. }
  231. .top-tab-cont {
  232. .lucency {
  233. position: absolute;
  234. top: 0;
  235. right: 0;
  236. width: 32px;
  237. height: 30px;
  238. opacity: 0.9;
  239. background-color: #fff;
  240. }
  241. .tab-cont {
  242. padding: retu;
  243. padding: 30rpx 26rpx 0;
  244. background-color: #fff;
  245. font-size: 32rpx;
  246. box-shadow: 0 3rpx 6rpx rgba(187, 216, 255, 0.2);
  247. .scroll-tab {
  248. width: 100%;
  249. white-space: nowrap;
  250. }
  251. .scroll-tab-item {
  252. // flex-grow: 1;
  253. text-align: center;
  254. display: inline-block;
  255. padding: 0rpx 8rpx 30rpx 8rpx;
  256. margin-right: 60rpx;
  257. border-bottom: 8rpx solid transparent;
  258. position: relative;
  259. &:last-child {
  260. margin-right: 0;
  261. }
  262. &.active {
  263. border-bottom: none;
  264. color: #2c83ff;
  265. font-weight: 700;
  266. }
  267. .border_act {
  268. width: 100%;
  269. height: 8rpx;
  270. position: absolute;
  271. bottom: 0;
  272. left: 0;
  273. }
  274. .reg-hint {
  275. position: absolute;
  276. top: 0rpx;
  277. right: -10rpx;
  278. width: 14rpx;
  279. height: 14rpx;
  280. background-color: #ff0000;
  281. border-radius: 50%;
  282. }
  283. }
  284. }
  285. }
  286. .collect-ul {
  287. // margin-top: 30rpx;s
  288. padding-top: 175rpx;
  289. // padding-top: 4rpx;
  290. .collect-ltem {
  291. display: flex;
  292. padding: 30rpx 34rpx;
  293. background: #fff;
  294. margin-bottom: 4rpx;
  295. align-items: center;
  296. justify-content: space-between;
  297. .title {
  298. position: relative;
  299. max-width: 625rpx;
  300. color: #4a4a4a;
  301. font-size: 34rpx;
  302. padding-left: 28rpx;
  303. .reg-text {
  304. position: absolute;
  305. top: 15rpx;
  306. left: 0rpx;
  307. width: 14rpx;
  308. height: 14rpx;
  309. background-color: #ff0000;
  310. border-radius: 50%;
  311. z-index: 9;
  312. }
  313. }
  314. .desc {
  315. margin-top: 17rpx;
  316. padding-left: 28rpx;
  317. width: 625rpx;
  318. color: #999;
  319. }
  320. }
  321. }
  322. }
  323. </style>