加油站付款小程序,打印小票
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.

140 lines
2.4 KiB

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