detail.vue 5.2 KB

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