index.vue 16 KB

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