detail.vue 16 KB

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