2
xuxy
2024-06-27 353b734a16dd753bef78105364f5a7ecbeac9712
pages/login/farmer-login.vue
@@ -26,13 +26,15 @@
               <view class="t-a input" v-if="loginType=='code'">
                  <input type="text" :password="true" name="password" placeholder="请输入密码" v-model="password" />
                  <input type="text" name="userName" placeholder="请输入手机验证码" v-model="smsCode" />
               </view>
               <button @tap="login()" class="bottom-button">登 录</button>
               <view class="flex">
                  <view class="topic-font" @click="loginType='code'">手机验证码登录</view>
                  <view class="topic-font" v-if="loginType=='pwd'" @click="loginType='code'">手机验证码登录</view>
                  <view class="topic-font" v-if="loginType=='code'" @click="loginType='pwd'">账号密码登录</view>
                  <view class="topic-font m-l-a m-r-0" @click="toReg">前往注册</view>
               </view>
            </form>
@@ -48,11 +50,14 @@
      data() {
         return {
            openId: '-1',
            // userName: '12345678',
            // password: '12345678',
            userName: '',
            userName: 'gzm',
            password: '123456',
            // userName: '',
            // password: '',
            phoneNumber: '',
            password: '',
            smsCode:'',
            checked: false,
            loginType: 'pwd', //pwd和code,密码和验证码登录
            pcfvalue: undefined,
@@ -112,8 +117,8 @@
            // uni.switchTab({
            //    url: '/pages/index/index'
            // })
            uni.navigateTo({
               url: '/pages/login/farmer-reg'
            uni.redirectTo({
               url: '/sub_pages/farmer/farmer-reg/farmer-reg'
            })
         },
@@ -151,7 +156,7 @@
            // const {
            // code
            // } = await this.$http.request('get', '/api/login/admin')
            const resp = await this.$store.dispatch('loginShop', post);
            const resp = await this.$store.dispatch('loginSupplier', post);
            // uni.hideLoading()
            if (resp.code == 0) {
@@ -255,6 +260,11 @@
   .t-login .t-a {
      position: relative;
      .get-code{
         position: absolute;
         right: 40rpx;
         top: 20rpx;
      }
   }
   .t-login .t-a .icon {