index.vue 6.9 KB

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