逻辑调整优化

This commit is contained in:
yunkexin 2024-09-02 17:37:50 +08:00
parent 814573aa62
commit 59fc1be7c7
3 changed files with 39 additions and 19 deletions

View File

@ -57,6 +57,7 @@
import { import {
RegisterUser RegisterUser
} from '../../services/apply.js' } from '../../services/apply.js'
import config from '../../config/common.js'
import { import {
isChinaMobilePhone, isChinaMobilePhone,
easyCheckID, easyCheckID,
@ -66,9 +67,10 @@
data() { data() {
return { return {
showSex: false, showSex: false,
appurl: config.uni_app_url,
formatter: null, formatter: null,
pickerShow: false, pickerShow: false,
loading:false, loading: false,
pickerColumns: [Array(60).fill(null).map((_, i) => i)], pickerColumns: [Array(60).fill(null).map((_, i) => i)],
model1: { model1: {
userInfo: { userInfo: {
@ -200,13 +202,13 @@
} }
this.loading = true this.loading = true
const json = { const json = {
Name: this.model1.userInfo.Name, Name: this.model1.userInfo.Name,
Sex: this.model1.userInfo.Sex == '男'?'1':'0', Sex: this.model1.userInfo.Sex == '男' ? '1' : '0',
Phone: this.model1.userInfo.Phone, Phone: this.model1.userInfo.Phone,
ID_CARD: this.model1.userInfo.ID_CARD, ID_CARD: this.model1.userInfo.ID_CARD,
InTime: this.model1.userInfo.InTime, InTime: this.model1.userInfo.InTime,
WORKINGYEAR: this.model1.userInfo.WORKINGYEAR, WORKINGYEAR: this.model1.userInfo.WORKINGYEAR,
} }
// const json = { // const json = {
// Name: '', // Name: '',
// Sex: '0', // Sex: '0',
@ -217,16 +219,31 @@
// } // }
RegisterUser(json).then((res) => { RegisterUser(json).then((res) => {
if (res.code == 200) { if (res.code == 200) {
console.log('成功', res);
this.loading = false this.loading = false
uni.navigateTo({ uni.showToast({
url: '/pages/apply/complete?type=success' title: '注册成功!',
icon: 'none'
}) })
setTimeout(() => {
uni.hideToast();
location.href = this.appurl
// uni.redirectTo({
// url: '/pages/webview/webview?url=' + this.appurl
// })
},1500)
// uni.navigateTo({
// url: '/pages/apply/complete?type=success'
// })
} else { } else {
this.loading = false this.loading = false
uni.navigateTo({ uni.showToast({
url: `/pages/apply/complete?type=failed&title=${res.msg}` title: res.msg,
icon: 'none'
}) })
// uni.navigateTo({
// url: `/pages/apply/complete?type=failed&title=${res.msg}`
// })
} }
}).catch((err) => { }).catch((err) => {

View File

@ -117,18 +117,18 @@
// }) // })
}, },
getCaidan() { getCaidan() {
const json = { const json = {
Company: this.company, Company: uni.getStorageSync('Company'),
Post: '搬运工', Post: '搬运工',
Type: 1 Type: 1
} }
getMenu(json).then((res) => { getMenu(json).then((res) => {
console.log('成功', res);
this.baseList = res.data this.baseList = res.data
}).catch((err) => { }).catch((err) => {
console.error('失败', err); uni.showToast({
title: '请求错误',
icon: 'none'
})
}) })
} }

View File

@ -5,7 +5,10 @@ import handle401 from './handle401'
export default { export default {
send(params) { send(params) {
let Company = uni.getStorageSync('Company') const pages = getCurrentPages()
const currentPage = pages[pages.length - 1]
const Options = currentPage.options
let Company = Options.Company?Options.Company:'XLK'
let tenantId = '' let tenantId = ''
if (Company == 'DCJD') { if (Company == 'DCJD') {
tenantId = 'A0000025' tenantId = 'A0000025'