secretDetails.vue 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="container container-secret">
  3. <view class="tabs-content">
  4. <view :class="['item-li', isType == item.value && 'item-active']" v-for="item in tabsList" :key="item.value" @click="tabsHandler(item)">
  5. {{ item.name }}
  6. <image v-if="isType == item.value" class="border_act" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/border_act.png"></image>
  7. </view>
  8. </view>
  9. <view class="collect-ul" v-if="haveData">
  10. <view class="collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item, index)">
  11. <text class="title text_twoLine"
  12. >{{ item.Title }}
  13. <text class="reg-text" v-if="item.IsRed"></text>
  14. </text>
  15. <view class="content">
  16. <view class="item-left">
  17. <view class="abstract">{{ item.Abstract }}</view>
  18. <view class="desc">
  19. <text class="publishDate">{{ item.PublishDate }}</text>
  20. </view>
  21. </view>
  22. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  23. </view>
  24. </view>
  25. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  26. </view>
  27. <view class="nodata" v-else>
  28. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  29. <text>暂时没有报告的内容</text>
  30. </view>
  31. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  32. </view>
  33. </template>
  34. <script>
  35. import { Reports } from "@/config/api.js";
  36. import { Throttle } from "@/config/util.js";
  37. import freeCharge from "@/components/freeCharge";
  38. let app = getApp({ allowDefault: true });
  39. export default {
  40. data() {
  41. return {
  42. isType: "",
  43. refresh: false, //正在下拉
  44. page_no: 1,
  45. pageSize: 10,
  46. collectList: [],
  47. haveData: true,
  48. totalPage: "",
  49. status: "loadmore",
  50. loadText: {
  51. loadmore: "上拉加载更多",
  52. loading: "加载中",
  53. nomore: "已经到底了",
  54. },
  55. tabsList: [
  56. { name: "本周研究汇总", value: 2 },
  57. { name: "上周纪要汇总", value: 3 },
  58. { name: "报告精选", value: 1 },
  59. ],
  60. };
  61. },
  62. components: {
  63. freeCharge,
  64. },
  65. computed: {
  66. navigationBarTitle() {
  67. return this.isType == 1 ? "报告精选" : this.isType == 2 ? "本周研究汇总" : "上周纪要汇总";
  68. },
  69. },
  70. methods: {
  71. //点击头部的tabs
  72. tabsHandler(item) {
  73. this.isType = item.value;
  74. uni.setNavigationBarTitle({
  75. title: this.navigationBarTitle,
  76. });
  77. this.page_no = 1;
  78. this.getList();
  79. },
  80. //获取数据
  81. async getList() {
  82. const res = await Reports.reportListByType({
  83. PageSize: this.pageSize,
  84. CurrentIndex: this.page_no,
  85. ReportType: this.isType,
  86. });
  87. if (res.Ret == 200) {
  88. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  89. this.totalPage = res.Data.Paging.Pages; //总页数
  90. if (this.page_no === 1) {
  91. this.collectList = res.Data.List || [];
  92. this.haveData = this.collectList.length ? true : false;
  93. if (this.refresh) {
  94. uni.stopPullDownRefresh();
  95. this.refresh = false;
  96. }
  97. } else {
  98. this.collectList = this.collectList.concat(res.Data.List);
  99. }
  100. }
  101. },
  102. //跳转详情
  103. goDetail(item, index) {
  104. /* 无需授权且已绑定 检验是或否有权限 */
  105. this.collectList[index].IsRed = false;
  106. this.$store.dispatch("checkHandle", "/reportPages/reportSecretDetail/reportSecretDetail?type=" + this.isType + "&id=" + item.ArticleId);
  107. },
  108. },
  109. onLoad(option) {
  110. this.isType = option.type;
  111. this.isType == 1 ? uni.hideShareMenu() : "";
  112. uni.setNavigationBarTitle({
  113. title: this.isType == 1 ? "报告精选" : this.isType == 2 ? "本周研究汇总" : "上周纪要汇总",
  114. });
  115. this.getList();
  116. },
  117. /* 触底 */
  118. onReachBottom: Throttle(function () {
  119. if (this.status === "nomore") return;
  120. this.status = "loading";
  121. this.page_no++;
  122. this.getList();
  123. }),
  124. /* 下拉刷新 */
  125. onPullDownRefresh: Throttle(function () {
  126. this.page_no = 1;
  127. this.refresh = true;
  128. this.getList();
  129. }),
  130. /* 用户点击分享 */
  131. onShareAppMessage: function (res) {
  132. return {
  133. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.navigationBarTitle,
  134. path: "/reportPages/secretDetails/secretDetails?type=" + this.isType,
  135. success: (res) => {},
  136. fail: (err) => {},
  137. };
  138. },
  139. };
  140. </script>
  141. <style lang="scss" scoped>
  142. .container-secret {
  143. background: #f7f7f7;
  144. padding-bottom: 30rpx;
  145. .tabs-content {
  146. position: sticky;
  147. top: -1rpx;
  148. left: 0;
  149. background-color: #fff;
  150. height: 81rpx;
  151. display: flex;
  152. font-size: 30rpx;
  153. font-weight: 400;
  154. padding: 21rpx 35rpx 0;
  155. color: #999999;
  156. z-index: 99;
  157. .item-li {
  158. position: relative;
  159. margin-right: 60rpx;
  160. .border_act {
  161. width: 60%;
  162. height: 6rpx;
  163. position: absolute;
  164. bottom: 0rpx;
  165. left: 50%;
  166. transform: translateX(-50%);
  167. }
  168. }
  169. .item-active {
  170. color: #333333;
  171. font-weight: 500;
  172. }
  173. }
  174. .collect-ul {
  175. padding-top: 4rpx;
  176. .collect-ltem {
  177. padding: 30rpx 20rpx 30rpx 34rpx;
  178. background: #fff;
  179. margin-bottom: 4rpx;
  180. width: 682rpx;
  181. margin: 20rpx auto 0;
  182. .title {
  183. position: relative;
  184. color: #4a4a4a;
  185. font-size: 34rpx;
  186. padding-left: 28rpx;
  187. .reg-text {
  188. position: absolute;
  189. top: 15rpx;
  190. left: 0rpx;
  191. width: 14rpx;
  192. height: 14rpx;
  193. background-color: #ff0000;
  194. border-radius: 50%;
  195. z-index: 9;
  196. }
  197. }
  198. .content {
  199. display: flex;
  200. align-items: center;
  201. justify-content: space-between;
  202. }
  203. .desc {
  204. display: flex;
  205. align-items: center;
  206. margin-top: 17rpx;
  207. padding-left: 28rpx;
  208. color: #999;
  209. }
  210. .publishDate {
  211. margin-right: 30rpx;
  212. white-space: nowrap;
  213. }
  214. .text-name {
  215. color: #2c83ff;
  216. font-size: 26rpx;
  217. }
  218. }
  219. }
  220. .title {
  221. color: #333333;
  222. font-size: 30rpx;
  223. font-weight: 400;
  224. width: 100%;
  225. padding-bottom: 15rpx;
  226. border-bottom: 1px dashed #ccc;
  227. }
  228. .abstract {
  229. margin: 20rpx 0 0 30rpx;
  230. color: #666666;
  231. font-size: 28rpx;
  232. font-weight: 400;
  233. padding-right: 10rpx;
  234. }
  235. }
  236. </style>