index.vue 19 KB

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