index.vue 7.1 KB

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