info.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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">
  13. <view class="lable">注册时间</view>
  14. <view class="gg"><text v-text="item.registerTime"></text></view>
  15. </view>
  16. </view>
  17. <button class="btn" @click="exit()">退出登录</button>
  18. </view>
  19. </template>
  20. <script>
  21. export default {
  22. data() {
  23. return {
  24. item: {}
  25. };
  26. },
  27. onLoad() {
  28. this.item = this.$getUser();
  29. },
  30. methods: {
  31. exit() {
  32. uni.showModal({
  33. title: '提示',
  34. content: '确定退出登录?',
  35. success: res => {
  36. if (res.confirm) {
  37. uni.removeStorageSync('user');
  38. uni.navigateBack();
  39. }
  40. }
  41. });
  42. }
  43. }
  44. };
  45. </script>
  46. <style>
  47. .item {
  48. background-color: white;
  49. padding: 10px;
  50. border-radius: 5px;
  51. box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
  52. }
  53. .l {
  54. line-height: 56px;
  55. }
  56. .gg {
  57. text-align: right;
  58. color: #868686;
  59. flex: 1;
  60. }
  61. .header {
  62. width: 50px;
  63. height: 50px;
  64. border-radius: 50%;
  65. }
  66. button {
  67. margin-top: 30px;
  68. }
  69. </style>