detail.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282
  1. <template>
  2. <view 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="https://oss.starify.cn/prod/starify/up/0001018678/20241108/672da70c02212.png?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"><van-button type="primary" @click="navigateTo('/pages/index/index?tab=exhibitor')">点击查看更多展商信息</van-button></view>
  83. <disclaimer-text></disclaimer-text>
  84. </view>
  85. </u-scroll-view>
  86. <u-share-action-sheet :show.sync="showShare" :show-info="shareInfo" />
  87. </view>
  88. </template>
  89. <script>
  90. import NavBar from '@/components/layout/nav-bar'
  91. import UScrollView from '@/components/common/u-scroll-view'
  92. import UShareActionSheet from '@/components/common/u-share-action-sheet'
  93. import UPanel from '@/components/common/u-panel'
  94. import ExhibitRecommend from '@/pages/exhibitor/components/exhibit-recommend.vue'
  95. import NewsRecommend from '@/pages/news/components/news-recommend.vue'
  96. import ActivityRecommend from '@/pages/activity/components/activity-recommend.vue'
  97. import { exhibitorsInfo, exhibitorsCollect, exhibitorsLike, exhibitorsPoll, globalPollShow } from '@/api/exhibitor'
  98. import DisclaimerText from '@/components/disclaimer-text/index.vue'
  99. export default {
  100. options: {
  101. // styleIsolation: 'shared'
  102. },
  103. components: {
  104. NavBar,
  105. UScrollView,
  106. UShareActionSheet,
  107. UPanel,
  108. ExhibitRecommend,
  109. ActivityRecommend,
  110. NewsRecommend,
  111. DisclaimerText
  112. },
  113. computed: {
  114. },
  115. onLoad(options) {
  116. this.exhibitorId = options.id
  117. this.getExhibitorsInfo()
  118. },
  119. data() {
  120. return {
  121. showExhibitMore: true,
  122. showShare: false,
  123. shareInfo: null,
  124. exhibitRecommendLimit: 4,
  125. exhibitor: {
  126. name_zh_cn: '',
  127. name_en_us: '',
  128. country: '',
  129. hall_booth_no: '',
  130. product_cate_names: [],
  131. application_areas_names: [],
  132. pv: 0,
  133. poll_count: 0,
  134. is_collect: 0,
  135. is_like: 0,
  136. is_poll: 0
  137. },
  138. exhibitorId: 0,
  139. pollShow: {
  140. exhibitors_poll_show: 0,
  141. product_poll_show: 0
  142. }
  143. }
  144. },
  145. created() {
  146. this.loadFontFace('Poppins')
  147. this.getGlobalPollShow()
  148. },
  149. methods: {
  150. getExhibitorsInfo() {
  151. exhibitorsInfo({id: this.exhibitorId}).then(res => {
  152. if (res.code === 0) {
  153. this.exhibitor = res.data
  154. }
  155. })
  156. },
  157. onShareAppMessage(ops) {
  158. return this.shareInfo
  159. },
  160. onShare() {
  161. this.shareInfo = {
  162. title: this.exhibitor.name_zh_cn,
  163. path: `/pages/exhibitor/detail?id=` + this.exhibitor.id,
  164. imageUrl: this.exhibitor.logo + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
  165. }
  166. this.showShare = true
  167. },
  168. onCollect() { // 收藏
  169. this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
  170. exhibitorsCollect({ id: this.exhibitor.id }).then(res => {
  171. if (res.code === 0) {
  172. this.exhibitor.is_collect = this.exhibitor.is_collect === 0 ? 1 : 0
  173. }
  174. })
  175. },
  176. onLike() { // 点赞
  177. this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
  178. exhibitorsLike({ id: this.exhibitor.id }).then(res => {
  179. if (res.code === 0) {
  180. this.exhibitor.is_like = this.exhibitor.is_like === 0 ? 1 : 0
  181. }
  182. })
  183. },
  184. onPoll() { // 投票
  185. this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
  186. exhibitorsPoll({ id: this.exhibitor.id }).then(res => {
  187. if (res.code === 0) {
  188. this.exhibitor.is_poll = this.exhibitor.is_poll === 0 ? 1 : 0
  189. if (this.exhibitor.is_poll === 1) {
  190. this.exhibitor.poll_count = this.exhibitor.poll_count + 1
  191. } else {
  192. this.exhibitor.poll_count = this.exhibitor.poll_count - 1
  193. this.exhibitor.poll_count = this.exhibitor.poll_count < 0 ? 0 : this.exhibitor.poll_count
  194. }
  195. }
  196. })
  197. },
  198. getGlobalPollShow() {
  199. globalPollShow().then(res => {
  200. this.pollShow = res.data
  201. })
  202. }
  203. }
  204. }
  205. </script>
  206. <style lang="scss">
  207. @import "@/static/style/pages/exhibitor-detail.scss";
  208. .exhibitor-detail{
  209. .exhibitor-main{
  210. display: flex;
  211. }
  212. .exhibitor-logo{
  213. width: 166rpx;
  214. height: 166rpx;
  215. background: #FFFFFF;
  216. border: 1rpx solid #D9D9D9;
  217. image{
  218. width: 100%;
  219. height: 100%;
  220. }
  221. }
  222. .u-panel{
  223. background-color: #FFFFFF;
  224. }
  225. .exhibitor-title{
  226. font-family: Poppins, Poppins;
  227. font-size: 30rpx;
  228. color: #000000;
  229. line-height: 40rpx;
  230. padding-left: 19rpx;
  231. padding-right: 24rpx;
  232. .exhibitor-title-1{
  233. font-weight: bold;
  234. }
  235. .exhibitor-title-2 {
  236. font-size: 28rpx;
  237. }
  238. .exhibitor-title-3 {
  239. font-size: $fontSize0;
  240. color: #333333;
  241. line-height: 20rpx;
  242. margin-top: 10rpx;
  243. }
  244. }
  245. .exhibitor-number{
  246. flex-shrink: 0;
  247. justify-content: flex-end;
  248. margin-top: 12rpx;
  249. }
  250. .exhibitor-number-label{
  251. font-size: $fontSize0;
  252. color: #555555;
  253. }
  254. .exhibitor-number-text{
  255. font-family: Poppins, Poppins;
  256. font-weight: bold;
  257. font-size: $fontSize6;
  258. color: #E57519;
  259. letter-spacing: 2rpx;
  260. }
  261. .exhibitor-desc{
  262. font-family: Poppins, Poppins;
  263. font-size: $fontSize2;
  264. color: #333333;
  265. line-height: 35rpx;
  266. margin-top: 30rpx;
  267. margin-bottom: 12rpx;
  268. }
  269. .u-panel{
  270. margin-top: 40rpx;
  271. }
  272. .click-more{
  273. display: flex;
  274. justify-content: center;
  275. margin-top: 49rpx;
  276. @include link-button;
  277. }
  278. }
  279. </style>