index.vue 15 KB

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