purchaser.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401
  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. <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. <block v-if="item.SpecialTags">
  38. <text style="color: #90aeda" @click.stop="themeDetails(it, '月度收藏榜')" v-for="it in item.SpecialTags.split(',')" class="purchaser-content-row-object" :key="it">#{{ it }}</text>
  39. </block>
  40. <text v-for="it in item.List" class="purchaser-content-row-object" :key="it.IndustrialManagementId" @click.stop="themeDetails(it, '月度收藏榜')">#{{ it.IndustryName }}</text>
  41. </view>
  42. </view>
  43. </view>
  44. </view>
  45. <view class="purchaser-content-box">
  46. <view class="purchaser-content-box-head">
  47. <view class="content-box-head-title">
  48. <image src="https://hzstatic.hzinsights.com/cygx/icon/purchaser.png"></image>
  49. <text>研选活动</text>
  50. </view>
  51. <view class="content-box-head-more" @click="toActivityTotal">
  52. <text>查看全部</text>
  53. <image src="https://hzstatic.hzinsights.com/cygx/icon/right-arrow-circle.png"></image>
  54. </view>
  55. </view>
  56. <purchaserActivityList style="width: 682rpx" ref="purchaserActivityListRef">
  57. <view class="no-data-box">
  58. <view class="no-data">
  59. <image src="https://hzstatic.hzinsights.com/cygx/icon/activity-no-data.png"></image>
  60. <text>暂无对应活动</text>
  61. </view>
  62. <view class="end-activity-text" @click="endActivity">已结束活动>></view>
  63. </view>
  64. <view class="end-activity-text" @click="endActivity" slot="finished">已结束活动>></view>
  65. </purchaserActivityList>
  66. </view>
  67. </view>
  68. <freeCharge class="free-charge" :isShowFreeBtn="isShowFree" />
  69. <view class="voting-entry" v-if="isShowImg && wholeShowListData.IsShowQuestionnaire">
  70. <image @click.stop="goThemeVoting" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/theme_voting.png"></image>
  71. <image @click.stop="isShowImg = false" class="close-img" src="https://hzchart.oss-cn-shanghai.aliyuncs.com/new_cygx/close_voting.png"></image>
  72. </view>
  73. <Loading />
  74. </view>
  75. </template>
  76. <script>
  77. import freeCharge from "@/components/freeCharge";
  78. import SearchBar from "@/components/search-bar/searchBar.vue";
  79. import purchaserActivityList from "@/components/activity/purchaserActivityList.vue";
  80. import { purchaserApi } from "@/config/modules/purchaser.js";
  81. import { Research, activity } from "@/config/api.js";
  82. import { Throttle } from "@/config/util.js";
  83. export default {
  84. components: { freeCharge, SearchBar, purchaserActivityList },
  85. data() {
  86. return {
  87. //==============================
  88. bannerDataList: [],
  89. researchBanner: {},
  90. recentReportList: [],
  91. isShowImg: true,
  92. };
  93. },
  94. methods: {
  95. getBannerData() {
  96. //获取banner信息
  97. purchaserApi.getPurchaserBanner().then((res) => {
  98. if (res.Ret === 200) {
  99. this.researchBanner = res.Data.ListB[0] || {};
  100. this.bannerDataList = res.Data.ListA || [];
  101. }
  102. });
  103. },
  104. async getRecentReportList() {
  105. // 获取最近更新报告
  106. const res = await Research.researchArticleNewList({
  107. PageSize: 5,
  108. CurrentIndex: 1,
  109. ArticleTypeIds: "",
  110. });
  111. if (res.Ret === 200) {
  112. this.recentReportList = res.Data.List || [];
  113. }
  114. },
  115. //去往文章详情页面
  116. goDetail(item) {
  117. if (item.IsSpecial == 1) {
  118. uni.navigateTo({ url: "/pages-purchaser/noteAndViewpoint/noteAndViewpoint?id=" + item.ArticleId });
  119. return;
  120. }
  121. this.$store.commit("setRouterReport", "月度收藏榜");
  122. uni.navigateTo({ url: "/pageMy/reportDetail/reportDetail?id=" + item.ArticleId });
  123. },
  124. //去往主题详情
  125. themeDetails(item, source) {
  126. if (item.IsSpecial == 1) return;
  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. item.Path === "pages-purchaser/specialColumn/specialColumn" && this.getRecordTracking("研选专栏");
  138. uni.navigateTo({
  139. url: "/" + item.Path,
  140. });
  141. },
  142. toReportTotal() {
  143. uni.navigateTo({
  144. url: "/pages-purchaser/lastestReport/lastestReport",
  145. });
  146. },
  147. toActivityTotal() {
  148. uni.navigateTo({
  149. url: "/pages-purchaser/purchaserActivity/purchaserActivity",
  150. });
  151. },
  152. /* 搜索 */
  153. async goSearch() {
  154. uni.navigateTo({ url: "/pages-search/indedxSearch/indedxSearch?id=研选" + "&source=买方研选页面" });
  155. },
  156. // 去往投票详情
  157. goThemeVoting() {
  158. uni.navigateTo({
  159. url: "/pages-purchaser/themeVote/themeVote",
  160. });
  161. },
  162. },
  163. onLoad() {},
  164. onShow() {
  165. this.$store.commit("setRouterReport", "买方研选");
  166. this.getRecordTracking("买方研选");
  167. this.getBannerData();
  168. this.getRecentReportList();
  169. this.$refs.purchaserActivityListRef.reloadActivityList();
  170. this.isShowImg = true;
  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: $uni-bg-color;
  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: #376cbb;
  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: #376cbb;
  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. .voting-entry {
  369. position: fixed;
  370. bottom: 200rpx;
  371. right: 10rpx;
  372. padding: 20rpx;
  373. z-index: 9;
  374. image {
  375. width: 126rpx;
  376. height: 134rpx;
  377. }
  378. .close-img {
  379. position: absolute;
  380. top: 0;
  381. right: 0;
  382. width: 40rpx;
  383. height: 40rpx;
  384. z-index: 11;
  385. }
  386. }
  387. }
  388. </style>
  389. <style lang="scss">
  390. wx-swiper .wx-swiper-dot {
  391. width: 6rpx;
  392. height: 6rpx;
  393. border-radius: 6rpx;
  394. margin-bottom: -16rpx;
  395. }
  396. </style>