detail.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  1. <template>
  2. <div class="device-detail" v-if="productInfo">
  3. <div class="detail-title">设备认证</div>
  4. <div class="page-top">
  5. <div class="swiper">
  6. <img :src="productInfo.pcImage" class="device-image" />
  7. <div class="auth-seal"></div>
  8. <img
  9. class="auth-card"
  10. :src="authCardImage"
  11. @click="onShowAuthCard"
  12. v-if="!showAuthCard"
  13. />
  14. <img class="auth-logo" :src="authLogoImage" />
  15. </div>
  16. <div class="device-info">
  17. <div class="logo">
  18. <img :src="productInfo.clubLogo" alt="logo" />
  19. </div>
  20. <div class="section">
  21. <div class="name" v-text="productInfo.productName"></div>
  22. <div class="sncode mobile">
  23. SN码:<span>{{ productInfo.snCode | snCodeRender }}</span>
  24. </div>
  25. <div class="row">
  26. <!-- <span>产地:{{ productInfo.productionPlace }}</span> -->
  27. <!-- <span>品牌:{{ productInfo.brandName }}</span><i></i><span>产地:西班牙巴塞罗那</span> -->
  28. <span>品牌:RÖS'S</span><i></i><span>产地:西班牙巴塞罗那</span>
  29. </div>
  30. <div class="sncode pc">
  31. SN码:<span>{{ productInfo.snCode | snCodeRender }}</span>
  32. </div>
  33. <div class="maker">制造商:{{ productInfo.manufacturer }}</div>
  34. <!-- <div class="supplier">代理商:{{ productInfo.shopName }}</div> -->
  35. <div class="supplier">代理商:ACEBELLE生物科技(深圳)有限公司</div>
  36. </div>
  37. <div class="auth">
  38. <div class="auth-icon"></div>
  39. <div class="auth-info">
  40. <span class="font-bold">ROS'S</span>
  41. <span>授予</span>
  42. <span>{{ productInfo.authParty }}</span>
  43. <span>正品拥有</span>
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. <div class="page-content">
  49. <div class="device-params">
  50. <div class="title">相关参数</div>
  51. <div class="line"></div>
  52. <div class="params">
  53. <div class="row" v-for="(row, index) in paramListRender" :key="index">
  54. <template v-for="(col, index) in row">
  55. <div class="col" :key="'name' + index">
  56. {{ col.paramName }}{{ isPc ? ':' : '' }}
  57. </div>
  58. <div class="col" :key="'content' + index">
  59. {{ col.paramContent }}
  60. </div>
  61. </template>
  62. </div>
  63. </div>
  64. </div>
  65. </div>
  66. <!-- 授权牌弹窗 -->
  67. <div class="mask" v-if="showAuthCard" @click="onHideAuthCard"></div>
  68. <transition
  69. enter-active-class="animate__zoomIn"
  70. leave-active-class="animate__zoomOut"
  71. >
  72. <div class="auth-card-content animate__animated" v-if="showAuthCard">
  73. <div class="auth-card-popup">
  74. <span class="el-icon-circle-close" @click="onHideAuthCard"></span>
  75. <img :src="authCardImage" />
  76. </div>
  77. </div>
  78. </transition>
  79. </div>
  80. </template>
  81. <script>
  82. import { mapGetters } from 'vuex'
  83. import { chunk } from 'lodash'
  84. export default {
  85. layout: 'app-ross',
  86. filters: {
  87. snCodeRender(code) {
  88. return code.replace(/^(\w{2})\w+(\w{4})$/, '$1******$2')
  89. },
  90. },
  91. data() {
  92. return {
  93. showAuthCard: false,
  94. bannerList: [],
  95. productInfo: null,
  96. }
  97. },
  98. watch: {
  99. isPc() {
  100. this.$nextTick(() => {
  101. window.location.reload()
  102. })
  103. },
  104. },
  105. computed: {
  106. ...mapGetters(['isPc']),
  107. // 参数列表
  108. paramListRender() {
  109. if (!this.productInfo) return []
  110. return this.isPc
  111. ? chunk(this.productInfo.paramList, 2)
  112. : chunk(this.productInfo.paramList, 1)
  113. },
  114. // 机构logo
  115. authLogoImage() {
  116. if (!this.productInfo) return ''
  117. return this.productInfo.authLogo
  118. },
  119. // 授权牌
  120. authCardImage() {
  121. if (!this.productInfo) return ''
  122. return this.productInfo.appletsCertificateImage
  123. },
  124. },
  125. created() {
  126. this.fetchProductDetails()
  127. },
  128. methods: {
  129. onShowAuthCard() {
  130. this.showAuthCard = true
  131. },
  132. onHideAuthCard() {
  133. this.showAuthCard = false
  134. },
  135. async fetchProductDetails() {
  136. const productId = this.$route.query.id
  137. try {
  138. const { data } = await this.$http.api.fetchProductDetails({
  139. productId: productId,
  140. })
  141. this.productInfo = data
  142. } catch (error) {
  143. console.log(error)
  144. }
  145. },
  146. },
  147. }
  148. </script>
  149. <style lang="scss" scoped>
  150. ::v-deep {
  151. .swiper-pagination-bullet {
  152. background: #f3920d !important;
  153. }
  154. .simple-swiper {
  155. .swiper-pagination-bullet-active {
  156. background: #f3920d;
  157. }
  158. }
  159. }
  160. .mask {
  161. width: 100vw;
  162. height: 100vh;
  163. position: fixed;
  164. left: 0;
  165. top: 0;
  166. z-index: 8;
  167. background: rgba(0, 0, 0, 0.5);
  168. }
  169. // pc 端
  170. @media screen and (min-width: 768px) {
  171. .device-detail {
  172. margin-bottom: 48px;
  173. .auth-card-content {
  174. width: 100vw;
  175. height: 100vh;
  176. position: fixed;
  177. left: 0;
  178. top: 0;
  179. display: flex;
  180. justify-content: center;
  181. align-items: center;
  182. z-index: 9;
  183. .auth-card-popup {
  184. position: relative;
  185. width: 622px;
  186. img {
  187. display: block;
  188. width: 100%;
  189. height: auto;
  190. }
  191. .el-icon-circle-close {
  192. position: absolute;
  193. top: -50px;
  194. right: 0;
  195. font-size: 32px;
  196. color: #fff;
  197. cursor: pointer;
  198. }
  199. }
  200. }
  201. .detail-title {
  202. font-size: 24px;
  203. color: #282828;
  204. margin: 32px auto 24px;
  205. width: 1200px;
  206. }
  207. .page-top,
  208. .page-content {
  209. width: 1200px;
  210. margin: 0 auto;
  211. background: #fff;
  212. }
  213. .page-top {
  214. display: flex;
  215. justify-content: space-between;
  216. align-items: flex-start;
  217. padding: 24px;
  218. padding-right: 40px;
  219. .swiper {
  220. position: relative;
  221. width: 540px;
  222. height: 540px;
  223. background: #f7f7f7;
  224. .device-image {
  225. width: 100%;
  226. height: 100%;
  227. }
  228. ::v-deep {
  229. img {
  230. width: 540px;
  231. height: 540px;
  232. }
  233. }
  234. .auth-seal {
  235. position: absolute;
  236. width: 70px;
  237. height: 70px;
  238. background: url(~assets/theme-images/ross/pc-icon-auth-seal.png)
  239. no-repeat center;
  240. background-size: 70px;
  241. right: 24px;
  242. bottom: 24px;
  243. z-index: 2;
  244. }
  245. .auth-card {
  246. position: absolute;
  247. width: auto;
  248. height: 110px;
  249. display: block;
  250. bottom: 24px;
  251. left: 24px;
  252. z-index: 2;
  253. cursor: pointer;
  254. }
  255. .auth-logo {
  256. position: absolute;
  257. max-width: 120px;
  258. max-height: 120px;
  259. top: 24px;
  260. left: 24px;
  261. z-index: 2;
  262. }
  263. }
  264. .device-info {
  265. width: 572px;
  266. position: relative;
  267. .section {
  268. width: 360px;
  269. word-break: break-all;
  270. }
  271. .logo {
  272. width: 114px;
  273. height: 114px;
  274. border-radius: 50%;
  275. // background: #d8d8d8;
  276. border: 1px solid #d8d8d8;
  277. box-sizing: border-box;
  278. position: absolute;
  279. right: 0;
  280. top: 0;
  281. &::after {
  282. content: '';
  283. position: absolute;
  284. right: 6px;
  285. bottom: 0;
  286. display: block;
  287. width: 24px;
  288. height: 24px;
  289. background: url(~assets/theme-images/ross/pc-icon-auth-ren.png)
  290. no-repeat center;
  291. background-size: 23px;
  292. }
  293. img {
  294. display: block;
  295. width: 100%;
  296. height: 100%;
  297. // background: pink;
  298. border-radius: 50%;
  299. }
  300. }
  301. .name {
  302. font-size: 24px;
  303. color: #282828;
  304. line-height: 1.6;
  305. margin-bottom: 24px;
  306. font-weight: bold;
  307. }
  308. .row,
  309. .sncode,
  310. .maker {
  311. margin-bottom: 16px;
  312. }
  313. .row {
  314. line-height: 24px;
  315. i {
  316. position: relative;
  317. margin: 0 16px;
  318. &::after {
  319. content: '';
  320. display: block;
  321. width: 1px;
  322. height: 16px;
  323. background: #999999;
  324. position: absolute;
  325. top: 0;
  326. left: 0;
  327. }
  328. }
  329. span {
  330. font-size: 18px;
  331. color: #999999;
  332. }
  333. }
  334. .sncode.mobile {
  335. display: none;
  336. }
  337. .sncode.pc {
  338. font-size: 18px;
  339. color: #282828;
  340. }
  341. .supplier,
  342. .maker {
  343. font-size: 20px;
  344. color: #282828;
  345. }
  346. .auth {
  347. width: 100%;
  348. min-height: 114px;
  349. background: #f3920d;
  350. margin-top: 56px;
  351. box-sizing: border-box;
  352. padding: 24px;
  353. .auth-icon {
  354. height: 28px;
  355. background: url(~assets/theme-images/ross/pc-icon-auth.png)
  356. no-repeat left center;
  357. background-size: auto 28px;
  358. }
  359. .auth-info {
  360. font-size: 0;
  361. margin-top: 10px;
  362. span {
  363. font-size: 20px;
  364. color: #fff;
  365. }
  366. }
  367. }
  368. }
  369. }
  370. .page-content {
  371. margin-top: 16px;
  372. box-sizing: border-box;
  373. padding: 24px;
  374. .device-params {
  375. .title {
  376. font-size: 28px;
  377. color: #282828;
  378. font-weight: bold;
  379. }
  380. .line {
  381. height: 1px;
  382. background: #ececec;
  383. position: relative;
  384. margin-top: 10px;
  385. margin-bottom: 20px;
  386. &::after {
  387. content: '';
  388. position: absolute;
  389. width: 73px;
  390. height: 2px;
  391. background: #f3920d;
  392. left: 0;
  393. bottom: 0;
  394. }
  395. }
  396. .params {
  397. width: 100%;
  398. .row {
  399. display: table-row;
  400. width: 100%;
  401. }
  402. .col {
  403. display: table-cell;
  404. font-size: 16px;
  405. padding: 12px 0;
  406. &:nth-child(2n-1) {
  407. color: #999999;
  408. white-space: nowrap;
  409. }
  410. &:nth-child(2n) {
  411. color: #282828;
  412. padding-left: 12px;
  413. }
  414. &:nth-child(3) {
  415. padding-left: 100px;
  416. }
  417. }
  418. }
  419. }
  420. }
  421. }
  422. }
  423. // 移动端
  424. @media screen and (max-width: 768px) {
  425. .device-detail {
  426. .detail-title {
  427. display: none;
  428. }
  429. .auth-card-content {
  430. width: 100vw;
  431. height: 100vh;
  432. position: fixed;
  433. left: 0;
  434. top: 0;
  435. display: flex;
  436. justify-content: center;
  437. align-items: center;
  438. z-index: 9;
  439. .auth-card-popup {
  440. position: relative;
  441. width: 86vw;
  442. img {
  443. display: block;
  444. width: 100%;
  445. height: auto;
  446. }
  447. .el-icon-circle-close {
  448. position: absolute;
  449. top: -8vw;
  450. right: 0;
  451. font-size: 7vw;
  452. color: #fff;
  453. cursor: pointer;
  454. }
  455. }
  456. }
  457. .page-top,
  458. .page-content {
  459. margin: 0 auto;
  460. background: #fff;
  461. }
  462. .page-top {
  463. .swiper {
  464. position: relative;
  465. width: 100vw;
  466. height: 100vw;
  467. background: #f7f7f7;
  468. .device-image {
  469. width: 100%;
  470. height: 100%;
  471. }
  472. ::v-deep {
  473. img {
  474. width: 100vw;
  475. height: 100vw;
  476. }
  477. }
  478. .auth-seal {
  479. position: absolute;
  480. width: 13.8vw;
  481. height: 13.8vw;
  482. background: url(~assets/theme-images/ross/h5-icon-auth-seal.png)
  483. no-repeat center;
  484. background-size: 13.8vw;
  485. right: 4vw;
  486. bottom: 4vw;
  487. z-index: 2;
  488. }
  489. .auth-card {
  490. position: absolute;
  491. width: auto;
  492. height: 20.6vw;
  493. display: block;
  494. bottom: 4vw;
  495. left: 4vw;
  496. z-index: 2;
  497. }
  498. .auth-logo {
  499. position: absolute;
  500. max-width: 18vw;
  501. max-height: 18vw;
  502. top: 4vw;
  503. left: 4vw;
  504. z-index: 2;
  505. }
  506. }
  507. .device-info {
  508. position: relative;
  509. .section {
  510. word-break: break-all;
  511. padding: 4vw 4vw 0;
  512. }
  513. .logo {
  514. width: 18vw;
  515. height: 18vw;
  516. border-radius: 50%;
  517. // background: #d8d8d8;
  518. border: 0.1vw solid #d8d8d8;
  519. box-sizing: border-box;
  520. position: absolute;
  521. right: 4vw;
  522. top: 5.8vw;
  523. &::after {
  524. content: '';
  525. position: absolute;
  526. right: 0.7vw;
  527. bottom: 0;
  528. display: block;
  529. width: 3.6vw;
  530. height: 3.6vw;
  531. background: url(~assets/theme-images/ross/h5-icon-auth-ren.png)
  532. no-repeat center;
  533. background-size: 3.6vw;
  534. }
  535. img {
  536. display: block;
  537. width: 100%;
  538. height: 100%;
  539. // background: pink;
  540. border-radius: 50%;
  541. }
  542. }
  543. .name {
  544. font-size: 5.4vw;
  545. color: #282828;
  546. line-height: 7.4vw;
  547. margin-bottom: 2.4vw;
  548. font-weight: bold;
  549. }
  550. .sncode.pc {
  551. display: none;
  552. }
  553. .sncode.mobile {
  554. margin: 2.4vw 0 5.6vw;
  555. color: #282828;
  556. font-size: 4vw;
  557. }
  558. .row {
  559. line-height: 4.7vw;
  560. i {
  561. position: relative;
  562. margin: 0 4vw;
  563. &::after {
  564. content: '';
  565. display: block;
  566. width: 0.2vw;
  567. height: 3vw;
  568. background: #282828;
  569. position: absolute;
  570. top: 1vw;
  571. left: 0;
  572. }
  573. }
  574. span {
  575. font-size: 3.6vw;
  576. color: #282828;
  577. }
  578. }
  579. .row,
  580. .maker {
  581. margin-bottom: 1.2vw;
  582. }
  583. .supplier,
  584. .maker {
  585. font-size: 3.6vw;
  586. color: #282828;
  587. }
  588. .auth {
  589. // width: 100%;
  590. margin: 0 4vw;
  591. min-height: 20vw;
  592. background: #f3920d;
  593. margin-top: 4vw;
  594. box-sizing: border-box;
  595. padding: 5.2vw 4vw;
  596. border-radius: 1.2vw;
  597. .auth-icon {
  598. height: 4.9vw;
  599. background: url(~assets/theme-images/ross/h5-icon-auth.png)
  600. no-repeat left center;
  601. background-size: auto 4.9vw;
  602. }
  603. .auth-info {
  604. font-size: 0;
  605. margin-top: 1vw;
  606. span {
  607. font-size: 3.6vw;
  608. line-height: 6.4vw;
  609. color: #fff;
  610. font-weight: bold;
  611. }
  612. }
  613. }
  614. }
  615. }
  616. .page-content {
  617. .device-params {
  618. padding: 8vw 4vw;
  619. box-sizing: border-box;
  620. .title {
  621. font-size: 4.6vw;
  622. color: #282828;
  623. font-weight: bold;
  624. }
  625. .line {
  626. // height: 0.2vw;
  627. // background: #ececec;
  628. position: relative;
  629. margin-top: 4.7vw;
  630. margin-bottom: 1.2vw;
  631. }
  632. .params {
  633. width: 100%;
  634. word-break: break-all;
  635. text-align: justify;
  636. .row {
  637. display: table-row;
  638. width: 100%;
  639. &:first-child {
  640. .col {
  641. padding-top: 0;
  642. }
  643. }
  644. &:last-child {
  645. .col {
  646. padding-bottom: 0;
  647. }
  648. }
  649. }
  650. .col {
  651. display: table-cell;
  652. font-size: 3.6vw;
  653. padding: 1.6vw 0;
  654. &:nth-child(2n-1) {
  655. color: #282828;
  656. padding-right: 3.2vw;
  657. font-weight: bold;
  658. white-space: nowrap;
  659. border-right: 0.2vw solid #d8d8d8;
  660. }
  661. &:nth-child(2n) {
  662. color: #4e4e4e;
  663. padding-left: 3.2vw;
  664. }
  665. }
  666. }
  667. }
  668. }
  669. }
  670. }
  671. </style>