index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  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-hyt',
  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. watch: {
  137. screenWidth: {
  138. handler(val) {
  139. const changeBanner = document.getElementsByClassName('page-top')[0]
  140. if (changeBanner) {
  141. if (val > 768) {
  142. if(this.banner.headPcBanner) {
  143. changeBanner.style.backgroundImage = 'url('+ this.banner.headPcBanner+ ')'
  144. }
  145. }else {
  146. if(this.banner.headAppBanner) {
  147. changeBanner.style.backgroundImage = 'url('+ this.banner.headAppBanner+ ')'
  148. }
  149. }
  150. }
  151. },
  152. immediate: true,
  153. deep: true
  154. }
  155. },
  156. mounted() {
  157. window.addEventListener('scroll', () => {
  158. this.scrollTop = document.documentElement.scrollTop
  159. })
  160. window.addEventListener('scroll', () => {
  161. this.scrollTop = document.documentElement.scrollTop
  162. })
  163. this.getBanner() // 获取轮播图
  164. // 监听页面尺寸变化
  165. this.screenWidth = document.body.clientWidth
  166. window.onresize = () => {
  167. return (() => {
  168. this.screenWidth = document.body.clientWidth
  169. })()
  170. }
  171. },
  172. created() {
  173. document.title = '官方正品授权查询'
  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: #4093b5;
  230. }
  231. }
  232. }
  233. }
  234. // pc 端
  235. @media screen and (min-width: 768px) {
  236. .page {
  237. position: relative;
  238. // min-height: calc(100vh - 80px);
  239. min-height: 120vh;
  240. background-color: #fff;
  241. }
  242. .page-top {
  243. height: 530px;
  244. background-image: url(~assets/theme-images/hyt/pc/banner-club.jpg);
  245. background-size: cover;
  246. background-position: center;
  247. }
  248. .page-content {
  249. position: relative;
  250. width: 1000px;
  251. margin: 0 auto;
  252. .title {
  253. font-size: 16px;
  254. color: #404040;
  255. span {
  256. color: #4093b5;
  257. }
  258. }
  259. .filter {
  260. padding: 48px 0 105px;
  261. .search {
  262. width: 640px;
  263. margin: 0 auto;
  264. .el-input {
  265. height: 46px;
  266. font-size: 16px;
  267. .el-input__icon {
  268. font-size: 24px;
  269. line-height: 46px;
  270. margin-left: 12px;
  271. }
  272. ::v-deep {
  273. & > .el-input__inner {
  274. height: 46px;
  275. padding-left: 55px;
  276. }
  277. }
  278. }
  279. }
  280. }
  281. .navbar {
  282. position: absolute;
  283. top: 240px;
  284. right: -168px;
  285. width: 120px;
  286. border-radius: 16px;
  287. background: #fff;
  288. box-shadow: 0px 6px 20px rgba(40, 40, 40, 0.1);
  289. padding: 24px 0;
  290. box-sizing: border-box;
  291. z-index: 2;
  292. .link {
  293. &:hover {
  294. .icon {
  295. &.icon-device {
  296. background: url(~assets/theme-images/hyt/pc/nav-entry-device-active.png)
  297. no-repeat center center,
  298. linear-gradient(180deg, #4bb9e6 0%, #4093b5 100%);
  299. background-size: 48px, 100%;
  300. }
  301. &.icon-doctor {
  302. background: url(~assets/theme-images/hyt/pc/nav-entry-doctor-active.png)
  303. no-repeat center center,
  304. linear-gradient(180deg, #4bb9e6 0%, #4093b5 100%);
  305. background-size: 48px, 100%;
  306. }
  307. }
  308. .text {
  309. color: #4093b5;
  310. }
  311. }
  312. span {
  313. display: block;
  314. }
  315. .icon {
  316. width: 72px;
  317. height: 72px;
  318. background: linear-gradient(180deg, #f6f6f7 0%, #f6f6f7 100%);
  319. border-radius: 12px;
  320. transition: all 0.2s;
  321. &.icon-device {
  322. background: url(~assets/theme-images/hyt/pc/nav-entry-device.png)
  323. no-repeat center center #f6f6f7;
  324. background-size: 48px;
  325. }
  326. &.icon-doctor {
  327. background: url(~assets/theme-images/hyt/pc/nav-entry-doctor.png)
  328. no-repeat center center #f6f6f7;
  329. background-size: 48px;
  330. }
  331. }
  332. .text {
  333. font-size: 16px;
  334. color: #404040;
  335. margin-top: 8px;
  336. }
  337. }
  338. }
  339. .list {
  340. display: flex;
  341. align-items: center;
  342. justify-content: space-between;
  343. flex-wrap: wrap;
  344. .empty {
  345. width: 390px;
  346. }
  347. .section {
  348. width: 490px;
  349. height: 136px;
  350. background-color: #f3f5f6;
  351. border-radius: 4px;
  352. box-sizing: border-box;
  353. padding: 16px;
  354. cursor: pointer;
  355. transition: all 0.4s;
  356. &:hover {
  357. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  358. }
  359. .cover {
  360. display: block;
  361. width: 104px;
  362. height: 104px;
  363. }
  364. .info {
  365. position: relative;
  366. margin-left: 12px;
  367. width: 330px;
  368. .name {
  369. width: 200px;
  370. font-size: 18px;
  371. color: #101010;
  372. font-weight: bold;
  373. margin-bottom: 24px;
  374. text-overflow: ellipsis;
  375. white-space: nowrap;
  376. overflow: hidden;
  377. }
  378. .mobile,
  379. .address {
  380. width: 268px;
  381. position: relative;
  382. font-size: 14px;
  383. color: #404040;
  384. padding-left: 24px;
  385. line-height: 24px;
  386. text-overflow: ellipsis;
  387. white-space: nowrap;
  388. margin-top: 6px;
  389. overflow: hidden;
  390. &::after {
  391. content: '';
  392. display: block;
  393. width: 16px;
  394. height: 16px;
  395. position: absolute;
  396. left: 0;
  397. top: 50%;
  398. transform: translateY(-50%);
  399. background-size: 16px;
  400. background-repeat: no-repeat;
  401. }
  402. }
  403. .mobile {
  404. &::after {
  405. background-image: url(~assets/theme-images/common/pc-icon-mobile.png);
  406. }
  407. }
  408. .address {
  409. &::after {
  410. background-image: url(~assets/theme-images/common/pc-icon-address.png);
  411. }
  412. }
  413. .distance {
  414. position: absolute;
  415. font-size: 14px;
  416. color: #404040;
  417. top: 2px;
  418. right: 0;
  419. }
  420. }
  421. }
  422. }
  423. }
  424. }
  425. // 移动 端
  426. @media screen and (max-width: 768px) {
  427. .page-top {
  428. height: 100vw;
  429. background-image: url(~assets/theme-images/hyt/h5/banner-club.png);
  430. background-size: 100vw 100vw !important;
  431. background-position: center;
  432. .logo {
  433. display: block;
  434. width: 14.8vw;
  435. height: 14.8vw;
  436. border-radius: 50%;
  437. background: #fff;
  438. }
  439. .name {
  440. font-size: 4vw;
  441. color: #fff;
  442. }
  443. }
  444. .page-content {
  445. position: relative;
  446. .title {
  447. font-size: 3.4vw;
  448. color: #404040;
  449. span {
  450. color: #4093b5;
  451. }
  452. }
  453. .filter {
  454. padding: 6.4vw 3.2vw 12.8vw;
  455. }
  456. .navbar {
  457. position: fixed;
  458. top: 50% !important;
  459. right: 3.2vw;
  460. left: unset !important;
  461. width: 14vw;
  462. border-radius: 1.6vw;
  463. background: #fff;
  464. box-shadow: 0px 0.6vw 2vw rgba(40, 40, 40, 0.1);
  465. padding: 2.8vw 0;
  466. box-sizing: border-box;
  467. z-index: 2;
  468. span {
  469. display: block;
  470. }
  471. .icon {
  472. position: relative;
  473. width: 7.2vw;
  474. height: 7.2vw;
  475. border-radius: 1.2vw;
  476. background: linear-gradient(180deg, #4bb9e6 0%, #4093b5 100%);
  477. &.icon-device,
  478. &.icon-doctor {
  479. &::after {
  480. content: '';
  481. display: block;
  482. width: 4.8vw;
  483. height: 4.8vw;
  484. position: absolute;
  485. left: 50%;
  486. top: 50%;
  487. transform: translate(-50%, -50%);
  488. background-size: 4.8vw !important;
  489. }
  490. }
  491. &.icon-device {
  492. &::after {
  493. background: url(~assets/theme-images/hyt/pc/nav-entry-device-active.png)
  494. no-repeat center;
  495. }
  496. }
  497. &.icon-doctor {
  498. &::after {
  499. background: url(~assets/theme-images/hyt/pc/nav-entry-doctor-active.png)
  500. no-repeat center;
  501. }
  502. }
  503. }
  504. .text {
  505. font-size: 2.4vw;
  506. color: #4093b5;
  507. margin-top: 1.2vw;
  508. }
  509. }
  510. }
  511. .list {
  512. display: flex;
  513. align-items: center;
  514. flex-direction: column;
  515. .section {
  516. width: 93.6vw;
  517. height: 26vw;
  518. background-color: #f3f5f6;
  519. border-radius: 4px;
  520. box-sizing: border-box;
  521. padding: 3.2vw;
  522. .cover {
  523. display: block;
  524. width: 19.6vw;
  525. height: 19.6vw;
  526. }
  527. .info {
  528. position: relative;
  529. margin-left: 3.2vw;
  530. .name {
  531. width: 48vw;
  532. font-size: 4vw;
  533. color: #101010;
  534. font-weight: bold;
  535. margin-bottom: 4vw;
  536. text-overflow: ellipsis;
  537. white-space: nowrap;
  538. overflow: hidden;
  539. }
  540. .mobile,
  541. .address {
  542. width: 66vw;
  543. position: relative;
  544. font-size: 3vw;
  545. color: #404040;
  546. padding-left: 5vw;
  547. line-height: 5vw;
  548. text-overflow: ellipsis;
  549. white-space: nowrap;
  550. overflow: hidden;
  551. &::after {
  552. content: '';
  553. display: block;
  554. width: 4vw;
  555. height: 4vw;
  556. position: absolute;
  557. left: 0;
  558. top: 50%;
  559. transform: translateY(-50%);
  560. background-size: 4vw 4vw;
  561. background-repeat: no-repeat;
  562. }
  563. }
  564. .mobile {
  565. &::after {
  566. background-image: url(~assets/theme-images/common/h5-icon-mobile.png);
  567. }
  568. }
  569. .address {
  570. &::after {
  571. background-image: url(~assets/theme-images/common/h5-icon-address.png);
  572. }
  573. }
  574. .distance {
  575. position: absolute;
  576. font-size: 3vw;
  577. color: #404040;
  578. top: 0.8vw;
  579. right: 0;
  580. }
  581. }
  582. }
  583. }
  584. }
  585. </style>