secretDetails.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="container container-secret">
  3. <view class="global_one_tabs">
  4. <view :class="['item', isType == item.value && 'tabs-active']" v-for="item in tabsList" :key="item.value" @click="tabsHandler(item)">
  5. {{ item.name }}
  6. </view>
  7. </view>
  8. <view class="collect-ul" v-if="haveData">
  9. <view class="global_card_content collect-ltem" v-for="(item, index) in collectList" :key="index" @click="goDetail(item)">
  10. <view>
  11. <text class="title global_title text_twoLine">
  12. {{ item.Title }}
  13. <text class="reg-text" v-if="item.IsRed"></text>
  14. </text>
  15. <view class="content">
  16. {{ item.Abstract }}
  17. </view>
  18. <view class="desc">{{ item.PublishDate }} </view>
  19. </view>
  20. <view class="right-icon">
  21. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  22. </view>
  23. </view>
  24. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  25. </view>
  26. <view class="nodata" v-else>
  27. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  28. <text>暂时没有报告的内容</text>
  29. </view>
  30. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  31. <Loading />
  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: 2,
  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. methods: {
  67. //点击头部的tabs
  68. tabsHandler(item) {
  69. this.isType = item.value;
  70. this.page_no = 1;
  71. this.getList();
  72. },
  73. //获取数据
  74. async getList() {
  75. const res = await Reports.reportListByType({
  76. PageSize: this.pageSize,
  77. CurrentIndex: this.page_no,
  78. ReportType: this.isType,
  79. });
  80. if (res.Ret == 200) {
  81. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  82. this.totalPage = res.Data.Paging.Pages; //总页数
  83. if (this.page_no === 1) {
  84. this.collectList = res.Data.List || [];
  85. this.haveData = this.collectList.length ? true : false;
  86. if (this.refresh) {
  87. uni.stopPullDownRefresh();
  88. this.refresh = false;
  89. }
  90. } else {
  91. this.collectList = this.collectList.concat(res.Data.List);
  92. }
  93. }
  94. },
  95. //跳转详情
  96. goDetail(item) {
  97. /* 无需授权且已绑定 检验是或否有权限 */
  98. item.IsRed = false;
  99. uni.navigateTo({ url: "/reportPages/reportSecretDetail/reportSecretDetail?type=" + this.isType + "&id=" + item.ArticleId });
  100. },
  101. },
  102. onLoad(option) {
  103. this.isType = option.type || 2;
  104. this.getList();
  105. },
  106. /* 触底 */
  107. onReachBottom: Throttle(function () {
  108. if (this.status === "nomore") return;
  109. this.status = "loading";
  110. this.page_no++;
  111. this.getList();
  112. }),
  113. /* 下拉刷新 */
  114. onPullDownRefresh: Throttle(function () {
  115. this.page_no = 1;
  116. this.refresh = true;
  117. this.getList();
  118. }),
  119. /* 用户点击分享 */
  120. onShareAppMessage: function (res) {
  121. return {
  122. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "周度汇总",
  123. path: "/reportPages/secretDetails/secretDetails?type=" + this.isType,
  124. success: (res) => {},
  125. fail: (err) => {},
  126. };
  127. },
  128. };
  129. </script>
  130. <style lang="scss" scoped>
  131. .container-secret {
  132. background: $uni-bg-color;
  133. padding-bottom: 30rpx;
  134. .global_one_tabs {
  135. .item {
  136. flex: 1;
  137. }
  138. }
  139. .collect-ul {
  140. padding-top: 4rpx;
  141. .collect-ltem {
  142. padding: 20rpx 20rpx;
  143. border-top: 4rpx solid $uni-color-new;
  144. background: #fff;
  145. margin-bottom: 4rpx;
  146. width: 682rpx;
  147. margin: 20rpx auto 0;
  148. display: flex;
  149. justify-content: space-between;
  150. .right-icon {
  151. display: flex;
  152. align-items: center;
  153. }
  154. .title {
  155. position: relative;
  156. padding-left: 28rpx;
  157. margin-bottom: 10rpx;
  158. .reg-text {
  159. position: absolute;
  160. top: 15rpx;
  161. left: 0rpx;
  162. width: 14rpx;
  163. height: 14rpx;
  164. background-color: #ff0000;
  165. border-radius: 50%;
  166. z-index: 9;
  167. }
  168. }
  169. .content {
  170. width: 610rpx;
  171. margin-right: 10rpx;
  172. background-color: #f8f8fa;
  173. padding: 10rpx 20rpx 10rpx 25rpx;
  174. color: #999;
  175. border-radius: 4rpx;
  176. }
  177. .desc {
  178. display: flex;
  179. align-items: center;
  180. margin-top: 17rpx;
  181. padding-left: 24rpx;
  182. color: #999;
  183. }
  184. }
  185. }
  186. }
  187. </style>