detail.vue 17 KB

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