index.vue 14 KB

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