detail.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231
  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-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. i {
  99. font-size: 0;
  100. display: inline-block;
  101. background: url(https://static.caimei365.com/www/authentic/pc/ldm-icon-star.png)
  102. no-repeat left center;
  103. padding-left: 13px;
  104. vertical-align: 2px;
  105. margin-left: 7px;
  106. &::after,
  107. &::before {
  108. display: inline-block;
  109. content: '';
  110. width: 13px;
  111. height: 13px;
  112. background: url(https://static.caimei365.com/www/authentic/pc/ldm-icon-star.png)
  113. no-repeat center;
  114. vertical-align: middle;
  115. margin-left: 4px;
  116. }
  117. }
  118. }
  119. .tag {
  120. font-size: 16px;
  121. color: #221815;
  122. }
  123. }
  124. .param-list {
  125. .param {
  126. padding: 32px 0;
  127. border-bottom: 1px solid rgba(0, 0, 0, 0.3);
  128. &:first-child {
  129. border-top: 1px solid rgba(0, 0, 0, 0.3);
  130. }
  131. .name {
  132. font-size: 18px;
  133. font-weight: bold;
  134. color: #000;
  135. }
  136. .content {
  137. font-size: 16px;
  138. color: #9c9c9c;
  139. margin-top: 12px;
  140. text-align: justify;
  141. line-height: 1.7;
  142. }
  143. }
  144. }
  145. }
  146. }
  147. @media screen and (max-width: 768px) {
  148. .page-top {
  149. .swiper {
  150. width: 100vw;
  151. height: 100vw;
  152. background-color: pink;
  153. }
  154. }
  155. .page-title {
  156. display: none;
  157. }
  158. .page-content {
  159. padding: 4.7vw 6.2vw;
  160. .doctor-info {
  161. padding-bottom: 6vw;
  162. .name {
  163. font-size: 6.2vw;
  164. font-weight: bold;
  165. color: #000;
  166. margin-bottom: 3.2vw;
  167. i {
  168. font-size: 0;
  169. display: inline-block;
  170. background: url(https://static.caimei365.com/www/authentic/h5/ldm-icon-star.png)
  171. no-repeat left center;
  172. padding-left: 3.2vw;
  173. vertical-align: 1vw;
  174. margin-left: 1.8vw;
  175. &::after,
  176. &::before {
  177. display: inline-block;
  178. content: '';
  179. width: 3.2vw;
  180. height: 3.2vw;
  181. background: url(https://static.caimei365.com/www/authentic/h5/ldm-icon-star.png)
  182. no-repeat center;
  183. vertical-align: middle;
  184. margin-left: 0.9vw;
  185. }
  186. }
  187. }
  188. .tag {
  189. font-size: 3vw;
  190. color: #221815;
  191. }
  192. }
  193. .param-list {
  194. .param {
  195. padding: 6vw 0;
  196. border-bottom: 0.1vw solid rgba(0, 0, 0, 0.3);
  197. &:first-child {
  198. border-top: 0.1vw solid rgba(0, 0, 0, 0.3);
  199. }
  200. .name {
  201. font-size: 3.2vw;
  202. font-weight: bold;
  203. color: #000;
  204. }
  205. .content {
  206. font-size: 3vw;
  207. color: #9c9c9c;
  208. margin-top: 1.6vw;
  209. text-align: justify;
  210. line-height: 1.7;
  211. }
  212. }
  213. }
  214. }
  215. }
  216. </style>