yaolonglong
3 天以前 b5f084460e9e639358fbf91056a86be8d0a5c4b2
pages/companyLogin/companyLogin.vue
@@ -38,7 +38,7 @@
          </view>
          <view class="form-input set-flex set-flex-content-between">
            <input type="number" v-model="form.code" placeholder="请输入验证码" />
            <view>
                  <view @tap='toGetCode'>
              <text class="driver"></text>
              <text class="getcode">{{tips}}</text>
            </view>
@@ -59,12 +59,7 @@
<script>
  // 00营商办,01执法,02企业 区分不同的登陆页面
  import {
    getCode,
    codeLogin,
    getInfo,
    getCompanyList
  } from '@/api/auth.js'
   import { getCode, codeLogin, getInfo, getCompanyList } from '@/api/auth.js'
  import selectVue from '@/components/select.vue'
  export default {
    components: {
@@ -98,7 +93,7 @@
      }
    },
    methods: {
      getCode() {
         toGetCode() {
        if (!this.form.phone) {
          uni.showToast({
            title: '请输入手机号',
@@ -118,9 +113,7 @@
          uni.showLoading({
            title: '正在获取验证码'
          })
          getCode({
            phone: this.form.phone
          }).then(val => {
               getCode({phone: this.form.phone }).then(val => {
            if (val.data.code == 200) {
              this.startCountdown()
              uni.hideLoading();
@@ -159,13 +152,13 @@
          })
          return
        }
        // if(!this.form.code){
        //    uni.showToast({
        //       title: '请输入验证码',
        //       icon: 'none'
        //    })
        //    return
        // }
            if(!this.form.code){
               uni.showToast({
                  title: '请输入验证码',
                  icon: 'none'
               })
               return
            }
        codeLogin(this.form).then(val => {
          if (val.data.token) {
            this.loginToken = val.data.token
@@ -214,11 +207,7 @@
        })
      },
      getCompanyList(companyPhone) {
        getCompanyList({
          companyPhone,
          companyStatus: 0,
          checkStatus: 2
        }).then(val => {
            getCompanyList({companyPhone, companyStatus: 0, checkStatus: 2}).then(val => {
          if (val.data.rows.length > 1) {
            this.$refs.selectVue.open(val.data.rows)
          } else {
@@ -246,27 +235,23 @@
      height: 345rpx;
      text-align: center;
      background-color: #111;
      &>image {
        width: 100%;
        height: 345rpx;
      }
    }
    .content-box {
      border-radius: 40rpx 40rpx 0 0;
      padding: 40rpx 32rpx;
      position: relative;
      top: 80rpx;
      background-color: white;
      .form {
        .form-item {
          .form-label {
            font-size: 34rpx;
            margin: 0 0 24rpx 16rpx;
          }
          .form-input {
            background-color: #F7F7F7;
            padding: 20rpx;
@@ -274,18 +259,15 @@
          }
        }
      }
      .margin-bottom {
        margin-bottom: 36rpx;
      }
      .getcode {
        color: #1171E0;
        font-size: 34rpx;
        font-weight: 500;
        width: 20%;
      }
      .driver {
        display: inline-block;
        vertical-align: middle;
@@ -295,7 +277,6 @@
        background-color: #C3C6CD;
      }
    }
    .company-register {
      position: fixed;
      bottom: 32rpx;
@@ -309,7 +290,6 @@
      background: #F0F8FF;
    }
  }
  ::v-deep .u-radio {
    margin-bottom: 20rpx;
  }