index.vue 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634
  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. banner: {},
  104. screenWidth: ""
  105. }
  106. },
  107. computed: {
  108. ...mapGetters(['screenWidth', 'isPc', 'authUserId']),
  109. offsetTop() {
  110. if (this.scrollTop <= window.innerHeight / 2) return '10px'
  111. return 10 + this.scrollTop - window.innerHeight / 2 + 'px'
  112. },
  113. },
  114. created() {
  115. document.title = '官方正品授权查询'
  116. },
  117. mounted() {
  118. window.addEventListener('scroll', () => {
  119. this.scrollTop = document.documentElement.scrollTop
  120. })
  121. this.getBanner() // 获取轮播图
  122. // 监听页面尺寸变化
  123. this.screenWidth = document.body.clientWidth
  124. window.onresize = () => {
  125. return (() => {
  126. this.screenWidth = document.body.clientWidth
  127. })()
  128. }
  129. },
  130. beforeDestroy() {
  131. window.removeEventListener('scroll', () => {
  132. this.scrollTop = document.documentElement.scrollTop
  133. })
  134. },
  135. watch: {
  136. screenWidth: {
  137. handler(val) {
  138. const changeBanner = document.getElementsByClassName('page-top')[0]
  139. if (changeBanner) {
  140. if (val > 768) {
  141. if(this.banner.headPcBanner) {
  142. changeBanner.style.backgroundImage = 'url('+ this.banner.headPcBanner+ ')'
  143. }
  144. }else {
  145. if(this.banner.headAppBanner) {
  146. changeBanner.style.backgroundImage = 'url('+ this.banner.headAppBanner+ ')'
  147. }
  148. }
  149. }
  150. },
  151. immediate: true,
  152. deep: true
  153. }
  154. },
  155. methods: {
  156. // 抖音挑战赛
  157. toActivity() {
  158. if(this.screenWidth > 768) {
  159. this.banner.jumpLink && window.open(this.banner.jumpLink)
  160. this.banner.jumpPcPicture && window.open(this.banner.jumpPcPicture)
  161. } else {
  162. this.banner.jumpLink && window.open(this.banner.jumpLink)
  163. this.banner.jumpAppPicture && window.open(this.banner.jumpAppPicture)
  164. }
  165. },
  166. // 从缓存中获取数据
  167. initFromCache(cacheData) {
  168. const data = objectCover(this, cacheData)
  169. console.log(data)
  170. this.$nextTick(() => {
  171. this.$refs.citySelect.initSelectValue({
  172. provinceId: data.provinceId,
  173. cityId: data.cityId,
  174. townId: data.townId,
  175. })
  176. })
  177. },
  178. // banner
  179. async getBanner() {
  180. const { data } = await this.$http.api.bannerImg(this.authUserId)
  181. this.banner = data
  182. const changeBanner = document.getElementsByClassName('page-top')[0]
  183. if (this.screenWidth > 768) {
  184. this.banner.headPcBanner && (changeBanner.style.backgroundImage = 'url('+ this.banner.headPcBanner+ ')')
  185. }else {
  186. this.banner.headAppBanner && (changeBanner.style.backgroundImage = 'url('+ this.banner.headAppBanner+ ')')
  187. }
  188. },
  189. // 城市变化
  190. onCityChange(valueMap) {
  191. const { provinceId, cityId, townId } = valueMap
  192. this.listQuery.provinceId = provinceId
  193. this.listQuery.cityId = cityId
  194. this.listQuery.townId = townId
  195. this.filterClubList()
  196. },
  197. },
  198. }
  199. </script>
  200. <style scoped lang="scss">
  201. .el-input {
  202. ::v-deep {
  203. @include useTheme() {
  204. & > {
  205. .el-input.is-active .el-input__inner,
  206. .el-input__inner:focus {
  207. border-color: fetch('color');
  208. }
  209. }
  210. }
  211. }
  212. }
  213. // pc 端
  214. @media screen and (min-width: 768px) {
  215. .page {
  216. @include useTheme() {
  217. position: relative;
  218. min-height: calc(100vh - 80px - 80px);
  219. background-color: #fff;
  220. .page-top {
  221. height: 530px;
  222. background-image: fetch('pc-banner-club');
  223. // background-image: url(~/assets/theme-images/app/pc-banner-club.png);
  224. background-size: cover;
  225. background-position: center;
  226. cursor: pointer;
  227. }
  228. .page-content {
  229. position: relative;
  230. width: 1000px;
  231. margin: 0 auto;
  232. .title {
  233. font-size: 16px;
  234. color: #404040;
  235. span {
  236. color: fetch('color');
  237. }
  238. }
  239. .filter {
  240. padding: 48px 0 105px;
  241. .search {
  242. width: 640px;
  243. margin: 0 auto;
  244. .el-input {
  245. height: 46px;
  246. font-size: 16px;
  247. .el-input__icon {
  248. font-size: 24px;
  249. line-height: 46px;
  250. margin-left: 12px;
  251. }
  252. ::v-deep {
  253. & > .el-input__inner {
  254. height: 46px;
  255. padding-left: 55px;
  256. }
  257. }
  258. }
  259. }
  260. }
  261. .navbar-container {
  262. position: absolute;
  263. top: 240px;
  264. right: -180px;
  265. display: flex;
  266. justify-content: center;
  267. align-items: center;
  268. flex-direction: column;
  269. .activity-entry {
  270. width: 168px;
  271. height: 168px;
  272. background: url(~assets/theme-images/ross/pc-icon-entry.png) no-repeat center;
  273. background-size: 168px;
  274. margin-bottom: 16px;
  275. }
  276. .navbar {
  277. width: 120px;
  278. border-radius: 16px;
  279. background: #fff;
  280. box-shadow: 0px 6px 20px rgba(40, 40, 40, 0.1);
  281. padding: 24px 0;
  282. box-sizing: border-box;
  283. z-index: 2;
  284. .link {
  285. &:hover {
  286. .icon {
  287. &.icon-device {
  288. background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png) no-repeat center center,
  289. linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  290. background-size: 48px, 100%;
  291. }
  292. &.icon-doctor {
  293. background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png) no-repeat center center,
  294. linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  295. background-size: 48px, 100%;
  296. }
  297. }
  298. .text {
  299. color: fetch('color');
  300. }
  301. }
  302. span {
  303. display: block;
  304. }
  305. .icon {
  306. width: 72px;
  307. height: 72px;
  308. // background: linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  309. background-color: #f6f6f7;
  310. border-radius: 12px;
  311. &.icon-device {
  312. background: url(~assets/theme-images/ross/pc-nav-entry-device.png) no-repeat center center #f6f6f7;
  313. background-size: 48px;
  314. }
  315. &.icon-doctor {
  316. background: url(~assets/theme-images/ross/pc-nav-entry-doctor.png) no-repeat center center #f6f6f7;
  317. background-size: 48px;
  318. }
  319. }
  320. .text {
  321. font-size: 16px;
  322. color: #404040;
  323. margin-top: 8px;
  324. }
  325. }
  326. }
  327. }
  328. .list {
  329. display: flex;
  330. align-items: center;
  331. justify-content: space-between;
  332. flex-wrap: wrap;
  333. .empty {
  334. width: 390px;
  335. }
  336. .section {
  337. width: 490px;
  338. height: 136px;
  339. background-color: #f3f5f6;
  340. border-radius: 4px;
  341. box-sizing: border-box;
  342. padding: 16px;
  343. cursor: pointer;
  344. transition: all 0.4s;
  345. &:hover {
  346. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  347. }
  348. .cover {
  349. display: block;
  350. width: 104px;
  351. height: 104px;
  352. }
  353. .info {
  354. position: relative;
  355. margin-left: 12px;
  356. width: 330px;
  357. .name {
  358. width: 200px;
  359. font-size: 18px;
  360. color: #101010;
  361. font-weight: bold;
  362. margin-bottom: 24px;
  363. text-overflow: ellipsis;
  364. white-space: nowrap;
  365. overflow: hidden;
  366. }
  367. .mobile,
  368. .address {
  369. width: 268px;
  370. position: relative;
  371. font-size: 14px;
  372. color: #404040;
  373. padding-left: 24px;
  374. line-height: 24px;
  375. text-overflow: ellipsis;
  376. white-space: nowrap;
  377. margin-top: 6px;
  378. overflow: hidden;
  379. &::after {
  380. content: '';
  381. display: block;
  382. width: 16px;
  383. height: 16px;
  384. position: absolute;
  385. left: 0;
  386. top: 50%;
  387. transform: translateY(-50%);
  388. background-size: 16px;
  389. background-repeat: no-repeat;
  390. }
  391. }
  392. .mobile {
  393. &::after {
  394. background-image: url(~assets/theme-images/common/pc-icon-mobile.png);
  395. }
  396. }
  397. .address {
  398. &::after {
  399. background-image: url(~assets/theme-images/common/pc-icon-address.png);
  400. }
  401. }
  402. .distance {
  403. position: absolute;
  404. font-size: 14px;
  405. color: #404040;
  406. top: 2px;
  407. right: 0;
  408. }
  409. }
  410. }
  411. }
  412. }
  413. }
  414. }
  415. }
  416. // 移动 端
  417. @media screen and (max-width: 768px) {
  418. .page {
  419. @include useTheme() {
  420. .page-top {
  421. height: 100vw;
  422. background: fetch('h5-banner-club');
  423. // background-image: url(~assets/theme-images/ross/h5-banner-club.png);
  424. background-size: 100vw 100vw !important;
  425. .logo {
  426. display: block;
  427. width: 14.8vw;
  428. height: 14.8vw;
  429. border-radius: 50%;
  430. background: #fff;
  431. }
  432. .name {
  433. font-size: 4vw;
  434. color: #fff;
  435. }
  436. }
  437. .page-content {
  438. position: relative;
  439. .title {
  440. font-size: 3.4vw;
  441. color: #404040;
  442. span {
  443. color: fetch('color');
  444. }
  445. }
  446. .filter {
  447. padding: 6.4vw 3.2vw 12.8vw;
  448. }
  449. .navbar-container {
  450. position: fixed;
  451. top: 50% !important;
  452. right: 3.2vw;
  453. left: unset !important;
  454. display: flex;
  455. justify-content: center;
  456. align-items: center;
  457. flex-direction: column;
  458. z-index: 2;
  459. .activity-entry {
  460. width: 23.6vw;
  461. height: 23.6vw;
  462. background: url(~assets/theme-images/ross/pc-icon-entry.png) no-repeat center;
  463. background-size: 23.6vw;
  464. margin-bottom: 1.6vw;
  465. }
  466. .navbar {
  467. width: 14vw;
  468. border-radius: 1.6vw;
  469. background: #fff;
  470. box-shadow: 0px 0.6vw 2vw rgba(40, 40, 40, 0.1);
  471. padding: 2.8vw 0;
  472. box-sizing: border-box;
  473. span {
  474. display: block;
  475. }
  476. .icon {
  477. position: relative;
  478. width: 7.2vw;
  479. height: 7.2vw;
  480. border-radius: 1.2vw;
  481. background: linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
  482. &.icon-device,
  483. &.icon-doctor {
  484. &::after {
  485. content: '';
  486. display: block;
  487. width: 4.8vw;
  488. height: 4.8vw;
  489. position: absolute;
  490. left: 50%;
  491. top: 50%;
  492. transform: translate(-50%, -50%);
  493. background-size: 4.8vw !important;
  494. }
  495. }
  496. &.icon-device {
  497. &::after {
  498. background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png) no-repeat center;
  499. }
  500. }
  501. &.icon-doctor {
  502. &::after {
  503. background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png) no-repeat center;
  504. }
  505. }
  506. }
  507. .text {
  508. font-size: 2.4vw;
  509. color: #f3920d;
  510. margin-top: 1.2vw;
  511. }
  512. }
  513. }
  514. }
  515. .list {
  516. display: flex;
  517. align-items: center;
  518. flex-direction: column;
  519. .section {
  520. width: 93.6vw;
  521. height: 26vw;
  522. background-color: #f3f5f6;
  523. border-radius: 4px;
  524. box-sizing: border-box;
  525. padding: 3.2vw;
  526. .cover {
  527. display: block;
  528. width: 19.6vw;
  529. height: 19.6vw;
  530. }
  531. .info {
  532. position: relative;
  533. margin-left: 3.2vw;
  534. .name {
  535. width: 48vw;
  536. font-size: 4vw;
  537. color: #101010;
  538. font-weight: bold;
  539. margin-bottom: 4vw;
  540. text-overflow: ellipsis;
  541. white-space: nowrap;
  542. overflow: hidden;
  543. }
  544. .mobile,
  545. .address {
  546. width: 66vw;
  547. position: relative;
  548. font-size: 3vw;
  549. color: #404040;
  550. padding-left: 5vw;
  551. line-height: 5vw;
  552. text-overflow: ellipsis;
  553. white-space: nowrap;
  554. overflow: hidden;
  555. &::after {
  556. content: '';
  557. display: block;
  558. width: 4vw;
  559. height: 4vw;
  560. position: absolute;
  561. left: 0;
  562. top: 50%;
  563. transform: translateY(-50%);
  564. background-size: 4vw 4vw;
  565. background-repeat: no-repeat;
  566. }
  567. }
  568. .mobile {
  569. &::after {
  570. background-image: url(~assets/theme-images/common/h5-icon-mobile.png);
  571. }
  572. }
  573. .address {
  574. &::after {
  575. background-image: url(~assets/theme-images/common/h5-icon-address.png);
  576. }
  577. }
  578. .distance {
  579. position: absolute;
  580. font-size: 3vw;
  581. color: #404040;
  582. top: 0.8vw;
  583. right: 0;
  584. }
  585. }
  586. }
  587. }
  588. }
  589. }
  590. }
  591. </style>