detail.vue 5.0 KB

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