detail.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  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="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"><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. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  170. return
  171. }
  172. exhibitorsCollect({ id: this.exhibitor.id }).then(res => {
  173. if (res.code === 0) {
  174. this.exhibitor.is_collect = this.exhibitor.is_collect === 0 ? 1 : 0
  175. }
  176. })
  177. },
  178. onLike() { // 点赞
  179. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  180. return
  181. }
  182. exhibitorsLike({ id: this.exhibitor.id }).then(res => {
  183. if (res.code === 0) {
  184. this.exhibitor.is_like = this.exhibitor.is_like === 0 ? 1 : 0
  185. }
  186. })
  187. },
  188. onPoll() { // 投票
  189. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  190. return
  191. }
  192. exhibitorsPoll({ id: this.exhibitor.id }).then(res => {
  193. if (res.code === 0) {
  194. this.exhibitor.is_poll = this.exhibitor.is_poll === 0 ? 1 : 0
  195. if (this.exhibitor.is_poll === 1) {
  196. this.exhibitor.poll_count = this.exhibitor.poll_count + 1
  197. } else {
  198. this.exhibitor.poll_count = this.exhibitor.poll_count - 1
  199. this.exhibitor.poll_count = this.exhibitor.poll_count < 0 ? 0 : this.exhibitor.poll_count
  200. }
  201. }
  202. })
  203. },
  204. getGlobalPollShow() {
  205. globalPollShow().then(res => {
  206. this.pollShow = res.data
  207. })
  208. }
  209. }
  210. }
  211. </script>
  212. <style lang="scss">
  213. @import "@/static/style/pages/exhibitor-detail.scss";
  214. .exhibitor-detail{
  215. .exhibitor-main{
  216. display: flex;
  217. }
  218. .exhibitor-logo{
  219. width: 166rpx;
  220. height: 166rpx;
  221. background: #FFFFFF;
  222. border: 1rpx solid #D9D9D9;
  223. image{
  224. width: 100%;
  225. height: 100%;
  226. }
  227. }
  228. .u-panel{
  229. background-color: #FFFFFF;
  230. }
  231. .exhibitor-title{
  232. font-family: Poppins, Poppins;
  233. font-size: 30rpx;
  234. color: #000000;
  235. line-height: 40rpx;
  236. padding-left: 19rpx;
  237. padding-right: 24rpx;
  238. .exhibitor-title-1{
  239. font-weight: bold;
  240. }
  241. .exhibitor-title-2 {
  242. font-size: 28rpx;
  243. }
  244. .exhibitor-title-3 {
  245. font-size: $fontSize0;
  246. color: #333333;
  247. line-height: 20rpx;
  248. margin-top: 10rpx;
  249. }
  250. }
  251. .exhibitor-number{
  252. flex-shrink: 0;
  253. justify-content: flex-end;
  254. margin-top: 12rpx;
  255. }
  256. .exhibitor-number-label{
  257. font-size: $fontSize0;
  258. color: #555555;
  259. }
  260. .exhibitor-number-text{
  261. font-family: Poppins, Poppins;
  262. font-weight: bold;
  263. font-size: $fontSize6;
  264. color: #E57519;
  265. letter-spacing: 2rpx;
  266. }
  267. .exhibitor-desc{
  268. font-family: Poppins, Poppins;
  269. font-size: $fontSize2;
  270. color: #333333;
  271. line-height: 35rpx;
  272. margin-top: 30rpx;
  273. margin-bottom: 12rpx;
  274. }
  275. .u-panel{
  276. margin-top: 40rpx;
  277. }
  278. .click-more{
  279. display: flex;
  280. justify-content: center;
  281. margin-top: 49rpx;
  282. @include link-button;
  283. }
  284. }
  285. </style>