detail.vue 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280
  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. },
  132. exhibitorId: 0,
  133. pollShow: {
  134. exhibitors_poll_show: 0,
  135. product_poll_show: 0
  136. }
  137. }
  138. },
  139. created() {
  140. this.loadFontFace('Poppins')
  141. this.getGlobalPollShow()
  142. },
  143. methods: {
  144. getExhibitorsInfo() {
  145. exhibitorsInfo({id: this.exhibitorId}).then(res => {
  146. if (res.code === 0) {
  147. this.exhibitor = res.data
  148. }
  149. })
  150. },
  151. onShareAppMessage(ops) {
  152. return {
  153. title: '科世达(上海)连接器有限公司',
  154. path: `/pages/exhibitor/detail`,
  155. imageUrl: this.exhibitor.logo + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
  156. }
  157. },
  158. onShare() {
  159. this.shareInfo = {
  160. title: this.exhibitor.name_zh_cn,
  161. path: `/pages/exhibitor/detail?id=` + this.exhibitor.id,
  162. imageUrl: this.exhibitor.logo + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
  163. }
  164. this.showShare = true
  165. },
  166. onCollect() { // 收藏
  167. this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
  168. exhibitorsCollect({ id: this.exhibitor.id }).then(res => {
  169. if (res.code === 0) {
  170. this.exhibitor.is_collect = this.exhibitor.is_collect === 0 ? 1 : 0
  171. }
  172. })
  173. },
  174. onLike() { // 点赞
  175. this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
  176. exhibitorsLike({ id: this.exhibitor.id }).then(res => {
  177. if (res.code === 0) {
  178. this.exhibitor.is_like = this.exhibitor.is_like === 0 ? 1 : 0
  179. }
  180. })
  181. },
  182. onPoll() { // 投票
  183. this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)
  184. exhibitorsPoll({ id: this.exhibitor.id }).then(res => {
  185. if (res.code === 0) {
  186. this.exhibitor.is_poll = this.exhibitor.is_poll === 0 ? 1 : 0
  187. if (this.exhibitor.is_poll === 1) {
  188. this.exhibitor.poll_count = this.exhibitor.poll_count + 1
  189. } else {
  190. this.exhibitor.poll_count = this.exhibitor.poll_count - 1
  191. this.exhibitor.poll_count = this.exhibitor.poll_count < 0 ? 0 : this.exhibitor.poll_count
  192. }
  193. }
  194. })
  195. },
  196. getGlobalPollShow() {
  197. globalPollShow().then(res => {
  198. this.pollShow = res.data
  199. })
  200. }
  201. }
  202. }
  203. </script>
  204. <style lang="scss">
  205. @import "@/static/style/pages/exhibitor-detail.scss";
  206. .exhibitor-detail{
  207. .exhibitor-main{
  208. display: flex;
  209. }
  210. .exhibitor-logo{
  211. width: 166rpx;
  212. height: 166rpx;
  213. background: #FFFFFF;
  214. border: 1rpx solid #D9D9D9;
  215. image{
  216. width: 100%;
  217. height: 100%;
  218. }
  219. }
  220. .u-panel{
  221. background-color: #FFFFFF;
  222. }
  223. .exhibitor-title{
  224. font-family: Poppins, Poppins;
  225. font-size: 30rpx;
  226. color: #000000;
  227. line-height: 40rpx;
  228. padding-left: 19rpx;
  229. padding-right: 24rpx;
  230. .exhibitor-title-1{
  231. font-weight: bold;
  232. }
  233. .exhibitor-title-2 {
  234. font-size: 28rpx;
  235. }
  236. .exhibitor-title-3 {
  237. font-size: $fontSize0;
  238. color: #333333;
  239. line-height: 20rpx;
  240. margin-top: 10rpx;
  241. }
  242. }
  243. .exhibitor-number{
  244. flex-shrink: 0;
  245. justify-content: flex-end;
  246. margin-top: 12rpx;
  247. }
  248. .exhibitor-number-label{
  249. font-size: $fontSize0;
  250. color: #555555;
  251. }
  252. .exhibitor-number-text{
  253. font-family: Poppins, Poppins;
  254. font-weight: bold;
  255. font-size: $fontSize6;
  256. color: #E57519;
  257. letter-spacing: 2rpx;
  258. }
  259. .exhibitor-desc{
  260. font-family: Poppins, Poppins;
  261. font-size: $fontSize2;
  262. color: #333333;
  263. line-height: 35rpx;
  264. margin-top: 30rpx;
  265. margin-bottom: 12rpx;
  266. }
  267. .u-panel{
  268. margin-top: 40rpx;
  269. }
  270. .click-more{
  271. display: flex;
  272. justify-content: center;
  273. margin-top: 49rpx;
  274. @include link-button;
  275. }
  276. }
  277. </style>