setUp.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. {{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. onLoad() {
  38. if(this.userInfo.avatarUrl != null || this.userInfo.avatarUrl != ""){
  39. this.headUrl = this.userInfo.avatarUrl
  40. }
  41. if(this.userInfo.userName != null || this.userInfo.userName != ""){
  42. this.username = this.userInfo.userName
  43. }
  44. },
  45. methods:{
  46. switchPicture(){
  47. uni.navigateTo({
  48. url: `/pages/user/set_picture`
  49. })
  50. },
  51. nickname(){
  52. uni.navigateTo({
  53. url: `/pages/user/set_nickname`
  54. })
  55. }
  56. }
  57. }
  58. </script>
  59. <style lang="scss" scoped>
  60. .container {
  61. padding: 10px 10px 0px;
  62. background-color: #F5F6FA;
  63. }
  64. .headPortrait {
  65. width: 100%;
  66. height: 52px;
  67. margin-top: 15px;
  68. background-color: #FFFFFF;
  69. border-radius: 6px;
  70. // justify-content: flex-end;
  71. }
  72. .title {
  73. font-size: 16px;
  74. line-height: 50px;
  75. font-weight: 600;
  76. margin-left: 10px;
  77. }
  78. .pictures {
  79. justify-content: flex-end;
  80. width: 35px;
  81. height: 35px;
  82. background-color: #E0FAF6;
  83. border-radius: 18px;
  84. margin-top: 6px;
  85. }
  86. .picture {
  87. width: 35px;
  88. height: 35px;
  89. }
  90. .arrow {
  91. margin-left: 15px;
  92. width: 8px;
  93. height: 12px;
  94. top: 18px;
  95. // justify-content: flex-end
  96. }
  97. .nextStep{
  98. margin-right: 20px;
  99. }
  100. .username{
  101. line-height: 50px;
  102. color: #6D6D72;
  103. }
  104. </style>