用户注册跳转登录bug/switch转为u-switch组件

This commit is contained in:
曹前明 2022-10-23 21:41:52 +08:00
parent 959a846bcf
commit 3641cf4fb5
5 changed files with 43 additions and 30 deletions

View File

@ -127,7 +127,7 @@
onShow() {
// debugger;
// console.log(this.vuex_perm)
if(this.vuex_user.type==='visitor'){
if(this.vuex_user.type==='visitor'||this.vuex_user.type==='driver'){
this.limitedVisit = true;
}else{
let date = new Date();

View File

@ -390,34 +390,34 @@
}
console.log(perms);
that.$u.vuex('vuex_perm', perms)
})
that.$u.api.hrmUserInfo().then(res => {
that.$u.vuex('vuex_employee', res)
if (res.type === 'employee') {
uni.reLaunch({
url: '/pages/home/home_'
})
} else {
//
if (res.id_number == '' || res.photo == '' || res.id_number == null || res
.photo == null) {
//
that.$u.api.hrmUserInfo().then(res => {
that.$u.vuex('vuex_employee', res)
if (res.type === 'employee') {
uni.reLaunch({
url: '/pages/my/myInfoChange'
url: '/pages/home/home_'
})
} else {
//
if (res.type === 'remployee') {
//
if (res.id_number == '' || res.photo == '' || res.id_number == null || res
.photo == null) {
//
uni.reLaunch({
url: '/pages/home/home_'
url: '/pages/my/myInfoChange'
})
} else {
uni.reLaunch({
url: '/pages/workSpace/workSpace'
})
//
if (res.type === 'remployee') {
uni.reLaunch({
url: '/pages/home/home_'
})
} else {
uni.reLaunch({
url: '/pages/workSpace/workSpace'
})
}
}
}
}
})
})
// #ifdef APP-PLUS
let secret = that.ranStr(12)

View File

@ -107,8 +107,12 @@
if (!that.checkedParams(obj)) return;
that.$u.api.visitorRegister(obj).then(res => {
uni.hideLoading();
uni.showToast({
title:"注册成功,请重新登录",
icon: "none"
})
uni.reLaunch({
url: '/pages/login/login_'
url: '/pages/login/login_?autoLoading=no'
})
})

View File

@ -10,7 +10,7 @@
<view class="item item_bottom_border">
<view class="title">手机号</view>
<view class="content">
<input type="text" v-model="userInfo.phone" maxlength="20" placeholder="请输入" />
<input type="text" v-model="userInfo.phone" maxlength="20" placeholder="请输入" disabled/>
</view>
</view>
<view class="item item_bottom_border">
@ -112,12 +112,21 @@
if (!that.paramsCheck()) {
return;
} else {
uni.showLoading({
title: '保存中...',
mask: true
})
this.$u.api.hrmUpdateInfo(this.userInfo).then(res=>{
debugger;
console.log(res)
uni.navigateTo({
url: '/pages/my/my'
uni.hideLoading()
uni.showToast({
title: '保存成功',
icon: 'none'
})
uni.reLaunch({
url: '/pages/workSpace/workSpace'
})
}).catch(e=>{
uni.hideLoading()
})
}
},

View File

@ -56,13 +56,13 @@
<view class="item item_bottom_border">
<view class="title">是否报备</view>
<view class="content">
<switch name="is_main" v-model="formData.is_reported" />
<u-switch v-model="formData.is_reported"></u-switch>
</view>
</view>
<view class="item item_bottom_border">
<view class="title">是否主访客</view>
<view class="content">
<switch name="is_main" v-model="formData.is_main" />
<u-switch v-model="formData.is_main"></u-switch>
</view>
</view>
<view class="item item_bottom_border" style="height: fit-content;">
@ -143,7 +143,7 @@
},
onShow() {
this.getHeader();
// this.getUserRange();
this.getUserRange();
},
methods: {
getHeader() {