index.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564
  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"></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. }
  126. },
  127. computed: {
  128. ...mapGetters(['screenWidth', 'isPc']),
  129. offsetTop() {
  130. if (this.scrollTop <= window.innerHeight / 2) return '240px'
  131. return 240 + this.scrollTop - window.innerHeight / 2 + 'px'
  132. },
  133. },
  134. mounted() {
  135. window.addEventListener('scroll', () => {
  136. this.scrollTop = document.documentElement.scrollTop
  137. })
  138. },
  139. beforeDestroy() {
  140. window.removeEventListener('scroll', () => {})
  141. },
  142. methods: {
  143. // 从缓存中获取数据
  144. initFromCache(cacheData) {
  145. const data = objectCover(this, cacheData)
  146. console.log(data)
  147. this.$nextTick(() => {
  148. this.$refs.citySelect.initSelectValue({
  149. provinceId: data.provinceId,
  150. cityId: data.cityId,
  151. townId: data.townId,
  152. })
  153. })
  154. },
  155. // 城市变化
  156. onCityChange(valueMap) {
  157. const { provinceId, cityId, townId } = valueMap
  158. this.listQuery.provinceId = provinceId
  159. this.listQuery.cityId = cityId
  160. this.listQuery.townId = townId
  161. this.filterClubList()
  162. },
  163. },
  164. }
  165. </script>
  166. <style scoped lang="scss">
  167. .el-input {
  168. ::v-deep {
  169. & > {
  170. .el-input.is-active .el-input__inner,
  171. .el-input__inner:focus {
  172. border-color: #4093B5;
  173. }
  174. }
  175. }
  176. }
  177. // pc 端
  178. @media screen and (min-width: 768px) {
  179. .page {
  180. position: relative;
  181. min-height: calc(100vh - 80px - 80px);
  182. background-color: #fff;
  183. }
  184. .page-top {
  185. height: 530px;
  186. background-image: url(~assets/theme-images/hyt/pc/banner-club.jpg);
  187. background-size: cover;
  188. background-position: center;
  189. }
  190. .page-content {
  191. position: relative;
  192. width: 1000px;
  193. margin: 0 auto;
  194. .title {
  195. font-size: 16px;
  196. color: #404040;
  197. span {
  198. color: #4093B5;
  199. }
  200. }
  201. .filter {
  202. padding: 48px 0 105px;
  203. .search {
  204. width: 640px;
  205. margin: 0 auto;
  206. .el-input {
  207. height: 46px;
  208. font-size: 16px;
  209. .el-input__icon {
  210. font-size: 24px;
  211. line-height: 46px;
  212. margin-left: 12px;
  213. }
  214. ::v-deep {
  215. & > .el-input__inner {
  216. height: 46px;
  217. padding-left: 55px;
  218. }
  219. }
  220. }
  221. }
  222. }
  223. .navbar {
  224. position: absolute;
  225. top: 240px;
  226. right: -168px;
  227. width: 120px;
  228. border-radius: 16px;
  229. background: #fff;
  230. box-shadow: 0px 6px 20px rgba(40, 40, 40, 0.1);
  231. padding: 24px 0;
  232. box-sizing: border-box;
  233. z-index: 2;
  234. .link {
  235. &:hover {
  236. .icon {
  237. &.icon-device {
  238. background: url(~assets/theme-images/hyt/pc/nav-entry-device-active.png)
  239. no-repeat center center,
  240. linear-gradient(180deg, #4BB9E6 0%, #4093B5 100%);
  241. background-size: 48px, 100%;
  242. }
  243. &.icon-doctor {
  244. background: url(~assets/theme-images/hyt/pc/nav-entry-doctor-active.png)
  245. no-repeat center center,
  246. linear-gradient(180deg, #4BB9E6 0%, #4093B5 100%);
  247. background-size: 48px, 100%;
  248. }
  249. }
  250. .text {
  251. color: #4093B5;
  252. }
  253. }
  254. span {
  255. display: block;
  256. }
  257. .icon {
  258. width: 72px;
  259. height: 72px;
  260. background: linear-gradient(180deg, #f6f6f7 0%, #f6f6f7 100%);
  261. border-radius: 12px;
  262. transition: all 0.2s;
  263. &.icon-device {
  264. background: url(~assets/theme-images/hyt/pc/nav-entry-device.png)
  265. no-repeat center center #f6f6f7;
  266. background-size: 48px;
  267. }
  268. &.icon-doctor {
  269. background: url(~assets/theme-images/hyt/pc/nav-entry-doctor.png)
  270. no-repeat center center #f6f6f7;
  271. background-size: 48px;
  272. }
  273. }
  274. .text {
  275. font-size: 16px;
  276. color: #404040;
  277. margin-top: 8px;
  278. }
  279. }
  280. }
  281. .list {
  282. display: flex;
  283. align-items: center;
  284. justify-content: space-between;
  285. flex-wrap: wrap;
  286. .empty {
  287. width: 390px;
  288. }
  289. .section {
  290. width: 490px;
  291. height: 136px;
  292. background-color: #f3f5f6;
  293. border-radius: 4px;
  294. box-sizing: border-box;
  295. padding: 16px;
  296. cursor: pointer;
  297. transition: all 0.4s;
  298. &:hover {
  299. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  300. }
  301. .cover {
  302. display: block;
  303. width: 104px;
  304. height: 104px;
  305. }
  306. .info {
  307. position: relative;
  308. margin-left: 12px;
  309. width: 330px;
  310. .name {
  311. width: 200px;
  312. font-size: 18px;
  313. color: #101010;
  314. font-weight: bold;
  315. margin-bottom: 24px;
  316. text-overflow: ellipsis;
  317. white-space: nowrap;
  318. overflow: hidden;
  319. }
  320. .mobile,
  321. .address {
  322. width: 268px;
  323. position: relative;
  324. font-size: 14px;
  325. color: #404040;
  326. padding-left: 24px;
  327. line-height: 24px;
  328. text-overflow: ellipsis;
  329. white-space: nowrap;
  330. margin-top: 6px;
  331. overflow: hidden;
  332. &::after {
  333. content: '';
  334. display: block;
  335. width: 16px;
  336. height: 16px;
  337. position: absolute;
  338. left: 0;
  339. top: 50%;
  340. transform: translateY(-50%);
  341. background-size: 16px;
  342. background-repeat: no-repeat;
  343. }
  344. }
  345. .mobile {
  346. &::after {
  347. background-image: url(~assets/theme-images/common/pc-icon-mobile.png);
  348. }
  349. }
  350. .address {
  351. &::after {
  352. background-image: url(~assets/theme-images/common/pc-icon-address.png);
  353. }
  354. }
  355. .distance {
  356. position: absolute;
  357. font-size: 14px;
  358. color: #404040;
  359. top: 2px;
  360. right: 0;
  361. }
  362. }
  363. }
  364. }
  365. }
  366. }
  367. // 移动 端
  368. @media screen and (max-width: 768px) {
  369. .page-top {
  370. height: 100vw;
  371. background-image: url(~assets/theme-images/hyt/h5/banner-club.png);
  372. background-size: 100vw 100vw !important;
  373. background-position: center;
  374. .logo {
  375. display: block;
  376. width: 14.8vw;
  377. height: 14.8vw;
  378. border-radius: 50%;
  379. background: #fff;
  380. }
  381. .name {
  382. font-size: 4vw;
  383. color: #fff;
  384. }
  385. }
  386. .page-content {
  387. position: relative;
  388. .title {
  389. font-size: 3.4vw;
  390. color: #404040;
  391. span {
  392. color: #4093B5;
  393. }
  394. }
  395. .filter {
  396. padding: 6.4vw 3.2vw 12.8vw;
  397. }
  398. .navbar {
  399. position: fixed;
  400. top: 50% !important;
  401. right: 3.2vw;
  402. left: unset !important;
  403. width: 14vw;
  404. border-radius: 1.6vw;
  405. background: #fff;
  406. box-shadow: 0px 0.6vw 2vw rgba(40, 40, 40, 0.1);
  407. padding: 2.8vw 0;
  408. box-sizing: border-box;
  409. z-index: 2;
  410. span {
  411. display: block;
  412. }
  413. .icon {
  414. position: relative;
  415. width: 7.2vw;
  416. height: 7.2vw;
  417. border-radius: 1.2vw;
  418. background: linear-gradient(180deg, #4BB9E6 0%, #4093B5 100%);
  419. &.icon-device,
  420. &.icon-doctor {
  421. &::after {
  422. content: '';
  423. display: block;
  424. width: 4.8vw;
  425. height: 4.8vw;
  426. position: absolute;
  427. left: 50%;
  428. top: 50%;
  429. transform: translate(-50%, -50%);
  430. background-size: 4.8vw !important;
  431. }
  432. }
  433. &.icon-device {
  434. &::after {
  435. background: url(~assets/theme-images/hyt/pc/nav-entry-device-active.png)
  436. no-repeat center;
  437. }
  438. }
  439. &.icon-doctor {
  440. &::after {
  441. background: url(~assets/theme-images/hyt/pc/nav-entry-doctor-active.png)
  442. no-repeat center;
  443. }
  444. }
  445. }
  446. .text {
  447. font-size: 2.4vw;
  448. color: #4093B5;
  449. margin-top: 1.2vw;
  450. }
  451. }
  452. }
  453. .list {
  454. display: flex;
  455. align-items: center;
  456. flex-direction: column;
  457. .section {
  458. width: 93.6vw;
  459. height: 26vw;
  460. background-color: #f3f5f6;
  461. border-radius: 4px;
  462. box-sizing: border-box;
  463. padding: 3.2vw;
  464. .cover {
  465. display: block;
  466. width: 19.6vw;
  467. height: 19.6vw;
  468. }
  469. .info {
  470. position: relative;
  471. margin-left: 3.2vw;
  472. .name {
  473. width: 48vw;
  474. font-size: 4vw;
  475. color: #101010;
  476. font-weight: bold;
  477. margin-bottom: 4vw;
  478. text-overflow: ellipsis;
  479. white-space: nowrap;
  480. overflow: hidden;
  481. }
  482. .mobile,
  483. .address {
  484. width: 66vw;
  485. position: relative;
  486. font-size: 3vw;
  487. color: #404040;
  488. padding-left: 5vw;
  489. line-height: 5vw;
  490. text-overflow: ellipsis;
  491. white-space: nowrap;
  492. overflow: hidden;
  493. &::after {
  494. content: '';
  495. display: block;
  496. width: 4vw;
  497. height: 4vw;
  498. position: absolute;
  499. left: 0;
  500. top: 50%;
  501. transform: translateY(-50%);
  502. background-size: 4vw 4vw;
  503. background-repeat: no-repeat;
  504. }
  505. }
  506. .mobile {
  507. &::after {
  508. background-image: url(~assets/theme-images/common/h5-icon-mobile.png);
  509. }
  510. }
  511. .address {
  512. &::after {
  513. background-image: url(~assets/theme-images/common/h5-icon-address.png);
  514. }
  515. }
  516. .distance {
  517. position: absolute;
  518. font-size: 3vw;
  519. color: #404040;
  520. top: 0.8vw;
  521. right: 0;
  522. }
  523. }
  524. }
  525. }
  526. }
  527. </style>