userInfo.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <view class="page">
  3. <uni-nav-bar :fixed="true" background-color="#FFE05C" :border="false" :statusBar="true" left-icon="left" title="个人信息" @clickLeft="back" />
  4. <view class="outView">
  5. <form>
  6. <view class="flex-row justify-between bordBot" >
  7. <view class="key flex-col justify-center ">
  8. <text>头像</text>
  9. </view>
  10. <view class="photoView">
  11. <image class="photoImage" :src="userInfo.avatarUrl || '/static/ud4.png'"></image>
  12. </view>
  13. </view>
  14. <view class="flex-row justify-between bordBot" >
  15. <view class="key flex-col justify-center ">
  16. <text>姓名</text>
  17. </view>
  18. <view class="nikeName flex-col justify-center">
  19. <input disabled type="nickname" name="nickname" v-model="userInfo.name" placeholder="请输入昵称"/>
  20. </view>
  21. </view>
  22. <view class="flex-row justify-between bordBot" >
  23. <view class="key flex-col justify-center ">
  24. <text>性别</text>
  25. </view>
  26. <view class="flex-row justify-end groupItemContent">
  27. <text v-if="userInfo.sex == 0">男</text>
  28. <text v-else-if="userInfo.sex == 1">女</text>
  29. <text v-else>未知</text>
  30. <!-- <u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
  31. </view>
  32. </view>
  33. <view class="flex-row justify-between bordBot" >
  34. <view class="key flex-col justify-center ">
  35. <text>手机号</text>
  36. </view>
  37. <view class="flex-row justify-end groupItemContent" @click="settingTelphone">
  38. <text>{{userInfo.phonenumber? userInfo.phonenumber : '' }}</text>
  39. <!-- <u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
  40. </view>
  41. </view>
  42. <!-- <view class="flex-row justify-between bordBot" >-->
  43. <!-- <view class="key flex-col justify-center ">-->
  44. <!-- <text>修改密码</text>-->
  45. <!-- </view>-->
  46. <!-- <view class="flex-row justify-end groupItemContent " @click="updatePassword">-->
  47. <!-- <text>点击修改</text>-->
  48. <!-- <u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
  49. <!-- </view>-->
  50. <!-- </view>-->
  51. </form>
  52. </view>
  53. <view class="logoutButton">
  54. <u-button type="error" text="退出登录" @click="logout"></u-button>
  55. </view>
  56. </view>
  57. </template>
  58. <script>
  59. export default {
  60. data() {
  61. return {
  62. photoUrl:'',
  63. userInfo: {},
  64. genderIndex:0,
  65. genderList: [{gender:'男',id:'0'},
  66. {gender:'女',id:'1'},
  67. {gender:'未知',id:'2'}],
  68. };
  69. },
  70. mounted() {
  71. },
  72. onShow() {
  73. // 用户信息
  74. this.userInfo = uni.getStorageSync('userInfo')
  75. console.log(this.userInfo)
  76. },
  77. methods: {
  78. updatePassword(){
  79. uni.navigateTo({
  80. url:'/pages/updatePassword/updatePassword'
  81. })
  82. },
  83. back() {
  84. uni.navigateBack({
  85. delta: 1
  86. })
  87. },
  88. logout(){
  89. this.$api.login.logout().then(res=>{
  90. uni.clearStorageSync();
  91. uni.navigateTo({
  92. url:'/pages/login/login'
  93. })
  94. })
  95. }
  96. }
  97. };
  98. </script>
  99. <style lang="scss">
  100. @import './index.rpx.css';
  101. </style>