detail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. <template>
  2. <page-layout class="exhibitor-detail" v-if="exhibitor && exhibitor.name_zh_cn">
  3. <nav-bar title="展商详情" @init="onInitNavbar"></nav-bar>
  4. <u-scroll-view>
  5. <view class="main-container">
  6. <view class="exhibitor-main">
  7. <view class="exhibitor-logo">
  8. <image v-if="exhibitor && exhibitor.logo" :src="exhibitor.logo + '?x-oss-process=image/resize,w_400'" mode="aspectFit" />
  9. <image v-else src="https://onlinecatelogue.productronicachina.com.cn/assets/image/normal-logo.jpg" mode="aspectFit" />
  10. </view>
  11. <view class="exhibitor-title">
  12. <view class="exhibitor-title-1">
  13. {{ exhibitor.name_zh_cn }}
  14. </view>
  15. <view class="exhibitor-title-2">
  16. {{ exhibitor.name_en_us }}
  17. </view>
  18. <view class="exhibitor-title-3" v-if="exhibitor.country_name">
  19. {{ exhibitor.country_name }}
  20. </view>
  21. </view>
  22. <view class="exhibitor-info">
  23. <view class="exhibitor-number">
  24. <view class="exhibitor-number-label">展位号:</view>
  25. <view class="exhibitor-number-text">{{ exhibitor.hall_booth_no }}</view>
  26. </view>
  27. <view class="exhibitor-right">
  28. <view class="exhibitor-info-item">
  29. <view class="iconfont icon-View"></view>
  30. {{ exhibitor.pv }}
  31. </view>
  32. <view class="exhibitor-info-item" v-if="pollShow.exhibitors_poll_show">
  33. <view class="iconfont icon-xiaochengxu-renqiicon"></view>
  34. <view>人气:{{ exhibitor.poll_count }}</view>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="exhibitor-desc">
  40. {{ exhibitor.introduce_zh_cn }}
  41. </view>
  42. <view class="exhibitor-tags">
  43. <view class="exhibitor-tags-category">产品分类:</view>
  44. <view class="exhibitor-tags-list">
  45. <view class="exhibitor-tag" v-for="(item) in exhibitor.product_cate_names">{{ item }}</view>
  46. </view>
  47. </view>
  48. <view class="exhibitor-tags">
  49. <view class="exhibitor-tags-category">应用领域:</view>
  50. <view class="exhibitor-tags-list">
  51. <view class="exhibitor-tag" v-for="(item) in exhibitor.application_areas_names">{{ item }}</view>
  52. </view>
  53. </view>
  54. <u-panel title="展品资料">
  55. <exhibit-recommend :limit="exhibitRecommendLimit" :exhibitorId="exhibitorId"/>
  56. </u-panel>
  57. <u-panel title="展商新闻">
  58. <news-recommend recommend-type="detail" :exhibitorId="exhibitorId"/>
  59. </u-panel>
  60. <u-panel title="展商活动">
  61. <activity-recommend recommend-type="detail" :exhibitorId="exhibitorId"/>
  62. </u-panel>
  63. <view class="click-more">
  64. <van-button type="primary" @click="navigateTo('/pages/index/index?tab=exhibitor')">点击查看更多展商信息</van-button>
  65. </view>
  66. <view class="exhibitor-operation">
  67. <view class="exhibitor-action">
  68. <view @click.stop="onShare()">
  69. <view class="iconfont icon-zhuanfa"></view>
  70. <view>分享</view>
  71. </view>
  72. <view @click="onCollect()">
  73. <view v-if="exhibitor.is_collect" class="iconfont icon-favourites-filled-star-symbol active"></view>
  74. <view v-else class="iconfont icon-Favourites-Add-Large"></view>
  75. <view>收藏</view>
  76. </view>
  77. <view @click="onLike()">
  78. <view v-if="exhibitor.is_like" class="iconfont icon-aixin active"></view>
  79. <view v-else class="iconfont icon-heart1"></view>
  80. <view>点赞</view>
  81. </view>
  82. <view v-if="pollShow.exhibitors_poll_show" @click="onPoll()">
  83. <view v-if="exhibitor.is_poll" class="iconfont icon-Ticket1 active"></view>
  84. <view v-else class="iconfont icon-xiaochengxu-toupiaoicon"></view>
  85. <view>投票</view>
  86. </view>
  87. </view>
  88. </view>
  89. <disclaimer-text></disclaimer-text>
  90. </view>
  91. </u-scroll-view>
  92. <float-button></float-button>
  93. <van-dialog id="van-dialog"/>
  94. <u-share-action-sheet :show.sync="showShare" :show-info="shareInfo"/>
  95. </page-layout>
  96. </template>
  97. <script>
  98. import NavBar from '@/components/layout/nav-bar'
  99. import UScrollView from '@/components/common/u-scroll-view'
  100. import UShareActionSheet from '@/components/common/u-share-action-sheet'
  101. import UPanel from '@/components/common/u-panel'
  102. import ExhibitRecommend from '@/pages/exhibitor/components/exhibit-recommend.vue'
  103. import NewsRecommend from '@/pages/news/components/news-recommend.vue'
  104. import ActivityRecommend from '@/pages/activity/components/activity-recommend.vue'
  105. import {exhibitorsInfo, exhibitorsCollect, exhibitorsLike, exhibitorsPoll, globalPollShow} from '@/api/exhibitor'
  106. import DisclaimerText from '@/components/disclaimer-text/index.vue'
  107. import floatButton from "@/components/layout/float-button"
  108. import PageLayout from "@/components/layout/page-layout";
  109. import countryZhCn from "@/utils/country-zh-cn";
  110. export default {
  111. options: {
  112. // styleIsolation: 'shared'
  113. },
  114. components: {
  115. PageLayout,
  116. NavBar,
  117. UScrollView,
  118. UShareActionSheet,
  119. UPanel,
  120. ExhibitRecommend,
  121. ActivityRecommend,
  122. NewsRecommend,
  123. DisclaimerText,
  124. floatButton
  125. },
  126. computed: {},
  127. onLoad(options) {
  128. this.exhibitorId = options.id
  129. this.getExhibitorsInfo()
  130. },
  131. data() {
  132. return {
  133. showExhibitMore: true,
  134. showShare: false,
  135. shareInfo: null,
  136. exhibitRecommendLimit: 4,
  137. exhibitor: {
  138. name_zh_cn: '',
  139. name_en_us: '',
  140. country: '',
  141. hall_booth_no: '',
  142. product_cate_names: [],
  143. application_areas_names: [],
  144. pv: 0,
  145. poll_count: 0,
  146. is_collect: 0,
  147. is_like: 0,
  148. is_poll: 0
  149. },
  150. exhibitorId: 0,
  151. pollShow: {
  152. exhibitors_poll_show: 0,
  153. product_poll_show: 0
  154. }
  155. }
  156. },
  157. created() {
  158. this.getGlobalPollShow()
  159. uni.$on('refreshData', (val) => {
  160. if (val === 'pages/exhibitor/detail') {
  161. this.getExhibitorsInfo()
  162. }
  163. })
  164. },
  165. methods: {
  166. getExhibitorsInfo() {
  167. exhibitorsInfo({id: this.exhibitorId}).then(res => {
  168. if (res.code === 0) {
  169. this.exhibitor = res.data
  170. for (let i = 0; i < countryZhCn.length; i++) {
  171. if (countryZhCn[i].code === this.exhibitor.country) {
  172. this.exhibitor.country_name = countryZhCn[i].name
  173. break;
  174. }
  175. }
  176. }
  177. })
  178. },
  179. onShareAppMessage(ops) {
  180. return this.shareInfo
  181. },
  182. onShare() {
  183. this.shareInfo = {
  184. title: this.exhibitor.name_zh_cn,
  185. path: `/pages/exhibitor/detail?id=` + this.exhibitor.id,
  186. imageUrl: this.exhibitor.logo + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
  187. }
  188. this.showShare = true
  189. },
  190. onCollect() { // 收藏
  191. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  192. return
  193. }
  194. exhibitorsCollect({id: this.exhibitor.id}).then(res => {
  195. if (res.code === 0) {
  196. this.exhibitor.is_collect = this.exhibitor.is_collect === 0 ? 1 : 0
  197. }
  198. })
  199. },
  200. onLike() { // 点赞
  201. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  202. return
  203. }
  204. exhibitorsLike({id: this.exhibitor.id}).then(res => {
  205. if (res.code === 0) {
  206. this.exhibitor.is_like = this.exhibitor.is_like === 0 ? 1 : 0
  207. }
  208. })
  209. },
  210. onPoll() { // 投票
  211. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  212. return
  213. }
  214. exhibitorsPoll({id: this.exhibitor.id}).then(res => {
  215. if (res.code === 0) {
  216. this.exhibitor.is_poll = this.exhibitor.is_poll === 0 ? 1 : 0
  217. if (this.exhibitor.is_poll === 1) {
  218. this.exhibitor.poll_count = this.exhibitor.poll_count + 1
  219. } else {
  220. this.exhibitor.poll_count = this.exhibitor.poll_count - 1
  221. this.exhibitor.poll_count = this.exhibitor.poll_count < 0 ? 0 : this.exhibitor.poll_count
  222. }
  223. }
  224. })
  225. },
  226. getGlobalPollShow() {
  227. globalPollShow().then(res => {
  228. this.pollShow = res.data
  229. })
  230. }
  231. }
  232. }
  233. </script>
  234. <style lang="scss">
  235. @import "@/static/style/pages/exhibitor-detail.scss";
  236. .exhibitor-detail {
  237. padding-bottom: 40rpx;
  238. .exhibitor-main {
  239. display: flex;
  240. align-items: flex-start;
  241. }
  242. .exhibitor-info {
  243. display: flex;
  244. flex-direction: column;
  245. grid-gap: 12rpx;
  246. color: #555555;
  247. .exhibitor-right {
  248. display: flex;
  249. grid-gap: 6rpx;
  250. .exhibitor-info-item {
  251. display: flex;
  252. align-items: center;
  253. grid-gap: 3rpx;
  254. font-size: $fontSize0;
  255. }
  256. }
  257. }
  258. .exhibitor-logo {
  259. width: 160rpx;
  260. height: 160rpx;
  261. padding: 6rpx;
  262. background: #FFFFFF;
  263. border: 1rpx solid #D9D9D9;
  264. image {
  265. width: 100%;
  266. height: 100%;
  267. }
  268. }
  269. .u-panel {
  270. //background-color: #FFFFFF;
  271. }
  272. .exhibitor-title {
  273. flex: 1;
  274. min-width: 1rpx;
  275. font-size: $fontSize5;
  276. color: #000000;
  277. line-height: 40rpx;
  278. padding-left: 19rpx;
  279. padding-right: 24rpx;
  280. word-break: break-word;
  281. .exhibitor-title-1 {
  282. font-weight: bold;
  283. }
  284. .exhibitor-title-2 {
  285. font-size: $fontSize4;
  286. }
  287. .exhibitor-title-3 {
  288. font-size: $fontSize1;
  289. color: #333333;
  290. line-height: $fontSize1;
  291. margin-top: 10rpx;
  292. }
  293. }
  294. .exhibitor-number {
  295. flex-shrink: 0;
  296. justify-content: flex-end;
  297. margin-top: 12rpx;
  298. }
  299. .exhibitor-number-label {
  300. font-size: $fontSize0;
  301. color: #555555;
  302. }
  303. .exhibitor-number-text {
  304. font-weight: bold;
  305. font-size: $fontSize6;
  306. color: #E57519;
  307. letter-spacing: 2rpx;
  308. }
  309. .exhibitor-desc {
  310. font-size: $fontSize3;
  311. color: #333333;
  312. line-height: 35rpx;
  313. margin-top: 30rpx;
  314. margin-bottom: 12rpx;
  315. line-height: 1.5;
  316. }
  317. .u-panel {
  318. padding: 0 !important;
  319. margin-top: 40rpx;
  320. }
  321. .click-more {
  322. display: flex;
  323. justify-content: center;
  324. margin-top: 49rpx;
  325. @include link-button;
  326. }
  327. }
  328. </style>