mine.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="page mine">
  3. <view class="content" @click="onModifyInfo()">
  4. <head-image :name="userInfo.nickName"
  5. :url="userInfo.headImage"
  6. :size="160"></head-image>
  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. .info-item {
  76. display: flex;
  77. align-items: flex-start;
  78. flex-direction: column;
  79. padding-left: 40rpx;
  80. flex: 1;
  81. .info-primary {
  82. display: flex;
  83. align-items: center;
  84. .info-username {
  85. font-size: 40rpx;
  86. font-weight: 600;
  87. }
  88. .icon-man {
  89. color: darkblue;
  90. }
  91. .icon-girl {
  92. color: darkred;
  93. }
  94. }
  95. }
  96. .info-arrow {
  97. width: 50rpx;
  98. font-size: 30rpx;
  99. font-weight: 600;
  100. }
  101. }
  102. .line {
  103. margin: 20rpx;
  104. border-bottom: 1px solid #aaaaaa;
  105. }
  106. .btn-group {
  107. margin: 100rpx;
  108. .btn {
  109. margin-top: 20rpx;
  110. }
  111. }
  112. }
  113. </style>