detail.vue 16 KB

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