1
0

userInfo.vue 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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="navigateTo('/pages/humanFace/humanFace')">
  47. <text>{{userInfo.techFaceId?'已上传':'未上传'}}</text>
  48. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  49. </view>
  50. </view>
  51. <view class="flex-row justify-between bordBot" >
  52. <view class="key flex-col justify-center ">
  53. <text>修改密码</text>
  54. </view>
  55. <view class="flex-row justify-end groupItemContent " @click="navigateTo('/pages/updatePassword/updatePassword')">
  56. <text>点击修改</text>
  57. <u-icon name="arrow-right" color="#666" size="18"></u-icon>
  58. </view>
  59. </view>
  60. </form>
  61. </view>
  62. <view class="logoutButton">
  63. <u-button type="error" text="退出登录" @click="logout"></u-button>
  64. </view>
  65. </view>
  66. </template>
  67. <script>
  68. export default {
  69. data() {
  70. return {
  71. photoUrl:'',
  72. userInfo: {},
  73. genderIndex:0,
  74. genderList: [{gender:'男',id:'0'},
  75. {gender:'女',id:'1'},
  76. {gender:'未知',id:'2'}],
  77. };
  78. },
  79. mounted() {
  80. },
  81. onShow() {
  82. // 用户信息
  83. this.userInfo = uni.getStorageSync('userInfo')
  84. console.log(this.userInfo)
  85. },
  86. methods: {
  87. navigateTo(url){
  88. uni.navigateTo({
  89. url:url
  90. })
  91. },
  92. back() {
  93. uni.navigateBack({
  94. delta: 1
  95. })
  96. },
  97. logout(){
  98. this.$api.login.logout().then(res=>{
  99. uni.removeStorageSync('accessToken');
  100. uni.removeStorageSync('userInfo');
  101. uni.navigateTo({
  102. url:'/pages/login/login'
  103. })
  104. })
  105. }
  106. }
  107. };
  108. </script>
  109. <style lang="scss">
  110. @import './index.rpx.css';
  111. </style>