123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671 |
- <template>
- <div class="page">
- <van-list
- v-model="loadingMore"
- :finished="finished"
- :immediate-check="false"
- :finished-text="total ? '没有更多了' : ''"
- @load="fetchClubList"
- >
- <div class="page-top flex flex-col justify-center items-center" @click="toActivity"></div>
- <div class="page-content">
- <div class="navbar-container" :style="{ top: offsetTop }">
- <!-- <nuxt-link :to="routePrefix + '/activity/challenge'">
- <div class="activity-entry"></div>
- </nuxt-link> -->
- <div class="navbar flex items-center flex-col">
- <nuxt-link :to="routePrefix + '/approve/device'" class="link flex items-center flex-col">
- <span class="icon icon-device"></span>
- <span class="text">设备认证</span>
- </nuxt-link>
- <nuxt-link
- :to="routePrefix + '/approve/personnel/operate'"
- class="link flex items-center flex-col md:mt-6 mt-4"
- >
- <span class="icon icon-doctor"></span>
- <span class="text">体疗师认证</span>
- </nuxt-link>
- </div>
- </div>
- <div class="filter">
- <div class="search">
- <el-input placeholder="搜索机构" v-model="listQuery.authParty" @change="filterClubList">
- <i slot="prefix" class="el-input__icon el-icon-search"></i>
- </el-input>
- </div>
- <div class="area">
- <RossSelectGroup @change="onCityChange" ref="citySelect" />
- </div>
- </div>
- <!-- 明星机构 -->
- <template v-if="starList.length > 0">
- <div class="title flex justify-between px-4 pt-8 pb-6 md:px-0">
- <div>明星机构</div>
- <nuxt-link :to="routePrefix + '/approve/club/star-list'">更多<i class="el-icon-arrow-right"></i></nuxt-link>
- </div>
- <!-- 列表 -->
- <div class="list">
- <template v-for="item in starList">
- <div class="section flex justify-between mb-4" :key="item.authId" @click="toDetail(item)">
- <img class="cover" :src="item.logo || drawLogo(item.authParty)" />
- <div class="info">
- <div class="name" v-text="item.authParty"></div>
- <div class="mobile">{{ maskPhoneNumber(item.mobile) || '暂无' }}</div>
- <div class="address">
- <!--{{ formatAddress(item.area, item.address) }}-->
- </div>
- </div>
- </div>
- </template>
- </div>
- </template>
- <!-- 标题 -->
- <div class="title flex justify-between px-4 pt-8 pb-6 md:px-0">
- <div>距您最近...</div>
- <div>共<span v-text="total" class="font-bold"></span>家授权机构</div>
- </div>
- <!-- 列表 -->
- <div class="list">
- <template v-for="item in list">
- <div class="section flex justify-between mb-4" :key="item.authId" @click="toDetail(item)">
- <img class="cover" :src="item.logo || drawLogo(item.authParty)" />
- <div class="info">
- <div class="name" v-text="item.authParty"></div>
- <div class="mobile">{{ maskPhoneNumber(item.mobile) }}</div>
- <div class="address">
- <!--{{ formatAddress(item.area, item.address) }}-->
- </div>
- <div
- class="distance"
- v-text="formatDistance(item.distance)"
- v-if="item.distance && item.distance !== 99999"
- ></div>
- </div>
- </div>
- </template>
- </div>
- <!-- 列表为空 -->
- <SimpleEmpty v-if="!total && !isRequest" name="icon-empty-club.png" description="敬请期待~"></SimpleEmpty>
- </div>
- </van-list>
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- import clubListMixin from '@/mixins/clubList'
- import { objectCover } from '@/utils'
- export default {
- layout: 'app-ross',
- mixins: [clubListMixin],
- data() {
- return {
- scrollTop: 0,
- banner: {},
- screenWidth: ''
- }
- },
- computed: {
- ...mapGetters(['isPc', 'authUserId']),
- offsetTop() {
- if (this.scrollTop <= window.innerHeight / 2) return '10px'
- return 10 + this.scrollTop - window.innerHeight / 2 + 'px'
- },
- },
- created() {
- // document.title = '官方正品授权查询'
- },
- mounted() {
- this.initAppMessageShareData() // 公众号分享授权页面
- window.addEventListener('scroll', () => {
- this.scrollTop = document.documentElement.scrollTop
- })
- this.getBanner() // 获取轮播图
- // 监听页面尺寸变化
- this.screenWidth = document.body.clientWidth
- window.onresize = () => {
- return (() => {
- this.screenWidth = document.body.clientWidth
- })()
- }
- },
- beforeDestroy() {
- window.removeEventListener('scroll', () => {
- this.scrollTop = document.documentElement.scrollTop
- })
- },
- watch: {
- screenWidth: {
- handler(val) {
- const changeBanner = document.getElementsByClassName('page-top')[0]
- if (changeBanner) {
- if (val > 768) {
- if(this.banner.headPcBanner) {
- changeBanner.style.backgroundImage = 'url('+ this.banner.headPcBanner+ ')'
- }
- }else {
- if(this.banner.headAppBanner) {
- changeBanner.style.backgroundImage = 'url('+ this.banner.headAppBanner+ ')'
- }
- }
- }
- },
- immediate: true,
- deep: true
- }
- },
- methods: {
- // 抖音挑战赛
- toActivity() {
- if(this.screenWidth > 768) {
- this.banner.jumpLink && window.open(this.banner.jumpLink)
- this.banner.jumpPcPicture && window.open(this.banner.jumpPcPicture)
- } else {
- this.banner.jumpLink && window.open(this.banner.jumpLink)
- this.banner.jumpAppPicture && window.open(this.banner.jumpAppPicture)
- }
- },
- // 从缓存中获取数据
- initFromCache(cacheData) {
- const data = objectCover(this, cacheData)
- console.log(data)
- this.$nextTick(() => {
- this.$refs.citySelect.initSelectValue({
- provinceId: data.provinceId,
- cityId: data.cityId,
- townId: data.townId,
- })
- })
- },
- // banner
- async getBanner() {
- const { data } = await this.$http.api.bannerImg(this.authUserId)
- this.banner = data
- const changeBanner = document.getElementsByClassName('page-top')[0]
- if (this.screenWidth > 768) {
- this.banner.headPcBanner && (changeBanner.style.backgroundImage = 'url('+ this.banner.headPcBanner+ ')')
- }else {
- this.banner.headAppBanner && (changeBanner.style.backgroundImage = 'url('+ this.banner.headAppBanner+ ')')
- }
- },
- // 城市变化
- onCityChange(valueMap) {
- const { provinceId, cityId, townId } = valueMap
- this.listQuery.provinceId = provinceId
- this.listQuery.cityId = cityId
- this.listQuery.townId = townId
- this.filterClubList()
- },
- // 分享当前页面
- initAppMessageShareData() {
- console.log(window.location.href, window.location.origin)
- // 重试次数
- let retryCount = 1
- this.$wxReady((wx) => {
- //需在用户可能点击分享按钮前就先调用
- wx.updateAppMessageShareData({
- title: '官方正品授权查询', // 分享标题
- desc: '官方正品授权', // 分享描述
- link: window.location.href, // 分享链接,该链接域名或路径必须与当前页面对应的公众号 JS 安全域名一致
- imgUrl: this.banner.headAppBanner, // 分享图标
- fail: () => {
- if (retryCount === 0) return
- this.initAppMessageShareData()
- retryCount--
- },
- })
- })
- },
- maskPhoneNumber(phoneNumber) {
- // 检查手机号长度是否合法(假设为11位)
- if (!phoneNumber || phoneNumber.length !== 11) {
- return '暂无';
- }
- // 提取前三位和最后四位
- const prefix = phoneNumber.slice(0, 3);
- const suffix = phoneNumber.slice(-4);
- // 使用星号(*)替换中间的数字
- const maskedMiddle = '****'.repeat(Math.ceil((phoneNumber.length - prefix.length - suffix.length) / 4));
- // 拼接脱敏后的手机号
- return prefix + maskedMiddle + suffix;
- }
- },
- }
- </script>
- <style scoped lang="scss">
- .el-input {
- ::v-deep {
- @include useTheme() {
- & > {
- .el-input.is-active .el-input__inner,
- .el-input__inner:focus {
- border-color: fetch('color');
- }
- }
- }
- }
- }
- // pc 端
- @media screen and (min-width: 768px) {
- .page {
- @include useTheme() {
- position: relative;
- min-height: calc(100vh - 80px - 80px);
- background-color: #fff;
- .page-top {
- height: 530px;
- background-image: fetch('pc-banner-club');
- // background-image: url(~/assets/theme-images/app/pc-banner-club.png);
- background-size: cover;
- background-position: center;
- cursor: pointer;
- }
- .page-content {
- position: relative;
- width: 1000px;
- margin: 0 auto;
- .title {
- font-size: 16px;
- color: #404040;
- span {
- color: fetch('color');
- }
- }
- .filter {
- padding: 48px 0 105px;
- .search {
- width: 640px;
- margin: 0 auto;
- .el-input {
- height: 46px;
- font-size: 16px;
- .el-input__icon {
- font-size: 24px;
- line-height: 46px;
- margin-left: 12px;
- }
- ::v-deep {
- & > .el-input__inner {
- height: 46px;
- padding-left: 55px;
- }
- }
- }
- }
- }
- .navbar-container {
- position: absolute;
- top: 240px;
- right: -180px;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- .activity-entry {
- width: 168px;
- height: 168px;
- background: url(~assets/theme-images/ross/pc-icon-entry.png) no-repeat center;
- background-size: 168px;
- margin-bottom: 16px;
- }
- .navbar {
- width: 120px;
- border-radius: 16px;
- background: #fff;
- box-shadow: 0px 6px 20px rgba(40, 40, 40, 0.1);
- padding: 24px 0;
- box-sizing: border-box;
- z-index: 2;
- .link {
- &:hover {
- .icon {
- &.icon-device {
- background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png) no-repeat center center,
- linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
- background-size: 48px, 100%;
- }
- &.icon-doctor {
- background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png) no-repeat center center,
- linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
- background-size: 48px, 100%;
- }
- }
- .text {
- color: fetch('color');
- }
- }
- span {
- display: block;
- }
- .icon {
- width: 72px;
- height: 72px;
- // background: linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
- background-color: #f6f6f7;
- border-radius: 12px;
- &.icon-device {
- background: url(~assets/theme-images/ross/pc-nav-entry-device.png) no-repeat center center #f6f6f7;
- background-size: 48px;
- }
- &.icon-doctor {
- background: url(~assets/theme-images/ross/pc-nav-entry-doctor.png) no-repeat center center #f6f6f7;
- background-size: 48px;
- }
- }
- .text {
- font-size: 16px;
- color: #404040;
- margin-top: 8px;
- }
- }
- }
- }
- .list {
- display: flex;
- align-items: center;
- justify-content: space-between;
- flex-wrap: wrap;
- .empty {
- width: 390px;
- }
- .section {
- width: 490px;
- height: 136px;
- background-color: #f3f5f6;
- border-radius: 4px;
- box-sizing: border-box;
- padding: 16px;
- cursor: pointer;
- transition: all 0.4s;
- &:hover {
- box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
- }
- .cover {
- display: block;
- width: 104px;
- height: 104px;
- }
- .info {
- position: relative;
- margin-left: 12px;
- width: 330px;
- @include flex-column-between;
- .name {
- width: 200px;
- font-size: 20px;
- color: #101010;
- font-weight: bold;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .mobile,
- .address {
- width: 268px;
- position: relative;
- font-size: 14px;
- color: #404040;
- padding-left: 24px;
- line-height: 24px;
- text-overflow: ellipsis;
- white-space: nowrap;
- margin-top: 6px;
- overflow: hidden;
- &::after {
- content: '';
- display: block;
- width: 16px;
- height: 16px;
- position: absolute;
- left: 0;
- top: 50%;
- transform: translateY(-50%);
- background-size: 16px;
- background-repeat: no-repeat;
- }
- }
- .mobile {
- &::after {
- background-image: url(~assets/theme-images/common/pc-icon-mobile.png);
- }
- }
- .address {
- &::after {
- background-image: url(~assets/theme-images/common/pc-icon-address.png);
- }
- }
- .distance {
- position: absolute;
- font-size: 14px;
- color: #404040;
- top: 2px;
- right: 0;
- }
- }
- }
- }
- }
- }
- }
- }
- // 移动 端
- @media screen and (max-width: 768px) {
- .page {
- @include useTheme() {
- .page-top {
- height: 100vw;
- background: fetch('h5-banner-club');
- // background-image: url(~assets/theme-images/ross/h5-banner-club.png);
- background-size: 100vw 100vw !important;
- .logo {
- display: block;
- width: 14.8vw;
- height: 14.8vw;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 4vw;
- color: #fff;
- }
- }
- .page-content {
- position: relative;
- .title {
- font-size: 3.4vw;
- color: #404040;
- span {
- color: fetch('color');
- }
- }
- .filter {
- padding: 6.4vw 3.2vw 12.8vw;
- }
- .navbar-container {
- position: fixed;
- top: 50% !important;
- right: 3.2vw;
- left: unset !important;
- display: flex;
- justify-content: center;
- align-items: center;
- flex-direction: column;
- z-index: 2;
- .activity-entry {
- width: 23.6vw;
- height: 23.6vw;
- background: url(~assets/theme-images/ross/pc-icon-entry.png) no-repeat center;
- background-size: 23.6vw;
- margin-bottom: 1.6vw;
- }
- .navbar {
- width: 14vw;
- border-radius: 1.6vw;
- background: #fff;
- box-shadow: 0px 0.6vw 2vw rgba(40, 40, 40, 0.1);
- padding: 2.8vw 0;
- box-sizing: border-box;
- span {
- display: block;
- }
- .icon {
- position: relative;
- width: 7.2vw;
- height: 7.2vw;
- border-radius: 1.2vw;
- background: linear-gradient(180deg, #ffba63 0%, #f3920d 100%);
- &.icon-device,
- &.icon-doctor {
- &::after {
- content: '';
- display: block;
- width: 4.8vw;
- height: 4.8vw;
- position: absolute;
- left: 50%;
- top: 50%;
- transform: translate(-50%, -50%);
- background-size: 4.8vw !important;
- }
- }
- &.icon-device {
- &::after {
- background: url(~assets/theme-images/ross/pc-nav-entry-device-active.png) no-repeat center;
- }
- }
- &.icon-doctor {
- &::after {
- background: url(~assets/theme-images/ross/pc-nav-entry-doctor-active.png) no-repeat center;
- }
- }
- }
- .text {
- font-size: 2.4vw;
- color: #f3920d;
- margin-top: 1.2vw;
- }
- }
- }
- }
- .list {
- display: flex;
- align-items: center;
- flex-direction: column;
- .section {
- width: 93.6vw;
- height: 26vw;
- background-color: #f3f5f6;
- border-radius: 4px;
- box-sizing: border-box;
- padding: 3.2vw;
- .cover {
- display: block;
- width: 19.6vw;
- height: 19.6vw;
- }
- .info {
- position: relative;
- margin-left: 3.2vw;
- @include flex-column-between;
- .name {
- width: 48vw;
- font-size: 4vw;
- color: #101010;
- font-weight: bold;
- margin-top: 5.4vw;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .mobile,
- .address {
- width: 66vw;
- position: relative;
- font-size: 3vw;
- color: #404040;
- padding-left: 5vw;
- line-height: 5vw;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- &::after {
- content: '';
- display: block;
- width: 4vw;
- height: 4vw;
- position: absolute;
- left: 0;
- top: 50%;
- transform: translateY(-50%);
- background-size: 4vw 4vw;
- background-repeat: no-repeat;
- }
- }
- .mobile {
- &::after {
- background-image: url(~assets/theme-images/common/h5-icon-mobile.png);
- }
- }
- .address {
- &::after {
- background-image: url(~assets/theme-images/common/h5-icon-address.png);
- }
- }
- .distance {
- position: absolute;
- font-size: 3vw;
- color: #404040;
- top: 0.8vw;
- right: 0;
- }
- }
- }
- }
- }
- }
- }
- </style>
|