nickname.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <template>
  2. <view class="pass-box">
  3. <en-nav ></en-nav>
  4. <view class="login-box" :style="{'height':'calc(100vh - '+navHeight+'px)'}" >
  5. <view class="login-top">
  6. <view class="login-title">
  7. <text class="title-item sys-color-black sys-weight-600">昵称&密码</text>
  8. </view>
  9. <view class="login-from">
  10. <view class="from-title">
  11. <view class="title-circle sys-background-black" :class="{'sys-background-green':nickname!==''}"></view>
  12. <view class="title-text sys-color-black">设置昵称</view>
  13. </view>
  14. <view class="from-text from-item">
  15. <input type="tel" class="from-input sys-color-gray-3" max="11" v-model="nickname" placeholder="请输入昵称"></input>
  16. </view>
  17. <view class="from-title from-item">
  18. <view class="title-circle sys-background-black" :class="{'sys-background-green':password.length>=6}"></view>
  19. <view class="title-text sys-color-black">设置密码</view>
  20. </view>
  21. <view class="from-text from-item">
  22. <input type="password" class="from-input sys-color-gray-3" v-model="password" placeholder="请设置密码(6位以上)"></input>
  23. </view>
  24. </view>
  25. </view>
  26. <view class="login-bottom">
  27. <view class="login-but sys-color-white sys-background-black sys-selected-but" @click="setNextStep" :class="{'sys-unselected-but':!isOK}">下一步</view>
  28. </view>
  29. </view>
  30. </view>
  31. </template>
  32. <script>
  33. import EnNav from "@/components/en-utils/en-nav/en-nav";
  34. import tools from "@/service/tools";
  35. export default {
  36. components: {EnNav},
  37. data() {
  38. return {
  39. navHeight:40,
  40. isOK:false,
  41. isShakeBut:false,
  42. nickname:'',
  43. password:'',
  44. }
  45. },
  46. watch:{
  47. 'nickname':function (){
  48. this.verifyIsOK()
  49. },
  50. 'password':function (){
  51. this.verifyIsOK()
  52. },
  53. },
  54. methods: {
  55. setNextStep(){
  56. if(this.isOK){
  57. uni.navigateTo({
  58. 'url':'/pages/perfect/cards'
  59. })
  60. }else {
  61. tools.error('请完善信息')
  62. this.isShakeBut=true
  63. setTimeout(()=>{
  64. this.isShakeBut=false
  65. },500)
  66. }
  67. },
  68. verifyIsOK(){
  69. this.isOK = this.nickname!=='' && this.password.length>=6;
  70. },
  71. setNavHeight(navHeight){
  72. this.navHeight=navHeight+41
  73. },
  74. }
  75. }
  76. </script>
  77. <style scoped lang="scss">
  78. @import "/static/css/shake.css";
  79. .login-box{
  80. padding: 82rpx 80rpx 0 80rpx;
  81. box-sizing: border-box;
  82. position: relative;
  83. .login-top{
  84. .login-title{
  85. padding-bottom: 60rpx;
  86. .title-item{
  87. font-size: 48rpx;
  88. }
  89. }
  90. .login-from{
  91. .from-title{
  92. display: flex;
  93. justify-content: flex-start;
  94. height: 44rpx;
  95. .title-circle{
  96. width: 16rpx;
  97. height: 16rpx;
  98. border-radius: 50%;
  99. margin-top: 14rpx;
  100. margin-right: 8rpx;
  101. }
  102. }
  103. .from-text{
  104. width: 100%;
  105. padding-bottom: 40rpx;
  106. border-bottom: 1rpx solid #E0E0E0;
  107. .from-input{
  108. font-size: 32rpx;
  109. height: 44rpx;
  110. line-height: 44rpx;
  111. }
  112. .from-input::placeholder{
  113. color: #999999;
  114. }
  115. }
  116. .from-item{
  117. margin-top: 60rpx;
  118. }
  119. }
  120. .login-but{
  121. margin-top: 120rpx;
  122. }
  123. .local-txt{
  124. padding-top: 32rpx;
  125. font-size: 24rpx;
  126. text-align: center;
  127. }
  128. }
  129. .login-bottom{
  130. padding-bottom: calc(58rpx + env(safe-area-inset-bottom));
  131. position: absolute;
  132. bottom: 0;
  133. left: 68rpx;
  134. width:calc(100vw - 136rpx);
  135. .login-but{
  136. margin-top: 120rpx;
  137. }
  138. }
  139. }
  140. </style>