ll
liukangdong
2025-01-23 904436a616ca08fc95e1cbbbd13059835ef37e72
h5/pages/waybill/home.vue
@@ -9,16 +9,9 @@
         <view class="item">
            <view class="la">验证码</view>
           <view class="df_sb">
              <input
                v-model="form.code"
                placeholder="请输入验证码"
                 placeholder-class="placeholder9"
                  :maxlength="6"
                type="number"
              />
              <text class="captcha" v-if="countDown == 0" @click="initCaptcha"
                >获取验证码</text
              >
               <input v-model="form.code" placeholder="请输入验证码" placeholder-class="placeholder9" :maxlength="6"
                  type="number" />
               <text class="captcha" v-if="countDown == 0" @click="initCaptcha">获取验证码</text>
              <text class="placeholder9" v-else>{{ countDown }}</text>
           </view>
         </view>
@@ -30,7 +23,12 @@
</template>
<script>
   import { sendSms, loginGkUserWithCode, wxAuthorizea, getUserInfo } from '@/api'
   import {
      sendSms,
      loginGkUserWithCode,
      wxAuthorizea,
      getUserInfo
   } from '@/api'
   export default {
      data() {
         return {
@@ -40,7 +38,7 @@
            },
            countDown: 0,
            
            code: ''
            code: '111'
         };
      },
      onShow() {
@@ -60,11 +58,17 @@
      },
      methods: {
         onSubmit() {
            const { code, phone } = this.form
            const {
               code,
               phone
            } = this.form
            if (!phone) return this.showToast('手机号不能为空')
            if (!code) return this.showToast('验证码不能为空')
            loginGkUserWithCode({
              phone, code,openid: this.$store.state.openId, userType: 3
               phone,
               code,
               openid: this.$store.state.openId,
               userType: 3
            }).then(res => {
              if (res && res.code == 200) {
                  this.$store.commit('setToken', res.data)
@@ -113,12 +117,16 @@
             title: '手机号不能为空',
             icon: 'none'
           })
           sendSms({ phone: this.form.phone }).then(res => {
            sendSms({
               phone: this.form.phone
            }).then(res => {
               if (res.code === 200) {
             this.countDown = 60
             setInterval(() => {
               if (this.countDown == 0) return
               this.countDown--
             }, 1000)
               }
           })
         },
      }
@@ -128,6 +136,7 @@
<style lang="scss">
.main_app{
   padding-top: 218rpx;
   .bg{
      width: 750rpx;
      position: absolute;
@@ -135,6 +144,7 @@
      top: 0;
      z-index: -1;
   }
   .login_wrap {
     width: 690rpx;
     height: 490rpx;
@@ -151,6 +161,7 @@
       box-sizing: border-box;
       margin-bottom: 30rpx;
         border-bottom: 1px solid #E5E5E5;
       &:last-child {
         margin-bottom: 0 !important;
       }
@@ -160,14 +171,17 @@
            font-size: 28rpx;
            color: #222222;
         }
       .captcha {
         color: $uni-color-primary;
       }
         .df_sb{
            display: flex;
            justify-content: space-between;
            align-items: center;
         }
       input {
         flex: 1;
         height: 86rpx;
@@ -179,11 +193,13 @@
       }
     }
   }
   .login_btn {
    width: 630rpx;
    height: 88rpx;
     box-sizing: border-box;
     margin-top: 40rpx;
     .login_btn_n {
       width: 100%;
       height: 98rpx;