user.vue 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <!-- <view class="content">
  3. <view class="btn-row">
  4. <button type="default" @tap="bindLogout">退出登录</button>
  5. </view>
  6. </view> -->
  7. <view class="page-fill">
  8. <view class="header">
  9. <image src="../../static/icons/CpoxxFw_-5-AFyVyAABLIH8xBTw233.png" class="face"></image>
  10. <view class="info-wapper">
  11. <view class="nickname">
  12. 用户名:{{username}}
  13. </view>
  14. </view>
  15. <view>
  16. <button type="default" @tap="bindLogout" class="settings">退出</button>
  17. </view>
  18. </view>
  19. </view>
  20. </template>
  21. <script>
  22. import {
  23. mapState,
  24. mapMutations
  25. } from 'vuex'
  26. export default {
  27. data() {
  28. return {
  29. username: null,
  30. };
  31. },
  32. onShow() {
  33. var me = this;
  34. var username = uni.getStorageSync("username");
  35. me.username = username;
  36. },
  37. computed: {
  38. },
  39. methods: {
  40. bindLogout() {
  41. uni.reLaunch({
  42. url: '/pages/Login/Login',
  43. });
  44. }
  45. }
  46. }
  47. </script>
  48. <style>
  49. .page-fill {
  50. width: 100%;
  51. height: 100%;
  52. }
  53. .header {
  54. padding: 60upx 30upx 40upx 30upx;
  55. background-color: #ffd655;
  56. background: url(../../static/icons/CpoxxFwu_1OAYFAIAAAzO_Q1tPg693.png) repeat;
  57. display: flex;
  58. flex-direction: row;
  59. justify-content: flex-start;
  60. }
  61. .face {
  62. width: 120upx;
  63. height: 120upx;
  64. border-radius: 50%;
  65. flex-shrink: 0;
  66. }
  67. .info-wapper {
  68. width: 60%;
  69. margin-left: 40upx;
  70. display: flex;
  71. flex-direction: column;
  72. }
  73. .nickname {
  74. color: #6a5018;
  75. font-size: 12px;
  76. font-weight: bold;
  77. padding: 30upx 0upx 0upx 0upx;
  78. }
  79. .set-wapper {
  80. display: flex;
  81. flex-direction: row;
  82. justify-content: flex-end;
  83. width: 15%;
  84. }
  85. .settings {
  86. width: 160upx;
  87. height: 110upx;
  88. }
  89. </style>