userInfo.vue 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <template>
  2. <view class="content">
  3. <view class="row1">
  4. <text class="tit">头像</text>
  5. <view class="background-img"><image class="background-img" v-model="avatar" :src="avatar" mode="aspectFill"></image></view>
  6. </view>
  7. <view class="row">
  8. <text class="tit">家长</text>
  9. <input class="input" type="text" v-model="patriarch" placeholder-class="placeholder" />
  10. </view>
  11. <view class="row">
  12. <text class="tit">学生</text>
  13. <input class="input" type="text" v-model="student" placeholder-class="placeholder" />
  14. </view>
  15. <view class="row">
  16. <text class="tit">手机号</text>
  17. <input class="input" type="text" v-model="phone" placeholder-class="placeholder" />
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import { mapState } from 'vuex';
  23. export default{
  24. data(){
  25. return{
  26. avatar: '',
  27. patriarch: '',
  28. student: '',
  29. phone: ''
  30. }
  31. },
  32. computed: {
  33. ...mapState('user', ['userInfo'])
  34. },
  35. onShow(option) {
  36. // 获取生日日期
  37. this.patriarch = this.userInfo.real_name || '';
  38. this.avatar = this.userInfo.avatar || '';
  39. this.phone = this.userInfo.phone || '';
  40. },
  41. }
  42. </script>
  43. <style lang="scss">
  44. .row1 {
  45. display: flex;
  46. align-items: center;
  47. justify-content: space-between;
  48. position: relative;
  49. padding: 0 30upx;
  50. height: 110upx;
  51. background: #fff;
  52. margin-bottom: 20upx;
  53. .tit {
  54. flex-shrink: 0;
  55. width: 120upx;
  56. font-size: $font-lg;
  57. color: $font-color-dark;
  58. }
  59. .background-img {
  60. width: 80rpx;
  61. height: 80rpx;
  62. border-radius: 50%;
  63. background: #f2f2f2;
  64. }
  65. }
  66. .row {
  67. display: flex;
  68. align-items: center;
  69. justify-content: space-between;
  70. position: relative;
  71. padding: 0 30upx;
  72. height: 110upx;
  73. background: #fff;
  74. .tit {
  75. flex-shrink: 0;
  76. width: 120upx;
  77. font-size: $font-lg;
  78. color: $font-color-dark;
  79. }
  80. .tit1 {
  81. flex-shrink: 0;
  82. width: 150upx;
  83. font-size: $font-lg;
  84. color: $font-color-dark;
  85. }
  86. .input {
  87. flex: 1;
  88. font-size: $font-base;
  89. color: $color-gray;
  90. }
  91. }
  92. </style>