purchaser.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409
  1. <template>
  2. <view class="container resear-container">
  3. <view class="top-content-box">
  4. <search-bar @goSearch="goSearch" :searchTitle="searchPlaceholderList.SummarySearch" :width="70" />
  5. </view>
  6. <view class="resear-body">
  7. <view class="resear-banner-box">
  8. <view class="banner-box-left">
  9. <swiper autoplay :interval="4000" circular indicator-dots indicator-color="rgba(255, 255, 255, 0.43)" indicator-active-color="#ffffff">
  10. <swiper-item v-for="item in bannerDataList" :key="item.IndexImg" @click="bannerSwiperHandler(item)" class="swiper-item">
  11. <image :src="item.IndexImg"></image>
  12. </swiper-item>
  13. </swiper>
  14. </view>
  15. <view class="banner-box-right">
  16. <image :src="researchBanner.IndexImg" @click="bannerSwiperHandler(null)"></image>
  17. </view>
  18. </view>
  19. <view class="purchaser-content-box">
  20. <view class="purchaser-content-box-head">
  21. <view class="content-box-head-title">
  22. <image src="https://hzstatic.hzinsights.com/cygx/icon/purchaser-report.png"></image>
  23. <text>近期报告更新</text>
  24. </view>
  25. <view class="content-box-head-more" @click="toReportTotal">
  26. <text>全部更新</text>
  27. <image src="https://hzstatic.hzinsights.com/cygx/icon/right-arrow-circle.png"></image>
  28. </view>
  29. </view>
  30. <view class="purchaser-content-box-body">
  31. <view class="purchaser-content-box-row" v-for="item in recentReportList" :key="item.ArticleId">
  32. <text class="purchaser-content-row-tag" :style="{ padding: item.ArticleTypeName.length == 2 ? '4rpx 28rpx' : '4rpx 15rpx' }">
  33. {{ item.ArticleTypeName }}
  34. </text>
  35. <view class="purchaser-content-row-title" :style="{ marginLeft: item.Title.substr(0, 1) != '【' ? '14rpx' : 0 }" @click="goDetail(item)">
  36. {{ item.Title }}
  37. <text v-for="it in item.List" class="purchaser-content-row-object" :key="it.IndustrialManagementId" @click.stop="themeDetails(it, '月度收藏榜')">#{{ it.IndustryName }}</text>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. <view class="purchaser-content-box">
  43. <view class="purchaser-content-box-head">
  44. <view class="content-box-head-title">
  45. <image src="https://hzstatic.hzinsights.com/cygx/icon/purchaser.png"></image>
  46. <text>研选活动</text>
  47. </view>
  48. <view class="content-box-head-more" @click="toActivityTotal">
  49. <text>查看全部</text>
  50. <image src="https://hzstatic.hzinsights.com/cygx/icon/right-arrow-circle.png"></image>
  51. </view>
  52. </view>
  53. <purchaserActivityList style="width: 682rpx" ref="purchaserActivityListRef">
  54. <view class="no-data-box">
  55. <view class="no-data">
  56. <image src="https://hzstatic.hzinsights.com/cygx/icon/activity-no-data.png"></image>
  57. <text>暂无对应活动</text>
  58. </view>
  59. <view class="end-activity-text" @click="endActivity">已结束活动>></view>
  60. </view>
  61. <view class="end-activity-text" @click="endActivity" slot="finished">已结束活动>></view>
  62. </purchaserActivityList>
  63. </view>
  64. </view>
  65. <!-- <view class="notice-content" v-if="wholeShowListData.YanXuan_Explain">
  66. <view class="notice">
  67. <image src="https://hzchart.oss-cn-shanghai.aliyuncs.com/cygx/czbk/placard_icon.png"></image>
  68. <view class="notice-bar">
  69. <van-notice-bar color="#3385FF" background="#DFECFF" text="买方研选内容试行阶段,限时免费。也欢迎您向我们提宝贵建议。" />
  70. </view>
  71. </view>
  72. </view> -->
  73. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  74. <Loading />
  75. </view>
  76. </template>
  77. <script>
  78. import freeCharge from "@/components/freeCharge";
  79. import SearchBar from "@/components/search-bar/searchBar.vue";
  80. import purchaserActivityList from "@/components/activity/purchaserActivityList.vue";
  81. import { purchaserApi } from "@/config/modules/purchaser.js";
  82. import { Research, activity } from "@/config/api.js";
  83. import { Throttle } from "@/config/util.js";
  84. export default {
  85. components: { freeCharge, SearchBar, purchaserActivityList },
  86. data() {
  87. return {
  88. //==============================
  89. bannerDataList: [],
  90. researchBanner: {},
  91. recentReportList: [],
  92. };
  93. },
  94. methods: {
  95. getBannerData() {
  96. //获取banner信息
  97. purchaserApi.getPurchaserBanner().then((res) => {
  98. console.log(res);
  99. if (res.Ret === 200) {
  100. this.researchBanner = res.Data.ListB[0] || {};
  101. this.bannerDataList = res.Data.ListA || [];
  102. }
  103. });
  104. },
  105. async getRecentReportList() {
  106. // 获取最近更新报告
  107. const res = await Research.researchArticleNewList({
  108. PageSize: 5,
  109. CurrentIndex: 1,
  110. ArticleTypeIds: "",
  111. });
  112. if (res.Ret === 200) {
  113. this.recentReportList = res.Data.List || [];
  114. }
  115. },
  116. //去往文章详情页面
  117. goDetail(item) {
  118. if (item.IsSpecial == 1) {
  119. uni.navigateTo({ url: "/pages-purchaser/specialColumn/specialColumn" });
  120. return;
  121. }
  122. this.$store.commit("setRouterReport", "月度收藏榜");
  123. uni.navigateTo({ url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId });
  124. },
  125. //去往主题详情
  126. themeDetails(item, source) {
  127. uni.navigateTo({ url: "/reportPages/researchTheme/researchTheme?id=" + item.IndustrialManagementId + "&pageRouter=" + source });
  128. },
  129. // 跳转研选已结束活动
  130. endActivity() {
  131. uni.navigateTo({
  132. url: "/pages-purchaser/finishedActivity/finishedActivity",
  133. });
  134. },
  135. // 宣传单跳转
  136. bannerSwiperHandler(item) {
  137. if (!item) {
  138. // 榜单
  139. uni.navigateTo({
  140. url: "/pages-purchaser/researchList/researchList",
  141. });
  142. return;
  143. }
  144. uni.navigateTo({
  145. url: "/" + item.Path,
  146. });
  147. },
  148. toReportTotal() {
  149. uni.navigateTo({
  150. url: "/pages-purchaser/lastestReport/lastestReport",
  151. });
  152. },
  153. toActivityTotal() {
  154. uni.navigateTo({
  155. url: "/pages-purchaser/purchaserActivity/purchaserActivity",
  156. });
  157. },
  158. /* 搜索 */
  159. async goSearch() {
  160. await this.$store.dispatch("checkHandle", "/pages-search/indedxSearch/indedxSearch?id=研选" + "&source=买方研选页面");
  161. },
  162. },
  163. onLoad() {
  164. this.getBannerData();
  165. this.getRecentReportList();
  166. this.$refs.purchaserActivityListRef.reloadActivityList();
  167. },
  168. onShow() {
  169. this.$store.commit("setRouterReport", "买方研选");
  170. this.getRecordTracking("买方研选");
  171. },
  172. /**
  173. * 用户点击分享
  174. */
  175. onShareAppMessage: function (res) {
  176. return {
  177. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "买方研选",
  178. path: "pages/purchaser/purchaser",
  179. success: (res) => {},
  180. fail: (err) => {},
  181. };
  182. },
  183. onReachBottom: Throttle(function () {
  184. if (this.$refs.purchaserActivityListRef.page_no >= this.$refs.purchaserActivityListRef.pages) return;
  185. this.$refs.purchaserActivityListRef.loadActivityMore();
  186. }),
  187. };
  188. </script>
  189. <style lang="scss">
  190. .resear-container {
  191. background-color: #f3f5f9;
  192. .top-content-box {
  193. position: sticky;
  194. top: 0;
  195. left: 0;
  196. right: 0;
  197. z-index: 999;
  198. padding-left: 30rpx;
  199. background-color: white;
  200. }
  201. .resear-body {
  202. padding: 20rpx 34rpx;
  203. box-sizing: border-box;
  204. .resear-banner-box {
  205. display: flex;
  206. align-items: center;
  207. margin-bottom: 20rpx;
  208. .banner-box-left {
  209. height: 110rpx;
  210. width: 448rpx;
  211. margin-right: 20rpx;
  212. swiper {
  213. height: 100%;
  214. width: 100%;
  215. image {
  216. height: 100%;
  217. width: 100%;
  218. border-radius: 8rpx;
  219. }
  220. }
  221. }
  222. .banner-box-right {
  223. image {
  224. height: 110rpx;
  225. width: 214rpx;
  226. vertical-align: bottom;
  227. border-radius: 8rpx;
  228. }
  229. }
  230. }
  231. .purchaser-content-box {
  232. margin-bottom: 20rpx;
  233. .purchaser-content-box-head {
  234. display: flex;
  235. align-items: center;
  236. justify-content: space-between;
  237. padding: 20rpx;
  238. font-size: 28rpx;
  239. font-weight: 400;
  240. color: #3385ff;
  241. .content-box-head-title {
  242. display: flex;
  243. align-items: center;
  244. image {
  245. height: 30rpx;
  246. width: 30rpx;
  247. margin-right: 10rpx;
  248. }
  249. text {
  250. font-weight: bold;
  251. color: #333333;
  252. font-size: 32rpx;
  253. line-height: 45rpx;
  254. }
  255. }
  256. .content-box-head-more {
  257. height: 36rpx;
  258. min-width: 120rpx;
  259. display: flex;
  260. align-items: center;
  261. justify-content: center;
  262. border-radius: 36rpx;
  263. background-color: #e5efff;
  264. display: flex;
  265. align-items: center;
  266. text {
  267. font-size: 20rpx;
  268. line-height: 28rpx;
  269. font-weight: 400;
  270. color: #7990b1;
  271. margin-right: 4rpx;
  272. }
  273. image {
  274. height: 15rpx;
  275. width: 15rpx;
  276. }
  277. }
  278. }
  279. .purchaser-content-box-body {
  280. padding: 0 20rpx 20rpx;
  281. background-color: white;
  282. border-radius: 16rpx;
  283. border-top: 10rpx solid #8fa4c4;
  284. .purchaser-content-box-row {
  285. padding: 30rpx 0;
  286. border-bottom: solid 1px #dcdfe6;
  287. display: flex;
  288. align-items: flex-start;
  289. &:last-child {
  290. border-bottom: none;
  291. }
  292. .purchaser-content-row-tag {
  293. white-space: nowrap;
  294. // padding: 4rpx 15rpx;
  295. width: 110rpx;
  296. // min-width: 110rpx;
  297. height: 36rpx;
  298. color: white;
  299. font-size: 20rpx;
  300. line-height: 28rpx;
  301. font-weight: bold;
  302. border-radius: 38rpx;
  303. color: #928563;
  304. background-color: #f2e8cc;
  305. text-align: justify;
  306. text-justify: inter-ideograph; // IE兼容
  307. text-align-last: justify;
  308. margin-right: 8px;
  309. &:after {
  310. content: "";
  311. width: 110px;
  312. display: block;
  313. }
  314. }
  315. .purchaser-content-row-title {
  316. -webkit-line-clamp: 2;
  317. text-overflow: ellipsis;
  318. overflow: hidden;
  319. display: -webkit-box;
  320. -webkit-box-orient: vertical;
  321. word-break: break-all;
  322. font-size: 28rpx;
  323. font-weight: bold;
  324. color: #333333;
  325. line-height: 46rpx;
  326. .purchaser-content-row-object {
  327. color: #3385ff;
  328. display: inline-block;
  329. margin-left: 8rpx;
  330. }
  331. }
  332. }
  333. }
  334. .no-data-box {
  335. width: 682rpx;
  336. height: 710rpx;
  337. border-radius: 16rpx;
  338. background-color: white;
  339. display: flex;
  340. flex-direction: column;
  341. align-items: center;
  342. justify-content: center;
  343. .no-data {
  344. display: flex;
  345. flex-direction: column;
  346. align-items: center;
  347. margin-bottom: 40rpx;
  348. image {
  349. width: 412rpx;
  350. height: 380rpx;
  351. margin-bottom: 40rpx;
  352. }
  353. text {
  354. font-size: 24rpx;
  355. line-height: 34rpx;
  356. color: #999999;
  357. }
  358. }
  359. }
  360. .end-activity-text {
  361. text-align: center;
  362. font-size: 24rpx;
  363. line-height: 34rpx;
  364. color: #376cbb;
  365. }
  366. }
  367. }
  368. // .notice-content {
  369. // position: sticky;
  370. // left: 0;
  371. // top: 200rpx;
  372. // z-index: 99;
  373. // width: 100%;
  374. // background-color: #fff;
  375. // padding-bottom: 20rpx;
  376. // }
  377. // .notice {
  378. // height: 56rpx;
  379. // overflow: hidden;
  380. // background-color: #dfecff;
  381. // display: flex;
  382. // align-items: center;
  383. // padding-left: 30rpx;
  384. // image {
  385. // width: 30rpx;
  386. // height: 30rpx;
  387. // }
  388. // .notice-bar {
  389. // flex: 1;
  390. // }
  391. // .van-notice-bar {
  392. // height: 56rpx;
  393. // }
  394. // }
  395. }
  396. </style>
  397. <style lang="scss">
  398. wx-swiper .wx-swiper-dot {
  399. width: 6rpx;
  400. height: 6rpx;
  401. border-radius: 6rpx;
  402. margin-bottom: -16rpx;
  403. }
  404. </style>