浏览代码

no message

BF-202210271038\Administrator 2 年之前
父节点
当前提交
4fe8596629
共有 5 个文件被更改,包括 55 次插入10 次删除
  1. 5 0
      package-lock.json
  2. 1 0
      package.json
  3. 6 1
      pages/login/localPhoneLogin.vue
  4. 1 1
      pages/perfect/nickname.vue
  5. 42 8
      pages/perfect/sexAndAge.vue

+ 5 - 0
package-lock.json

@@ -45,6 +45,11 @@
       "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==",
       "dev": true
     },
+    "jquery": {
+      "version": "3.6.4",
+      "resolved": "https://registry.npmjs.org/jquery/-/jquery-3.6.4.tgz",
+      "integrity": "sha512-v28EW9DWDFpzcD9O5iyJXg3R3+q+mET5JhnjJzQUZMHOv67bpSIHq81GEYpPNZHG+XXHsfSme3nxp/hndKEcsQ=="
+    },
     "js-base64": {
       "version": "2.6.4",
       "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-2.6.4.tgz",

+ 1 - 0
package.json

@@ -1,5 +1,6 @@
 {
   "dependencies": {
+    "jquery": "^3.6.4",
     "uni-read-pages": "^1.0.5",
     "uni-simple-router": "^2.0.7",
     "uploading-oss": "^1.0.3"

+ 6 - 1
pages/login/localPhoneLogin.vue

@@ -9,7 +9,7 @@
         </view>
         <view class="local-txt sys-color-gray-9">本机号码登录</view>
         <view class="local-phone sys-color-black sys-weight-400">188****4188</view>
-        <view class="login-but sys-color-white sys-background-black">一键登录</view>
+        <view class="login-but sys-color-white sys-background-black" @click="login">一键登录</view>
         <view @click="goToOther" class="other-phone sys-color-gray-6">其他手机号登录</view>
       </view>
       <view class="login-bottom">
@@ -37,6 +37,11 @@ export default {
       console.log('navHeight:'+navHeight)
       this.navHeight=navHeight
     },
+    login(){
+      uni.navigateTo({
+        'url':'/pages/perfect/sexAndAge'
+      })
+    },
     goToOther(){
       uni.navigateTo({
         'url':'/pages/login/otherPhoneLogin'

+ 1 - 1
pages/perfect/nickname.vue

@@ -12,7 +12,7 @@
             <view class="title-text sys-color-black">设置昵称</view>
           </view>
           <view class="from-text from-item">
-            <input type="tel" class="from-input sys-color-gray-3" max="11" v-model="nickname" placeholder="请输入昵称"></input>
+            <input type="text" class="from-input sys-color-gray-3" max="11" v-model="nickname" placeholder="请输入昵称"></input>
           </view>
           <view class="from-title from-item">
             <view class="title-circle sys-background-black" :class="{'sys-background-green':password.length>=6}"></view>

+ 42 - 8
pages/perfect/sexAndAge.vue

@@ -1,13 +1,13 @@
 <template>
   <view class="sex-box">
     <en-nav @navHeight="setNavHeight" ></en-nav>
-    <view class="login-box" :style="{'height':'calc(100vh - '+navHeight+'px)'}">
+    <view class="login-box"  :style="{'height':'calc(100vh - '+navHeight+'px)'}">
       <view class="login-top">
         <view class="login-title">
           <text class="title-item sys-color-black sys-weight-600">性别&年龄</text>
         </view>
         <view  class="local-txt sys-color-gray-9">注册完成,您的性别将无法修改</view>
-        <view class="sex-data">
+        <view class="sex-data" >
           <view class="sex-item" @click="setSex(1)">
             <view class="item-img">
               <view class="sex-img-box">
@@ -35,22 +35,22 @@
 
         </view>
         <view  class="local-txt sys-color-gray-9">设置生日(年龄大于18岁)</view>
-        <view class="age-data " :class="{'apply-shake':isShake}" >
+        <view class="age-data"   :class="{'apply-shake':isShake}" >
           <view class="age-item">
             <view class="age-input">
-              <input class="input-one" v-model="ageObj.year" type="number" :min="mixYear" :max="maxYear" placeholder="1999" @blur="verifyAge"></input>
+              <input class="input-one" :focus="yearFocus" v-model="ageObj.year"   type="number" :min="mixYear" :max="maxYear" placeholder="1999" @blur="verifyAge"></input>
             </view>
             <view class="age-text sys-color-black">年</view>
           </view>
           <view class="age-item">
             <view class="age-input">
-              <input type="number" v-model="ageObj.month" min="1" max="12" placeholder="01" @blur="verifyAge"></input>
+              <input type="number"  :focus="monthFocus" v-model="ageObj.month" min="1" max="12" placeholder="01" @blur="verifyAge"></input>
             </view>
             <view class="age-text sys-color-black">月</view>
           </view>
           <view class="age-item">
             <view class="age-input">
-              <input type="number" v-model="ageObj.day" min="1943" max="2006" placeholder="01" @blur="verifyAge"></input>
+              <input type="number"  :focus="dayFocus"  v-model="ageObj.day" min="1943" max="2006" placeholder="01" @blur="verifyAge"></input>
             </view>
             <view class="age-text sys-color-black">日</view>
           </view>
@@ -67,6 +67,7 @@
 <script>
 import EnNav from "@/components/en-utils/en-nav/en-nav";
 import tools from "@/service/tools";
+import $ from 'jquery'
 export default {
   components: {EnNav},
   data() {
@@ -82,6 +83,9 @@ export default {
         month:'',
         day:'',
       },
+      yearFocus:false,
+      monthFocus:false,
+      dayFocus:false,
       mixYear:2003,
       maxYear:2003,
       placeholderYear:1990,
@@ -101,8 +105,35 @@ export default {
     'sex':function (){
       this.verifyIsOK()
     },
+    'ageObj.year':function (){
+      if(this.ageObj.year.length>=4){
+        this.setFocus(2)
+      }
+    },
+    'ageObj.month':function (){
+      if(this.ageObj.month.length>=2){
+        this.setFocus(3)
+      }
+    },
+    'ageObj.day':function (){
+      if(this.ageObj.day.length>=2){
+        this.setFocus(0)
+      }
+    },
   },
   methods: {
+    setFocus(type){
+      this.yearFocus=false
+      this.monthFocus=false
+      this.dayFocus=false
+      if(type===1){
+        this.yearFocus=true
+      }else if(type===2){
+        this.monthFocus=true
+      }else if(type===3){
+        this.dayFocus=true
+      }
+    },
     setNextStep(){
       if(this.isOK){
         uni.navigateTo({
@@ -121,18 +152,21 @@ export default {
         if(this.ageObj.year > this.maxYear || this.ageObj.year < this.mixYear){
           this.setShake()
           this.ageObj.year=''
+          this.setFocus(1)
         }else {
           if(this.ageObj.month!=='' ){
             if(this.ageObj.month > 12 || this.ageObj.month < 1){
               this.setShake()
               this.ageObj.month=''
               this.ageObj.day=''
+              this.setFocus(2)
             }else {
               this.maxDay=tools.getCountDays(this.ageObj.year+'-'+this.ageObj.month)
               if(this.ageObj.day!==''){
                 if(this.ageObj.day > this.maxDay || this.ageObj.day < 1){
                   this.setShake()
                   this.ageObj.day=''
+                  this.setFocus(3)
                 }else {
                   this.age=this.ageObj.year+'-'+this.ageObj.month+'-'+this.ageObj.day
                 }
@@ -164,9 +198,9 @@ export default {
 <style scoped lang="scss">
 @import "/static/css/shake.css";
 .sex-box{
-  padding: 82rpx 80rpx 0 80rpx;
-  box-sizing: border-box;
   .login-top{
+    padding:0 80rpx;
+    margin-top: 80rpx;
     .login-title{
       .title-item{
         font-size: 48rpx;