index.vue 7.2 KB

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