mine.vue 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <template>
  2. <view class="page mine">
  3. <nav-bar>我的</nav-bar>
  4. <uni-card :is-shadow="false" is-full :border="false">
  5. <view class="content" @click="onModifyInfo()">
  6. <head-image :name="userInfo.nickName" :url="userInfo.headImage" :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" color="darkblue"></text>
  13. <text v-show="userInfo.sex == 1" class="iconfont icon-girl" color="darkred"></text>
  14. </view>
  15. <view class="info-text">
  16. <text class="label-text">
  17. 昵称:
  18. </text>
  19. <text class="content-text">
  20. {{ userInfo.nickName }}
  21. </text>
  22. </view>
  23. <view class="info-text">
  24. <view>
  25. <text class="label-text">
  26. 签名:
  27. </text>
  28. <text class="content-text">
  29. {{ userInfo.signature }}
  30. </text>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. </uni-card>
  36. <bar-group>
  37. <arrow-bar title="修改密码" icon="icon-modify-pwd" @tap="onModifyPassword()"></arrow-bar>
  38. </bar-group>
  39. <bar-group>
  40. <btn-bar title="退出登录" type="danger" @tap="onQuit()"></btn-bar>
  41. </bar-group>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. data() {
  47. return {}
  48. },
  49. methods: {
  50. onModifyInfo() {
  51. uni.navigateTo({
  52. url: "/pages/mine/mine-edit"
  53. })
  54. },
  55. onModifyPassword() {
  56. uni.navigateTo({
  57. url: "/pages/mine/mine-password"
  58. })
  59. },
  60. onQuit() {
  61. uni.showModal({
  62. title: '确认退出?',
  63. success: (res) => {
  64. if (res.confirm) {
  65. console.log(getApp())
  66. getApp().$vm.exit()
  67. }
  68. }
  69. });
  70. }
  71. },
  72. computed: {
  73. userInfo() {
  74. return this.userStore.userInfo;
  75. }
  76. }
  77. }
  78. </script>
  79. <style scoped lang="scss">
  80. .mine {
  81. .content {
  82. //height: 200rpx;
  83. display: flex;
  84. align-items: center;
  85. justify-content: space-between;
  86. padding: 20rpx;
  87. .info-item {
  88. display: flex;
  89. align-items: flex-start;
  90. flex-direction: column;
  91. padding-left: 40rpx;
  92. flex: 1;
  93. .info-text {
  94. line-height: 1.5;
  95. //margin-bottom: 10rpx;
  96. }
  97. .label-text {
  98. font-size: $im-font-size-small;
  99. color: $im-text-color-light;
  100. }
  101. .content-text {
  102. font-size: $im-font-size-small;
  103. color: $im-text-color-light;
  104. }
  105. .info-primary {
  106. display: flex;
  107. align-items: center;
  108. margin-bottom: 10rpx;
  109. .info-username {
  110. font-size: $im-font-size-large;
  111. font-weight: 600;
  112. }
  113. .icon-man {
  114. color: $im-text-color;
  115. font-size: $im-font-size-large;
  116. padding-left: 10rpx;
  117. }
  118. .icon-girl {
  119. color: darkred;
  120. }
  121. }
  122. }
  123. .info-arrow {
  124. width: 50rpx;
  125. font-size: 30rpx;
  126. position: relative;
  127. left: 30rpx;
  128. }
  129. }
  130. }
  131. </style>