lastestReport.vue 11 KB

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