userInfo.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.selfPhotoUrl || '/static/logo.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.nickName" 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-if="userInfo.sex == 2">未知</text>
  30. <text v-else>请选择性别</text>
  31. <!-- <u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
  32. </view>
  33. </view>
  34. <view class="flex-row justify-between bordBot" >
  35. <view class="key flex-col justify-center ">
  36. <text>手机号</text>
  37. </view>
  38. <view class="flex-row justify-end groupItemContent" @click="settingTelphone">
  39. <text>{{userInfo.phonenumber? userInfo.phonenumber : '' }}</text>
  40. <!-- <u-icon name="arrow-right" color="#666" size="18"></u-icon>-->
  41. </view>
  42. </view>
  43. </form>
  44. </view>
  45. <u-button class="logoutButton" type="error" text="退出登录" @click="logout"></u-button>
  46. </view>
  47. </template>
  48. <script>
  49. export default {
  50. data() {
  51. return {
  52. photoUrl:'',
  53. userInfo: {},
  54. genderIndex:0,
  55. genderList: [{gender:'男',id:'0'},
  56. {gender:'女',id:'1'},
  57. {gender:'未知',id:'2'}],
  58. };
  59. },
  60. mounted() {
  61. },
  62. onShow() {
  63. // 用户信息
  64. this.userInfo = uni.getStorageSync('userInfo')
  65. console.log(this.userInfo)
  66. },
  67. methods: {
  68. back() {
  69. uni.navigateBack({
  70. delta: 1
  71. })
  72. },
  73. logout(){
  74. this.$api.login.logout().then(res=>{
  75. uni.clearStorageSync();
  76. uni.navigateTo({
  77. url:'/pages/login/login'
  78. })
  79. })
  80. }
  81. }
  82. };
  83. </script>
  84. <style lang="scss">
  85. @import './index.rpx.css';
  86. </style>