123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354 |
- <template>
- <div class="page">
- <van-list
- v-model="isLoadingMore"
- :finished="finished"
- :immediate-check="false"
- :finished-text="total ? '没有更多了' : ''"
- @load="onLoadMore"
- >
- <div class="page-top flex flex-col justify-center items-center">
- <!-- <img class="logo" :src="supplierInfo.logo" /> -->
- <div class="mt-2 name">
- <span v-text="supplierInfo.shopName"></span><span v-if="themeName === 'ross'">官方体疗师认证</span><span v-else>官方医师认证</span>
- </div>
- </div>
- <div class="page-content">
- <!-- 搜索区域 -->
- <div class="search">
- <SimpleSearch
- v-model="listQuery.doctorName"
- @search="onSearch"
- :placeholder="searchPlaceholder"
- />
- </div>
- <!-- 标题 -->
- <div class="title px-4 pt-12 pb-6">
- 共<span v-text="total"></span>位{{
- themeName === 'ross' ? '体疗师' : '医师'
- }}
- </div>
- <!-- 列表 -->
- <div class="list">
- <div
- class="section flex justify-between mb-4"
- v-for="item in list"
- :key="item.doctorId"
- @click="toDetail(item)"
- >
- <img class="cover" :src="item.doctorImage" />
- <div class="info">
- <div class="name" v-text="item.doctorName"></div>
- <div class="tag">{{ item.tagList.join(' | ') }}</div>
- <div class="code">资格证编号:{{ item.certificateNo }}</div>
- <div class="club-name">所在机构:{{ item.clubName }}</div>
- </div>
- </div>
- <div class="empty" v-for="i in emptyList" :key="'empty' + i"></div>
- </div>
- <!-- 列表为空 -->
- <SimpleEmpty
- v-if="!total && !isRequest"
- name="icon-empty-doctor.png"
- description="敬请期待~"
- ></SimpleEmpty>
- </div>
- </van-list>
- </div>
- </template>
- <script>
- import { mapGetters } from 'vuex'
- import { debounce } from '@/utils'
- export default {
- layout: 'app',
- data() {
- return {
- isLoadingMore: true,
- finished: false,
- isRequest: true,
- listQuery: {
- authUserId: '',
- doctorType: 1,
- doctorName: '',
- pageNum: 1,
- pageSize: 9,
- },
- list: [],
- total: 0,
- }
- },
- computed: {
- ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix', 'themeName']),
- isEmpty() {
- return this.list.length === 0
- },
- emptyList() {
- return 3 - (this.list.length % 3)
- },
- searchPlaceholder() {
- return this.themeName === 'ross' ? '搜索体疗师' : '搜索医师'
- },
- },
- mounted() {
- this.fetchList()
- },
- methods: {
- fetchList: debounce(async function () {
- try {
- this.isLoadingMore = true
- this.listQuery.authUserId = this.authUserId
- const res = await this.$http.api.fetchDoctorList(this.listQuery)
- this.list = [...this.list, ...res.data.list]
- this.finished = !res.data.hasNextPage
- this.total = res.data.total
- this.listQuery.pageNum += 1
- this.isLoadingMore = false
- } catch (error) {
- console.log(error)
- } finally {
- this.isRequest = false
- }
- }, 400),
- // 搜索
- onSearch() {
- this.list = []
- this.listQuery.pageNum = 1
- this.fetchList()
- },
- // 医师详情
- toDetail(item) {
- const url = `${this.routePrefix}/approve/personnel/operate/detail?id=${item.doctorId}`
- this.$router.push(url)
- },
- // 加载更多
- onLoadMore() {
- this.fetchList()
- },
- },
- }
- </script>
- <style scoped lang="scss">
- .page {
- position: relative;
- min-height: calc(100vh - 80px - 80px);
- background-color: #fff;
- }
- // pc 端
- @media screen and (min-width: 768px) {
- .page-top {
- height: 420px;
- @include themify($themes) {
- background: themed('pc-banner-doctor') no-repeat center;
- }
- background-size: auto 420px;
- .logo {
- display: block;
- width: 120px;
- height: 120px;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 30px;
- color: #fff;
- }
- .logo,
- .name {
- transform: translateY(-30px);
- }
- }
- .page-content {
- width: 1200px;
- margin: 0 auto;
- .search {
- position: absolute;
- left: 50%;
- top: 300px;
- transform: translateX(-50%);
- }
- .title {
- font-size: 16px;
- color: #404040;
- span {
- @include themify($themes) {
- color: themed('color');
- }
- }
- }
- .list {
- display: flex;
- align-items: center;
- flex-wrap: wrap;
- justify-content: space-between;
- .empty {
- width: 390px;
- }
- .section {
- width: 390px;
- background-color: #f3f5f6;
- border-radius: 4px;
- box-sizing: border-box;
- padding: 12px;
- cursor: pointer;
- transition: all 0.4s;
- &:hover {
- box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
- }
- .cover {
- display: block;
- width: 84px;
- height: 84px;
- }
- .info {
- width: 270px;
- position: relative;
- margin-left: 12px;
- .name {
- font-size: 16px;
- color: #101010;
- font-weight: bold;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .tag,
- .code,
- .club-name {
- height: 20px;
- position: relative;
- font-size: 14px;
- color: #404040;
- line-height: 20px;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- span {
- color: #6d9eff;
- }
- }
- .tag {
- color: #909399;
- }
- }
- }
- }
- }
- }
- // 移动 端
- @media screen and (max-width: 768px) {
- .page-top {
- height: 46vw;
- @include themify($themes) {
- background: themed('h5-banner-doctor') no-repeat center;
- }
- background-size: auto 46vw;
- .logo {
- display: block;
- width: 14.8vw;
- height: 14.8vw;
- border-radius: 50%;
- background: #fff;
- }
- .name {
- font-size: 4vw;
- color: #fff;
- }
- }
- .page-content {
- position: relative;
- .search {
- position: absolute;
- left: 50%;
- top: 0;
- transform: translate(-50%, -50%);
- }
- .city {
- padding-top: 12vw;
- }
- .title {
- font-size: 3.4vw;
- color: #404040;
- span {
- @include themify($themes) {
- color: themed('color');
- }
- }
- }
- .list {
- display: flex;
- align-items: center;
- flex-direction: column;
- .section {
- width: 93.6vw;
- background-color: #f3f5f6;
- border-radius: 4px;
- box-sizing: border-box;
- padding: 3.2vw;
- .cover {
- display: block;
- width: 21.6vw;
- height: 21.6vw;
- }
- .info {
- position: relative;
- margin-left: 3.2vw;
- .name {
- font-size: 4vw;
- color: #101010;
- font-weight: bold;
- margin-bottom: 0.8vw;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- }
- .tag,
- .code,
- .club-name {
- width: 62vw;
- height: 5vw;
- position: relative;
- font-size: 3vw;
- color: #404040;
- line-height: 5vw;
- text-overflow: ellipsis;
- white-space: nowrap;
- overflow: hidden;
- span {
- color: #6d9eff;
- }
- }
- .tag {
- color: #909399;
- }
- }
- }
- }
- }
- }
- </style>
|