diff --git a/pages/apply/index.vue b/pages/apply/index.vue index 7dc98b5..42b7219 100644 --- a/pages/apply/index.vue +++ b/pages/apply/index.vue @@ -57,6 +57,7 @@ import { RegisterUser } from '../../services/apply.js' + import config from '../../config/common.js' import { isChinaMobilePhone, easyCheckID, @@ -66,9 +67,10 @@ data() { return { showSex: false, + appurl: config.uni_app_url, formatter: null, pickerShow: false, - loading:false, + loading: false, pickerColumns: [Array(60).fill(null).map((_, i) => i)], model1: { userInfo: { @@ -200,13 +202,13 @@ } this.loading = true const json = { - Name: this.model1.userInfo.Name, - Sex: this.model1.userInfo.Sex == '男'?'1':'0', - Phone: this.model1.userInfo.Phone, - ID_CARD: this.model1.userInfo.ID_CARD, - InTime: this.model1.userInfo.InTime, - WORKINGYEAR: this.model1.userInfo.WORKINGYEAR, - } + Name: this.model1.userInfo.Name, + Sex: this.model1.userInfo.Sex == '男' ? '1' : '0', + Phone: this.model1.userInfo.Phone, + ID_CARD: this.model1.userInfo.ID_CARD, + InTime: this.model1.userInfo.InTime, + WORKINGYEAR: this.model1.userInfo.WORKINGYEAR, + } // const json = { // Name: '云', // Sex: '0', @@ -217,16 +219,31 @@ // } RegisterUser(json).then((res) => { if (res.code == 200) { - console.log('成功', res); this.loading = false - uni.navigateTo({ - url: '/pages/apply/complete?type=success' + uni.showToast({ + 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 { this.loading = false - uni.navigateTo({ - url: `/pages/apply/complete?type=failed&title=${res.msg}` + uni.showToast({ + title: res.msg, + icon: 'none' }) + // uni.navigateTo({ + // url: `/pages/apply/complete?type=failed&title=${res.msg}` + // }) } }).catch((err) => { diff --git a/pages/index/index.vue b/pages/index/index.vue index 33bd45f..08377a2 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -117,18 +117,18 @@ // }) }, getCaidan() { - const json = { - Company: this.company, + Company: uni.getStorageSync('Company'), Post: '搬运工', Type: 1 } getMenu(json).then((res) => { - console.log('成功', res); this.baseList = res.data - }).catch((err) => { - console.error('失败', err); + uni.showToast({ + title: '请求错误', + icon: 'none' + }) }) } diff --git a/utils/request.js b/utils/request.js index 177eb1c..d1fb443 100644 --- a/utils/request.js +++ b/utils/request.js @@ -5,7 +5,10 @@ import handle401 from './handle401' export default { 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 = '' if (Company == 'DCJD') { tenantId = 'A0000025'