secretDetails.vue 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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.getList();
  104. },
  105. /* 触底 */
  106. onReachBottom: Throttle(function () {
  107. if (this.status === "nomore") return;
  108. this.status = "loading";
  109. this.page_no++;
  110. this.getList();
  111. }),
  112. /* 下拉刷新 */
  113. onPullDownRefresh: Throttle(function () {
  114. this.page_no = 1;
  115. this.refresh = true;
  116. this.getList();
  117. }),
  118. /* 用户点击分享 */
  119. onShareAppMessage: function (res) {
  120. return {
  121. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "周度汇总",
  122. path: "/reportPages/secretDetails/secretDetails?type=" + this.isType,
  123. success: (res) => {},
  124. fail: (err) => {},
  125. };
  126. },
  127. };
  128. </script>
  129. <style lang="scss" scoped>
  130. .container-secret {
  131. background: #f7f7f7;
  132. padding-bottom: 30rpx;
  133. .tabs-content {
  134. position: sticky;
  135. top: -1rpx;
  136. left: 0;
  137. background-color: #fff;
  138. height: 81rpx;
  139. display: flex;
  140. font-size: 30rpx;
  141. font-weight: 400;
  142. padding: 21rpx 35rpx 0;
  143. color: #999999;
  144. z-index: 99;
  145. .item-li {
  146. position: relative;
  147. margin-right: 60rpx;
  148. .border_act {
  149. width: 60%;
  150. height: 6rpx;
  151. position: absolute;
  152. bottom: 0rpx;
  153. left: 50%;
  154. transform: translateX(-50%);
  155. }
  156. }
  157. .item-active {
  158. color: #333333;
  159. font-weight: 500;
  160. }
  161. }
  162. .collect-ul {
  163. padding-top: 4rpx;
  164. .collect-ltem {
  165. padding: 30rpx 20rpx 30rpx 34rpx;
  166. background: #fff;
  167. margin-bottom: 4rpx;
  168. width: 682rpx;
  169. margin: 20rpx auto 0;
  170. .title {
  171. position: relative;
  172. color: #4a4a4a;
  173. font-size: 34rpx;
  174. padding-left: 28rpx;
  175. .reg-text {
  176. position: absolute;
  177. top: 15rpx;
  178. left: 0rpx;
  179. width: 14rpx;
  180. height: 14rpx;
  181. background-color: #ff0000;
  182. border-radius: 50%;
  183. z-index: 9;
  184. }
  185. }
  186. .content {
  187. display: flex;
  188. align-items: center;
  189. justify-content: space-between;
  190. }
  191. .desc {
  192. display: flex;
  193. align-items: center;
  194. margin-top: 17rpx;
  195. padding-left: 28rpx;
  196. color: #999;
  197. }
  198. .publishDate {
  199. margin-right: 30rpx;
  200. white-space: nowrap;
  201. }
  202. .text-name {
  203. color: #2c83ff;
  204. font-size: 26rpx;
  205. }
  206. }
  207. }
  208. .title {
  209. color: #333333;
  210. font-size: 30rpx;
  211. font-weight: 400;
  212. width: 100%;
  213. padding-bottom: 15rpx;
  214. border-bottom: 1px dashed #ccc;
  215. }
  216. .abstract {
  217. margin: 20rpx 0 0 30rpx;
  218. color: #666666;
  219. font-size: 28rpx;
  220. font-weight: 400;
  221. padding-right: 10rpx;
  222. }
  223. }
  224. </style>