mine.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. <template>
  2. <view class="page mine">
  3. <view class="content" @click="onModifyInfo()">
  4. <view class="avatar">
  5. <image class="head-image" :src="userInfo.headImage" lazy-load="true" mode="aspectFill"></image>
  6. </view>
  7. <view class="info-item">
  8. <view class="info-primary">
  9. <text class="info-username">
  10. {{userInfo.userName}}
  11. </text>
  12. <text v-show="userInfo.sex==0" class="iconfont icon-man"
  13. color="darkblue"></text>
  14. <text v-show="userInfo.sex==1" class="iconfont icon-girl"
  15. color="darkred"></text>
  16. </view>
  17. <text>
  18. 昵称 :{{userInfo.nickName}}
  19. </text>
  20. <text>
  21. 签名 :{{userInfo.signature}}
  22. </text>
  23. </view>
  24. <view class="info-arrow">></view>
  25. </view>
  26. <view class="line"></view>
  27. <view class="btn-group">
  28. <button class="btn" type="primary" @click="onModifyPassword()">修改密码</button>
  29. <button class="btn" type="warn" @click="onQuit()">退出</button>
  30. </view>
  31. </view>
  32. </template>
  33. <script>
  34. export default {
  35. data() {
  36. return {}
  37. },
  38. methods: {
  39. onModifyInfo() {
  40. uni.navigateTo({
  41. url: "/pages/mine/mine-edit"
  42. })
  43. },
  44. onModifyPassword() {
  45. uni.navigateTo({
  46. url: "/pages/mine/mine-password"
  47. })
  48. },
  49. onQuit() {
  50. uni.showModal({
  51. title: '确认退出?',
  52. success: (res) => {
  53. if (res.confirm) {
  54. getApp().exit()
  55. }
  56. }
  57. });
  58. }
  59. },
  60. computed: {
  61. userInfo() {
  62. return this.$store.state.userStore.userInfo;
  63. }
  64. }
  65. }
  66. </script>
  67. <style scoped lang="scss">
  68. .mine {
  69. .content {
  70. height: 200rpx;
  71. display: flex;
  72. align-items: center;
  73. justify-content: space-between;
  74. padding: 20rpx;
  75. .avatar {
  76. display: flex;
  77. justify-content: center;
  78. align-items: center;
  79. width: 160rpx;
  80. height: 160rpx;
  81. .head-image {
  82. width: 100%;
  83. height: 100%;
  84. border-radius: 10%;
  85. }
  86. }
  87. .info-item {
  88. display: flex;
  89. align-items: flex-start;
  90. flex-direction: column;
  91. padding-left: 40rpx;
  92. flex: 1;
  93. .info-primary {
  94. display: flex;
  95. align-items: center;
  96. .info-username {
  97. font-size: 40rpx;
  98. font-weight: 600;
  99. }
  100. .icon-man {
  101. color: darkblue;
  102. }
  103. .icon-girl {
  104. color: darkred;
  105. }
  106. }
  107. }
  108. .info-arrow {
  109. width: 50rpx;
  110. font-size: 30rpx;
  111. font-weight: 600;
  112. }
  113. }
  114. .line {
  115. margin: 20rpx;
  116. border-bottom: 1px solid #aaaaaa;
  117. }
  118. .btn-group {
  119. margin: 100rpx;
  120. .btn {
  121. margin-top: 20rpx;
  122. }
  123. }
  124. }
  125. </style>