user-info.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="flex-common-css bgc-f">
  3. <Nav title="个人资料" titleColor="#333" bgckgroundBox='#fff'></Nav>
  4. <scroll-view :scroll-y="true" class="scroll-view-css">
  5. <view class="user-img-box">
  6. <image class="user-img" :src="userInfoData.head_img" mode=""></image>
  7. <image @click="goToUrl(0)" class="set-iimg" src="@/static/img/my/pen.png" mode=""></image>
  8. </view>
  9. <view class="item-info-box box-border-box">
  10. <view class="item-box mb-32 flex-justify-space box-border-box">
  11. <view class="item-left fs-32 fc-3">
  12. 昵称
  13. </view>
  14. <view class="item-right align-items-center" @click="goToUrl(1)">
  15. <view class="fc-9198A2 fs-28 mr-6">
  16. {{userInfoData.nickname||''}}
  17. </view>
  18. <uni-icons color="#9198A2" type="right" size="20"></uni-icons>
  19. </view>
  20. </view>
  21. <view class="item-box mb-32 flex-justify-space box-border-box">
  22. <view class="item-left fs-32 fc-3">
  23. 性别
  24. </view>
  25. <view class="item-right align-items-center" @click="goToUrl(2)">
  26. <view v-if="userInfoData.sex == 0" class="fc-9198A2 fs-28 mr-6">保密</view>
  27. <view v-else-if="userInfoData.sex == 1" class="fc-9198A2 fs-28 mr-6">男</view>
  28. <view v-else class="fc-9198A2 fs-28 mr-6">女</view>
  29. <uni-icons color="#9198A2" type="right" size="20"></uni-icons>
  30. </view>
  31. </view>
  32. <view class="item-box mb-32 flex-justify-space box-border-box">
  33. <view class="item-left fs-32 fc-3">
  34. 更换手机号
  35. </view>
  36. <view class="item-right align-items-center" @click="goToUrl(3)">
  37. <view class="fc-9198A2 fs-28 mr-6">
  38. {{userInfoData.phone}}
  39. </view>
  40. <uni-icons color="#9198A2" type="right" size="20"></uni-icons>
  41. </view>
  42. </view>
  43. </view>
  44. </scroll-view>
  45. </view>
  46. </template>
  47. <script>
  48. import {userInfo} from '@/api/member.js'
  49. import tools from '@/service/tools';
  50. export default {
  51. data() {
  52. return {
  53. userInfoData:{
  54. nickname:'',
  55. head_img:'',
  56. phone:'',
  57. sex:'',
  58. msg_count:'',
  59. },
  60. };
  61. },
  62. onShow() {
  63. this.getUserInfo();
  64. },
  65. methods: {
  66. getUserInfo(){
  67. userInfo().then((res)=>{
  68. if(res.code === 1){
  69. this.userInfoData = res.data;
  70. }
  71. })
  72. },
  73. goToUrl(type) {
  74. if (type === 1) {
  75. // 昵称
  76. uni.navigateTo({
  77. url: '/pages-my/set-user-name'
  78. })
  79. } else if (type === 2) {
  80. // 性别
  81. uni.navigateTo({
  82. url: '/pages-my/set-user-sex'
  83. })
  84. } else {
  85. // 更换手机号
  86. uni.navigateTo({
  87. url: '/pages-my/set-user-phone'
  88. })
  89. }
  90. },
  91. },
  92. }
  93. </script>
  94. <style lang="scss" scoped>
  95. .user-img-box {
  96. width: 144rpx;
  97. height: 144rpx;
  98. position: relative;
  99. margin: 98rpx auto 80rpx;
  100. }
  101. .user-img {
  102. width: 100%;
  103. height: 100%;
  104. }
  105. .set-iimg {
  106. position: absolute;
  107. right: 10rpx;
  108. bottom: 2rpx;
  109. width: 33rpx;
  110. height: 33rpx;
  111. }
  112. .item-info-box {
  113. padding: 0 0 0 32rpx;
  114. .item-box {
  115. padding: 0 32rpx 32rpx 0;
  116. border-bottom: 1rpx solid #EEEEEE;
  117. }
  118. }
  119. </style>