exhibit-detail.vue 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. <template>
  2. <view class="exhibit-detail exhibitor-detail">
  3. <nav-bar title="展品介绍" @init="onInitNavbar"></nav-bar>
  4. <u-scroll-view>
  5. <view class="main-container">
  6. <view class="exhibit-image">
  7. <image :src="exhibit.pic + '?x-oss-process=image/resize,w_800'" mode="aspectFit"/>
  8. <view v-for="(item) in exhibit.product_attr_names" class="exhibit-tag">{{ item }}</view>
  9. </view>
  10. <view class="exhibit-name">{{ exhibit.name }}</view>
  11. <view class="exhibit-desc">{{ exhibit.summary}}</view>
  12. <view class="exhibit-tags exhibitor-tags">
  13. <view class="exhibitor-tags-category">产品分类:</view>
  14. <view class="exhibitor-tags-list">
  15. <view v-for="(item) in exhibit.product_cate_names" class="exhibitor-tag">{{ item }}</view>
  16. </view>
  17. </view>
  18. <view class="exhibit-tags exhibitor-tags">
  19. <view class="exhibitor-tags-category">应用领域:</view>
  20. <view class="exhibitor-tags-list">
  21. <view v-for="(item) in exhibit.application_areas_names" class="exhibitor-tag">{{ item }}</view>
  22. </view>
  23. </view>
  24. <view class="exhibit-operation exhibitor-operation">
  25. <view class="exhibitor-views">浏览:{{ exhibit.pv }}</view>
  26. <view class="exhibitor-action">
  27. <view v-if="pollShow.product_poll_show">
  28. <view class="iconfont icon-xiaochengxu-renqiicon"></view>
  29. <view>人气:{{ exhibit.poll_count }}</view>
  30. </view>
  31. <view>
  32. <button :plain="true" @click.stop="onShare">
  33. <view>
  34. <view class="iconfont icon-zhuanfa"></view>
  35. <view>分享</view>
  36. </view>
  37. </button>
  38. </view>
  39. <view @click="onCollect()">
  40. <view v-if="exhibit.is_collect" class="iconfont icon-favourites-filled-star-symbol active"></view>
  41. <view v-else class="iconfont icon-Favourites-Add-Large"></view>
  42. <view>收藏</view>
  43. </view>
  44. <view @click="onLike()">
  45. <view v-if="exhibit.is_like" class="iconfont icon-aixin active"></view>
  46. <view v-else class="iconfont icon-heart1"></view>
  47. <view>点赞</view>
  48. </view>
  49. <view v-if="pollShow.product_poll_show" @click="onPoll()">
  50. <view v-if="exhibit.is_poll" class="iconfont icon-Ticket1 active"></view>
  51. <view v-else class="iconfont icon-xiaochengxu-toupiaoicon"></view>
  52. <view>投票</view>
  53. </view>
  54. </view>
  55. </view>
  56. <u-panel title="展商信息">
  57. <view class="exhibitor-card">
  58. <view class="exhibitor-info">
  59. <view class="exhibitor-logo">
  60. <image :src="exhibit.exhibitors_logo + '?x-oss-process=image/resize,w_400'" mode="widthFix" />
  61. </view>
  62. <view class="exhibitor-name-cn">{{ exhibit.exhibitors_name_zh_cn }}</view>
  63. <view class="exhibitor-name-en">{{ exhibit.exhibitors_name_en_us }}</view>
  64. <view class="exhibitor-detail-link">
  65. <van-button type="primary" @click="onClickDetail">
  66. <template>
  67. <view>点击了解展商更多信息</view> <view class="arrow iconfont icon-right-s"></view>
  68. </template>
  69. </van-button>
  70. </view>
  71. </view>
  72. <view class="exhibitor-number">
  73. <view class="exhibitor-number-label">我们的展位号</view>
  74. <view class="exhibitor-number-text">{{ exhibit.exhibitors_hall }}馆 {{ exhibit.exhibitors_booth_no }}</view>
  75. </view>
  76. </view>
  77. </u-panel>
  78. <disclaimer-text></disclaimer-text>
  79. </view>
  80. </u-scroll-view>
  81. <u-share-action-sheet :show.sync="showShare" :show-info="shareInfo" />
  82. </view>
  83. </template>
  84. <script>
  85. import NavBar from '@/components/layout/nav-bar'
  86. import UScrollView from '@/components/common/u-scroll-view'
  87. import UShareActionSheet from '@/components/common/u-share-action-sheet'
  88. import UPanel from '@/components/common/u-panel'
  89. import DisclaimerText from '@/components/disclaimer-text/index.vue'
  90. import { exhibitorsProductInfo, globalPollShow, exhibitorsProductCollect, exhibitorsProductLike, exhibitorsProductPoll } from '@/api/exhibitor'
  91. export default {
  92. options: {
  93. styleIsolation: 'shared'
  94. },
  95. components: {
  96. NavBar,
  97. UScrollView,
  98. UShareActionSheet,
  99. UPanel,
  100. DisclaimerText
  101. },
  102. computed: {},
  103. data() {
  104. return {
  105. showShare: false,
  106. shareInfo: null,
  107. exhibit: {
  108. is_collect: 0,
  109. is_like: 0,
  110. is_poll: 0,
  111. name: '',
  112. summary: '',
  113. product_cate_names: [],
  114. application_areas_names: [],
  115. product_attr_names: [],
  116. pic: '',
  117. poll_count: 0,
  118. pv: 0,
  119. exhibitors_logo: '',
  120. exhibitors_name_zh_cn: '',
  121. exhibitors_name_en_us: '',
  122. exhibitors_hall: '',
  123. exhibitors_booth_no: ''
  124. },
  125. id: 0,
  126. pollShow: {
  127. exhibitors_poll_show: 0,
  128. product_poll_show: 0
  129. }
  130. }
  131. },
  132. onLoad(options) {
  133. this.id = options.id
  134. this.getProductInfo()
  135. },
  136. created() {
  137. this.loadFontFace('Poppins')
  138. this.getGlobalPollShow()
  139. },
  140. methods: {
  141. getProductInfo() {
  142. exhibitorsProductInfo({id: this.id}).then(res => {
  143. if (res.code === 0) {
  144. this.exhibit = res.data
  145. }
  146. })
  147. },
  148. onShareAppMessage() {
  149. return this.shareInfo
  150. },
  151. onShare() {
  152. this.shareInfo = {
  153. title: this.exhibit.name,
  154. path: `/pages/exhibitor/exhibit-detail` + this.id,
  155. imageUrl: this.exhibit.pic + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
  156. }
  157. this.showShare = true
  158. },
  159. onClickDetail(e) {
  160. this.navigateTo('/pages/exhibitor/detail?id=' + this.exhibit.exhibitors_id)
  161. },
  162. getGlobalPollShow() {
  163. globalPollShow().then(res => {
  164. this.pollShow = res.data
  165. })
  166. },
  167. onCollect() { // 收藏
  168. this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.id)
  169. exhibitorsProductCollect({ id: this.id }).then(res => {
  170. if (res.code === 0) {
  171. this.exhibit.is_collect = this.exhibit.is_collect === 0 ? 1 : 0
  172. }
  173. })
  174. },
  175. onLike() { // 点赞
  176. this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.id)
  177. exhibitorsProductLike({ id: this.id }).then(res => {
  178. if (res.code === 0) {
  179. this.exhibit.is_like = this.exhibit.is_like === 0 ? 1 : 0
  180. }
  181. })
  182. },
  183. onPoll() { // 投票
  184. this.checkAuth('/pages/exhibitor/exhibit-detail?id=' + this.id)
  185. exhibitorsProductPoll({ id: this.id }).then(res => {
  186. if (res.code === 0) {
  187. this.exhibit.is_poll = this.exhibit.is_poll === 0 ? 1 : 0
  188. if (this.exhibit.is_poll === 1) {
  189. this.exhibit.poll_count = this.exhibit.poll_count + 1
  190. } else {
  191. this.exhibit.poll_count = this.exhibit.poll_count - 1
  192. this.exhibit.poll_count = this.exhibit.poll_count < 0 ? 0 : this.exhibit.poll_count
  193. }
  194. }
  195. })
  196. },
  197. }
  198. }
  199. </script>
  200. <style lang="scss">
  201. @import "@/static/style/pages/exhibitor-detail.scss";
  202. .exhibit-detail{
  203. .exhibit-image{
  204. position: relative;
  205. height: 438rpx;
  206. background-color: #FFFFFF;
  207. border-radius: 5rpx;
  208. border: 1rpx solid #D6D6D6;
  209. .exhibit-tag{
  210. position: absolute;
  211. top: 28rpx;
  212. left: 29rpx;
  213. padding: 12rpx 22rpx;
  214. color: $textActionColor;
  215. font-size: $fontSize0;
  216. background-color: lighten($textActionColor, 43%);
  217. }
  218. }
  219. .exhibitor-detail-link{
  220. @include link-button;
  221. }
  222. .exhibit-name{
  223. margin-top: 28rpx;
  224. font-family: Poppins, Poppins;
  225. font-weight: bold;
  226. font-size: $fontSize6;
  227. color: #000000;
  228. line-height: 42rpx;
  229. }
  230. .exhibit-desc{
  231. margin-top: 18rpx;
  232. font-family: Poppins, Poppins;
  233. font-size: $fontSize2;
  234. color: #555555;
  235. line-height: 35rpx;
  236. }
  237. .exhibitor-card{
  238. display: flex;
  239. background-color: #FFFFFF;
  240. .exhibitor-info{
  241. padding: 36rpx;
  242. flex: 1;
  243. }
  244. .exhibitor-logo{
  245. width: 194rpx;
  246. image{
  247. height: auto;
  248. }
  249. }
  250. .exhibitor-detail-link{
  251. margin-top: 36rpx;
  252. }
  253. .exhibitor-name-cn,.exhibitor-name-en{
  254. font-family: Poppins, Poppins;
  255. font-size: $fontSize3;
  256. color: #000000;
  257. line-height: 28rpx;
  258. }
  259. .exhibitor-name-en{
  260. margin-top: 10rpx;
  261. font-size: $fontSize2;
  262. }
  263. .exhibitor-number{
  264. @include display-flex-center;
  265. flex-direction: column;
  266. width: 267rpx;
  267. background-color: $buttonPrimaryColor;
  268. color: #FFFFFF;
  269. }
  270. .exhibitor-number-text{
  271. width: 161rpx;
  272. text-align: center;
  273. font-family: Poppins, Poppins;
  274. font-weight: bold;
  275. font-size: 55rpx;
  276. line-height: 64rpx;
  277. margin-top: 30rpx;
  278. }
  279. .exhibitor-number-label{
  280. font-family: Poppins, Poppins;
  281. font-size: $fontSize3;
  282. line-height: 28rpx;
  283. color: rgba(255, 255, 255, 0.74);
  284. }
  285. }
  286. .u-panel{
  287. margin-top: 54rpx;
  288. padding: 0;
  289. .u-panel-title{
  290. &:after{
  291. display: none;
  292. }
  293. }
  294. }
  295. }
  296. </style>