index.vue 14 KB

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