index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350
  1. <template>
  2. <div class="page">
  3. <van-list
  4. v-model="isLoadingMore"
  5. :finished="finished"
  6. :immediate-check="false"
  7. :finished-text="total ? '没有更多了' : ''"
  8. @load="onLoadMore"
  9. >
  10. <div class="page-top flex flex-col justify-center items-center">
  11. <img class="logo" :src="supplierInfo.logo" />
  12. <div class="mt-2 name">
  13. <span v-text="supplierInfo.shopName"></span><span v-if="themeName === 'ross'">官方体疗师认证</span><span v-else>官方医师认证</span>
  14. </div>
  15. </div>
  16. <div class="page-content">
  17. <!-- 搜索区域 -->
  18. <div class="search">
  19. <SimpleSearch
  20. v-model="listQuery.doctorName"
  21. @search="onSearch"
  22. :placeholder="searchPlaceholder"
  23. />
  24. </div>
  25. <!-- 标题 -->
  26. <div class="title px-4 pt-12 pb-6">
  27. 共<span v-text="total"></span>位{{
  28. themeName === 'ross' ? '体疗师' : '医师'
  29. }}
  30. </div>
  31. <!-- 列表 -->
  32. <div class="list">
  33. <div
  34. class="section flex justify-between mb-4"
  35. v-for="item in list"
  36. :key="item.doctorId"
  37. @click="toDetail(item)"
  38. >
  39. <img class="cover" :src="item.doctorImage" />
  40. <div class="info">
  41. <div class="name" v-text="item.doctorName"></div>
  42. <div class="tag">{{ item.tagList.join(' | ') }}</div>
  43. <div class="code">资格证编号:<span>{{ item.certificateNo }}</span></div>
  44. <div class="club-name">所在机构:<span>{{ item.clubName }}</span></div>
  45. </div>
  46. </div>
  47. </div>
  48. <!-- 列表为空 -->
  49. <SimpleEmpty
  50. v-if="!total && !isRequest"
  51. name="icon-empty-doctor.png"
  52. description="敬请期待~"
  53. ></SimpleEmpty>
  54. </div>
  55. </van-list>
  56. </div>
  57. </template>
  58. <script>
  59. import { mapGetters } from 'vuex'
  60. import { debounce } from '@/utils'
  61. export default {
  62. layout: 'app-ross',
  63. data() {
  64. return {
  65. isLoadingMore: true,
  66. finished: false,
  67. isRequest: true,
  68. listQuery: {
  69. authUserId: '',
  70. doctorType: 1,
  71. doctorName: '',
  72. pageNum: 1,
  73. pageSize: 9,
  74. },
  75. list: [],
  76. total: 0,
  77. }
  78. },
  79. computed: {
  80. ...mapGetters(['supplierInfo', 'authUserId', 'routePrefix', 'themeName']),
  81. searchPlaceholder() {
  82. return this.themeName === 'ross' ? '搜索体疗师' : '搜索医师'
  83. },
  84. },
  85. mounted() {
  86. this.fetchList()
  87. },
  88. methods: {
  89. fetchList: debounce(async function () {
  90. try {
  91. this.isLoadingMore = true
  92. this.listQuery.authUserId = this.authUserId
  93. const res = await this.$http.api.fetchDoctorList(this.listQuery)
  94. this.list = [...this.list, ...res.data.list]
  95. this.finished = !res.data.hasNextPage
  96. this.total = res.data.total
  97. this.listQuery.pageNum += 1
  98. this.isLoadingMore = false
  99. } catch (error) {
  100. console.log(error)
  101. } finally {
  102. this.isRequest = false
  103. }
  104. }, 400),
  105. // 搜索
  106. onSearch() {
  107. this.list = []
  108. this.listQuery.pageNum = 1
  109. this.fetchList()
  110. },
  111. // 医师详情
  112. toDetail(item) {
  113. const url = `${this.routePrefix}/approve/personnel/operate/detail?id=${item.doctorId}`
  114. this.$router.push(url)
  115. },
  116. // 加载更多
  117. onLoadMore() {
  118. this.fetchList()
  119. },
  120. },
  121. }
  122. </script>
  123. <style scoped lang="scss">
  124. .page {
  125. position: relative;
  126. min-height: calc(100vh - 80px - 80px);
  127. background-color: #fff;
  128. }
  129. // pc 端
  130. @media screen and (min-width: 768px) {
  131. .page-top {
  132. height: 420px;
  133. @include themify($themes) {
  134. background: themed('pc-banner-doctor') no-repeat center;
  135. }
  136. background-size: auto 420px;
  137. .logo {
  138. display: block;
  139. width: 120px;
  140. height: 120px;
  141. border-radius: 50%;
  142. background: #fff;
  143. }
  144. .name {
  145. font-size: 30px;
  146. color: #fff;
  147. }
  148. .logo,
  149. .name {
  150. transform: translateY(-30px);
  151. }
  152. }
  153. .page-content {
  154. width: 1000px;
  155. margin: 0 auto;
  156. .search {
  157. position: absolute;
  158. left: 50%;
  159. top: 300px;
  160. transform: translateX(-50%);
  161. }
  162. .title {
  163. font-size: 16px;
  164. color: #404040;
  165. span {
  166. @include themify($themes) {
  167. color: themed('color');
  168. }
  169. }
  170. }
  171. .list {
  172. display: flex;
  173. align-items: center;
  174. flex-wrap: wrap;
  175. justify-content: space-between;
  176. .empty {
  177. width: 390px;
  178. }
  179. .section {
  180. width: 490px;
  181. height: 136px;
  182. background-color: #f3f5f6;
  183. border-radius: 4px;
  184. box-sizing: border-box;
  185. padding: 16px;
  186. cursor: pointer;
  187. transition: all 0.4s;
  188. &:hover {
  189. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  190. }
  191. .cover {
  192. display: block;
  193. width: 104px;
  194. height: 104px;
  195. }
  196. .info {
  197. width: 334px;
  198. position: relative;
  199. margin-left: 12px;
  200. .name {
  201. font-size: 18px;
  202. color: #101010;
  203. font-weight: bold;
  204. text-overflow: ellipsis;
  205. white-space: nowrap;
  206. overflow: hidden;
  207. font-weight: bold;
  208. margin-bottom: 8px;
  209. }
  210. .tag,
  211. .code,
  212. .club-name {
  213. height: 20px;
  214. position: relative;
  215. font-size: 14px;
  216. color: #999;
  217. line-height: 20px;
  218. text-overflow: ellipsis;
  219. white-space: nowrap;
  220. overflow: hidden;
  221. margin-top: 4px;
  222. span {
  223. color: #333333;
  224. }
  225. }
  226. .tag {
  227. color: #909399;
  228. }
  229. }
  230. }
  231. }
  232. }
  233. }
  234. // 移动 端
  235. @media screen and (max-width: 768px) {
  236. .page-top {
  237. height: 46vw;
  238. @include themify($themes) {
  239. background: themed('h5-banner-doctor') no-repeat center;
  240. background-size: auto 46vw;
  241. }
  242. .logo {
  243. display: block;
  244. width: 14.8vw;
  245. height: 14.8vw;
  246. border-radius: 50%;
  247. background: #fff;
  248. }
  249. .name {
  250. font-size: 4vw;
  251. color: #fff;
  252. }
  253. }
  254. .page-content {
  255. position: relative;
  256. .search {
  257. position: absolute;
  258. left: 50%;
  259. top: 0;
  260. transform: translate(-50%, -50%);
  261. }
  262. .city {
  263. padding-top: 12vw;
  264. }
  265. .title {
  266. font-size: 3.4vw;
  267. color: #404040;
  268. span {
  269. @include themify($themes) {
  270. color: themed('color');
  271. }
  272. }
  273. }
  274. .list {
  275. display: flex;
  276. align-items: center;
  277. flex-direction: column;
  278. .section {
  279. width: 93.6vw;
  280. background-color: #f3f5f6;
  281. border-radius: 4px;
  282. box-sizing: border-box;
  283. padding: 3.2vw;
  284. .cover {
  285. display: block;
  286. width: 21.6vw;
  287. height: 21.6vw;
  288. }
  289. .info {
  290. position: relative;
  291. margin-left: 3.2vw;
  292. .name {
  293. font-size: 4vw;
  294. color: #101010;
  295. font-weight: bold;
  296. margin-bottom: 0.8vw;
  297. text-overflow: ellipsis;
  298. white-space: nowrap;
  299. overflow: hidden;
  300. }
  301. .tag,
  302. .code,
  303. .club-name {
  304. width: 62vw;
  305. height: 5vw;
  306. position: relative;
  307. font-size: 3vw;
  308. color: #999;
  309. line-height: 5vw;
  310. text-overflow: ellipsis;
  311. white-space: nowrap;
  312. overflow: hidden;
  313. span {
  314. color: #333;
  315. }
  316. }
  317. .tag {
  318. color: #909399;
  319. }
  320. }
  321. }
  322. }
  323. }
  324. }
  325. </style>