index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  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 class="navbar flex items-center flex-col" :style="{ top: offsetTop }">
  13. <nuxt-link :to="routePrefix + '/approve/device'" class="link flex items-center flex-col">
  14. <span class="icon icon-device"></span>
  15. <span class="text">设备认证</span>
  16. </nuxt-link>
  17. <nuxt-link
  18. :to="routePrefix + '/approve/personnel/operate'"
  19. class="link flex items-center flex-col md:mt-6 mt-4"
  20. >
  21. <span class="icon icon-doctor"></span>
  22. <span class="text">体疗师认证</span>
  23. </nuxt-link>
  24. </div>
  25. <div class="filter">
  26. <div class="search">
  27. <el-input placeholder="搜索机构" v-model="listQuery.authParty" @change="filterClubList">
  28. <i slot="prefix" class="el-input__icon el-icon-search"></i>
  29. </el-input>
  30. </div>
  31. <div class="area">
  32. <RossSelectGroup @change="onCityChange" ref="citySelect" />
  33. </div>
  34. </div>
  35. <!-- 明星机构 -->
  36. <template v-if="starList.length > 0">
  37. <div class="title flex justify-between px-4 pt-8 pb-6 md:px-0">
  38. <div>明星机构</div>
  39. <nuxt-link :to="routePrefix + '/approve/club/star-list'">更多<i class="el-icon-arrow-right"></i></nuxt-link>
  40. </div>
  41. <!-- 列表 -->
  42. <div class="list">
  43. <template v-for="item in starList">
  44. <div class="section flex justify-between mb-4" :key="item.authId" @click="toDetail(item)">
  45. <img class="cover" :src="item.logo || drawLogo(item.authParty)" />
  46. <div class="info">
  47. <div class="name" v-text="item.authParty"></div>
  48. <div class="mobile">{{ item.mobile || '暂无' }}</div>
  49. <div class="address">
  50. {{ formatAddress(item.area, item.address) }}
  51. </div>
  52. </div>
  53. </div>
  54. </template>
  55. </div>
  56. </template>
  57. <!-- 标题 -->
  58. <div class="title flex justify-between px-4 pt-8 pb-6 md:px-0">
  59. <div>距您最近...</div>
  60. <div>共<span v-text="total" class="font-bold"></span>家授权机构</div>
  61. </div>
  62. <!-- 列表 -->
  63. <div class="list">
  64. <template v-for="item in list">
  65. <div class="section flex justify-between mb-4" :key="item.authId" @click="toDetail(item)">
  66. <img class="cover" :src="item.logo || drawLogo(item.authParty)" />
  67. <div class="info">
  68. <div class="name" v-text="item.authParty"></div>
  69. <div class="mobile">{{ item.mobile || '暂无' }}</div>
  70. <div class="address">
  71. {{ formatAddress(item.area, item.address) }}
  72. </div>
  73. <div
  74. class="distance"
  75. v-text="formatDistance(item.distance)"
  76. v-if="item.distance && item.distance !== 99999"
  77. ></div>
  78. </div>
  79. </div>
  80. </template>
  81. </div>
  82. <!-- 列表为空 -->
  83. <SimpleEmpty v-if="!total && !isRequest" name="icon-empty-club.png" description="敬请期待~"></SimpleEmpty>
  84. </div>
  85. </van-list>
  86. </div>
  87. </template>
  88. <script>
  89. import { mapGetters } from 'vuex'
  90. import clubListMixin from '@/mixins/clubList'
  91. import { objectCover } from '@/utils'
  92. export default {
  93. layout: 'app-ross',
  94. mixins: [clubListMixin],
  95. data() {
  96. return {
  97. scrollTop: 0,
  98. }
  99. },
  100. computed: {
  101. ...mapGetters(['screenWidth', 'isPc']),
  102. offsetTop() {
  103. if (this.scrollTop <= window.innerHeight / 2) return '240px'
  104. return 240 + this.scrollTop - window.innerHeight / 2 + 'px'
  105. },
  106. },
  107. mounted() {
  108. window.addEventListener('scroll', () => {
  109. this.scrollTop = document.documentElement.scrollTop
  110. })
  111. },
  112. beforeDestroy() {
  113. window.removeEventListener('scroll', () => {})
  114. },
  115. methods: {
  116. // 从缓存中获取数据
  117. initFromCache(cacheData) {
  118. const data = objectCover(this, cacheData)
  119. console.log(data)
  120. this.$nextTick(() => {
  121. this.$refs.citySelect.initSelectValue({
  122. provinceId: data.provinceId,
  123. cityId: data.cityId,
  124. townId: data.townId,
  125. })
  126. })
  127. },
  128. // 城市变化
  129. onCityChange(valueMap) {
  130. const { provinceId, cityId, townId } = valueMap
  131. this.listQuery.provinceId = provinceId
  132. this.listQuery.cityId = cityId
  133. this.listQuery.townId = townId
  134. this.filterClubList()
  135. },
  136. },
  137. }
  138. </script>
  139. <style scoped lang="scss">
  140. .el-input {
  141. ::v-deep {
  142. @include useTheme() {
  143. & > {
  144. .el-input.is-active .el-input__inner,
  145. .el-input__inner:focus {
  146. border-color: fetch('color');
  147. }
  148. }
  149. }
  150. }
  151. }
  152. // pc 端
  153. @media screen and (min-width: 768px) {
  154. .page {
  155. @include useTheme() {
  156. position: relative;
  157. min-height: calc(100vh - 80px - 80px);
  158. background-color: #fff;
  159. .page-top {
  160. height: 530px;
  161. background-image: fetch('pc-banner-club');
  162. background-size: cover;
  163. background-position: center;
  164. }
  165. .page-content {
  166. position: relative;
  167. width: 1000px;
  168. margin: 0 auto;
  169. .title {
  170. font-size: 16px;
  171. color: #404040;
  172. span {
  173. color: fetch('color');
  174. }
  175. }
  176. .filter {
  177. padding: 48px 0 105px;
  178. .search {
  179. width: 640px;
  180. margin: 0 auto;
  181. .el-input {
  182. height: 46px;
  183. font-size: 16px;
  184. .el-input__icon {
  185. font-size: 24px;
  186. line-height: 46px;
  187. margin-left: 12px;
  188. }
  189. ::v-deep {
  190. & > .el-input__inner {
  191. height: 46px;
  192. padding-left: 55px;
  193. }
  194. }
  195. }
  196. }
  197. }
  198. .navbar {
  199. position: absolute;
  200. top: 240px;
  201. right: -168px;
  202. width: 120px;
  203. border-radius: 16px;
  204. background: #fff;
  205. box-shadow: 0px 6px 20px rgba(40, 40, 40, 0.1);
  206. padding: 24px 0;
  207. box-sizing: border-box;
  208. z-index: 2;
  209. .link {
  210. &:hover {
  211. .icon {
  212. &.icon-device {
  213. background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png) no-repeat center center,
  214. linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  215. background-size: 48px, 100%;
  216. }
  217. &.icon-doctor {
  218. background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png) no-repeat center center,
  219. linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  220. background-size: 48px, 100%;
  221. }
  222. }
  223. .text {
  224. color: fetch('color');
  225. }
  226. }
  227. span {
  228. display: block;
  229. }
  230. .icon {
  231. width: 72px;
  232. height: 72px;
  233. // background: linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  234. background-color: #f6f6f7;
  235. border-radius: 12px;
  236. &.icon-device {
  237. background: url(~assets/theme-images/ross/pc-nav-entry-device.png) no-repeat center center #f6f6f7;
  238. background-size: 48px;
  239. }
  240. &.icon-doctor {
  241. background: url(~assets/theme-images/ross/pc-nav-entry-doctor.png) no-repeat center center #f6f6f7;
  242. background-size: 48px;
  243. }
  244. }
  245. .text {
  246. font-size: 16px;
  247. color: #404040;
  248. margin-top: 8px;
  249. }
  250. }
  251. }
  252. .list {
  253. display: flex;
  254. align-items: center;
  255. justify-content: space-between;
  256. flex-wrap: wrap;
  257. .empty {
  258. width: 390px;
  259. }
  260. .section {
  261. width: 490px;
  262. height: 136px;
  263. background-color: #f3f5f6;
  264. border-radius: 4px;
  265. box-sizing: border-box;
  266. padding: 16px;
  267. cursor: pointer;
  268. transition: all 0.4s;
  269. &:hover {
  270. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  271. }
  272. .cover {
  273. display: block;
  274. width: 104px;
  275. height: 104px;
  276. }
  277. .info {
  278. position: relative;
  279. margin-left: 12px;
  280. width: 330px;
  281. .name {
  282. width: 200px;
  283. font-size: 18px;
  284. color: #101010;
  285. font-weight: bold;
  286. margin-bottom: 24px;
  287. text-overflow: ellipsis;
  288. white-space: nowrap;
  289. overflow: hidden;
  290. }
  291. .mobile,
  292. .address {
  293. width: 268px;
  294. position: relative;
  295. font-size: 14px;
  296. color: #404040;
  297. padding-left: 24px;
  298. line-height: 24px;
  299. text-overflow: ellipsis;
  300. white-space: nowrap;
  301. margin-top: 6px;
  302. overflow: hidden;
  303. &::after {
  304. content: '';
  305. display: block;
  306. width: 16px;
  307. height: 16px;
  308. position: absolute;
  309. left: 0;
  310. top: 50%;
  311. transform: translateY(-50%);
  312. background-size: 16px;
  313. background-repeat: no-repeat;
  314. }
  315. }
  316. .mobile {
  317. &::after {
  318. background-image: url(~assets/theme-images/common/pc-icon-mobile.png);
  319. }
  320. }
  321. .address {
  322. &::after {
  323. background-image: url(~assets/theme-images/common/pc-icon-address.png);
  324. }
  325. }
  326. .distance {
  327. position: absolute;
  328. font-size: 14px;
  329. color: #404040;
  330. top: 2px;
  331. right: 0;
  332. }
  333. }
  334. }
  335. }
  336. }
  337. }
  338. }
  339. }
  340. // 移动 端
  341. @media screen and (max-width: 768px) {
  342. .page {
  343. @include useTheme() {
  344. .page-top {
  345. height: 100vw;
  346. background: fetch('h5-banner-club');
  347. background-size: 100vw 100vw !important;
  348. .logo {
  349. display: block;
  350. width: 14.8vw;
  351. height: 14.8vw;
  352. border-radius: 50%;
  353. background: #fff;
  354. }
  355. .name {
  356. font-size: 4vw;
  357. color: #fff;
  358. }
  359. }
  360. .page-content {
  361. position: relative;
  362. .title {
  363. font-size: 3.4vw;
  364. color: #404040;
  365. span {
  366. color: fetch('color');
  367. }
  368. }
  369. .filter {
  370. padding: 6.4vw 3.2vw 12.8vw;
  371. }
  372. .navbar {
  373. position: fixed;
  374. top: 50% !important;
  375. right: 3.2vw;
  376. left: unset !important;
  377. width: 14vw;
  378. border-radius: 1.6vw;
  379. background: #fff;
  380. box-shadow: 0px 0.6vw 2vw rgba(40, 40, 40, 0.1);
  381. padding: 2.8vw 0;
  382. box-sizing: border-box;
  383. z-index: 2;
  384. span {
  385. display: block;
  386. }
  387. .icon {
  388. position: relative;
  389. width: 7.2vw;
  390. height: 7.2vw;
  391. border-radius: 1.2vw;
  392. background: linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  393. &.icon-device,
  394. &.icon-doctor {
  395. &::after {
  396. content: '';
  397. display: block;
  398. width: 4.8vw;
  399. height: 4.8vw;
  400. position: absolute;
  401. left: 50%;
  402. top: 50%;
  403. transform: translate(-50%, -50%);
  404. background-size: 4.8vw !important;
  405. }
  406. }
  407. &.icon-device {
  408. &::after {
  409. background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png) no-repeat center;
  410. }
  411. }
  412. &.icon-doctor {
  413. &::after {
  414. background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png) no-repeat center;
  415. }
  416. }
  417. }
  418. .text {
  419. font-size: 2.4vw;
  420. color: #f3920d;
  421. margin-top: 1.2vw;
  422. }
  423. }
  424. }
  425. .list {
  426. display: flex;
  427. align-items: center;
  428. flex-direction: column;
  429. .section {
  430. width: 93.6vw;
  431. height: 26vw;
  432. background-color: #f3f5f6;
  433. border-radius: 4px;
  434. box-sizing: border-box;
  435. padding: 3.2vw;
  436. .cover {
  437. display: block;
  438. width: 19.6vw;
  439. height: 19.6vw;
  440. }
  441. .info {
  442. position: relative;
  443. margin-left: 3.2vw;
  444. .name {
  445. width: 48vw;
  446. font-size: 4vw;
  447. color: #101010;
  448. font-weight: bold;
  449. margin-bottom: 4vw;
  450. text-overflow: ellipsis;
  451. white-space: nowrap;
  452. overflow: hidden;
  453. }
  454. .mobile,
  455. .address {
  456. width: 66vw;
  457. position: relative;
  458. font-size: 3vw;
  459. color: #404040;
  460. padding-left: 5vw;
  461. line-height: 5vw;
  462. text-overflow: ellipsis;
  463. white-space: nowrap;
  464. overflow: hidden;
  465. &::after {
  466. content: '';
  467. display: block;
  468. width: 4vw;
  469. height: 4vw;
  470. position: absolute;
  471. left: 0;
  472. top: 50%;
  473. transform: translateY(-50%);
  474. background-size: 4vw 4vw;
  475. background-repeat: no-repeat;
  476. }
  477. }
  478. .mobile {
  479. &::after {
  480. background-image: url(~assets/theme-images/common/h5-icon-mobile.png);
  481. }
  482. }
  483. .address {
  484. &::after {
  485. background-image: url(~assets/theme-images/common/h5-icon-address.png);
  486. }
  487. }
  488. .distance {
  489. position: absolute;
  490. font-size: 3vw;
  491. color: #404040;
  492. top: 0.8vw;
  493. right: 0;
  494. }
  495. }
  496. }
  497. }
  498. }
  499. }
  500. }
  501. </style>