detail.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  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 }}</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-color: pink;
  87. }
  88. }
  89. .page-content {
  90. width: 503px;
  91. .doctor-info {
  92. padding-bottom: 35px;
  93. .name {
  94. font-size: 35px;
  95. font-weight: bold;
  96. color: #000;
  97. margin-bottom: 22px;
  98. &::after {
  99. content: '';
  100. display: inline-block;
  101. margin-left: 12px;
  102. width: 36px;
  103. height: 42px;
  104. background: url(https://static.caimei365.com/www/authentic/pc/ldm-icon-badge.png)
  105. no-repeat center;
  106. background-size: 36px 42px;
  107. vertical-align: -8px;
  108. }
  109. }
  110. .tag {
  111. font-size: 16px;
  112. color: #221815;
  113. }
  114. }
  115. .param-list {
  116. .param {
  117. padding: 32px 0;
  118. border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  119. &:first-child {
  120. border-top: 1px solid rgba(0, 0, 0, 0.3);
  121. }
  122. .name {
  123. font-size: 18px;
  124. font-weight: bold;
  125. color: #000;
  126. }
  127. .content {
  128. font-size: 16px;
  129. color: #9c9c9c;
  130. margin-top: 12px;
  131. text-align: justify;
  132. line-height: 1.7;
  133. }
  134. }
  135. }
  136. }
  137. }
  138. @media screen and (max-width: 768px) {
  139. .page-title {
  140. display: none;
  141. }
  142. .page-top {
  143. .swiper {
  144. width: 100vw;
  145. height: 100vw;
  146. background-color: pink;
  147. }
  148. }
  149. .page-content {
  150. padding: 4.7vw 6.2vw;
  151. .doctor-info {
  152. padding-bottom: 6vw;
  153. .name {
  154. font-size: 6.2vw;
  155. font-weight: bold;
  156. color: #000;
  157. margin-bottom: 3.2vw;
  158. &::after {
  159. content: '';
  160. display: inline-block;
  161. margin-left: 1.8vw;
  162. width: 6.5vw;
  163. height: 7.6vw;
  164. background: url(https://static.caimei365.com/www/authentic/h5/ldm-icon-badge.png)
  165. no-repeat center;
  166. background-size: 6.4vw 7.6vw;
  167. vertical-align: -1.4vw;
  168. }
  169. }
  170. .tag {
  171. font-size: 3vw;
  172. color: #221815;
  173. }
  174. }
  175. .param-list {
  176. .param {
  177. padding: 6vw 0;
  178. border-bottom: 0.1vw solid rgba(0, 0, 0, 0.3);
  179. &:first-child {
  180. border-top: 0.1vw solid rgba(0, 0, 0, 0.3);
  181. }
  182. .name {
  183. font-size: 3.2vw;
  184. font-weight: bold;
  185. color: #000;
  186. }
  187. .content {
  188. font-size: 3vw;
  189. color: #9c9c9c;
  190. margin-top: 1.6vw;
  191. text-align: justify;
  192. line-height: 1.7;
  193. }
  194. }
  195. }
  196. }
  197. }
  198. </style>