yangan
23 小时以前 a28d0135ee42809b2c5863609da37155d3ecba5b
pages/login/insideUser.vue
@@ -9,16 +9,26 @@
               v-model="username"
               @changeInput="changeInput2"
               @input="handleInput2"
               :placeholder="'请输入登录账号'"
            ></customPagination>
         </view>
      </view>
      <view class="loginBtn">
      <u-button type="primary"
            text="人脸登录"
            @click="submit()"
            :loading="submitLoading">
      </u-button>
    </view>
         <view class="loginbutton">
            <u-button type="primary"
                        text="人脸登录"
                        @click="submit()"
                        :loading="submitLoading">
            </u-button>
         </view>
         <view class="loginbutton">
            <u-button type="primary"
               text="密码登录"
               @click="gologin()"
               :loading="submitLoading">
            </u-button>
         </view>
      </view>
   </view>
</template>
<script>
@@ -52,14 +62,21 @@
          window.identifyResult = this.identifyResult;
      },
      methods: {
         gologin(){
            redirectLogin()
         },
         async  identifyResult(result){
             if(result==true){
             if(result=='true'){
                this.$u.toast('人脸检测完成');
             //登录接口
             uni.showLoading({
                title: '登录中...'
             });
             this.submitLoading = true
            let obj = this.userList.find(item => item.username.trim() === this.username.trim());
            if (obj) {
              this.password = obj.password;
            }
             await apiLoginPassword({
                   username: this.username,
                   password: this.password,
@@ -107,7 +124,7 @@
                });
             }else{
                this.submitLoading = false
                this.$u.toast('登录失败!');
                this.$u.toast('人脸检测失败!');
             }
         },
         changeInput2(e){
@@ -119,15 +136,11 @@
         ...mapMutations(['setUserTabbar']),
         //登录
         async submit() {
            uni.showLoading({
               title: '登录中...'
            });
            //表单校验
            if (this.username.length === 0) {
               this.$u.toast('请输入账号');
               return;
            }
            if (this.userList.filter(item=> item.username == this.username).length == 0){
            if (this.userList.filter(item=> item.username.trim() == this.username.trim()).length == 0){
               this.$u.toast('该账号未登录请先登录');
               setTimeout(() => {
                  redirectLogin();
@@ -146,6 +159,9 @@
   .dengluBtn {
      margin-top: 130rpx;
   }
   .loginbutton{
      margin: 40rpx 0;
   }
  /* #ifdef H5 */
  .loginBtn{
    width: 80%;