index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  1. <template>
  2. <div class="page">
  3. <van-list
  4. v-model="loadingMore"
  5. :finished="finished"
  6. :immediate-check="false"
  7. :finished-text="total ? '没有更多了' : ''"
  8. @load="fetchClubList"
  9. >
  10. <div class="page-top flex flex-col justify-center items-center" @click="toActivity"></div>
  11. <div class="page-content">
  12. <div
  13. class="navbar flex items-center flex-col"
  14. :style="{ top: offsetTop }"
  15. >
  16. <nuxt-link
  17. :to="routePrefix + '/approve/device'"
  18. class="link flex items-center flex-col"
  19. >
  20. <span class="icon icon-device"></span>
  21. <span class="text">设备认证</span>
  22. </nuxt-link>
  23. <nuxt-link
  24. :to="routePrefix + '/approve/personnel/operate'"
  25. class="link flex items-center flex-col md:mt-6 mt-4"
  26. >
  27. <span class="icon icon-doctor"></span>
  28. <span class="text">体疗师认证</span>
  29. </nuxt-link>
  30. </div>
  31. <div class="filter">
  32. <div class="search">
  33. <el-input
  34. placeholder="搜索机构"
  35. v-model="listQuery.authParty"
  36. @change="filterClubList"
  37. >
  38. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  39. </el-input>
  40. </div>
  41. <div class="area">
  42. <RossSelectGroup @change="onCityChange" ref="citySelect" />
  43. </div>
  44. </div>
  45. <!-- 明星机构 -->
  46. <template v-if="starList.length > 0">
  47. <div class="title flex justify-between px-4 pt-8 pb-6 md:px-0">
  48. <div>明星机构</div>
  49. <nuxt-link :to="routePrefix + '/approve/club/star-list'"
  50. >更多<i class="el-icon-arrow-right"></i
  51. ></nuxt-link>
  52. </div>
  53. <!-- 列表 -->
  54. <div class="list">
  55. <template v-for="item in starList">
  56. <div
  57. class="section flex justify-between mb-4"
  58. :key="item.authId"
  59. @click="toDetail(item)"
  60. >
  61. <img
  62. class="cover"
  63. :src="item.logo || drawLogo(item.authParty)"
  64. />
  65. <div class="info">
  66. <div class="name" v-text="item.authParty"></div>
  67. <div class="mobile">{{ item.mobile || '暂无' }}</div>
  68. <div class="address">
  69. {{ formatAddress(item.area, item.address) }}
  70. </div>
  71. </div>
  72. </div>
  73. </template>
  74. </div>
  75. </template>
  76. <!-- 标题 -->
  77. <div class="title flex justify-between px-4 pt-8 pb-6 md:px-0">
  78. <div>距您最近...</div>
  79. <div>共<span v-text="total" class="font-bold"></span>家授权机构</div>
  80. </div>
  81. <!-- 列表 -->
  82. <div class="list">
  83. <template v-for="item in list">
  84. <div
  85. class="section flex justify-between mb-4"
  86. :key="item.authId"
  87. @click="toDetail(item)"
  88. >
  89. <img class="cover" :src="item.logo || drawLogo(item.authParty)" />
  90. <div class="info">
  91. <div class="name" v-text="item.authParty"></div>
  92. <div class="mobile">{{ item.mobile || '暂无' }}</div>
  93. <div class="address">
  94. {{ formatAddress(item.area, item.address) }}
  95. </div>
  96. <div
  97. class="distance"
  98. v-text="formatDistance(item.distance)"
  99. v-if="item.distance && item.distance !== 99999"
  100. ></div>
  101. </div>
  102. </div>
  103. </template>
  104. </div>
  105. <!-- 列表为空 -->
  106. <SimpleEmpty
  107. v-if="!total && !isRequest"
  108. name="icon-empty-club.png"
  109. description="敬请期待~"
  110. ></SimpleEmpty>
  111. </div>
  112. </van-list>
  113. </div>
  114. </template>
  115. <script>
  116. import { mapGetters } from 'vuex'
  117. import clubListMixin from '@/mixins/clubList'
  118. import { objectCover } from '@/utils'
  119. export default {
  120. layout: 'app-normal',
  121. mixins: [clubListMixin],
  122. data() {
  123. return {
  124. scrollTop: 0,
  125. banner: {},
  126. screenWidth: ""
  127. }
  128. },
  129. computed: {
  130. ...mapGetters(['screenWidth', 'isPc']),
  131. offsetTop() {
  132. if (this.scrollTop <= window.innerHeight / 2) return '240px'
  133. return 240 + this.scrollTop - window.innerHeight / 2 + 'px'
  134. },
  135. },
  136. created() {
  137. document.title = '官方正品授权查询'
  138. },
  139. watch: {
  140. screenWidth: {
  141. handler(val) {
  142. const changeBanner = document.getElementsByClassName('page-top')[0]
  143. if (changeBanner) {
  144. if (val > 768) {
  145. if(this.banner.headPcBanner) {
  146. changeBanner.style.backgroundImage = 'url('+ this.banner.headPcBanner+ ')'
  147. }
  148. }else {
  149. if(this.banner.headAppBanner) {
  150. changeBanner.style.backgroundImage = 'url('+ this.banner.headAppBanner+ ')'
  151. }
  152. }
  153. }
  154. },
  155. immediate: true,
  156. deep: true
  157. }
  158. },
  159. mounted() {
  160. window.addEventListener('scroll', () => {
  161. this.scrollTop = document.documentElement.scrollTop
  162. })
  163. window.addEventListener('scroll', () => {
  164. this.scrollTop = document.documentElement.scrollTop
  165. })
  166. this.getBanner() // 获取轮播图
  167. // 监听页面尺寸变化
  168. this.screenWidth = document.body.clientWidth
  169. window.onresize = () => {
  170. return (() => {
  171. this.screenWidth = document.body.clientWidth
  172. })()
  173. }
  174. },
  175. beforeDestroy() {
  176. window.removeEventListener('scroll', () => {})
  177. },
  178. methods: {
  179. // 抖音挑战赛
  180. toActivity() {
  181. if(this.screenWidth > 768) {
  182. this.banner.jumpLink && window.open(this.banner.jumpLink)
  183. this.banner.jumpPcPicture && window.open(this.banner.jumpPcPicture)
  184. } else {
  185. this.banner.jumpLink && window.open(this.banner.jumpLink)
  186. this.banner.jumpAppPicture && window.open(this.banner.jumpAppPicture)
  187. }
  188. },
  189. // 从缓存中获取数据
  190. initFromCache(cacheData) {
  191. const data = objectCover(this, cacheData)
  192. console.log(data)
  193. this.$nextTick(() => {
  194. this.$refs.citySelect.initSelectValue({
  195. provinceId: data.provinceId,
  196. cityId: data.cityId,
  197. townId: data.townId,
  198. })
  199. })
  200. },
  201. // 城市变化
  202. onCityChange(valueMap) {
  203. const { provinceId, cityId, townId } = valueMap
  204. this.listQuery.provinceId = provinceId
  205. this.listQuery.cityId = cityId
  206. this.listQuery.townId = townId
  207. this.filterClubList()
  208. },
  209. // banner
  210. async getBanner() {
  211. const { data } = await this.$http.api.bannerImg(this.authUserId)
  212. this.banner = data
  213. const changeBanner = document.getElementsByClassName('page-top')[0]
  214. if (this.screenWidth > 768) {
  215. this.banner.headPcBanner && (changeBanner.style.backgroundImage = 'url('+ this.banner.headPcBanner+ ')')
  216. }else {
  217. this.banner.headAppBanner && (changeBanner.style.backgroundImage = 'url('+ this.banner.headAppBanner+ ')')
  218. }
  219. },
  220. },
  221. }
  222. </script>
  223. <style scoped lang="scss">
  224. .el-input {
  225. ::v-deep {
  226. & > {
  227. .el-input.is-active .el-input__inner,
  228. .el-input__inner:focus {
  229. border-color: #bc1724;
  230. }
  231. }
  232. }
  233. }
  234. // pc 端
  235. @media screen and (min-width: 768px) {
  236. .page {
  237. position: relative;
  238. min-height: calc(100vh - 80px - 80px);
  239. background-color: #fff;
  240. }
  241. .page-top {
  242. height: 530px;
  243. background-image: url(~assets/theme-images/normal/pc/banner-club.png);
  244. background-size: cover;
  245. background-position: center;
  246. }
  247. .page-content {
  248. position: relative;
  249. width: 1000px;
  250. margin: 0 auto;
  251. .title {
  252. font-size: 16px;
  253. color: #404040;
  254. span {
  255. color: #bc1724;
  256. }
  257. }
  258. .filter {
  259. padding: 48px 0 105px;
  260. .search {
  261. width: 640px;
  262. margin: 0 auto;
  263. .el-input {
  264. height: 46px;
  265. font-size: 16px;
  266. .el-input__icon {
  267. font-size: 24px;
  268. line-height: 46px;
  269. margin-left: 12px;
  270. }
  271. ::v-deep {
  272. & > .el-input__inner {
  273. height: 46px;
  274. padding-left: 55px;
  275. }
  276. }
  277. }
  278. }
  279. }
  280. .navbar {
  281. position: absolute;
  282. top: 240px;
  283. right: -168px;
  284. width: 120px;
  285. border-radius: 16px;
  286. background: #fff;
  287. box-shadow: 0px 6px 20px rgba(40, 40, 40, 0.1);
  288. padding: 24px 0;
  289. box-sizing: border-box;
  290. z-index: 2;
  291. .link {
  292. &:hover {
  293. .icon {
  294. &.icon-device {
  295. background: url(~assets/theme-images/normal/pc/nav-entry-device-active.png)
  296. no-repeat center center,
  297. linear-gradient(180deg, #e41d2d 0%, #bc1724 100%);
  298. background-size: 48px, 100%;
  299. }
  300. &.icon-doctor {
  301. background: url(~assets/theme-images/normal/pc/nav-entry-doctor-active.png)
  302. no-repeat center center,
  303. linear-gradient(180deg, #e41d2d 0%, #bc1724 100%);
  304. background-size: 48px, 100%;
  305. }
  306. }
  307. .text {
  308. color: #bc1724;
  309. }
  310. }
  311. span {
  312. display: block;
  313. }
  314. .icon {
  315. width: 72px;
  316. height: 72px;
  317. background: linear-gradient(180deg, #f6f6f7 0%, #f6f6f7 100%);
  318. border-radius: 12px;
  319. transition: all 0.2s;
  320. &.icon-device {
  321. background: url(~assets/theme-images/normal/pc/nav-entry-device.png)
  322. no-repeat center center #f6f6f7;
  323. background-size: 48px;
  324. }
  325. &.icon-doctor {
  326. background: url(~assets/theme-images/normal/pc/nav-entry-doctor.png)
  327. no-repeat center center #f6f6f7;
  328. background-size: 48px;
  329. }
  330. }
  331. .text {
  332. font-size: 16px;
  333. color: #404040;
  334. margin-top: 8px;
  335. }
  336. }
  337. }
  338. .list {
  339. display: flex;
  340. align-items: center;
  341. justify-content: space-between;
  342. flex-wrap: wrap;
  343. .empty {
  344. width: 390px;
  345. }
  346. .section {
  347. width: 490px;
  348. height: 136px;
  349. background-color: #f3f5f6;
  350. border-radius: 4px;
  351. box-sizing: border-box;
  352. padding: 16px;
  353. cursor: pointer;
  354. transition: all 0.4s;
  355. &:hover {
  356. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  357. }
  358. .cover {
  359. display: block;
  360. width: 104px;
  361. height: 104px;
  362. }
  363. .info {
  364. position: relative;
  365. margin-left: 12px;
  366. width: 330px;
  367. .name {
  368. width: 200px;
  369. font-size: 18px;
  370. color: #101010;
  371. font-weight: bold;
  372. margin-bottom: 24px;
  373. text-overflow: ellipsis;
  374. white-space: nowrap;
  375. overflow: hidden;
  376. }
  377. .mobile,
  378. .address {
  379. width: 268px;
  380. position: relative;
  381. font-size: 14px;
  382. color: #404040;
  383. padding-left: 24px;
  384. line-height: 24px;
  385. text-overflow: ellipsis;
  386. white-space: nowrap;
  387. margin-top: 6px;
  388. overflow: hidden;
  389. &::after {
  390. content: '';
  391. display: block;
  392. width: 16px;
  393. height: 16px;
  394. position: absolute;
  395. left: 0;
  396. top: 50%;
  397. transform: translateY(-50%);
  398. background-size: 16px;
  399. background-repeat: no-repeat;
  400. }
  401. }
  402. .mobile {
  403. &::after {
  404. background-image: url(~assets/theme-images/common/pc-icon-mobile.png);
  405. }
  406. }
  407. .address {
  408. &::after {
  409. background-image: url(~assets/theme-images/common/pc-icon-address.png);
  410. }
  411. }
  412. .distance {
  413. position: absolute;
  414. font-size: 14px;
  415. color: #404040;
  416. top: 2px;
  417. right: 0;
  418. }
  419. }
  420. }
  421. }
  422. }
  423. }
  424. // 移动 端
  425. @media screen and (max-width: 768px) {
  426. .page-top {
  427. height: 100vw;
  428. background-image: url(~assets/theme-images/normal/h5/banner-club.png);
  429. background-size: 100vw 100vw !important;
  430. background-position: center;
  431. .logo {
  432. display: block;
  433. width: 14.8vw;
  434. height: 14.8vw;
  435. border-radius: 50%;
  436. background: #fff;
  437. }
  438. .name {
  439. font-size: 4vw;
  440. color: #fff;
  441. }
  442. }
  443. .page-content {
  444. position: relative;
  445. .title {
  446. font-size: 3.4vw;
  447. color: #404040;
  448. span {
  449. color: #bc1724;
  450. }
  451. }
  452. .filter {
  453. padding: 6.4vw 3.2vw 12.8vw;
  454. }
  455. .navbar {
  456. position: fixed;
  457. top: 50% !important;
  458. right: 3.2vw;
  459. left: unset !important;
  460. width: 14vw;
  461. border-radius: 1.6vw;
  462. background: #fff;
  463. box-shadow: 0px 0.6vw 2vw rgba(40, 40, 40, 0.1);
  464. padding: 2.8vw 0;
  465. box-sizing: border-box;
  466. z-index: 2;
  467. span {
  468. display: block;
  469. }
  470. .icon {
  471. position: relative;
  472. width: 7.2vw;
  473. height: 7.2vw;
  474. border-radius: 1.2vw;
  475. background: linear-gradient(180deg, #e41d2d 0%, #bc1724 100%);
  476. &.icon-device,
  477. &.icon-doctor {
  478. &::after {
  479. content: '';
  480. display: block;
  481. width: 4.8vw;
  482. height: 4.8vw;
  483. position: absolute;
  484. left: 50%;
  485. top: 50%;
  486. transform: translate(-50%, -50%);
  487. background-size: 4.8vw !important;
  488. }
  489. }
  490. &.icon-device {
  491. &::after {
  492. background: url(~assets/theme-images/normal/pc/nav-entry-device-active.png)
  493. no-repeat center;
  494. }
  495. }
  496. &.icon-doctor {
  497. &::after {
  498. background: url(~assets/theme-images/normal/pc/nav-entry-doctor-active.png)
  499. no-repeat center;
  500. }
  501. }
  502. }
  503. .text {
  504. font-size: 2.4vw;
  505. color: #bc1724;
  506. margin-top: 1.2vw;
  507. }
  508. }
  509. }
  510. .list {
  511. display: flex;
  512. align-items: center;
  513. flex-direction: column;
  514. .section {
  515. width: 93.6vw;
  516. height: 26vw;
  517. background-color: #f3f5f6;
  518. border-radius: 4px;
  519. box-sizing: border-box;
  520. padding: 3.2vw;
  521. .cover {
  522. display: block;
  523. width: 19.6vw;
  524. height: 19.6vw;
  525. }
  526. .info {
  527. position: relative;
  528. margin-left: 3.2vw;
  529. .name {
  530. width: 48vw;
  531. font-size: 4vw;
  532. color: #101010;
  533. font-weight: bold;
  534. margin-bottom: 4vw;
  535. text-overflow: ellipsis;
  536. white-space: nowrap;
  537. overflow: hidden;
  538. }
  539. .mobile,
  540. .address {
  541. width: 66vw;
  542. position: relative;
  543. font-size: 3vw;
  544. color: #404040;
  545. padding-left: 5vw;
  546. line-height: 5vw;
  547. text-overflow: ellipsis;
  548. white-space: nowrap;
  549. overflow: hidden;
  550. &::after {
  551. content: '';
  552. display: block;
  553. width: 4vw;
  554. height: 4vw;
  555. position: absolute;
  556. left: 0;
  557. top: 50%;
  558. transform: translateY(-50%);
  559. background-size: 4vw 4vw;
  560. background-repeat: no-repeat;
  561. }
  562. }
  563. .mobile {
  564. &::after {
  565. background-image: url(~assets/theme-images/common/h5-icon-mobile.png);
  566. }
  567. }
  568. .address {
  569. &::after {
  570. background-image: url(~assets/theme-images/common/h5-icon-address.png);
  571. }
  572. }
  573. .distance {
  574. position: absolute;
  575. font-size: 3vw;
  576. color: #404040;
  577. top: 0.8vw;
  578. right: 0;
  579. }
  580. }
  581. }
  582. }
  583. }
  584. </style>