detail.vue 7.9 KB

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