mine.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  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. console.log(getApp())
  55. getApp().$vm.exit()
  56. }
  57. }
  58. });
  59. }
  60. },
  61. computed: {
  62. userInfo() {
  63. return this.userStore.userInfo;
  64. }
  65. }
  66. }
  67. </script>
  68. <style scoped lang="scss">
  69. .mine {
  70. .content {
  71. height: 200rpx;
  72. display: flex;
  73. align-items: center;
  74. justify-content: space-between;
  75. padding: 20rpx;
  76. .info-item {
  77. display: flex;
  78. align-items: flex-start;
  79. flex-direction: column;
  80. padding-left: 40rpx;
  81. flex: 1;
  82. .info-primary {
  83. display: flex;
  84. align-items: center;
  85. .info-username {
  86. font-size: 40rpx;
  87. font-weight: 600;
  88. }
  89. .icon-man {
  90. color: darkblue;
  91. }
  92. .icon-girl {
  93. color: darkred;
  94. }
  95. }
  96. }
  97. .info-arrow {
  98. width: 50rpx;
  99. font-size: 30rpx;
  100. font-weight: 600;
  101. }
  102. }
  103. .line {
  104. margin: 20rpx;
  105. border-bottom: 1px solid #aaaaaa;
  106. }
  107. .btn-group {
  108. margin: 100rpx;
  109. .btn {
  110. margin-top: 20rpx;
  111. }
  112. }
  113. }
  114. </style>