secretDetails.vue 5.2 KB

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