detail.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  1. <template>
  2. <page-layout class="exhibitor-detail" v-if="exhibitor && exhibitor.name_zh_cn">
  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_name }}
  19. </view>
  20. </view>
  21. <view class="exhibitor-info">
  22. <view class="exhibitor-number">
  23. <view class="exhibitor-number-label">展位号:</view>
  24. <view class="exhibitor-number-text">{{ exhibitor.hall_booth_no }}</view>
  25. </view>
  26. <view class="exhibitor-right">
  27. <view class="exhibitor-info-item">
  28. <view class="iconfont icon-View"></view>
  29. {{ exhibitor.pv }}
  30. </view>
  31. <view class="exhibitor-info-item" v-if="pollShow.exhibitors_poll_show">
  32. <view class="iconfont icon-xiaochengxu-renqiicon"></view>
  33. <view>人气:{{ exhibitor.poll_count }}</view>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <view class="exhibitor-desc">
  39. {{ exhibitor.introduce_zh_cn }}
  40. </view>
  41. <view class="exhibitor-tags">
  42. <view class="exhibitor-tags-category">产品分类:</view>
  43. <view class="exhibitor-tags-list">
  44. <view class="exhibitor-tag" v-for="(item) in exhibitor.product_cate_names">{{ item }}</view>
  45. </view>
  46. </view>
  47. <view class="exhibitor-tags">
  48. <view class="exhibitor-tags-category">应用领域:</view>
  49. <view class="exhibitor-tags-list">
  50. <view class="exhibitor-tag" v-for="(item) in exhibitor.application_areas_names">{{ item }}</view>
  51. </view>
  52. </view>
  53. <u-panel title="展品资料">
  54. <exhibit-recommend :limit="exhibitRecommendLimit" :exhibitorId="exhibitorId"/>
  55. </u-panel>
  56. <u-panel title="展商新闻">
  57. <news-recommend recommend-type="detail" :exhibitorId="exhibitorId"/>
  58. </u-panel>
  59. <u-panel title="展商活动">
  60. <activity-recommend recommend-type="detail" :exhibitorId="exhibitorId"/>
  61. </u-panel>
  62. <view class="click-more">
  63. <van-button type="primary" @click="navigateTo('/pages/index/index?tab=exhibitor')">点击查看更多展商信息</van-button>
  64. </view>
  65. <view class="exhibitor-operation">
  66. <view class="exhibitor-action">
  67. <view @click.stop="onShare()">
  68. <view class="iconfont icon-zhuanfa"></view>
  69. <view>分享</view>
  70. </view>
  71. <view @click="onCollect()">
  72. <view v-if="exhibitor.is_collect" class="iconfont icon-favourites-filled-star-symbol active"></view>
  73. <view v-else class="iconfont icon-Favourites-Add-Large"></view>
  74. <view>收藏</view>
  75. </view>
  76. <view @click="onLike()">
  77. <view v-if="exhibitor.is_like" class="iconfont icon-aixin active"></view>
  78. <view v-else class="iconfont icon-heart1"></view>
  79. <view>点赞</view>
  80. </view>
  81. <view v-if="pollShow.exhibitors_poll_show" @click="onPoll()">
  82. <view v-if="exhibitor.is_poll" class="iconfont icon-Ticket1 active"></view>
  83. <view v-else class="iconfont icon-xiaochengxu-toupiaoicon"></view>
  84. <view>投票</view>
  85. </view>
  86. </view>
  87. </view>
  88. <disclaimer-text></disclaimer-text>
  89. </view>
  90. </u-scroll-view>
  91. <float-button></float-button>
  92. <van-dialog id="van-dialog"/>
  93. <u-share-action-sheet :show.sync="showShare" :show-info="shareInfo"/>
  94. </page-layout>
  95. </template>
  96. <script>
  97. import NavBar from '@/components/layout/nav-bar'
  98. import UScrollView from '@/components/common/u-scroll-view'
  99. import UShareActionSheet from '@/components/common/u-share-action-sheet'
  100. import UPanel from '@/components/common/u-panel'
  101. import ExhibitRecommend from '@/pages/exhibitor/components/exhibit-recommend.vue'
  102. import NewsRecommend from '@/pages/news/components/news-recommend.vue'
  103. import ActivityRecommend from '@/pages/activity/components/activity-recommend.vue'
  104. import {exhibitorsInfo, exhibitorsCollect, exhibitorsLike, exhibitorsPoll, globalPollShow} from '@/api/exhibitor'
  105. import DisclaimerText from '@/components/disclaimer-text/index.vue'
  106. import floatButton from "@/components/layout/float-button"
  107. import PageLayout from "@/components/layout/page-layout";
  108. import countryZhCn from "@/utils/country-zh-cn";
  109. export default {
  110. options: {
  111. // styleIsolation: 'shared'
  112. },
  113. components: {
  114. PageLayout,
  115. NavBar,
  116. UScrollView,
  117. UShareActionSheet,
  118. UPanel,
  119. ExhibitRecommend,
  120. ActivityRecommend,
  121. NewsRecommend,
  122. DisclaimerText,
  123. floatButton
  124. },
  125. computed: {},
  126. onLoad(options) {
  127. this.exhibitorId = options.id
  128. this.getExhibitorsInfo()
  129. },
  130. data() {
  131. return {
  132. showExhibitMore: true,
  133. showShare: false,
  134. shareInfo: null,
  135. exhibitRecommendLimit: 4,
  136. exhibitor: {
  137. name_zh_cn: '',
  138. name_en_us: '',
  139. country: '',
  140. hall_booth_no: '',
  141. product_cate_names: [],
  142. application_areas_names: [],
  143. pv: 0,
  144. poll_count: 0,
  145. is_collect: 0,
  146. is_like: 0,
  147. is_poll: 0
  148. },
  149. exhibitorId: 0,
  150. pollShow: {
  151. exhibitors_poll_show: 0,
  152. product_poll_show: 0
  153. }
  154. }
  155. },
  156. created() {
  157. this.getGlobalPollShow()
  158. uni.$on('refreshData', (val) => {
  159. if (val === 'pages/exhibitor/detail') {
  160. this.getExhibitorsInfo()
  161. }
  162. })
  163. },
  164. methods: {
  165. getExhibitorsInfo() {
  166. exhibitorsInfo({id: this.exhibitorId}).then(res => {
  167. if (res.code === 0) {
  168. this.exhibitor = res.data
  169. for (let i = 0; i < countryZhCn.length; i++) {
  170. if (countryZhCn[i].code === this.exhibitor.country) {
  171. this.exhibitor.country_name = countryZhCn[i].name
  172. break;
  173. }
  174. }
  175. }
  176. })
  177. },
  178. onShareAppMessage(ops) {
  179. return this.shareInfo
  180. },
  181. onShare() {
  182. this.shareInfo = {
  183. title: this.exhibitor.name_zh_cn,
  184. path: `/pages/exhibitor/detail?id=` + this.exhibitor.id,
  185. imageUrl: this.exhibitor.logo + '?x-oss-process=image/resize,w_600,h_600,limit_0,m_pad'
  186. }
  187. this.showShare = true
  188. },
  189. onCollect() { // 收藏
  190. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  191. return
  192. }
  193. exhibitorsCollect({id: this.exhibitor.id}).then(res => {
  194. if (res.code === 0) {
  195. this.exhibitor.is_collect = this.exhibitor.is_collect === 0 ? 1 : 0
  196. }
  197. })
  198. },
  199. onLike() { // 点赞
  200. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  201. return
  202. }
  203. exhibitorsLike({id: this.exhibitor.id}).then(res => {
  204. if (res.code === 0) {
  205. this.exhibitor.is_like = this.exhibitor.is_like === 0 ? 1 : 0
  206. }
  207. })
  208. },
  209. onPoll() { // 投票
  210. if (!this.checkAuth('/pages/exhibitor/detail?id=' + this.exhibitor.id)) {
  211. return
  212. }
  213. exhibitorsPoll({id: this.exhibitor.id}).then(res => {
  214. if (res.code === 0) {
  215. this.exhibitor.is_poll = this.exhibitor.is_poll === 0 ? 1 : 0
  216. if (this.exhibitor.is_poll === 1) {
  217. this.exhibitor.poll_count = this.exhibitor.poll_count + 1
  218. } else {
  219. this.exhibitor.poll_count = this.exhibitor.poll_count - 1
  220. this.exhibitor.poll_count = this.exhibitor.poll_count < 0 ? 0 : this.exhibitor.poll_count
  221. }
  222. }
  223. })
  224. },
  225. getGlobalPollShow() {
  226. globalPollShow().then(res => {
  227. this.pollShow = res.data
  228. })
  229. }
  230. }
  231. }
  232. </script>
  233. <style lang="scss">
  234. @import "@/static/style/pages/exhibitor-detail.scss";
  235. .exhibitor-detail {
  236. padding-bottom: 40rpx;
  237. .exhibitor-main {
  238. display: flex;
  239. align-items: flex-start;
  240. }
  241. .exhibitor-info {
  242. display: flex;
  243. flex-direction: column;
  244. grid-gap: 12rpx;
  245. color: #555555;
  246. .exhibitor-right {
  247. display: flex;
  248. grid-gap: 6rpx;
  249. .exhibitor-info-item {
  250. display: flex;
  251. align-items: center;
  252. grid-gap: 3rpx;
  253. font-size: $fontSize0;
  254. }
  255. }
  256. }
  257. .exhibitor-logo {
  258. width: 160rpx;
  259. height: 160rpx;
  260. padding: 6rpx;
  261. background: #FFFFFF;
  262. border: 1rpx solid #D9D9D9;
  263. image {
  264. width: 100%;
  265. height: 100%;
  266. }
  267. }
  268. .u-panel {
  269. //background-color: #FFFFFF;
  270. }
  271. .exhibitor-title {
  272. flex: 1;
  273. font-size: $fontSize5;
  274. color: #000000;
  275. line-height: 40rpx;
  276. padding-left: 19rpx;
  277. padding-right: 24rpx;
  278. .exhibitor-title-1 {
  279. font-weight: bold;
  280. }
  281. .exhibitor-title-2 {
  282. font-size: $fontSize4;
  283. }
  284. .exhibitor-title-3 {
  285. font-size: $fontSize1;
  286. color: #333333;
  287. line-height: $fontSize1;
  288. margin-top: 10rpx;
  289. }
  290. }
  291. .exhibitor-number {
  292. flex-shrink: 0;
  293. justify-content: flex-end;
  294. margin-top: 12rpx;
  295. }
  296. .exhibitor-number-label {
  297. font-size: $fontSize0;
  298. color: #555555;
  299. }
  300. .exhibitor-number-text {
  301. font-weight: bold;
  302. font-size: $fontSize6;
  303. color: #E57519;
  304. letter-spacing: 2rpx;
  305. }
  306. .exhibitor-desc {
  307. font-size: $fontSize3;
  308. color: #333333;
  309. line-height: 35rpx;
  310. margin-top: 30rpx;
  311. margin-bottom: 12rpx;
  312. line-height: 1.5;
  313. }
  314. .u-panel {
  315. padding: 0 !important;
  316. margin-top: 40rpx;
  317. }
  318. .click-more {
  319. display: flex;
  320. justify-content: center;
  321. margin-top: 49rpx;
  322. @include link-button;
  323. }
  324. }
  325. </style>