oms
This commit is contained in:
111
pages/login/coments/passwordLogin.vue
Normal file
111
pages/login/coments/passwordLogin.vue
Normal file
@@ -0,0 +1,111 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="form_body" style="">
|
||||
<view class="form_body_title">
|
||||
登录账户<br/>
|
||||
<text class="form_body_title_text">
|
||||
正在使用账号
|
||||
</text>
|
||||
<text style="font-weight: 600;" class="form_body_title_text">{{phone}}</text>
|
||||
</view>
|
||||
<view style="margin-top: 49rpx !important;" class="form_body_input">
|
||||
<view style="color: #999999; flex-shrink: 1;">
|
||||
<uni-icons type="locked" size="24"></uni-icons>
|
||||
</view>
|
||||
<uni-easyinput style="flex-grow: 1 !important;" type="password" v-model="password" placeholder="请输入密码"></uni-easyinput>
|
||||
</view>
|
||||
<view @tap="switchFn" class="switch">验证码登录</view>
|
||||
<view style="margin-top: 32rpx !important;" class="form_body_footer">
|
||||
<button @tap="sumit" class="form_body_butten">一键登录</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/*
|
||||
* @property {String} phone:输入的手机号 通过 onLoad中uni.$on('state')自定义事件 更新值
|
||||
* @property {String} password: 输入的密码
|
||||
* @property {Function} switchFn: 切换验证码登录组件
|
||||
* @property {Function} sumit: 一键登录
|
||||
*/
|
||||
import oilIdentityApi from '@/api/oil-identity'
|
||||
import md5 from 'js-md5'
|
||||
export default {
|
||||
props:{
|
||||
phone:{
|
||||
type:String,
|
||||
default:' '
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
password:'',
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
console.log(this.phone)
|
||||
},
|
||||
methods: {
|
||||
switchFn(e){
|
||||
let that = this
|
||||
uni.$emit('state',{
|
||||
state:2,
|
||||
phone:that.phone
|
||||
})
|
||||
},
|
||||
sumit(){
|
||||
console.log(this.phone,this.password)
|
||||
if(this.password==''){
|
||||
uni.showToast({
|
||||
title:"密码不能为空",
|
||||
icon:"none"
|
||||
})
|
||||
return
|
||||
}
|
||||
let data = {
|
||||
unionId: uni.getStorageSync('unionid') ,
|
||||
loginSystem:'OIL_OMS_WEB_MINI ',
|
||||
username:this.phone,
|
||||
password: md5(this.password)
|
||||
}
|
||||
oilIdentityApi.weChatLoginOilOmsWebMini(data).then(res=>{
|
||||
if(res.code==20000){
|
||||
console.log(res)
|
||||
uni.setStorageSync('Authorization',res.data.authTokenDTO.accessToken)
|
||||
uni.setStorageSync('accountStatus', res.data.isCompanyAccount)
|
||||
uni.setStorageSync('user', res.data.authTokenDTO.loginUser)
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: 'none',
|
||||
complete: (err) => {
|
||||
setTimeout(() => {
|
||||
uni.redirectTo({
|
||||
url:'../index/newindex'
|
||||
})
|
||||
}, 1000);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.switch{
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
margin-top: 21rpx;
|
||||
margin-left:29rpx;
|
||||
}
|
||||
.is-input-border{
|
||||
border: 0px !important;
|
||||
}
|
||||
.form_body_title_text{
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
</style>
|
||||
97
pages/login/coments/starlogin.vue
Normal file
97
pages/login/coments/starlogin.vue
Normal file
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="form_body" style="">
|
||||
<view class="form_body_title">欢迎登录星云台</view>
|
||||
<view class="form_body_input">
|
||||
<view style="color: #999999;">+86</view>
|
||||
<input type="number" v-model="phone" placeholder="请输入手机号" class="form_input" />
|
||||
</view>
|
||||
<view class="form_body_footer">
|
||||
<view class="form_body_footer_text">
|
||||
<view>
|
||||
<uni-data-checkbox multiple v-model="value" :localdata="range" @change="change">
|
||||
</uni-data-checkbox>
|
||||
</view>
|
||||
阅读并同意 <text style="color: #2A67FE;">《用户隐私政策》</text> 和 <text
|
||||
style="color: #2A67FE;">《星油能源注册服务协议》</text>
|
||||
</view>
|
||||
<button @tap="sumit" style="margin-top:26rpx; " class="form_body_butten">一键登录</button>
|
||||
</view>
|
||||
</view>
|
||||
<uni-popup ref="popup" type="center">
|
||||
<view class="popup">
|
||||
<view class="popup_title">为了更好地使用服务<br /><text style="margin-top: 15rpx;">登录前请先阅读并同意下方协议</text></view>
|
||||
<view class="popup_text">《用户隐私政策》和《星油能源注册服务协议》</view>
|
||||
<view class="popup_footer">
|
||||
<view @tap="ishowFn(0)" class="popup_footer_butteno">不同意</view>
|
||||
<view @tap="ishowFn(1)" class="popup_footer_buttent">同意并继续</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import tool from '@/utils/tool'
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
phone:'',
|
||||
value: [],
|
||||
range: [{
|
||||
"value": 0,
|
||||
"text": ""
|
||||
}]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
ishowFn(e){
|
||||
if(e){
|
||||
this.value.push(0)
|
||||
this.$refs.popup.close()
|
||||
}else{
|
||||
this.$refs.popup.close()
|
||||
}
|
||||
},
|
||||
sumit() {
|
||||
if (this.value.length == 0) {
|
||||
this.$refs.popup.open('center')
|
||||
return
|
||||
}
|
||||
if(this.phone==''){
|
||||
uni.showToast({
|
||||
title:'手机号不能为空',
|
||||
icon:'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
let checkPage = {
|
||||
phone:{
|
||||
custom:/^[1][3,4,5,7,8,9][0-9]{9}$/,
|
||||
WrongText:'请输入正确手机号码'
|
||||
}
|
||||
}
|
||||
let check = tool.checkFn({phone:this.phone},[],checkPage)
|
||||
if(!check.result){
|
||||
uni.showToast({
|
||||
title:check.WrongText,
|
||||
icon:'error'
|
||||
})
|
||||
return
|
||||
}
|
||||
let that = this
|
||||
uni.$emit('state',{
|
||||
state:1,
|
||||
phone:that.phone
|
||||
})
|
||||
},
|
||||
change(e) {
|
||||
console.log(this.value)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
97
pages/login/coments/verificationCode.vue
Normal file
97
pages/login/coments/verificationCode.vue
Normal file
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="form_body" style="">
|
||||
<view class="form_body_title">
|
||||
登陆账户<br/>
|
||||
<text class="form_body_title_text">
|
||||
验证码已发送至
|
||||
</text>
|
||||
<text style="font-weight: 600;" class="form_body_title_text">{{phone}}</text>
|
||||
</view>
|
||||
<view style=" background-color: #f0f2ff; border-radius: 0;" class="form_body_input">
|
||||
<xt-verify-code style="width: 100%;" v-model="verifyCode" @confirm="confirm"></xt-verify-code>
|
||||
</view>
|
||||
<view class="switch">
|
||||
<view @tap="switchFn">密码登录</view>
|
||||
<view style="font-size: 26rpx;color: #2866FF;" @tap="senFn">{{timer.time==0? timer.timeText:timer.time+'s'}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props:{
|
||||
phone:{
|
||||
type:String,
|
||||
default:''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
value: '',
|
||||
timer:{
|
||||
time:60,
|
||||
timeText:'重新发送'
|
||||
},
|
||||
verifyCode:'',
|
||||
range: [{
|
||||
"value": 0,
|
||||
"text": ""
|
||||
}]
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.timerFn()
|
||||
},
|
||||
methods: {
|
||||
senFn(){
|
||||
if(this.timer.time!==0) return;
|
||||
this.timer.time = 60
|
||||
this.timerFn()
|
||||
},
|
||||
timerFn(){
|
||||
let that = this
|
||||
let time = setInterval(() => {
|
||||
console.log('定时器启动')
|
||||
that.timer.time--;
|
||||
if(that.timer.time == 0){
|
||||
clearInterval(time)
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
switchFn(){
|
||||
let that = this
|
||||
uni.$emit('state',{
|
||||
state:1,
|
||||
phone:that.phone
|
||||
})
|
||||
},
|
||||
confirm(e){
|
||||
if(e){
|
||||
console.log(e)
|
||||
}
|
||||
console.log(this.verifyCode,'验证码')
|
||||
},
|
||||
sumit(){
|
||||
console.log(1)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.switch{
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #000000;
|
||||
margin-top: 21rpx;
|
||||
margin-left:29rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
.form_body_title_text{
|
||||
font-size: 28rpx;
|
||||
color: #333333;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user