detail.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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="club-info">
  11. <div class="section flex justify-between items-center">
  12. <div class="info">
  13. <div class="name" v-text="clubInfo.authParty"></div>
  14. <div class="mobile">{{ clubInfo.mobile | formatEmpty }}</div>
  15. <div class="address" v-text="address"></div>
  16. </div>
  17. <div class="logo"><img :src="clubInfo.logo" /></div>
  18. </div>
  19. <div class="section flex justify-between items-center mt-6">
  20. <div class="navigation">导航</div>
  21. <div class="distance" v-text="'距你' + clubInfo.distance + 'km'">
  22. 9999km
  23. </div>
  24. </div>
  25. </div>
  26. <div class="divider"></div>
  27. <div class="device-list">
  28. <div class="title">已认证设备</div>
  29. <div class="list">
  30. <div
  31. class="device flex justify-between items-center"
  32. v-for="item in clubInfo.productList"
  33. :key="item.productId"
  34. >
  35. <div class="info">
  36. <div class="name" v-text="item.productName"></div>
  37. <div class="code">SN码:{{ item.snCode | formatSnCode }}</div>
  38. </div>
  39. <div class="detail" @click="toDetail(item)">查看认证</div>
  40. </div>
  41. </div>
  42. </div>
  43. <SimpleEmpty
  44. v-if="isEmpty"
  45. name="icon-empty-device.png"
  46. description="暂无已认证设备"
  47. ></SimpleEmpty>
  48. </div>
  49. </div>
  50. </template>
  51. <script>
  52. import { drawLogo } from '@/utils'
  53. import { mapNavigate } from '@/utils/map-utils'
  54. export default {
  55. layout: 'app',
  56. filters: {
  57. formatEmpty(val) {
  58. return val || '未知'
  59. },
  60. formatSnCode(code) {
  61. if (!code) return ''
  62. return code.replace(/^(\w{2})\w+(\w{4})$/, '$1******$2')
  63. },
  64. },
  65. data() {
  66. return {
  67. clubInfo: {},
  68. }
  69. },
  70. computed: {
  71. address() {
  72. return this.clubInfo.area + this.clubInfo.address || '未知'
  73. },
  74. isEmpty() {
  75. return this.clubInfo.productList
  76. ? this.clubInfo.productList.length === 0
  77. : true
  78. },
  79. },
  80. mounted() {
  81. this.initData()
  82. },
  83. methods: {
  84. // 设备详情
  85. toDetail(item) {
  86. window.location.href = `${process.env.CIMEI_LOCAL}/product/auth/product-${item.productId}.html`
  87. },
  88. // 初始化
  89. initData() {
  90. const clubInfo = localStorage.getItem('clubInfo')
  91. if (clubInfo) {
  92. this.clubInfo = JSON.parse(clubInfo)
  93. this.fetchDetail()
  94. }
  95. },
  96. // 获取机构详细信息
  97. async fetchDetail() {
  98. try {
  99. const authId = this.clubInfo.authId
  100. const res = await this.$http.api.getAuthClubDetail({ authId })
  101. this.clubInfo = { ...this.clubInfo, ...res.data } // 合并
  102. } catch (error) {
  103. console.log(error)
  104. }
  105. if (this.clubInfo.bannerList.length <= 0) {
  106. this.clubInfo.bannerList.push('/placeholder.png')
  107. }
  108. if (!this.clubInfo.logo) {
  109. this.clubInfo.logo = drawLogo(this.clubInfo.authParty)
  110. }
  111. },
  112. // 导航
  113. navigation() {},
  114. },
  115. }
  116. </script>
  117. <style scoped lang="scss">
  118. // pc 端
  119. @media screen and (min-width: 768px) {
  120. .page {
  121. position: relative;
  122. width: 1200px;
  123. height: 612px;
  124. margin-left: auto;
  125. margin-right: auto;
  126. margin-top: 80px;
  127. background-color: #fff;
  128. box-sizing: border-box;
  129. padding: 16px;
  130. padding-right: 0;
  131. }
  132. .page-title {
  133. position: absolute;
  134. font-size: 24px;
  135. color: #333;
  136. top: -50px;
  137. left: 0;
  138. }
  139. .page-top {
  140. .swiper {
  141. width: 580px;
  142. height: 580px;
  143. }
  144. }
  145. .page-content {
  146. width: 580px;
  147. overflow-y: auto;
  148. .club-info {
  149. padding: 32px 24px;
  150. background: linear-gradient(
  151. 180deg,
  152. #ffe6e8 0%,
  153. rgba(255, 255, 255, 0) 100%
  154. );
  155. .info {
  156. width: 320px;
  157. .name {
  158. font-size: 24px;
  159. color: #101010;
  160. font-weight: bold;
  161. margin-bottom: 34px;
  162. }
  163. .mobile,
  164. .address {
  165. position: relative;
  166. padding-left: 24px;
  167. margin-top: 16px;
  168. line-height: 24px;
  169. font-size: 16px;
  170. color: #404040;
  171. &::after {
  172. content: '';
  173. display: block;
  174. width: 16px;
  175. height: 16px;
  176. position: absolute;
  177. left: 0;
  178. top: 4px;
  179. background-size: 16px;
  180. background-repeat: no-repeat;
  181. }
  182. }
  183. .mobile {
  184. &::after {
  185. background-image: url(https://static.caimei365.com/www/authentic/pc/icon-phone-active.png);
  186. }
  187. }
  188. .address {
  189. &::after {
  190. background-image: url(https://static.caimei365.com/www/authentic/pc/icon-address-active.png);
  191. }
  192. }
  193. }
  194. .logo {
  195. position: relative;
  196. width: 114px;
  197. height: 114px;
  198. border-radius: 50% 50% 0 50%;
  199. overflow: hidden;
  200. &::after {
  201. position: absolute;
  202. bottom: 0;
  203. right: 0;
  204. content: '';
  205. display: block;
  206. width: 23px;
  207. height: 23px;
  208. background: url(https://static.caimei365.com/www/authentic/pc/icon-avatar-v.png)
  209. no-repeat center;
  210. background-size: 23px;
  211. }
  212. }
  213. .navigation {
  214. display: flex;
  215. justify-content: center;
  216. align-items: center;
  217. width: 72px;
  218. height: 32px;
  219. border: 1px solid #bc1724;
  220. border-radius: 4px;
  221. background-color: #ffe6e8;
  222. font-size: 16px;
  223. color: #bc1724;
  224. cursor: pointer;
  225. &::after {
  226. content: '';
  227. display: block;
  228. width: 16px;
  229. height: 16px;
  230. background: url(https://static.caimei365.com/www/authentic/pc/icon-arround-right.png)
  231. no-repeat center;
  232. background-size: 16px;
  233. }
  234. }
  235. .distance {
  236. font-size: 14px;
  237. color: #404040;
  238. }
  239. }
  240. .device-list {
  241. .title {
  242. padding: 16px;
  243. font-size: 20px;
  244. font-weight: bold;
  245. color: #404040;
  246. background-color: #f3f5f6;
  247. }
  248. .list {
  249. padding-right: 16px;
  250. }
  251. .device {
  252. padding: 16px 0;
  253. border-bottom: 1px solid #d8d8d8;
  254. .info {
  255. .name {
  256. font-size: 18px;
  257. color: #101010;
  258. }
  259. .code {
  260. margin-top: 16px;
  261. font-size: 14px;
  262. color: #666;
  263. }
  264. }
  265. .detail {
  266. display: flex;
  267. justify-content: center;
  268. align-items: center;
  269. width: 80px;
  270. height: 32px;
  271. background: #bc1724;
  272. border-radius: 4px;
  273. font-size: 14px;
  274. color: #ffffff;
  275. }
  276. }
  277. }
  278. }
  279. }
  280. // 移动 端
  281. @media screen and (max-width: 768px) {
  282. .page-title {
  283. display: none;
  284. }
  285. .page-top {
  286. .swiper {
  287. height: 100vw;
  288. }
  289. }
  290. .page-content {
  291. .divider {
  292. height: 3.2vw;
  293. background-color: #f7f7f7;
  294. }
  295. .club-info {
  296. padding: 4vw;
  297. background: linear-gradient(
  298. 180deg,
  299. #ffe6e8 0%,
  300. rgba(255, 255, 255, 0) 100%
  301. );
  302. .info {
  303. width: 67vw;
  304. .name {
  305. font-size: 4.8vw;
  306. color: #101010;
  307. font-weight: bold;
  308. margin-bottom: 4vw;
  309. }
  310. .mobile,
  311. .address {
  312. position: relative;
  313. padding-left: 5vw;
  314. margin-top: 1.6vw;
  315. line-height: 5vw;
  316. font-size: 3.2vw;
  317. color: #404040;
  318. &::after {
  319. content: '';
  320. display: block;
  321. width: 4vw;
  322. height: 4vw;
  323. position: absolute;
  324. left: 0;
  325. top: 0.5vw;
  326. background-size: 4vw 4vw;
  327. background-repeat: no-repeat;
  328. }
  329. }
  330. .mobile {
  331. &::after {
  332. background-image: url(https://static.caimei365.com/www/authentic/h5/icon-phone-active.png);
  333. }
  334. }
  335. .address {
  336. &::after {
  337. background-image: url(https://static.caimei365.com/www/authentic/h5/icon-address-active.png);
  338. }
  339. }
  340. }
  341. .logo {
  342. position: relative;
  343. width: 18vw;
  344. height: 18vw;
  345. border-radius: 9vw 9vw 0 9vw;
  346. overflow: hidden;
  347. &::after {
  348. position: absolute;
  349. bottom: 0;
  350. right: 0;
  351. content: '';
  352. display: block;
  353. width: 3.6vw;
  354. height: 3.6vw;
  355. background: url(https://static.caimei365.com/www/authentic/h5/icon-avatar-v.png)
  356. no-repeat center;
  357. background-size: 3.6vw;
  358. }
  359. }
  360. .navigation {
  361. display: flex;
  362. justify-content: center;
  363. align-items: center;
  364. width: 14.4vw;
  365. height: 6.4vw;
  366. border: 0.1vw solid #bc1724;
  367. border-radius: 0.4vw;
  368. background-color: #ffe6e8;
  369. font-size: 3.2vw;
  370. color: #bc1724;
  371. &::after {
  372. content: '';
  373. display: block;
  374. width: 3.6vw;
  375. height: 3.6vw;
  376. background: url(https://static.caimei365.com/www/authentic/h5/icon-arround-right.png)
  377. no-repeat center;
  378. background-size: 3.6vw;
  379. }
  380. }
  381. .distance {
  382. font-size: 3vw;
  383. color: #404040;
  384. }
  385. }
  386. .device-list {
  387. .title {
  388. padding: 4vw;
  389. padding-bottom: 0;
  390. font-size: 4vw;
  391. font-weight: bold;
  392. color: #101010;
  393. }
  394. .device {
  395. padding: 4vw 0;
  396. margin: 0 4vw;
  397. border-bottom: 0.4vw solid #d8d8d8;
  398. .info {
  399. .name {
  400. font-size: 3.6vw;
  401. color: #101010;
  402. }
  403. .code {
  404. margin-top: 3.2vw;
  405. font-size: 3vw;
  406. color: #666;
  407. }
  408. }
  409. .detail {
  410. display: flex;
  411. justify-content: center;
  412. align-items: center;
  413. width: 15.8vw;
  414. height: 6.4vw;
  415. background: #bc1724;
  416. border-radius: 0.4vw;
  417. font-size: 3vw;
  418. color: #ffffff;
  419. }
  420. }
  421. }
  422. }
  423. }
  424. </style>