lastestReport.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392
  1. <template>
  2. <view class="lastest-report-container">
  3. <view class="announcement">
  4. <view class="checkbox-content">
  5. <van-checkbox-group class="checkbox-ui" :value="newCheckboxValue" @change="checkboxChange">
  6. <van-checkbox style="margin-right: 30rpx; flex-shrink: 0" shape="square" icon-size="14" :name="item.ArticleTypeId" v-for="item in checkboxGroup" :key="item.ArticleTypeId">
  7. {{ item.ArticleTypeName }}
  8. </van-checkbox>
  9. </van-checkbox-group>
  10. </view>
  11. <view class="content-ul">
  12. <blok v-if="haveData">
  13. <view class="global_card_content user-li" v-for="item in collectionList" :key="item.ArticleId">
  14. <view class="li-item">
  15. <text class="li-type global_content_center">
  16. {{ item.ArticleTypeName }}
  17. </text>
  18. <view>
  19. <text class="global_title" @click="goDetail(item)" :style="{ display: 'inline', marginLeft: item.Title.substr(0, 1) != '【' ? '14rpx' : 0 }">{{ item.Title }}</text>
  20. <block v-if="item.SpecialTags">
  21. <text style="color: #90aeda" @click="themeDetails(key, '月度收藏榜')" v-for="it in item.SpecialTags.split(',')" class="li-industry" :key="it">#{{ it }}</text>
  22. </block>
  23. <text class="li-industry" @click="themeDetails(key, '月度收藏榜')" v-for="key in item.List" :key="key.IndustrialManagementId"> # {{ key.IndustryName }} </text>
  24. </view>
  25. </view>
  26. <view class="li-bottom" style="color: #999999">
  27. <viwe class="time-user">
  28. <view class="time">
  29. {{ item.PublishDate }}
  30. </view>
  31. <view class="li-user" @click="authorDetails(item)">
  32. <image class="user_report-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/user_report.png"></image>
  33. <text class="text_oneLine"> {{ item.NickName }}</text>
  34. </view>
  35. </viwe>
  36. <view class="user-img">
  37. <view class="img-box">
  38. <image class="user-pv" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/examine_icon.png"></image>
  39. <text>
  40. {{ item.Pv }}
  41. </text>
  42. </view>
  43. <view class="img-box" @click="collectClick(item)">
  44. <image v-if="item.IsCollect" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collect_act.png"></image>
  45. <image v-else src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/collect_ico.png"></image>
  46. <text class=""> {{ item.CollectNum }} </text>
  47. </view>
  48. </view>
  49. </view>
  50. </view>
  51. </blok>
  52. <view class="nodata" v-else>
  53. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/act_search.png" mode="" class="nodata_ico"></image>
  54. <text>暂无活动</text>
  55. </view>
  56. </view>
  57. <u-loadmore :status="status" :load-text="loadText" v-if="page_no > 1" />
  58. </view>
  59. <Loading />
  60. </view>
  61. </template>
  62. <script>
  63. import { Research } from "@/config/api.js";
  64. import purchaserReportListMixins from "../components/purchaser-report-list-mixins.js";
  65. export default {
  66. data() {
  67. return {
  68. collectionList: [], //用户收藏
  69. newCheckboxValue: [],
  70. checkboxGroup: [],
  71. status: "loadmore",
  72. loadText: {
  73. loadmore: "上拉加载更多",
  74. loading: "加载中",
  75. nomore: "已经到底了",
  76. },
  77. page_no: 1,
  78. pageSize: 10,
  79. haveData: true,
  80. };
  81. },
  82. // purchaserReportListMixins 混入了 收藏、作者详情、文章详情、主题详情-method
  83. mixins: [purchaserReportListMixins],
  84. onLoad(option) {
  85. this.researchArticleTypeList();
  86. // this.researchArticleNewList()
  87. this.loadShare(option);
  88. },
  89. /** 用户点击分享 */
  90. onShareAppMessage: function (res) {
  91. return {
  92. title: "最新报告",
  93. path: "pages-purchaser/lastestReport/lastestReport?ArticleTypeIds=" + this.newCheckboxValue.join(","),
  94. };
  95. },
  96. methods: {
  97. loadShare(option) {
  98. this.newCheckboxValue = option.ArticleTypeIds ? option.ArticleTypeIds.split(",") || [] : [];
  99. this.researchArticleNewList();
  100. },
  101. // 复选框组的选择事件
  102. checkboxChange(e) {
  103. this.newCheckboxValue = e.detail;
  104. this.page_no = 1;
  105. this.researchArticleNewList();
  106. },
  107. // 获取最新下的文章类型
  108. async researchArticleTypeList() {
  109. const res = await Research.researchArticleTypeList();
  110. if (res.Ret === 200) {
  111. this.checkboxGroup = res.Data.List;
  112. }
  113. },
  114. // 获取最新的文章列表
  115. async researchArticleNewList() {
  116. const res = await Research.researchArticleNewList({
  117. PageSize: this.pageSize,
  118. CurrentIndex: this.page_no,
  119. ArticleTypeIds: this.newCheckboxValue.join(","),
  120. });
  121. if (res.Ret === 200) {
  122. this.status = res.Data.Paging.IsEnd ? "nomore" : "loadmore";
  123. this.collectionList = this.page_no === 1 ? res.Data.List || [] : [...this.collectionList, ...res.Data.List];
  124. if (this.page_no == 1) {
  125. this.haveData = this.collectionList.length ? true : false;
  126. }
  127. }
  128. },
  129. },
  130. onReachBottom() {
  131. if (this.status == "nomore") return;
  132. this.status = "loading";
  133. this.page_no++;
  134. this.researchArticleNewList();
  135. },
  136. };
  137. </script>
  138. <style lang="scss" scoped>
  139. .lastest-report-container {
  140. background-color: $uni-bg-color;
  141. box-sizing: border-box;
  142. padding: 116rpx 30rpx 30rpx;
  143. .checkbox-content {
  144. position: fixed;
  145. top: 0;
  146. left: 0;
  147. z-index: 9;
  148. width: 100%;
  149. // height: 80rpx;
  150. background-color: #fff;
  151. padding: 30rpx;
  152. }
  153. /deep/ .van-checkbox-group {
  154. display: flex;
  155. overflow: hidden;
  156. overflow-x: auto;
  157. }
  158. .content-ul {
  159. margin: 20rpx 0 0;
  160. border-top: 1px solid #f6f6f6;
  161. .user-li,
  162. .kol-li,
  163. .hot-li {
  164. margin-bottom: 20rpx;
  165. background-color: #fff;
  166. }
  167. .li-serial {
  168. width: 26rpx;
  169. height: 26rpx;
  170. line-height: 26rpx;
  171. color: #fff;
  172. font-size: 20rpx;
  173. text-align: center;
  174. border-radius: 4rpx 4rpx 4rpx 4rpx;
  175. margin: 7rpx 10rpx 0 20rpx;
  176. flex-shrink: 0;
  177. }
  178. .serial-number {
  179. margin-top: 0 !important;
  180. }
  181. .li-item {
  182. display: flex;
  183. .li-industry {
  184. color: $uni-color-new;
  185. margin-left: 20rpx;
  186. display: inline-block;
  187. font-size: 32rpx;
  188. font-weight: 600;
  189. }
  190. .li-title {
  191. display: flex;
  192. }
  193. }
  194. .li-type {
  195. width: 126rpx;
  196. height: 42rpx;
  197. color: #928563;
  198. font-size: 24rpx;
  199. font-weight: 500;
  200. border-radius: 38rpx;
  201. background-color: #f2e8cc;
  202. flex-shrink: 0;
  203. margin-right: 10rpx;
  204. }
  205. .kol-item {
  206. display: flex;
  207. flex-wrap: wrap;
  208. width: 480rpx;
  209. height: 120rpx;
  210. align-items: baseline;
  211. margin-bottom: 20rpx;
  212. .item-top {
  213. width: 100%;
  214. display: flex;
  215. align-items: center;
  216. justify-content: space-between;
  217. font-size: 29rpx;
  218. font-weight: 700;
  219. }
  220. .kol-text {
  221. width: 50%;
  222. margin-top: 10rpx;
  223. flex-shrink: 0;
  224. font-size: 24rpx;
  225. font-weight: 400;
  226. color: #333;
  227. }
  228. }
  229. .li-bottom {
  230. display: flex;
  231. justify-content: space-between;
  232. align-items: center;
  233. margin-top: 30rpx;
  234. width: 100%;
  235. font-size: 24rpx;
  236. .user-img {
  237. display: flex;
  238. align-items: center;
  239. justify-content: flex-end;
  240. width: 39%;
  241. image {
  242. width: 26rpx;
  243. height: 26rpx;
  244. margin-right: 10rpx;
  245. }
  246. view {
  247. display: flex;
  248. align-items: center;
  249. flex-shrink: 0;
  250. margin-left: 20rpx;
  251. }
  252. .user-pv {
  253. width: 30rpx;
  254. height: 30rpx;
  255. }
  256. }
  257. .time-user {
  258. display: flex;
  259. align-items: center;
  260. flex: 1;
  261. .time {
  262. width: 200rpx;
  263. }
  264. view {
  265. display: flex;
  266. align-items: center;
  267. flex-shrink: 0;
  268. }
  269. image {
  270. width: 24rpx;
  271. height: 24rpx;
  272. margin-right: 10rpx;
  273. }
  274. }
  275. }
  276. .read-more {
  277. margin-top: 10rpx;
  278. display: flex;
  279. flex-wrap: wrap;
  280. .industry-video-item {
  281. height: 106rpx;
  282. width: 150rpx;
  283. margin: 0 10rpx 10rpx 0;
  284. border-radius: 8rpx;
  285. background-size: cover;
  286. background-position: center;
  287. background-repeat: no-repeat;
  288. font-weight: 500;
  289. font-size: 24rpx;
  290. color: white;
  291. line-height: 45rpx;
  292. padding: 20rpx;
  293. position: relative;
  294. overflow: hidden;
  295. .industry-video-icon {
  296. height: 0rpx;
  297. width: 0rpx;
  298. border-style: solid;
  299. border-color: #376cbb #376cbb transparent transparent;
  300. border-width: 28rpx;
  301. position: absolute;
  302. right: 0;
  303. top: 0;
  304. image {
  305. position: absolute;
  306. right: -24rpx;
  307. bottom: 0;
  308. height: 20rpx;
  309. width: 20rpx;
  310. }
  311. }
  312. }
  313. .text-box {
  314. padding: 0;
  315. margin: 0 10rpx 10rpx 0;
  316. font-size: 24rpx;
  317. color: $uni-color-new;
  318. width: 150rpx;
  319. height: 48rpx;
  320. text-indent: 0em;
  321. line-height: 48rpx;
  322. text-align: center;
  323. background-color: #f8f8fa;
  324. border-radius: 200rpx;
  325. }
  326. }
  327. .hot-item {
  328. justify-content: space-between;
  329. align-items: center;
  330. .hot-new {
  331. align-items: center;
  332. flex: 1;
  333. padding-right: 20rpx;
  334. }
  335. .new-img {
  336. width: 26rpx;
  337. height: 28rpx;
  338. margin-left: 15rpx;
  339. flex-shrink: 0;
  340. }
  341. }
  342. }
  343. .kol-li {
  344. display: flex;
  345. align-items: center;
  346. padding-bottom: 30rpx;
  347. image {
  348. width: 120rpx;
  349. height: 120rpx;
  350. border-radius: 8rpx;
  351. margin: 0 20rpx 0 15rpx;
  352. overflow: hidden;
  353. flex-shrink: 0;
  354. }
  355. }
  356. .content-bottom {
  357. background-color: $uni-bg-color;
  358. text-align: center;
  359. line-height: 100rpx;
  360. color: #c4c4c4;
  361. font-size: 20rpx;
  362. }
  363. .industry-color {
  364. font-size: 26rpx;
  365. padding: 0rpx 20rpx;
  366. border-radius: 4rpx;
  367. margin-left: 20rpx;
  368. }
  369. .follw {
  370. color: #fff;
  371. border-radius: 4rpx;
  372. font-size: 24rpx;
  373. width: 110rpx;
  374. height: 42rpx;
  375. background-color: $uni-color-new;
  376. }
  377. .cancel-follw {
  378. background-color: #e5efff;
  379. color: $uni-color-new;
  380. }
  381. }
  382. </style>
  383. <style lang="scss"></style>