detail.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382
  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. <u-panel title="联系我们">
  64. <view class="exhibitor-module">
  65. <view class="exhibitor-title">
  66. {{ exhibitor.name_zh_cn }}<br>
  67. {{ exhibitor.name_en_us }}
  68. </view>
  69. <view class="exhibitor-module-info">
  70. <view class="exhibitor-info-left">
  71. <text class="title">
  72. 探索我们的更多服务
  73. </text>
  74. <view class="website" v-if="exhibitor.website">
  75. <view class="iconfont icon-World"></view>
  76. <text>{{ exhibitor.website }}</text>
  77. </view>
  78. </view>
  79. <view class="exhibitor-info-right" v-if="exhibitor.wechat_qrcode">
  80. <image mode="aspectFit" show-menu-by-longpress :src="exhibitor.wechat_qrcode" alt="qrcode"></image>
  81. </view>
  82. </view>
  83. <view class="exhibitor-hall-booth">
  84. <view class="title">
  85. 我们的展位号
  86. </view>
  87. <view class="content">
  88. {{exhibitor.hall}} {{exhibitor.booth_no}}
  89. </view>
  90. </view>
  91. </view>
  92. </u-panel>
  93. <view class="click-more">
  94. <van-button type="primary" @click="navigateTo('/pages/index/index?tab=exhibitor')">点击查看更多展商信息</van-button>
  95. </view>
  96. <view class="exhibitor-operation">
  97. <view class="exhibitor-action">
  98. <view @click.stop="onShare()">
  99. <view class="iconfont icon-zhuanfa"></view>
  100. <view>分享</view>
  101. </view>
  102. <view @click="onCollect()">
  103. <view v-if="exhibitor.is_collect" class="iconfont icon-favourites-filled-star-symbol active"></view>
  104. <view v-else class="iconfont icon-Favourites-Add-Large"></view>
  105. <view>收藏</view>
  106. </view>
  107. <view @click="onLike()">
  108. <view v-if="exhibitor.is_like" class="iconfont icon-aixin active"></view>
  109. <view v-else class="iconfont icon-heart1"></view>
  110. <view>点赞</view>
  111. </view>
  112. <view v-if="pollShow.exhibitors_poll_show" @click="onPoll()">
  113. <view v-if="exhibitor.is_poll" class="iconfont icon-Ticket1 active"></view>
  114. <view v-else class="iconfont icon-xiaochengxu-toupiaoicon"></view>
  115. <view>投票</view>
  116. </view>
  117. </view>
  118. </view>
  119. <disclaimer-text></disclaimer-text>
  120. </view>
  121. </u-scroll-view>
  122. <float-button></float-button>
  123. <van-dialog id="van-dialog"/>
  124. <u-share-action-sheet :show.sync="showShare" :show-info="shareInfo"/>
  125. </page-layout>
  126. </template>
  127. <script>
  128. import NavBar from '@/components/layout/nav-bar'
  129. import UScrollView from '@/components/common/u-scroll-view'
  130. import UShareActionSheet from '@/components/common/u-share-action-sheet'
  131. import UPanel from '@/components/common/u-panel'
  132. import ExhibitRecommend from '@/pages/exhibitor/components/exhibit-recommend.vue'
  133. import NewsRecommend from '@/pages/news/components/news-recommend.vue'
  134. import ActivityRecommend from '@/pages/activity/components/activity-recommend.vue'
  135. import {exhibitorsInfo, exhibitorsCollect, exhibitorsLike, exhibitorsPoll, globalPollShow} from '@/api/exhibitor'
  136. import DisclaimerText from '@/components/disclaimer-text/index.vue'
  137. import floatButton from "@/components/layout/float-button"
  138. import PageLayout from "@/components/layout/page-layout";
  139. import countryZhCn from "@/utils/country-zh-cn";
  140. export default {
  141. options: {
  142. // styleIsolation: 'shared'
  143. },
  144. components: {
  145. PageLayout,
  146. NavBar,
  147. UScrollView,
  148. UShareActionSheet,
  149. UPanel,
  150. ExhibitRecommend,
  151. ActivityRecommend,
  152. NewsRecommend,
  153. DisclaimerText,
  154. floatButton
  155. },
  156. computed: {},
  157. onLoad(options) {
  158. this.exhibitorId = options.id
  159. this.getExhibitorsInfo()
  160. },
  161. data() {
  162. return {
  163. showExhibitMore: true,
  164. showShare: false,
  165. shareInfo: null,
  166. exhibitRecommendLimit: 4,
  167. exhibitor: {
  168. name_zh_cn: '',
  169. name_en_us: '',
  170. country: '',
  171. hall_booth_no: '',
  172. product_cate_names: [],
  173. application_areas_names: [],
  174. pv: 0,
  175. poll_count: 0,
  176. is_collect: 0,
  177. is_like: 0,
  178. is_poll: 0
  179. },
  180. exhibitorId: 0,
  181. pollShow: {
  182. exhibitors_poll_show: 0,
  183. product_poll_show: 0
  184. }
  185. }
  186. },
  187. created() {
  188. this.getGlobalPollShow()
  189. uni.$on('refreshData', (val) => {
  190. if (val === 'pages/exhibitor/detail') {
  191. this.getExhibitorsInfo()
  192. }
  193. })
  194. },
  195. methods: {
  196. getExhibitorsInfo() {
  197. exhibitorsInfo({id: this.exhibitorId}).then(res => {
  198. if (res.code === 0) {
  199. this.exhibitor = res.data
  200. for (let i = 0; i < countryZhCn.length; i++) {
  201. if (countryZhCn[i].code === this.exhibitor.country) {
  202. this.exhibitor.country_name = countryZhCn[i].name
  203. break;
  204. }
  205. }
  206. this.shareInfo = {
  207. title: this.exhibitor.name_zh_cn,
  208. path: `/pages/exhibitor/detail?id=` + this.exhibitor.id,
  209. imageUrl: this.exhibitor.logo + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
  210. }
  211. }
  212. })
  213. },
  214. onShareAppMessage() {
  215. return this.shareInfo
  216. },
  217. onShareTimeline() {
  218. return this.shareInfo
  219. },
  220. onShare() {
  221. this.showShare = true
  222. },
  223. onCollect() { // 收藏
  224. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  225. return
  226. }
  227. exhibitorsCollect({id: this.exhibitor.id}).then(res => {
  228. if (res.code === 0) {
  229. this.exhibitor.is_collect = this.exhibitor.is_collect === 0 ? 1 : 0
  230. }
  231. })
  232. },
  233. onLike() { // 点赞
  234. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  235. return
  236. }
  237. exhibitorsLike({id: this.exhibitor.id}).then(res => {
  238. if (res.code === 0) {
  239. this.exhibitor.is_like = this.exhibitor.is_like === 0 ? 1 : 0
  240. }
  241. })
  242. },
  243. onPoll() { // 投票
  244. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  245. return
  246. }
  247. exhibitorsPoll({id: this.exhibitor.id}).then(res => {
  248. if (res.code === 0) {
  249. this.exhibitor.is_poll = this.exhibitor.is_poll === 0 ? 1 : 0
  250. if (this.exhibitor.is_poll === 1) {
  251. this.exhibitor.poll_count = this.exhibitor.poll_count + 1
  252. } else {
  253. this.exhibitor.poll_count = this.exhibitor.poll_count - 1
  254. this.exhibitor.poll_count = this.exhibitor.poll_count < 0 ? 0 : this.exhibitor.poll_count
  255. }
  256. }
  257. })
  258. },
  259. getGlobalPollShow() {
  260. globalPollShow().then(res => {
  261. this.pollShow = res.data
  262. })
  263. }
  264. }
  265. }
  266. </script>
  267. <style lang="scss">
  268. @import "@/static/style/pages/exhibitor-detail.scss";
  269. .exhibitor-detail {
  270. padding-bottom: 40rpx;
  271. .exhibitor-main {
  272. display: flex;
  273. align-items: flex-start;
  274. }
  275. .exhibitor-info {
  276. display: flex;
  277. flex-direction: column;
  278. grid-gap: 12rpx;
  279. color: #555555;
  280. max-width: 180rpx;
  281. word-break: break-word;
  282. .exhibitor-right {
  283. display: flex;
  284. grid-gap: 6rpx;
  285. justify-content: flex-end;
  286. .exhibitor-info-item {
  287. display: flex;
  288. align-items: center;
  289. grid-gap: 3rpx;
  290. font-size: $fontSize0;
  291. }
  292. }
  293. }
  294. .exhibitor-logo {
  295. width: 160rpx;
  296. height: 160rpx;
  297. padding: 6rpx;
  298. background: #FFFFFF;
  299. border: 1rpx solid #D9D9D9;
  300. image {
  301. width: 100%;
  302. height: 100%;
  303. }
  304. }
  305. .u-panel {
  306. //background-color: #FFFFFF;
  307. }
  308. .exhibitor-title {
  309. flex: 1;
  310. min-width: 1rpx;
  311. font-size: $fontSize5;
  312. color: #000000;
  313. line-height: 40rpx;
  314. padding-left: 19rpx;
  315. padding-right: 24rpx;
  316. word-break: break-word;
  317. .exhibitor-title-1 {
  318. font-weight: bold;
  319. }
  320. .exhibitor-title-2 {
  321. font-size: $fontSize4;
  322. }
  323. .exhibitor-title-3 {
  324. font-size: $fontSize1;
  325. color: #333333;
  326. line-height: $fontSize1;
  327. margin-top: 10rpx;
  328. }
  329. }
  330. .exhibitor-number {
  331. flex-shrink: 0;
  332. justify-content: flex-end;
  333. margin-top: 12rpx;
  334. }
  335. .exhibitor-number-label {
  336. font-size: $fontSize0;
  337. color: #555555;
  338. }
  339. .exhibitor-number-text {
  340. font-weight: bold;
  341. font-size: $fontSize6;
  342. color: #E57519;
  343. letter-spacing: 2rpx;
  344. }
  345. .exhibitor-desc {
  346. font-size: $fontSize3;
  347. color: #333333;
  348. line-height: 35rpx;
  349. margin-top: 30rpx;
  350. margin-bottom: 12rpx;
  351. line-height: 1.5;
  352. }
  353. .u-panel {
  354. padding: 0 !important;
  355. margin-top: 40rpx;
  356. }
  357. .click-more {
  358. display: flex;
  359. justify-content: center;
  360. margin-top: 49rpx;
  361. @include link-button;
  362. }
  363. }
  364. </style>