You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
106 lines
2.6 KiB
106 lines
2.6 KiB
<template>
|
|
<view>
|
|
<view class="main">
|
|
<view class="code">
|
|
<uni-easyinput v-model="username" :placeholder="plad" />
|
|
<com-zw />
|
|
<uni-easyinput v-model="password" :maxlength="25" placeholder="请输入密码" type="password" />
|
|
<com-zw />
|
|
</view>
|
|
<u-button type="primary" @tap.stop="confirm">登录</u-button>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
<script>
|
|
import {
|
|
mapMutations,
|
|
mapActions
|
|
} from 'vuex';
|
|
export default {
|
|
name: "phone-verify-logistics",
|
|
props: {
|
|
ret: {
|
|
type: Object,
|
|
default () {
|
|
return {}
|
|
}
|
|
},
|
|
plad: {
|
|
type: String,
|
|
default: '请输入手机号'
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
captchaId: '',
|
|
captchaImg: '',
|
|
username: '13122678567',
|
|
password: '123456',
|
|
}
|
|
},
|
|
created() {
|
|
this.getCaptchaImg();
|
|
|
|
},
|
|
methods: {
|
|
...mapMutations(['login']),
|
|
...mapActions(['getUserInfo']),
|
|
getCaptchaImg() {
|
|
this.tui.request("/common/captcha/init", "GET", null).then((res) => {
|
|
if (res.code == 200) {
|
|
this.captchaId = res.result
|
|
this.captchaImg = this.tui.interfaceUrl() + '/common/captcha/draw/' + this
|
|
.captchaId
|
|
}
|
|
}).catch((res) => {})
|
|
},
|
|
async confirm(form) { // 提
|
|
this.tui.request("/app/logitics/login", "POST", {
|
|
username: this.username,
|
|
password: this.password,
|
|
saveLogin: true
|
|
}, true, true).then((res) => {
|
|
console.log(res)
|
|
if (res.code == 200) {
|
|
uni.setStorageSync("hiver_token", res.result.lcomToken)
|
|
uni.setStorageSync("transCompany", res.result.logiticsCompany.id)
|
|
// let state = {
|
|
// token: res.result
|
|
// }
|
|
// this.login(state)
|
|
// this.getUserInfo()
|
|
this.tui.toast('登录成功', 2000, true)
|
|
setTimeout(() => {
|
|
uni.reLaunch({
|
|
url: '/pages/other/logistics'
|
|
// url: '/pages/index/index'
|
|
})
|
|
}, 200)
|
|
// if (res.result.type > 2) {
|
|
// setTimeout(() => {
|
|
// uni.reLaunch({
|
|
// // url: '/pages/index/logistics'
|
|
// url: '/pages/index/index'
|
|
// })
|
|
// }, 200)
|
|
// } else {
|
|
// setTimeout(() => {
|
|
// uni.reLaunch({
|
|
// url: '/pages/index/index'
|
|
// // url: '/pages/index/logistics'
|
|
// })
|
|
// }, 200)
|
|
// }
|
|
// } else {
|
|
// this.tui.toast(res.message)
|
|
// return
|
|
}
|
|
}).catch((res) => {})
|
|
},
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss" scoped>
|
|
@import '@/scss/phone-verify.scss';
|
|
</style>
|