secretDetails.vue 6.3 KB

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