secretDetails.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232
  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. </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. this.$store.dispatch("checkHandle", "/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: #f7f7f7;
  133. padding-bottom: 30rpx;
  134. .tabs-content {
  135. position: sticky;
  136. top: -1rpx;
  137. left: 0;
  138. background-color: #fff;
  139. height: 81rpx;
  140. display: flex;
  141. font-size: 30rpx;
  142. font-weight: 400;
  143. padding: 21rpx 35rpx 0;
  144. color: #999999;
  145. z-index: 99;
  146. .item-li {
  147. position: relative;
  148. margin-right: 60rpx;
  149. .border_act {
  150. width: 60%;
  151. height: 6rpx;
  152. position: absolute;
  153. bottom: 0rpx;
  154. left: 50%;
  155. transform: translateX(-50%);
  156. }
  157. }
  158. .item-active {
  159. color: #333333;
  160. font-weight: 500;
  161. }
  162. }
  163. .collect-ul {
  164. padding-top: 4rpx;
  165. .collect-ltem {
  166. padding: 30rpx 20rpx 30rpx 34rpx;
  167. background: #fff;
  168. margin-bottom: 4rpx;
  169. width: 682rpx;
  170. margin: 20rpx auto 0;
  171. .title {
  172. position: relative;
  173. color: #4a4a4a;
  174. font-size: 34rpx;
  175. padding-left: 28rpx;
  176. .reg-text {
  177. position: absolute;
  178. top: 15rpx;
  179. left: 0rpx;
  180. width: 14rpx;
  181. height: 14rpx;
  182. background-color: #ff0000;
  183. border-radius: 50%;
  184. z-index: 9;
  185. }
  186. }
  187. .content {
  188. display: flex;
  189. align-items: center;
  190. justify-content: space-between;
  191. }
  192. .desc {
  193. display: flex;
  194. align-items: center;
  195. margin-top: 17rpx;
  196. padding-left: 28rpx;
  197. color: #999;
  198. }
  199. .publishDate {
  200. margin-right: 30rpx;
  201. white-space: nowrap;
  202. }
  203. .text-name {
  204. color: #2c83ff;
  205. font-size: 26rpx;
  206. }
  207. }
  208. }
  209. .title {
  210. color: #333333;
  211. font-size: 30rpx;
  212. font-weight: 400;
  213. width: 100%;
  214. padding-bottom: 15rpx;
  215. border-bottom: 1px dashed #ccc;
  216. }
  217. .abstract {
  218. margin: 20rpx 0 0 30rpx;
  219. color: #666666;
  220. font-size: 28rpx;
  221. font-weight: 400;
  222. padding-right: 10rpx;
  223. }
  224. }
  225. </style>