info.vue 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <template>
  2. <view style="padding: 10px;">
  3. <view class="item">
  4. <view class="form_group hr">
  5. <view class="lable l">微信头像</view>
  6. <view class="gg"><image :src="item.avatarUrl" class="header"></image></view>
  7. </view>
  8. <view class="form_group hr">
  9. <view class="lable">微信昵称</view>
  10. <view class="gg"><text v-text="item.nickName"></text></view>
  11. </view>
  12. <view class="form_group hr">
  13. <view class="lable">性别</view>
  14. <view class="gg">
  15. <text v-if="item.gender==1">男</text>
  16. <text v-if="item.gender==2">女</text>
  17. </view>
  18. </view>
  19. <view class="form_group hr">
  20. <view class="lable">地区</view>
  21. <view class="gg">{{item.province}} {{item.city}}</view>
  22. </view>
  23. <view class="form_group hr">
  24. <view class="lable">注册时间</view>
  25. <view class="gg"><text v-text="item.registerTime"></text></view>
  26. </view>
  27. <button class="btn" @click="exit()">退出登陆</button>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. item: {}
  36. };
  37. },
  38. onLoad() {
  39. this.item = this.$getUser();
  40. if (this.item.sex === 0) {
  41. this.item.sex = '未知';
  42. }
  43. if (this.item.sex === 1) {
  44. this.item.sex = '男';
  45. }
  46. if (this.item.sex === 2) {
  47. this.item.sex = '女';
  48. }
  49. },
  50. methods: {
  51. exit() {
  52. uni.showModal({
  53. title: '提示',
  54. content: '确定注销登录?',
  55. success: res => {
  56. if (res.confirm) {
  57. uni.removeStorageSync('user');
  58. uni.navigateBack();
  59. }
  60. }
  61. });
  62. }
  63. }
  64. };
  65. </script>
  66. <style>
  67. page {
  68. background-color: $page;
  69. }
  70. .item {
  71. background-color: white;
  72. }
  73. .l {
  74. line-height: 56px;
  75. }
  76. .gg {
  77. text-align: right;
  78. color: #868686;
  79. flex: 1;
  80. }
  81. .header {
  82. width: 50px;
  83. height: 50px;
  84. border-radius: 50%;
  85. }
  86. button {
  87. margin-top: 30px;
  88. }
  89. </style>