info.vue 1.7 KB

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