detail.vue 9.4 KB

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