jiangping
2023-09-11 4fa0cbae96cde47e4878e16c87da294903a457ae
minipro_standard/pages/login/login.vue
@@ -7,15 +7,15 @@
      </view>
      <view class="bg_w rd8 ptb30 pl40 bbox com-input flex input-height">
         <image src="@/static/login_ic_code@2x.png" mode="" class="img40 mr25"></image>
         <u--input placeholder="企业代码" border="none" v-model="from.companyId"></u--input>
         <u--input placeholder="企业代码" border="none" v-model="form.companyId"></u--input>
      </view>
      <view class="bg_w rd8 ptb30 pl40 bbox mt40 flex input-height">
         <image src="@/static/login_ic_phone@2x.png" mode="" class="img40 mr25"></image>
         <u--input placeholder="手机号" border="none" v-model="from.username"></u--input>
         <u--input placeholder="手机号" border="none" v-model="form.username"></u--input>
      </view>
      <view class="bg_w rd8 ptb30 pl40 bbox mt40 flex input-height">
         <image src="@/static/login_ic_password@2x.png" mode="" class="img40 mr25"></image>
         <u--input placeholder="密码" border="none" v-model="from.password"></u--input>
         <u--input placeholder="密码" border="none" password v-model="form.password"></u--input>
      </view>
      <view class="login-btn mt80" @click="loginAction">立即登录</view>
   </view>
@@ -26,7 +26,7 @@
   export default {
      data() {
         return {
            from: {
            form: {
               openid: '',
               unionid: '',
               companyId: '',
@@ -56,8 +56,8 @@
                              });
                           }
                        } else {
                           that.from.openid = res.data.openid
                           that.from.unionid = res.data.unionid
                           that.form.openid = res.data.openid
                           that.form.unionid = res.data.unionid
                        }
                     }
                  })
@@ -66,10 +66,10 @@
      },
      methods: {
         async loginAction() {
            if (!this.from.companyId) return uni.showToast({ title: '企业代码不能为空', icon:"error", duration: 2000 });
            if (!this.from.username) return uni.showToast({ title: '手机号不能为空', icon:"error", duration: 2000 });
            if (!this.from.password) return uni.showToast({ title: '密码不能为空', icon:"error", duration: 2000 });
            let res = await wxAccountLogin(this.from)
            if (!this.form.companyId) return uni.showToast({ title: '企业代码不能为空', icon:"error", duration: 2000 });
            if (!this.form.username) return uni.showToast({ title: '手机号不能为空', icon:"error", duration: 2000 });
            if (!this.form.password) return uni.showToast({ title: '密码不能为空', icon:"error", duration: 2000 });
            let res = await wxAccountLogin(this.form)
            if (res.code === 200) {
               await this.$store.commit('SETSESSION', res.data)
               let user = await getUserInfo({})
@@ -122,6 +122,8 @@
   }
   .com-input {
      margin-top: -60px;
      position: relative;
      z-index: 2;
   }
   .login-btn {
      height: 98rpx;