index.vue 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. <template>
  2. <div class="page">
  3. <div class="page-top"></div>
  4. <div class="page-content">
  5. <div class="title">专业美容培训师</div>
  6. <div class="list">
  7. <div
  8. class="section flex items-center"
  9. v-for="item in list"
  10. :key="item.doctorId"
  11. >
  12. <img class="cover" :src="item.doctorImage" />
  13. <div class="info">
  14. <div class="name">{{ item.doctorName }}<i /></div>
  15. <div class="tag">{{ item.tagList.join(' | ') }}</div>
  16. <div class="more" @click="toDetail(item)">点击查看</div>
  17. </div>
  18. </div>
  19. </div>
  20. <!-- 列表为空 -->
  21. <SimpleEmpty
  22. v-if="!total && !isRequest"
  23. description="敬请期待~"
  24. ></SimpleEmpty>
  25. <!-- 页码 -->
  26. <SimplePagination
  27. themeType="black"
  28. v-if="total > listQuery.pageSize"
  29. :total="total"
  30. :pageItems="listQuery.pageSize"
  31. @change="onPagiantionChange"
  32. ></SimplePagination>
  33. </div>
  34. </div>
  35. </template>
  36. <script>
  37. import { mapGetters } from 'vuex'
  38. export default {
  39. layout: 'app-ldm',
  40. data() {
  41. return {
  42. isRequest: false,
  43. listQuery: {
  44. authUserId: '',
  45. doctorType: 2,
  46. doctorName: '',
  47. pageNum: 1,
  48. pageSize: 10,
  49. },
  50. list: [],
  51. total: 0,
  52. }
  53. },
  54. computed: {
  55. ...mapGetters(['supplierInfo', 'authUserId']),
  56. },
  57. mounted() {
  58. this.fetchList()
  59. },
  60. methods: {
  61. async fetchList() {
  62. try {
  63. this.listQuery.authUserId = this.authUserId
  64. const res = await this.$http.api.fetchDoctorList(this.listQuery)
  65. this.list = res.data.list
  66. this.total = res.data.total
  67. } catch (error) {
  68. console.log(error)
  69. } finally {
  70. this.isRequest = false
  71. }
  72. },
  73. // 搜索
  74. onSearch() {
  75. this.listQuery.pageNum = 1
  76. this.fetchList()
  77. },
  78. // 页码变化
  79. onPagiantionChange(index) {
  80. this.listQuery.pageNum = index
  81. this.fetchList()
  82. },
  83. // 医师详情
  84. toDetail(item) {
  85. localStorage.setItem('doctorInfo', JSON.stringify(item))
  86. const authUserId = this.$store.getters.authUserId
  87. this.$router.push(`/${authUserId}/ldm/approve/personnel/training/detail`)
  88. },
  89. },
  90. }
  91. </script>
  92. <style scoped lang="scss">
  93. @media screen and (min-width: 768px) {
  94. .page-top {
  95. height: 596px;
  96. background: url(https://static.caimei365.com/www/authentic/pc/ldm-bg-training-doctor.png)
  97. no-repeat center;
  98. background-size: auto 596px;
  99. }
  100. .page-content {
  101. width: 838px;
  102. margin: 0 auto;
  103. overflow: hidden;
  104. .title {
  105. font-size: 22px;
  106. color: #221815;
  107. padding-top: 112px;
  108. }
  109. .list {
  110. display: flex;
  111. align-items: center;
  112. justify-content: space-between;
  113. flex-wrap: wrap;
  114. margin-top: 27px;
  115. .section {
  116. width: 407px;
  117. padding: 14px;
  118. background: #f1f1f1;
  119. border-radius: 20px;
  120. box-sizing: border-box;
  121. margin-bottom: 25px;
  122. .cover {
  123. display: block;
  124. width: 92px;
  125. height: 92px;
  126. border-radius: 17px;
  127. }
  128. .info {
  129. position: relative;
  130. flex: 1;
  131. margin-left: 25px;
  132. .name {
  133. font-size: 28px;
  134. color: #000;
  135. text-overflow: ellipsis;
  136. overflow: hidden;
  137. white-space: nowrap;
  138. i {
  139. font-size: 0;
  140. display: inline-block;
  141. background: url(https://static.caimei365.com/www/authentic/pc/ldm-icon-star.png)
  142. no-repeat left center;
  143. padding-left: 13px;
  144. vertical-align: 2px;
  145. margin-left: 7px;
  146. &::after,
  147. &::before {
  148. display: inline-block;
  149. content: '';
  150. width: 13px;
  151. height: 13px;
  152. background: url(https://static.caimei365.com/www/authentic/pc/ldm-icon-star.png)
  153. no-repeat center;
  154. vertical-align: middle;
  155. margin-left: 4px;
  156. }
  157. }
  158. }
  159. .tag {
  160. width: 190px;
  161. font-size: 10px;
  162. color: #221815;
  163. text-overflow: ellipsis;
  164. overflow: hidden;
  165. white-space: nowrap;
  166. margin-top: 12px;
  167. }
  168. .more {
  169. position: absolute;
  170. bottom: 0;
  171. right: 0;
  172. font-size: 12px;
  173. color: #0080ed;
  174. cursor: pointer;
  175. &::after {
  176. content: '>';
  177. margin-left: 8px;
  178. }
  179. }
  180. }
  181. }
  182. }
  183. }
  184. }
  185. @media screen and (max-width: 768px) {
  186. .page-top {
  187. height: 59.6vw;
  188. background: url(https://static.caimei365.com/www/authentic/h5/ldm-bg-training-doctor.png);
  189. background-size: auto 59.6vw;
  190. }
  191. .page-content {
  192. .title {
  193. font-size: 3.6vw;
  194. color: #221815;
  195. padding-left: 5.6vw;
  196. padding-top: 9.8vw;
  197. }
  198. .list {
  199. display: flex;
  200. flex-direction: column;
  201. align-items: center;
  202. margin-top: 6vw;
  203. .section {
  204. width: 95vw;
  205. padding: 3.2vw;
  206. background: #f1f1f1;
  207. border-radius: 2vw;
  208. box-sizing: border-box;
  209. margin-bottom: 4.8vw;
  210. .cover {
  211. display: block;
  212. width: 21.5vw;
  213. height: 21.5vw;
  214. border-radius: 1.7vw;
  215. }
  216. .info {
  217. position: relative;
  218. flex: 1;
  219. margin-left: 2.7vw;
  220. .name {
  221. font-size: 6.6vw;
  222. color: #000;
  223. text-overflow: ellipsis;
  224. overflow: hidden;
  225. white-space: nowrap;
  226. i {
  227. font-size: 0;
  228. display: inline-block;
  229. background: url(https://static.caimei365.com/www/authentic/h5/ldm-icon-star.png)
  230. no-repeat left center;
  231. padding-left: 3.2vw;
  232. vertical-align: 1vw;
  233. margin-left: 1.8vw;
  234. &::after,
  235. &::before {
  236. display: inline-block;
  237. content: '';
  238. width: 3.2vw;
  239. height: 3.2vw;
  240. background: url(https://static.caimei365.com/www/authentic/h5/ldm-icon-star.png)
  241. no-repeat center;
  242. vertical-align: middle;
  243. margin-left: 0.9vw;
  244. }
  245. }
  246. }
  247. .tag {
  248. width: 46vw;
  249. font-size: 2.5vw;
  250. color: #221815;
  251. text-overflow: ellipsis;
  252. overflow: hidden;
  253. white-space: nowrap;
  254. margin-top: 1.2vw;
  255. }
  256. .more {
  257. position: absolute;
  258. bottom: 0;
  259. right: 0;
  260. font-size: 3vw;
  261. color: #0080ed;
  262. &::after {
  263. content: '>';
  264. margin-left: 1vw;
  265. }
  266. }
  267. }
  268. }
  269. }
  270. }
  271. }
  272. </style>