铝交易,微信公众号
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
3.0 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <template>
  2. <view class="login">
  3. <view class="title">
  4. {{ $t('pageTitle.aluminumTradingPlatform') }}
  5. </view>
  6. <view class="title">
  7. {{ $t('components.applyForAvatarNickname') }}
  8. </view>
  9. <button class="chooseAvatar" open-type="chooseAvatar" @chooseavatar="onChooseAvatar">
  10. <view class="line">
  11. <view class="">
  12. {{ $t('components.avatar') }}
  13. </view>
  14. <view class="">
  15. <image :src="userInfo.headImage" v-if="userInfo.headImage" style="width: 60rpx;height: 60rpx;"
  16. mode=""></image>
  17. <image src="../static/auth/headImage.png" v-else style="width: 50rpx;height: 50rpx;" mode=""></image>
  18. </view>
  19. </view>
  20. </button>
  21. <view class="line">
  22. <view class="">
  23. {{ $t('components.nickname') }}
  24. </view>
  25. <view class="">
  26. <input type="nickname" :placeholder=" $t('components.enterNickname')" style="text-align: right;" id="nickName"
  27. v-model="userInfo.nickName"/>
  28. </view>
  29. </view>
  30. <view class="btn" @click="submit">
  31. {{ $t('components.confirmR') }}
  32. </view>
  33. </view>
  34. </template>
  35. <script>
  36. export default {
  37. data() {
  38. return {
  39. userInfo: {
  40. headImage: '',
  41. nickName: '',
  42. }
  43. };
  44. },
  45. onShow() {
  46. },
  47. computed: {},
  48. methods: {
  49. onChooseAvatar(res) {
  50. let self = this
  51. self.$Oss.ossUpload(res.target.avatarUrl)
  52. .then(url => {
  53. self.userInfo.headImage = url
  54. })
  55. },
  56. submit() {
  57. let self = this
  58. uni.createSelectorQuery().in(this)
  59. .select("#nickName")
  60. .fields({
  61. properties: ["value"],
  62. })
  63. .exec((res) => {
  64. const nickName = res?.[0]?.value
  65. self.userInfo.nickName = nickName
  66. if (self.$utils.verificationAll(self.userInfo, {
  67. headImage: '请选择头像',
  68. nickName: '请填写昵称',
  69. })) {
  70. return
  71. }
  72. self.$api('infoUpdateInfo', self.userInfo, res => {
  73. if (res.code == 200) {
  74. uni.switchTab({
  75. url: '/pages/index/index'
  76. })
  77. }
  78. })
  79. })
  80. },
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .login {
  86. display: flex;
  87. flex-direction: column;
  88. justify-content: center;
  89. align-items: center;
  90. height: 80vh;
  91. .title {
  92. line-height: 45rpx;
  93. font-weight: 900;
  94. }
  95. .line {
  96. display: flex;
  97. justify-content: space-between;
  98. align-items: center;
  99. width: 80%;
  100. border-bottom: 1px solid #00000023;
  101. padding: 30rpx 0;
  102. margin: 0 auto;
  103. }
  104. .chooseAvatar {
  105. width: 100%;
  106. padding: 0;
  107. margin: 0;
  108. margin-top: 10vh;
  109. border: none;
  110. }
  111. .btn {
  112. // background: $uni-linear-gradient-btn-color;
  113. background: $uni-color;
  114. color: #fff;
  115. width: 80%;
  116. padding: 20rpx 0;
  117. text-align: center;
  118. border-radius: 15rpx;
  119. margin-top: 10vh;
  120. }
  121. }
  122. </style>