index.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="user">
  5. <image :src="avatar" mode="widthFix" class="avatar" @error="onErrorImg"></image>
  6. <view class="name">
  7. <text>{{name}}</text>
  8. </view>
  9. <view class="tags">
  10. <text>{{tags}}</text>
  11. </view>
  12. </view>
  13. <view class="hospital">
  14. <text class="name">{{hospitalName}}</text>
  15. <text class="grade">{{hospitalGrade}}</text>
  16. </view>
  17. </view>
  18. <view class="specialty">
  19. <view class="specialty-head-wrap">
  20. <text class="specialty-head">专业特长</text>
  21. </view>
  22. <view class="specialty-message">{{specialty}}</view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. export default{
  28. data(){
  29. return{
  30. defaultAvatar:require('@/static/images/avatar.png'),
  31. avatar:'',
  32. name:"",
  33. tags:"",
  34. hospitalName:"",
  35. hospitalGrade:"",
  36. specialty:""
  37. }
  38. },
  39. created() {
  40. this.init()
  41. },
  42. methods:{
  43. init(){
  44. let doctor=uni.getStorageSync('doctor');
  45. this.avatar=doctor.headportrait;
  46. this.name=doctor.doctorname;
  47. this.tags=doctor.technicaltitle;
  48. this.hospitalName=doctor.hospitalName;
  49. this.hospitalGrade=doctor.hospitalGrade;
  50. this.specialty=doctor.begoodat;
  51. },
  52. onErrorImg() {
  53. this.avatar=this.defaultAvatar;
  54. }
  55. },
  56. destroyed() {
  57. uni.removeStorageSync('doctor');
  58. }
  59. }
  60. </script>
  61. <style lang="scss" scoped>
  62. .content{
  63. .top{
  64. &{
  65. padding:64upx 0 40upx 0;
  66. display: flex;
  67. justify-content: center;
  68. align-items: center;
  69. flex-direction: column;
  70. }
  71. .user{
  72. padding-top: 18upx;
  73. .avatar{
  74. display: block;
  75. width: 150upx;
  76. height: 150upx;
  77. border-radius: 50%;
  78. margin: 0 auto;
  79. background-color: #ccc;
  80. }
  81. .name{
  82. font-size: 32upx;
  83. color: #333333;
  84. text-align: center;
  85. }
  86. .tags{
  87. font-size: 28upx;
  88. color: #666666;
  89. text-align: center;
  90. }
  91. }
  92. }
  93. .hospital{
  94. padding-top: 12upx;
  95. .name{
  96. font-size: 22upx;
  97. color: #666666;
  98. }
  99. .grade{
  100. font-size: 18upx;
  101. color: #3384FF;
  102. padding-left: 10upx;
  103. }
  104. }
  105. .specialty{
  106. line-height: 40upx;
  107. padding:0 56upx;
  108. .specialty-head{
  109. color:#3384FF;
  110. position: relative;
  111. font-size: 30upx;
  112. font-weight: 600;
  113. &::after{
  114. width: 50%;
  115. height: 6upx;
  116. display: block;
  117. content: "";
  118. position: absolute;
  119. left: 50%;
  120. transform: translateX(-50%);
  121. bottom: -8upx;
  122. background-color:#FA6400;
  123. z-index: 999;
  124. }
  125. }
  126. .specialty-message{
  127. font-size: 22upx;
  128. color: #999;
  129. padding-top: 18upx;
  130. }
  131. }
  132. }
  133. </style>