detail.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  1. <template>
  2. <div class="page md:flex md:justify-between">
  3. <div class="page-title">机构认证</div>
  4. <div class="page-top">
  5. <div class="swiper">
  6. <SimpleSwiper :imageList="clubInfo.bannerList"></SimpleSwiper>
  7. </div>
  8. </div>
  9. <div class="page-content">
  10. <div class="auth">
  11. <div class="auth-icon"></div>
  12. <div class="auth-info">
  13. <span class="font-bold">ROS'S</span>
  14. <span>授予</span>
  15. <span>{{ clubInfo.authParty }}</span>
  16. <span>正品拥有</span>
  17. </div>
  18. </div>
  19. <div class="club-info">
  20. <div class="section flex justify-between items-center">
  21. <div class="info">
  22. <div class="name" v-text="clubInfo.authParty"></div>
  23. <div class="mobile" @click="callMobile(clubInfo.mobile)">
  24. {{ clubInfo.mobile | formatEmpty }}
  25. </div>
  26. <div class="address" v-text="address"></div>
  27. </div>
  28. <div class="logo"><img :src="clubInfo.logo" /></div>
  29. </div>
  30. <div class="section flex justify-between items-center mt-6">
  31. <div class="navigation" @click="onMapNav">导航</div>
  32. <div
  33. class="distance"
  34. v-if="clubInfo.distance && clubInfo.distance < 99999"
  35. v-text="'距你' + clubInfo.distance + 'km'"
  36. ></div>
  37. </div>
  38. </div>
  39. <div class="divider"></div>
  40. <div class="device-list">
  41. <div class="title">已认证设备</div>
  42. <div class="list">
  43. <div
  44. class="device flex justify-between items-center"
  45. v-for="item in clubInfo.productList"
  46. :key="item.productId"
  47. >
  48. <div class="info">
  49. <div class="name" v-text="item.productName"></div>
  50. <div class="code">SN码:{{ item.snCode | formatSnCode }}</div>
  51. </div>
  52. <div class="detail" @click="toDetail(item)">查看认证</div>
  53. </div>
  54. </div>
  55. </div>
  56. <SimpleEmpty
  57. v-if="isEmpty"
  58. name="icon-empty-device.png"
  59. description="暂无已认证设备"
  60. ></SimpleEmpty>
  61. </div>
  62. <SimpleMapNav
  63. ref="mapNav"
  64. @click="navigation"
  65. color="#f3920d"
  66. ></SimpleMapNav>
  67. </div>
  68. </template>
  69. <script>
  70. import { drawLogo } from '@/utils'
  71. import { convertor, mapNavigate } from '@/utils/map-utils'
  72. import { callMobile } from '@/utils'
  73. import { mapGetters } from 'vuex'
  74. export default {
  75. layout: 'app-ross',
  76. filters: {
  77. formatEmpty(val) {
  78. return val || '暂无'
  79. },
  80. formatSnCode(code) {
  81. if (!code) return ''
  82. return code.replace(/^(\w{2})\w+(\w{4})$/, '$1******$2')
  83. },
  84. },
  85. data() {
  86. return {
  87. authId: '',
  88. clubInfo: {},
  89. }
  90. },
  91. computed: {
  92. ...mapGetters(['routePrefix']),
  93. address() {
  94. let resultAddress = this.clubInfo.area
  95. ? this.clubInfo.area + this.clubInfo.address
  96. : this.clubInfo.address
  97. return resultAddress || '暂无'
  98. },
  99. isEmpty() {
  100. return this.clubInfo.productList
  101. ? this.clubInfo.productList.length === 0
  102. : true
  103. },
  104. },
  105. mounted() {
  106. this.initData()
  107. },
  108. beforeDestroy() {
  109. this.$removeStorage(this.routePrefix, 'clubInfo')
  110. },
  111. methods: {
  112. callMobile,
  113. // 设备详情
  114. toDetail(item) {
  115. // window.location.href = `${process.env.CIMEI_LOCAL}/product/auth/product-${item.productId}.html`
  116. this.$router.push(
  117. `${this.routePrefix}/approve/device/detail?id=${item.productId}`
  118. )
  119. },
  120. // 初始化
  121. initData() {
  122. this.authId = parseInt(this.$route.query.id)
  123. const clubInfo = this.$getStorage(this.routePrefix, 'clubInfo')
  124. if (clubInfo) {
  125. this.clubInfo = clubInfo
  126. }
  127. this.fetchDetail()
  128. },
  129. // 获取机构详细信息
  130. async fetchDetail() {
  131. try {
  132. const res = await this.$http.api.getAuthClubDetail({
  133. authId: this.authId,
  134. })
  135. this.clubInfo = { ...this.clubInfo, ...res.data } // 合并
  136. } catch (error) {
  137. console.log(error)
  138. }
  139. // 默认轮播图
  140. if (this.clubInfo.bannerList.length <= 0) {
  141. this.clubInfo.bannerList.push('/placeholder.png')
  142. }
  143. // 默认logo
  144. if (!this.clubInfo.logo) {
  145. this.clubInfo.logo = drawLogo(this.clubInfo.authParty)
  146. }
  147. },
  148. // 地图导航
  149. onMapNav() {
  150. this.$refs.mapNav.open()
  151. },
  152. // 导航
  153. navigation(type) {
  154. const point = this.clubInfo.lngAndLat.split(',')
  155. let lng = point[0]
  156. let lat = point[1]
  157. mapNavigate(
  158. { lat, lng, title: this.clubInfo.authParty, address: this.address },
  159. type
  160. )
  161. this.$refs.mapNav.close()
  162. },
  163. },
  164. }
  165. </script>
  166. <style scoped lang="scss">
  167. // pc 端
  168. @media screen and (min-width: 768px) {
  169. .page {
  170. position: relative;
  171. width: 1200px;
  172. height: 612px;
  173. margin-left: auto;
  174. margin-right: auto;
  175. margin-top: 80px;
  176. background-color: #fff;
  177. box-sizing: border-box;
  178. padding: 16px;
  179. padding-right: 0;
  180. }
  181. .page-title {
  182. position: absolute;
  183. font-size: 24px;
  184. color: #333;
  185. top: -50px;
  186. left: 0;
  187. }
  188. .page-top {
  189. margin-right: 24px;
  190. .swiper {
  191. width: 580px;
  192. height: 580px;
  193. background: #f7f7f7;
  194. ::v-deep {
  195. img {
  196. width: 580px;
  197. height: 580px;
  198. }
  199. }
  200. }
  201. }
  202. .page-content {
  203. width: 580px;
  204. overflow-y: auto;
  205. &::-webkit-scrollbar {
  206. width: 8px;
  207. // background-color: #eeeeee;
  208. }
  209. &::-webkit-scrollbar-thumb {
  210. border-radius: 4px;
  211. background-color: #eeeeee;
  212. }
  213. .auth {
  214. width: 564px;
  215. min-height: 114px;
  216. background: #f3920d;
  217. box-sizing: border-box;
  218. padding: 24px;
  219. margin-bottom: 4px;
  220. border-radius: 4px;
  221. .auth-icon {
  222. height: 28px;
  223. background: url(~assets/theme-images/ross/pc-icon-auth.png) no-repeat
  224. left center;
  225. background-size: auto 28px;
  226. }
  227. .auth-info {
  228. font-size: 0;
  229. margin-top: 10px;
  230. span {
  231. font-size: 20px;
  232. color: #fff;
  233. }
  234. }
  235. }
  236. .club-info {
  237. padding: 32px 24px;
  238. width: 564px;
  239. min-height: 264px;
  240. background: url(~assets/theme-images/ross/pc-club-info-bg.png) center
  241. no-repeat;
  242. background-size: cover;
  243. box-sizing: border-box;
  244. .info {
  245. width: 360px;
  246. .name {
  247. font-size: 24px;
  248. color: #fff;
  249. font-weight: bold;
  250. margin-bottom: 34px;
  251. }
  252. .mobile,
  253. .address {
  254. position: relative;
  255. padding-left: 28px;
  256. margin-top: 16px;
  257. line-height: 24px;
  258. font-size: 16px;
  259. color: #fff;
  260. &::after {
  261. content: '';
  262. display: block;
  263. width: 24px;
  264. height: 24px;
  265. position: absolute;
  266. left: 0;
  267. top: 0;
  268. background-size: 20px;
  269. background-repeat: no-repeat;
  270. background-position: center;
  271. }
  272. }
  273. .mobile {
  274. cursor: pointer;
  275. &::after {
  276. @include themify($themes) {
  277. background-image: themed('pc-icon-mobile');
  278. }
  279. }
  280. }
  281. .address {
  282. &::after {
  283. @include themify($themes) {
  284. background-image: themed('h5-icon-address');
  285. }
  286. }
  287. }
  288. }
  289. .logo {
  290. position: relative;
  291. width: 114px;
  292. height: 114px;
  293. border-radius: 50% 50% 0 50%;
  294. overflow: hidden;
  295. background: #fff;
  296. &::after {
  297. position: absolute;
  298. bottom: 0;
  299. right: 0;
  300. content: '';
  301. display: block;
  302. width: 23px;
  303. height: 23px;
  304. background: url(~assets/theme-images/ross/pc-icon-avatar-v.png)
  305. no-repeat center;
  306. background-size: 23px;
  307. }
  308. }
  309. .navigation {
  310. display: flex;
  311. justify-content: center;
  312. align-items: center;
  313. width: 72px;
  314. height: 32px;
  315. border-radius: 4px;
  316. font-size: 16px;
  317. color: #f3920d;
  318. border: 1px solid #fff;
  319. background-color: #fff;
  320. cursor: pointer;
  321. &::after {
  322. content: '';
  323. display: block;
  324. width: 16px;
  325. height: 16px;
  326. margin-left: 4px;
  327. @include themify($themes) {
  328. background: themed('pc-icon-navigation') no-repeat center;
  329. }
  330. background-size: 16px;
  331. }
  332. }
  333. .distance {
  334. font-size: 14px;
  335. color: #fff;
  336. }
  337. }
  338. .device-list {
  339. .title {
  340. position: relative;
  341. font-size: 20px;
  342. font-weight: bold;
  343. color: #282828;
  344. line-height: 30px;
  345. padding-left: 32px;
  346. margin-top: 46px;
  347. margin-bottom: 24px;
  348. &::before {
  349. content: '';
  350. display: block;
  351. width: 30px;
  352. height: 30px;
  353. background: url(~assets/theme-images/ross/pc-icon-device-list.png)
  354. no-repeat center;
  355. position: absolute;
  356. left: 0;
  357. top: 0;
  358. }
  359. }
  360. .list {
  361. padding-right: 16px;
  362. }
  363. .device {
  364. padding: 20px 16px;
  365. box-sizing: border-box;
  366. background: #f3f5f6;
  367. margin-top: 16px;
  368. &:first-child {
  369. margin-top: 0;
  370. }
  371. .info {
  372. width: 80%;
  373. .name {
  374. font-size: 18px;
  375. color: #282828;
  376. }
  377. .code {
  378. margin-top: 12px;
  379. font-size: 14px;
  380. color: #666;
  381. }
  382. }
  383. .detail {
  384. display: flex;
  385. justify-content: center;
  386. align-items: center;
  387. width: 80px;
  388. height: 32px;
  389. border-radius: 4px;
  390. font-size: 14px;
  391. color: #ffffff;
  392. cursor: pointer;
  393. @include themify($themes) {
  394. background: themed('color');
  395. }
  396. }
  397. }
  398. }
  399. }
  400. }
  401. // 移动 端
  402. @media screen and (max-width: 768px) {
  403. .page-title {
  404. display: none;
  405. }
  406. .page-top {
  407. .swiper {
  408. height: 100vw;
  409. background: #f7f7f7;
  410. ::v-deep {
  411. img {
  412. height: 100vw;
  413. }
  414. }
  415. }
  416. }
  417. .page-content {
  418. .auth {
  419. // width: 100%;
  420. min-height: 20vw;
  421. background: #f3920d;
  422. box-sizing: border-box;
  423. padding: 5.2vw 4vw;
  424. .auth-icon {
  425. height: 4.9vw;
  426. background: url(~assets/theme-images/ross/h5-icon-auth.png) no-repeat
  427. left center;
  428. background-size: auto 4.9vw;
  429. }
  430. .auth-info {
  431. font-size: 0;
  432. margin-top: 1vw;
  433. span {
  434. font-size: 3.6vw;
  435. line-height: 6.4vw;
  436. color: #fff;
  437. font-weight: bold;
  438. }
  439. }
  440. }
  441. .club-info {
  442. padding: 4vw;
  443. width: 100vw;
  444. min-height: 43.4vw;
  445. background: url(~assets/theme-images/ross/h5-club-info-bg.png) center
  446. no-repeat;
  447. background-size: cover;
  448. box-sizing: border-box;
  449. .info {
  450. width: 67vw;
  451. .name {
  452. font-size: 4.8vw;
  453. color: #fff;
  454. font-weight: bold;
  455. margin-bottom: 4vw;
  456. }
  457. .mobile,
  458. .address {
  459. position: relative;
  460. padding-left: 5vw;
  461. margin-top: 1.6vw;
  462. line-height: 5vw;
  463. font-size: 3.2vw;
  464. color: #fff;
  465. &::after {
  466. content: '';
  467. display: block;
  468. width: 4vw;
  469. height: 5vw;
  470. position: absolute;
  471. left: 0;
  472. top: 0;
  473. background-size: 4vw 4vw;
  474. background-repeat: no-repeat;
  475. background-position: center;
  476. }
  477. }
  478. .mobile {
  479. &::after {
  480. @include themify($themes) {
  481. background-image: themed('h5-icon-mobile');
  482. }
  483. }
  484. }
  485. .address {
  486. &::after {
  487. @include themify($themes) {
  488. background-image: themed('h5-icon-address');
  489. }
  490. }
  491. }
  492. }
  493. .logo {
  494. position: relative;
  495. width: 18vw;
  496. height: 18vw;
  497. border-radius: 9vw 9vw 0 9vw;
  498. overflow: hidden;
  499. background: #fff;
  500. &::after {
  501. position: absolute;
  502. bottom: 0;
  503. right: 0;
  504. content: '';
  505. display: block;
  506. width: 3.6vw;
  507. height: 3.6vw;
  508. background: url(~assets/theme-images/ross/h5-icon-avatar-v.png)
  509. no-repeat center;
  510. background-size: 3.6vw;
  511. }
  512. }
  513. .navigation {
  514. display: flex;
  515. justify-content: center;
  516. align-items: center;
  517. width: 14.4vw;
  518. height: 6.4vw;
  519. border-radius: 0.4vw;
  520. font-size: 3.2vw;
  521. color: #f3920d;
  522. border: 1px solid #fff;
  523. background-color: #fff;
  524. &::after {
  525. content: '';
  526. display: block;
  527. width: 3.6vw;
  528. height: 3.6vw;
  529. margin-left: 0.4vw;
  530. @include themify($themes) {
  531. background: themed('h5-icon-navigation') no-repeat center;
  532. background-size: 3.6vw;
  533. }
  534. }
  535. }
  536. .distance {
  537. font-size: 3vw;
  538. color: #fff;
  539. }
  540. }
  541. .device-list {
  542. padding: 0 4vw;
  543. .title {
  544. position: relative;
  545. padding-left: 6.8vw;
  546. margin-top: 9.6vw;
  547. margin-bottom: 4vw;
  548. font-size: 4vw;
  549. font-weight: bold;
  550. color: #101010;
  551. &::before {
  552. content: '';
  553. display: block;
  554. width: 4.4vw;
  555. height: 4.4vw;
  556. background: url(~assets/theme-images/ross/h5-icon-device-list.png)
  557. no-repeat center;
  558. position: absolute;
  559. left: 0;
  560. top: 0;
  561. }
  562. }
  563. .device {
  564. padding: 4.4vw 3.2vw;
  565. background: #f3f5f6;
  566. margin-bottom: 3.2vw;
  567. .info {
  568. width: 74%;
  569. .name {
  570. font-size: 3.6vw;
  571. color: #282828;
  572. }
  573. .code {
  574. margin-top: 3.2vw;
  575. font-size: 3vw;
  576. color: #666;
  577. }
  578. }
  579. .detail {
  580. display: flex;
  581. justify-content: center;
  582. align-items: center;
  583. width: 15.8vw;
  584. height: 6.4vw;
  585. border-radius: 0.4vw;
  586. font-size: 3vw;
  587. color: #ffffff;
  588. @include themify($themes) {
  589. background: themed('color');
  590. }
  591. }
  592. }
  593. }
  594. }
  595. }
  596. </style>