帧视界壹通告,付费看视频的微信小程序
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.

141 lines
2.4 KiB

11 months ago
  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. />
  39. </view>
  40. </view>
  41. <view class="btn"
  42. @click="submit">
  43. 确认
  44. </view>
  45. </view>
  46. </template>
  47. <script>
  48. export default {
  49. data() {
  50. return {
  51. userInfo : {
  52. headImage : '',
  53. nickName : '',
  54. }
  55. };
  56. },
  57. onShow(){
  58. },
  59. computed : {
  60. },
  61. methods : {
  62. onChooseAvatar(res){
  63. let self = this
  64. self.$Oss.ossUpload(res.target.avatarUrl)
  65. .then(url => {
  66. self.userInfo.headImage = url
  67. })
  68. },
  69. submit(){
  70. let self = this
  71. uni.createSelectorQuery().in(this)
  72. .select("#nickName")
  73. .fields({
  74. properties: ["value"],
  75. })
  76. .exec((res) => {
  77. const nickName = res?.[0]?.value
  78. self.userInfo.nickName = nickName
  79. })
  80. if(this.$utils.verificationAll(this.userInfo, {
  81. headImage : '请选择头像',
  82. nickName : '请填写昵称',
  83. })){
  84. return
  85. }
  86. this.$api('infoUpdateInfo', this.userInfo, res => {
  87. if(res.code == 200){
  88. uni.navigateBack(-1)
  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: $uni-linear-gradient-btn-color;
  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>