| | |
| | | <!-- 企业登录 --> |
| | | <template> |
| | | <view class="companylogin"> |
| | | <u-navbar title="" :autoBack="true" bgColor="transparent"> |
| | | <u-navbar :autoBack="true" bgColor="transparent"> |
| | | <template slot="center"> |
| | | |
| | | </template> |
| | |
| | | </view> |
| | | <!-- <u--text text="企业注册" type="primary" @click="goRegister"></u--text> --> |
| | | </view> |
| | | <selectVue ref="selectVue" @select="select"></selectVue> |
| | | </view> |
| | | </template> |
| | | |
| | | <script> |
| | | // 00营商办,01执法,02企业 区分不同的登陆页面 |
| | | import { getCode, codeLogin, getInfo } from '@/api/auth.js' |
| | | import { getCode, codeLogin, getInfo, getCompanyList } from '@/api/auth.js' |
| | | import selectVue from '@/components/select.vue' |
| | | export default { |
| | | components: { |
| | | selectVue |
| | | }, |
| | | data() { |
| | | return { |
| | | tips: '获取验证码', |
| | |
| | | loginToken: '', |
| | | isSendCode: false, |
| | | countdownTime: 20, |
| | | timer: '' |
| | | timer: '', |
| | | sessionToken: "", |
| | | userInfo: {} |
| | | } |
| | | }, |
| | | onLoad(options) { |
| | |
| | | }, |
| | | getInfo() { |
| | | getInfo().then(val => { |
| | | uni.setStorageSync('userInfo', val.data.data) |
| | | if(this.form.userType == '02') { |
| | | uni.reLaunch({ |
| | | url:`/qiye/qiyeIndex/qiyeIndex?id=${val.data.data.deptId}` |
| | | }) |
| | | } else if(this.form.userType == '01'){ |
| | | uni.reLaunch({ |
| | | url:`/policy/policyIndex/policyIndex` |
| | | }) |
| | | // uni.setStorageSync('userInfo', val.data.data) |
| | | if(val.data.code === 200) { |
| | | this.userInfo = val.data.data |
| | | if(this.form.userType == '02') { |
| | | // 获取企业 |
| | | |
| | | this.getCompanyList(val.data.data.phonenumber) |
| | | } else if(this.form.userType == '01'){ |
| | | uni.setStorageSync('userInfo', val.data.data) |
| | | // uni.setStorageSync('sessionToken', this.loginToken) |
| | | uni.reLaunch({ |
| | | url:`/policy/policyIndex/policyIndex` |
| | | }) |
| | | } else { |
| | | uni.setStorageSync('userInfo', val.data.data) |
| | | // uni.setStorageSync('sessionToken', this.loginToken) |
| | | uni.reLaunch({ |
| | | url:`/policy/policyIndex/policyIndex` |
| | | }) |
| | | } |
| | | } else { |
| | | uni.reLaunch({ |
| | | url:`/policy/policyIndex/policyIndex` |
| | | uni.removeStorageSync('sessionToken') |
| | | uni.showToast({ |
| | | title: val.data.msg, |
| | | icon: 'none' |
| | | }) |
| | | } |
| | | |
| | | }).catch(err => { |
| | | uni.removeStorageSync('sessionToken') |
| | | }) |
| | | }, |
| | | goRegister() { |
| | | uni.navigateTo({ |
| | | url: `/pages/registerCompany/registerCompany` |
| | | }) |
| | | }, |
| | | getCompanyList(companyPhone) { |
| | | getCompanyList({companyPhone, companyStatus: 0, checkStatus: 2}).then(val => { |
| | | if(val.data.rows.length > 1){ |
| | | this.$refs.selectVue.open(val.data.rows) |
| | | } else { |
| | | uni.setStorageSync('userInfo', this.userInfo) |
| | | uni.reLaunch({ |
| | | url:`/qiye/qiyeIndex/qiyeIndex?id=${this.userInfo.deptId}` |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | select(event){ |
| | | uni.setStorageSync('userInfo', this.userInfo) |
| | | uni.reLaunch({ |
| | | url:`/qiye/qiyeIndex/qiyeIndex?id=${event}` |
| | | }) |
| | | } |
| | | } |
| | |
| | | background: #F0F8FF; |
| | | } |
| | | } |
| | | /deep/ .u-radio { |
| | | margin-bottom: 20rpx; |
| | | } |
| | | </style> |