purchaser.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  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(researchBanner)"></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. <image class="recommend-icon" v-if="item.TopTime > 0" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/recommend_YX.png"></image>
  33. <text class="purchaser-content-row-tag" :style="{ padding: item.ArticleTypeName.length == 2 ? '4rpx 28rpx' : '4rpx 15rpx' }">
  34. {{ item.ArticleTypeName }}
  35. </text>
  36. <view class="purchaser-content-row-title" :style="{ marginLeft: item.Title.substr(0, 1) != '【' ? '14rpx' : 0 }" @click="goDetail(item)">
  37. {{ item.Title }}
  38. <block v-if="item.SpecialTags">
  39. <text style="color: #90aeda" @click.stop="themeDetails(it, '月度收藏榜')" v-for="it in item.SpecialTags.split(',')" class="purchaser-content-row-object" :key="it">#{{ it }}</text>
  40. </block>
  41. <text v-for="it in item.List" class="purchaser-content-row-object" :key="it.IndustrialManagementId" @click.stop="themeDetails(it, '月度收藏榜')">#{{ it.IndustryName }}</text>
  42. </view>
  43. </view>
  44. </view>
  45. </view>
  46. <view class="purchaser-content-box">
  47. <view class="purchaser-content-box-head">
  48. <view class="content-box-head-title">
  49. <image src="https://hzstatic.hzinsights.com/cygx/icon/purchaser.png"></image>
  50. <text>研选活动</text>
  51. </view>
  52. <view class="content-box-head-more" @click="toActivityTotal">
  53. <text>查看全部</text>
  54. <image src="https://hzstatic.hzinsights.com/cygx/icon/right-arrow-circle.png"></image>
  55. </view>
  56. </view>
  57. <purchaserActivityList style="width: 682rpx" ref="purchaserActivityListRef">
  58. <view class="no-data-box">
  59. <view class="no-data">
  60. <image src="https://hzstatic.hzinsights.com/cygx/icon/activity-no-data.png"></image>
  61. <text>暂无对应活动</text>
  62. </view>
  63. <view class="end-activity-text" @click="endActivity">已结束活动>></view>
  64. </view>
  65. <view class="end-activity-text" @click="endActivity" slot="finished">已结束活动>></view>
  66. </purchaserActivityList>
  67. </view>
  68. </view>
  69. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  70. <view class="voting-entry" v-if="isShowImg && wholeShowListData.IsShowQuestionnaire">
  71. <image @click.stop="goThemeVoting" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/theme_voting.png"></image>
  72. <image @click.stop="isShowImg = false" class="close-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/close_voting.png"></image>
  73. </view>
  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. isShowImg: true,
  93. };
  94. },
  95. methods: {
  96. getBannerData() {
  97. //获取banner信息
  98. purchaserApi.getPurchaserBanner().then((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/noteAndViewpoint/noteAndViewpoint?id=" + item.ArticleId });
  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. if (item.IsSpecial == 1) return;
  128. uni.navigateTo({ url: "/reportPages/researchTheme/researchTheme?id=" + item.IndustrialManagementId + "&pageRouter=" + source });
  129. },
  130. // 跳转研选已结束活动
  131. endActivity() {
  132. uni.navigateTo({
  133. url: "/pages-purchaser/finishedActivity/finishedActivity",
  134. });
  135. },
  136. // 宣传单跳转
  137. bannerSwiperHandler(item) {
  138. item.Path === "pages-purchaser/specialColumn/specialColumn" && this.getRecordTracking("研选专栏");
  139. uni.navigateTo({
  140. url: "/" + item.Path,
  141. });
  142. },
  143. toReportTotal() {
  144. uni.navigateTo({
  145. url: "/pages-purchaser/lastestReport/lastestReport",
  146. });
  147. },
  148. toActivityTotal() {
  149. uni.navigateTo({
  150. url: "/pages-purchaser/purchaserActivity/purchaserActivity",
  151. });
  152. },
  153. /* 搜索 */
  154. async goSearch() {
  155. uni.navigateTo({ url: "/pages-search/indedxSearch/indedxSearch?id=研选" + "&source=买方研选页面" });
  156. },
  157. // 去往投票详情
  158. goThemeVoting() {
  159. uni.navigateTo({
  160. url: "/pages-purchaser/themeVote/themeVote",
  161. });
  162. },
  163. },
  164. onLoad() {},
  165. onShow() {
  166. this.$store.commit("setRouterReport", "买方研选");
  167. this.getRecordTracking("买方研选");
  168. this.getBannerData();
  169. this.getRecentReportList();
  170. this.$refs.purchaserActivityListRef.reloadActivityList();
  171. this.isShowImg = true;
  172. },
  173. /**
  174. * 用户点击分享
  175. */
  176. onShareAppMessage: function (res) {
  177. return {
  178. title: this.isHorzMobile ? "好友向您推荐此内容,上传名片享查研观向免费月卡!" : "买方研选",
  179. path: "pages/purchaser/purchaser",
  180. success: (res) => {},
  181. fail: (err) => {},
  182. };
  183. },
  184. onReachBottom: Throttle(function () {
  185. if (this.$refs.purchaserActivityListRef.page_no >= this.$refs.purchaserActivityListRef.pages) return;
  186. this.$refs.purchaserActivityListRef.loadActivityMore();
  187. }),
  188. };
  189. </script>
  190. <style lang="scss">
  191. .resear-container {
  192. background-color: $uni-bg-color;
  193. .top-content-box {
  194. position: sticky;
  195. top: 0;
  196. left: 0;
  197. right: 0;
  198. z-index: 999;
  199. padding-left: 30rpx;
  200. background-color: white;
  201. }
  202. .resear-body {
  203. padding: 20rpx 34rpx;
  204. box-sizing: border-box;
  205. .resear-banner-box {
  206. display: flex;
  207. align-items: center;
  208. margin-bottom: 20rpx;
  209. .banner-box-left {
  210. height: 110rpx;
  211. width: 448rpx;
  212. margin-right: 20rpx;
  213. swiper {
  214. height: 100%;
  215. width: 100%;
  216. image {
  217. height: 100%;
  218. width: 100%;
  219. border-radius: 8rpx;
  220. }
  221. }
  222. }
  223. .banner-box-right {
  224. image {
  225. height: 110rpx;
  226. width: 214rpx;
  227. vertical-align: bottom;
  228. border-radius: 8rpx;
  229. }
  230. }
  231. }
  232. .purchaser-content-box {
  233. margin-bottom: 20rpx;
  234. .purchaser-content-box-head {
  235. display: flex;
  236. align-items: center;
  237. justify-content: space-between;
  238. padding: 20rpx;
  239. font-size: 28rpx;
  240. font-weight: 400;
  241. color: #376cbb;
  242. .content-box-head-title {
  243. display: flex;
  244. align-items: center;
  245. image {
  246. height: 30rpx;
  247. width: 30rpx;
  248. margin-right: 10rpx;
  249. }
  250. text {
  251. font-weight: bold;
  252. color: #333333;
  253. font-size: 32rpx;
  254. line-height: 45rpx;
  255. }
  256. }
  257. .content-box-head-more {
  258. height: 36rpx;
  259. min-width: 120rpx;
  260. display: flex;
  261. align-items: center;
  262. justify-content: center;
  263. border-radius: 36rpx;
  264. background-color: #e5efff;
  265. display: flex;
  266. align-items: center;
  267. text {
  268. font-size: 20rpx;
  269. line-height: 28rpx;
  270. font-weight: 400;
  271. color: #7990b1;
  272. margin-right: 4rpx;
  273. }
  274. image {
  275. height: 15rpx;
  276. width: 15rpx;
  277. }
  278. }
  279. }
  280. .purchaser-content-box-body {
  281. padding: 0 20rpx 20rpx;
  282. background-color: white;
  283. border-radius: 16rpx;
  284. border-top: 10rpx solid #8fa4c4;
  285. .purchaser-content-box-row {
  286. padding: 30rpx 0;
  287. border-bottom: solid 1px #dcdfe6;
  288. display: flex;
  289. align-items: flex-start;
  290. &:last-child {
  291. border-bottom: none;
  292. }
  293. .purchaser-content-row-tag {
  294. white-space: nowrap;
  295. // padding: 4rpx 15rpx;
  296. width: 110rpx;
  297. // min-width: 110rpx;
  298. height: 36rpx;
  299. color: white;
  300. font-size: 20rpx;
  301. line-height: 28rpx;
  302. font-weight: bold;
  303. border-radius: 38rpx;
  304. color: #928563;
  305. background-color: #f2e8cc;
  306. text-align: justify;
  307. text-justify: inter-ideograph; // IE兼容
  308. text-align-last: justify;
  309. margin-right: 8px;
  310. &:after {
  311. content: "";
  312. width: 110px;
  313. display: block;
  314. }
  315. }
  316. .purchaser-content-row-title {
  317. -webkit-line-clamp: 2;
  318. text-overflow: ellipsis;
  319. overflow: hidden;
  320. display: -webkit-box;
  321. -webkit-box-orient: vertical;
  322. word-break: break-all;
  323. font-size: 28rpx;
  324. font-weight: bold;
  325. color: #333333;
  326. line-height: 46rpx;
  327. .purchaser-content-row-object {
  328. color: #376cbb;
  329. display: inline-block;
  330. margin-left: 8rpx;
  331. }
  332. }
  333. }
  334. }
  335. .no-data-box {
  336. width: 682rpx;
  337. height: 710rpx;
  338. border-radius: 16rpx;
  339. background-color: white;
  340. display: flex;
  341. flex-direction: column;
  342. align-items: center;
  343. justify-content: center;
  344. .no-data {
  345. display: flex;
  346. flex-direction: column;
  347. align-items: center;
  348. margin-bottom: 40rpx;
  349. image {
  350. width: 412rpx;
  351. height: 380rpx;
  352. margin-bottom: 40rpx;
  353. }
  354. text {
  355. font-size: 24rpx;
  356. line-height: 34rpx;
  357. color: #999999;
  358. }
  359. }
  360. }
  361. .end-activity-text {
  362. text-align: center;
  363. font-size: 24rpx;
  364. line-height: 34rpx;
  365. color: #376cbb;
  366. }
  367. }
  368. }
  369. .voting-entry {
  370. position: fixed;
  371. bottom: 200rpx;
  372. right: 10rpx;
  373. padding: 20rpx;
  374. z-index: 9;
  375. image {
  376. width: 126rpx;
  377. height: 134rpx;
  378. }
  379. .close-img {
  380. position: absolute;
  381. top: 0;
  382. right: 0;
  383. width: 40rpx;
  384. height: 40rpx;
  385. z-index: 11;
  386. }
  387. }
  388. .recommend-icon {
  389. flex-shrink: 0;
  390. width: 30rpx;
  391. height: 30rpx;
  392. margin-right: 15rpx;
  393. }
  394. }
  395. </style>
  396. <style lang="scss">
  397. wx-swiper .wx-swiper-dot {
  398. width: 6rpx;
  399. height: 6rpx;
  400. border-radius: 6rpx;
  401. margin-bottom: -16rpx;
  402. }
  403. </style>