detail.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  1. <template>
  2. <div class="page">
  3. <div class="page-title">专业美容培训师</div>
  4. <div class="page-top">
  5. <div class="swiper">
  6. <SimpleSwiper :imageList="doctorInfo.bannerList"></SimpleSwiper>
  7. </div>
  8. </div>
  9. <div class="page-content">
  10. <div class="doctor-info">
  11. <div class="name">{{ doctorInfo.doctorName }}<i /></div>
  12. <div class="tag">{{ doctorInfo.tagList.join(' | ') }}</div>
  13. </div>
  14. <div class="param-list">
  15. <div
  16. class="param"
  17. v-for="(param, index) in doctorInfo.paramList"
  18. :key="index"
  19. >
  20. <div class="name" v-text="param.name"></div>
  21. <div class="content" v-text="param.content"></div>
  22. </div>
  23. </div>
  24. </div>
  25. </div>
  26. </template>
  27. <script>
  28. export default {
  29. layout: 'app-ldm',
  30. data() {
  31. return {
  32. doctorId: '',
  33. doctorInfo: {
  34. tagList: [],
  35. paramList: [],
  36. },
  37. }
  38. },
  39. mounted() {
  40. this.initData()
  41. },
  42. methods: {
  43. initData() {
  44. this.doctorId = parseInt(this.$route.query.id)
  45. this.fetchDetail()
  46. },
  47. async fetchDetail() {
  48. try {
  49. const res = await this.$http.api.fetchDoctorDetail({
  50. doctorId: this.doctorId,
  51. })
  52. this.doctorInfo = res.data
  53. } catch (error) {
  54. console.log(error)
  55. }
  56. if (this.doctorInfo.bannerList.length <= 0) {
  57. this.doctorInfo.bannerList.push('/placeholder.png')
  58. }
  59. },
  60. },
  61. }
  62. </script>
  63. <style scoped lang="scss">
  64. @media screen and (min-width: 768px) {
  65. .page {
  66. position: relative;
  67. display: flex;
  68. justify-content: space-between;
  69. width: 1016px;
  70. margin: 0 auto;
  71. padding-top: 117px;
  72. }
  73. .page-title {
  74. position: absolute;
  75. left: 0;
  76. top: 60px;
  77. font-size: 26px;
  78. color: #221815;
  79. }
  80. .page-top {
  81. .swiper {
  82. width: 452px;
  83. height: 452px;
  84. background: #f7f7f7;
  85. ::v-deep {
  86. img {
  87. width: 452px;
  88. height: 452px;
  89. }
  90. }
  91. }
  92. }
  93. .page-content {
  94. width: 503px;
  95. .doctor-info {
  96. padding-bottom: 30px;
  97. .name {
  98. font-size: 35px;
  99. font-weight: bold;
  100. color: #000;
  101. margin-bottom: 22px;
  102. i {
  103. font-size: 0;
  104. display: inline-block;
  105. background: url(https://static.caimei365.com/www/authentic/pc/ldm-icon-star.png)
  106. no-repeat left center;
  107. padding-left: 13px;
  108. vertical-align: 2px;
  109. margin-left: 7px;
  110. &::after,
  111. &::before {
  112. display: inline-block;
  113. content: '';
  114. width: 13px;
  115. height: 13px;
  116. background: url(https://static.caimei365.com/www/authentic/pc/ldm-icon-star.png)
  117. no-repeat center;
  118. vertical-align: middle;
  119. margin-left: 4px;
  120. }
  121. }
  122. }
  123. .tag {
  124. font-size: 16px;
  125. color: #221815;
  126. }
  127. }
  128. .param-list {
  129. .param {
  130. padding: 24px 0;
  131. min-height: 160px;
  132. box-sizing: border-box;
  133. border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  134. &:first-child {
  135. border-top: 1px solid rgba(0, 0, 0, 0.3);
  136. }
  137. .name {
  138. font-size: 18px;
  139. font-weight: bold;
  140. color: #000;
  141. }
  142. .content {
  143. font-size: 16px;
  144. color: #9c9c9c;
  145. margin-top: 12px;
  146. text-align: justify;
  147. line-height: 1.6;
  148. }
  149. }
  150. }
  151. }
  152. }
  153. @media screen and (max-width: 768px) {
  154. .page-top {
  155. .swiper {
  156. height: 100vw;
  157. background: #f7f7f7;
  158. ::v-deep {
  159. img {
  160. height: 100vw;
  161. }
  162. }
  163. }
  164. }
  165. .page-title {
  166. display: none;
  167. }
  168. .page-content {
  169. padding: 4.7vw 6.2vw;
  170. .doctor-info {
  171. padding-bottom: 6vw;
  172. .name {
  173. font-size: 6.2vw;
  174. font-weight: bold;
  175. color: #000;
  176. margin-bottom: 3.2vw;
  177. i {
  178. font-size: 0;
  179. display: inline-block;
  180. background: url(https://static.caimei365.com/www/authentic/h5/ldm-icon-star.png)
  181. no-repeat left center;
  182. padding-left: 3.2vw;
  183. vertical-align: 1vw;
  184. margin-left: 1.8vw;
  185. &::after,
  186. &::before {
  187. display: inline-block;
  188. content: '';
  189. width: 3.2vw;
  190. height: 3.2vw;
  191. background: url(https://static.caimei365.com/www/authentic/h5/ldm-icon-star.png)
  192. no-repeat center;
  193. vertical-align: middle;
  194. margin-left: 0.9vw;
  195. }
  196. }
  197. }
  198. .tag {
  199. font-size: 3vw;
  200. color: #221815;
  201. }
  202. }
  203. .param-list {
  204. .param {
  205. padding: 6vw 0;
  206. border-bottom: 0.1vw solid rgba(0, 0, 0, 0.3);
  207. &:first-child {
  208. border-top: 0.1vw solid rgba(0, 0, 0, 0.3);
  209. }
  210. .name {
  211. font-size: 3.2vw;
  212. font-weight: bold;
  213. color: #000;
  214. }
  215. .content {
  216. font-size: 3vw;
  217. color: #9c9c9c;
  218. margin-top: 1.6vw;
  219. text-align: justify;
  220. line-height: 1.7;
  221. }
  222. }
  223. }
  224. }
  225. }
  226. </style>