mine.vue 2.8 KB

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