secretDetails.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. <view class="item-left">
  6. <text class="title text_twoLine"
  7. >{{ item.Title }}
  8. <text class="reg-text" v-if="item.IsRed"></text>
  9. </text>
  10. <view class="abstract">{{ item.Abstract }}</view>
  11. <view class="desc">
  12. <text class="publishDate">{{ item.PublishDate }}</text>
  13. </view>
  14. </view>
  15. <u-icon name="arrow-right" color="#BDBDBD" size="34"></u-icon>
  16. </view>
  17. <u-loadmore :status="status" icon-type="flower" :load-text="loadText" margin-top="20" v-if="totalPage > 1" />
  18. </view>
  19. <view class="nodata" v-else>
  20. <image src="@/static/img/nodata.png" mode="" class="nodata_ico"></image>
  21. <text>暂时没有报告的内容</text>
  22. </view>
  23. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree"/>
  24. </view>
  25. </template>
  26. <script>
  27. import { Reports } from "@/config/api.js";
  28. import { Throttle } from "@/config/util.js";
  29. import freeCharge from '@/components/freeCharge'
  30. let app = getApp({allowDefault: true});
  31. export default {
  32. data() {
  33. return {
  34. isType: "",
  35. refresh: false, //正在下拉
  36. page_no: 1,
  37. pageSize: 10,
  38. collectList: [],
  39. haveData: true,
  40. totalPage: "",
  41. status: "loadmore",
  42. loadText: {
  43. loadmore: "上拉加载更多",
  44. loading: "加载中",
  45. nomore: "已经到底了",
  46. },
  47. };
  48. },
  49. components: {
  50. freeCharge
  51. },
  52. methods: {
  53. async getList() {
  54. const res = await Reports.reportListByType({
  55. PageSize: this.pageSize,
  56. CurrentIndex: this.page_no,
  57. ReportType: this.isType,
  58. });
  59. if (res.Ret == 200) {
  60. this.status = this.page_no < res.Data.Paging.Pages ? "loadmore" : "nomore";
  61. this.totalPage = res.Data.Paging.Pages; //总页数
  62. if (this.page_no === 1) {
  63. this.collectList = res.Data.List || [];
  64. this.haveData = this.collectList.length ? true : false;
  65. if (this.refresh) {
  66. uni.stopPullDownRefresh();
  67. this.refresh = false;
  68. }
  69. } else {
  70. this.collectList = this.collectList.concat(res.Data.List);
  71. }
  72. }
  73. },
  74. goDetail(item, index) {
  75. /* 无需授权且已绑定 检验是或否有权限 */
  76. this.collectList[index].IsRed = false;
  77. this.$store.dispatch("checkHandle","/reportPages/reportSecretDetail/reportSecretDetail?type=" + this.isType + "&id=" + item.ArticleId)
  78. },
  79. },
  80. onLoad(option) {
  81. this.isType = option.type;
  82. this.isType == 1 ? uni.hideShareMenu() : "";
  83. uni.setNavigationBarTitle({
  84. title: this.isType == 1 ? "报告精选" : this.isType == 2 ? "本周研究汇总" : "上周纪要汇总",
  85. });
  86. this.getList();
  87. },
  88. /* 触底 */
  89. onReachBottom: Throttle(function () {
  90. if (this.status === "nomore") return;
  91. this.status = "loading";
  92. this.page_no++;
  93. this.getList();
  94. }),
  95. /* 下拉刷新 */
  96. onPullDownRefresh: Throttle(function () {
  97. this.page_no = 1;
  98. this.refresh = true;
  99. this.getList();
  100. }),
  101. onShareAppMessage(res) {
  102. return {
  103. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : this.isType == 2 ? "本周研究汇总" : "上周纪要汇总",
  104. path: "/reportPages/secretDetails/secretDetails?type=" + this.isType,
  105. };
  106. },
  107. };
  108. </script>
  109. <style lang="scss" scoped>
  110. @import "../index.scss";
  111. .container-secret {
  112. background-color: #f6f6f6;
  113. .title {
  114. color: #333333 !important;
  115. font-size: 30rpx !important;
  116. font-weight: 400 !important;
  117. }
  118. .abstract {
  119. margin: 20rpx 0 0 30rpx;
  120. color: #666666;
  121. font-size: 28rpx;
  122. font-weight: 400 !important;
  123. }
  124. }
  125. </style>