lastestReport.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <template>
  2. <view class="lastest-report-container">
  3. <view class="announcement" >
  4. <van-checkbox-group class="checkbox-ui" :value="newCheckboxValue" @change="checkboxChange">
  5. <van-checkbox
  6. style="margin-right: 30rpx; flex-shrink: 0"
  7. shape="square"
  8. icon-size="14"
  9. :name="item.ArticleTypeId"
  10. v-for="item in checkboxGroup"
  11. :key="item.ArticleTypeId"
  12. >{{ item.ArticleTypeName }}</van-checkbox
  13. >
  14. </van-checkbox-group>
  15. <view class="content-ul">
  16. <blok v-if="haveData">
  17. <view class="user-li" v-for="(item, index) in collectionList" :key="item.ArticleId">
  18. <view class="li-item">
  19. <text class="li-type" :style="{ background: item.ButtonStyle }">
  20. {{ item.ArticleTypeName }}
  21. </text>
  22. <view>
  23. <text
  24. class="title"
  25. @click="goDetail(item)"
  26. :style="{ display: 'inline', marginLeft: item.Title.substr(0, 1) != '【' ? '14rpx' : 0 }"
  27. >{{ item.Title }}</text
  28. >
  29. <text class="li-industry" @click="themeDetails(key, '月度收藏榜')" v-for="key in item.List" :key="key.IndustrialManagementId">
  30. # {{ key.IndustryName }}
  31. </text>
  32. </view>
  33. </view>
  34. <view class="li-item li-bottom" style="color: #999999">
  35. <viwe class="time-user">
  36. <text>
  37. {{ item.PublishDate }}
  38. </text>
  39. <view class="li-user" @click="authorDetails(item)">
  40. <image class="user_report-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/user_report.png"></image>
  41. <text class="text_oneLine"> {{ item.NickName }}</text>
  42. </view>
  43. </viwe>
  44. <view class="li-item user-img">
  45. <view class="img-box">
  46. <image class="user-pv" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/examine_icon.png"></image>
  47. <text>
  48. {{ item.Pv }}
  49. </text>
  50. </view>
  51. <view class="img-box" @click="collectClick(item)">
  52. <image v-if="item.IsCollect" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_act.png"></image>
  53. <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/collect_ico.png"></image>
  54. <text class=""> {{ item.CollectNum }}人收藏 </text>
  55. </view>
  56. </view>
  57. </view>
  58. </view>
  59. </blok>
  60. <view class="nodata" v-else>
  61. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  62. <text>暂无活动</text>
  63. </view>
  64. </view>
  65. <u-loadmore :status="status" :load-text="loadText" v-if="page_no > 1" />
  66. </view>
  67. <Loading />
  68. </view>
  69. </template>
  70. <script>
  71. import { Research } from "@/config/api.js";
  72. import purchaserReportListMixins from "../components/purchaser-report-list-mixins.js";
  73. export default {
  74. data() {
  75. return {
  76. collectionList: [], //用户收藏
  77. newCheckboxValue: [],
  78. checkboxGroup: [],
  79. status: "loadmore",
  80. loadText: {
  81. loadmore: "上拉加载更多",
  82. loading: "加载中",
  83. nomore: "已经到底了",
  84. },
  85. page_no: 1,
  86. pageSize: 10,
  87. haveData: true,
  88. }
  89. },
  90. // purchaserReportListMixins 混入了 收藏、作者详情、文章详情、主题详情-method
  91. mixins:[purchaserReportListMixins],
  92. onLoad(option) {
  93. this.researchArticleTypeList();
  94. // this.researchArticleNewList()
  95. this.loadShare(option);
  96. },
  97. /** 用户点击分享 */
  98. onShareAppMessage: function (res) {
  99. return {
  100. title: "最新报告",
  101. path: "pages-purchaser/lastestReport/lastestReport?ArticleTypeIds=" + this.newCheckboxValue.join(","),
  102. };
  103. },
  104. methods: {
  105. loadShare(option){
  106. this.newCheckboxValue = option.ArticleTypeIds?option.ArticleTypeIds.split(',') || []:[]
  107. this.researchArticleNewList();
  108. },
  109. // 复选框组的选择事件
  110. checkboxChange(e) {
  111. this.newCheckboxValue = e.detail;
  112. this.page_no = 1;
  113. this.researchArticleNewList();
  114. },
  115. // 获取最新下的文章类型
  116. async researchArticleTypeList() {
  117. const res = await Research.researchArticleTypeList();
  118. if (res.Ret === 200) {
  119. this.checkboxGroup = res.Data.List;
  120. }
  121. },
  122. // 获取最新的文章列表
  123. async researchArticleNewList() {
  124. const res = await Research.researchArticleNewList({
  125. PageSize: this.pageSize,
  126. CurrentIndex: this.page_no,
  127. ArticleTypeIds: this.newCheckboxValue.join(","),
  128. });
  129. if (res.Ret === 200) {
  130. this.status = res.Data.Paging.IsEnd ? "nomore" : "loadmore";
  131. this.collectionList = this.page_no === 1 ? res.Data.List || [] : [...this.collectionList, ...res.Data.List];
  132. if (this.page_no == 1) {
  133. this.haveData = this.collectionList.length ? true : false;
  134. }
  135. }
  136. },
  137. },
  138. onReachBottom() {
  139. if (this.status == "nomore") return;
  140. this.status = "loading";
  141. this.page_no++;
  142. this.researchArticleNewList();
  143. },
  144. }
  145. </script>
  146. <style lang="scss" scoped>
  147. @import "../components/purchaser-report-list.scss";
  148. .lastest-report-container{
  149. background-color: #f7f7f7;
  150. padding-top: 20rpx;
  151. box-sizing: border-box;
  152. .checkbox-ui {
  153. width: 100%;
  154. padding: 30rpx 0;
  155. overflow: hidden;
  156. overflow-x: auto;
  157. display: flex;
  158. border-bottom: 1rpx solid #ececec;
  159. }
  160. }
  161. </style>
  162. <style lang="scss">
  163. .van-checkbox-group {
  164. display: flex;
  165. flex-wrap: wrap;
  166. }
  167. </style>