index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331
  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. const url = `/${this.authUserId}/app/approve/personnel/operate/detail?id=${item.doctorId}`
  115. this.$router.push(url)
  116. },
  117. },
  118. }
  119. </script>
  120. <style scoped lang="scss">
  121. .page {
  122. position: relative;
  123. min-height: calc(100vh - 80px - 80px);
  124. background-color: #fff;
  125. }
  126. // pc 端
  127. @media screen and (min-width: 768px) {
  128. .page-top {
  129. height: 420px;
  130. background: url(https://static.caimei365.com/www/authentic/pc/bg-doctor.png)
  131. no-repeat center;
  132. background-size: auto 420px;
  133. .logo {
  134. display: block;
  135. width: 120px;
  136. height: 120px;
  137. border-radius: 50%;
  138. }
  139. .name {
  140. font-size: 30px;
  141. color: #fff;
  142. }
  143. .logo,
  144. .name {
  145. transform: translateY(-30px);
  146. }
  147. }
  148. .page-content {
  149. width: 1200px;
  150. margin: 0 auto;
  151. .search {
  152. position: absolute;
  153. left: 50%;
  154. top: 300px;
  155. transform: translateX(-50%);
  156. }
  157. .title {
  158. font-size: 16px;
  159. color: #404040;
  160. span {
  161. color: #bc1724;
  162. }
  163. }
  164. .list {
  165. display: flex;
  166. align-items: center;
  167. flex-wrap: wrap;
  168. justify-content: space-between;
  169. .empty {
  170. width: 390px;
  171. }
  172. .section {
  173. width: 390px;
  174. background-color: #f3f5f6;
  175. border-radius: 4px;
  176. box-sizing: border-box;
  177. padding: 12px;
  178. cursor: pointer;
  179. transition: all 0.4s;
  180. &:hover {
  181. box-shadow: 0 0 24px rgba(0, 0, 0, 0.2);
  182. }
  183. .cover {
  184. display: block;
  185. width: 84px;
  186. height: 84px;
  187. }
  188. .info {
  189. width: 270px;
  190. position: relative;
  191. margin-left: 12px;
  192. .name {
  193. font-size: 16px;
  194. color: #101010;
  195. font-weight: bold;
  196. text-overflow: ellipsis;
  197. white-space: nowrap;
  198. overflow: hidden;
  199. }
  200. .tag,
  201. .code,
  202. .club-name {
  203. height: 20px;
  204. position: relative;
  205. font-size: 14px;
  206. color: #404040;
  207. line-height: 20px;
  208. text-overflow: ellipsis;
  209. white-space: nowrap;
  210. overflow: hidden;
  211. span {
  212. color: #6d9eff;
  213. }
  214. }
  215. .tag {
  216. color: #909399;
  217. }
  218. }
  219. }
  220. }
  221. }
  222. }
  223. // 移动 端
  224. @media screen and (max-width: 768px) {
  225. .page-top {
  226. height: 46vw;
  227. background: url(https://static.caimei365.com/www/authentic/h5/bg-doctor.png);
  228. background-size: auto 46vw;
  229. .logo {
  230. display: block;
  231. width: 14.8vw;
  232. height: 14.8vw;
  233. border-radius: 50%;
  234. }
  235. .name {
  236. font-size: 4vw;
  237. color: #fff;
  238. }
  239. }
  240. .page-content {
  241. position: relative;
  242. .search {
  243. position: absolute;
  244. left: 50%;
  245. top: 0;
  246. transform: translate(-50%, -50%);
  247. }
  248. .city {
  249. padding-top: 12vw;
  250. }
  251. .title {
  252. font-size: 3.4vw;
  253. color: #404040;
  254. span {
  255. color: #bc1724;
  256. }
  257. }
  258. .list {
  259. display: flex;
  260. align-items: center;
  261. flex-direction: column;
  262. .section {
  263. width: 93.6vw;
  264. background-color: #f3f5f6;
  265. border-radius: 4px;
  266. box-sizing: border-box;
  267. padding: 3.2vw;
  268. .cover {
  269. display: block;
  270. width: 21.6vw;
  271. height: 21.6vw;
  272. }
  273. .info {
  274. position: relative;
  275. margin-left: 3.2vw;
  276. .name {
  277. font-size: 4vw;
  278. color: #101010;
  279. font-weight: bold;
  280. margin-bottom: 0.8vw;
  281. text-overflow: ellipsis;
  282. white-space: nowrap;
  283. overflow: hidden;
  284. }
  285. .tag,
  286. .code,
  287. .club-name {
  288. width: 62vw;
  289. height: 5vw;
  290. position: relative;
  291. font-size: 3vw;
  292. color: #404040;
  293. line-height: 5vw;
  294. text-overflow: ellipsis;
  295. white-space: nowrap;
  296. overflow: hidden;
  297. span {
  298. color: #6d9eff;
  299. }
  300. }
  301. .tag {
  302. color: #909399;
  303. }
  304. }
  305. }
  306. }
  307. }
  308. }
  309. </style>