setUp.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <template>
  2. <view class="container">
  3. <view class=" flex headPortrait justify-between">
  4. <view class="title">头像</view>
  5. <view class="nextStep flex">
  6. <view class="pictures">
  7. <image :src="headUrl" class="picture"></image>
  8. </view>
  9. <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" @click="switchPicture"></image>
  10. </view>
  11. </view>
  12. <view class="flex headPortrait justify-between">
  13. <view class="title">昵称</view>
  14. <view class="nextStep flex">
  15. <view class="username">
  16. {{userInfo.userName}}
  17. </view>
  18. <image src="../../static/img/myimg/gengduo1@3x.png" class="arrow" @click="nickname"></image>
  19. </view>
  20. </view>
  21. </view>
  22. </template>
  23. <script>
  24. import {
  25. mapState
  26. } from 'vuex';
  27. export default {
  28. data() {
  29. return {
  30. headUrl:"../../static/img/myimg/YongHu@3x.png",
  31. username:"",
  32. }
  33. },
  34. computed: {
  35. // ...mapState(['hasLogin', 'userInfo'])
  36. },
  37. onShow() {
  38. this.getList()
  39. },
  40. onLoad() {
  41. },
  42. methods:{
  43. getList(){
  44. this.userInfo= wx.getStorageSync('userInfo')
  45. this.headUrl = this.userInfo.avatarUrl
  46. if(this.headUrl == null || this.headUrl == ""){
  47. this.headUrl="../../static/img/myimg/YongHu@3x.png"
  48. }
  49. this.username = this.userInfo.userName
  50. },
  51. switchPicture(){
  52. uni.navigateTo({
  53. url: `/pages/user/set_picture`
  54. })
  55. },
  56. nickname(){
  57. uni.navigateTo({
  58. url: `/pages/user/set_nickname`
  59. })
  60. }
  61. }
  62. }
  63. </script>
  64. <style lang="scss" scoped>
  65. .container {
  66. padding: 10px 10px 0px;
  67. background-color: #F5F6FA;
  68. }
  69. .headPortrait {
  70. width: 100%;
  71. height: 52px;
  72. margin-top: 15px;
  73. background-color: #FFFFFF;
  74. border-radius: 6px;
  75. // justify-content: flex-end;
  76. }
  77. .title {
  78. font-size: 16px;
  79. line-height: 50px;
  80. font-weight: 600;
  81. margin-left: 10px;
  82. }
  83. .pictures {
  84. justify-content: flex-end;
  85. width: 35px;
  86. height: 35px;
  87. background-color: #E0FAF6;
  88. border-radius: 18px;
  89. margin-top: 6px;
  90. }
  91. .picture {
  92. width: 35px;
  93. height: 35px;
  94. }
  95. .arrow {
  96. margin-left: 15px;
  97. width: 8px;
  98. height: 12px;
  99. top: 18px;
  100. // justify-content: flex-end
  101. }
  102. .nextStep{
  103. margin-right: 20px;
  104. }
  105. .username{
  106. line-height: 50px;
  107. color: #6D6D72;
  108. }
  109. </style>