diff --git a/apis/modules/user.js b/apis/modules/user.js index f1cf456..1a2ac30 100644 --- a/apis/modules/user.js +++ b/apis/modules/user.js @@ -52,7 +52,7 @@ export const queryCity = (data) => { } export const updateAvatars = data => { - return post(`users/users/user/updateAvatars?openId=${data.openId}&url=${data.url}&userName=${data.userName}`) + return post(`users/users/user/updateAvatars?openId=${data.openId}&url=${data.url}&userName=${data.userName}&platformId=7`) } export const sendPhoneOrEmailCode = (data) => { diff --git a/config/common.js b/config/common.js index aedb83e..2db3f6f 100644 --- a/config/common.js +++ b/config/common.js @@ -25,7 +25,7 @@ export default { name: '供应商' }, ], - // 认证状态 + // 审核状态 auditStatus: [ { id: null, @@ -48,4 +48,23 @@ export default { name: '不通过' }, ], + // 认证状态 + authenticationStatus: [ + { + id: null, + name: '不限' + }, + { + id: 0, + name: '未认证' + }, + { + id: 1, + name: '认证中' + }, + { + id: 2, + name: '已认证' + }, + ], } diff --git a/other/activityDetail/activityDetail.vue b/other/activityDetail/activityDetail.vue index 6570536..5159bf1 100644 --- a/other/activityDetail/activityDetail.vue +++ b/other/activityDetail/activityDetail.vue @@ -248,6 +248,7 @@ .label { min-width: 180rpx; font-size: 28rpx; + text-align: right; } .val { font-size: 28rpx; diff --git a/other/supplierDetail/supplierDetail.vue b/other/supplierDetail/supplierDetail.vue index 21acff7..41338ba 100644 --- a/other/supplierDetail/supplierDetail.vue +++ b/other/supplierDetail/supplierDetail.vue @@ -1,21 +1,19 @@ @@ -127,6 +127,9 @@ }, // 列表 getList() { + uni.showLoading({ + title: '加载中' + }) postLoginActivity({ pageNum: this.page, pageSize: this.pageSize, @@ -142,11 +145,14 @@ this.now = await Util.getNow() this.statusInterval() + uni.hideLoading() this.timer = setInterval(() => { this.now = new Date(this.now.setSeconds(this.now.getSeconds() + 1)) this.statusInterval() }, 1000) - }).catch(e => {}) + }).catch(e => { + uni.hideLoading() + }) }, async statusInterval () { this.list.map(item => { diff --git a/pages/login/login.vue b/pages/login/login.vue index d61e38c..650ad69 100644 --- a/pages/login/login.vue +++ b/pages/login/login.vue @@ -116,6 +116,7 @@ this.submiting = false // 用户不存在,则让用户授权手机号,直接让用户选择角色注册 if (state === 'bind') { + this.submiting = false this.code = code this.openid = sessionKey.openid this.sessionKey = sessionKey.session_key @@ -159,6 +160,7 @@ const phone = data.phoneNumber this.phone = phone if (this.isReg) { // 注册 + this.submiting = false this.$refs.popup.open('bottom') } else { // 登录绑定手机号 userBinding({ @@ -198,28 +200,34 @@ }, // 注册申请授权 async toReg(platformId) { - const { data } = await kindergartenWeChatApplication({ - code: this.code, - openId: this.openid, - platformId, - phone: this.phone - }) - this.teamName = data.teamName - uni.setStorageSync('token', data.token) - uni.setStorageSync('platformId', platformId) - uni.setStorageSync('openId', data.openId) - uni.setStorageSync('teamId', data.teamId) - - // 选择的是供应商或者幼儿园,则加一个未提交的审核状态 - if (platformId === 5 || platformId === 6) { - await saveCertification({ - openId: data.openId, - auditStatus: 0, - platformSource: platformId, - companyName: this.teamName + if (this.submiting) return false + this.submiting = true + try { + const { data } = await kindergartenWeChatApplication({ + code: this.code, + openId: this.openid, + platformId, + phone: this.phone }) + this.teamName = data.teamName + uni.setStorageSync('token', data.token) + uni.setStorageSync('platformId', platformId) + uni.setStorageSync('openId', data.openId) + uni.setStorageSync('teamId', data.teamId) + + // 选择的是供应商或者幼儿园,则加一个未提交的审核状态 + if (platformId === 5 || platformId === 6) { + await saveCertification({ + openId: data.openId, + auditStatus: 0, + platformSource: platformId, + companyName: this.teamName + }) + } + this.toIndex() + } catch(e) { + this.submiting = false } - this.toIndex() }, toAgreement(id) { this.$util.openFile(id) diff --git a/pages/person/person.vue b/pages/person/person.vue index a72ba8d..868e124 100644 --- a/pages/person/person.vue +++ b/pages/person/person.vue @@ -4,7 +4,7 @@ - + @@ -15,8 +15,8 @@ - {{ curAccount.account || userName }} - {{ curAccount.phone }} + {{ info.userName || userName }} + {{ curAccount.account || info.phone }} {{ info.authentication }} @@ -86,7 +86,6 @@ {{ platformName }}负责人 {{ auditStatus }} - {{ enterInfo.companyName }} @@ -177,7 +176,9 @@ auditStatus: '', isMember: true, // 成员标识 organizationName: '', - curAccount: {} + curAccount: { + account: '' + } } }, computed: { @@ -211,6 +212,16 @@ const { result } = await viewUserDetails({ openId: this.openId }) + // status为false,说明用户被删除了,则退出登录 + if (result.status === false) { + this.$util.errMsg(result.message) + setTimeout(() => { + uni.clearStorageSync() + this.$util.to('/pages/login/login') + }, 1500) + return false + } + if (result.hrUserInfo) { if (!result.hrUserInfo.userAvatars) result.hrUserInfo.userAvatars = Common.avatar // 没有头像则显示默认头像 this.info = result.hrUserInfo @@ -224,13 +235,18 @@ if (accountList && accountList.length) { const enter = accountList.find(e => e.platformId !== '7') this.curAccount = enter || accountList[0] + // 如果没有企业的身份,则重置身份为个人 + if (!enter) { + uni.setStorageSync('platformId', 7) + this.platformId = 7 + } } }, // 企业认证信息 async getEnterInfo() { const { data } = await enterpriseCertificationStatus(this.openId) if (data) { - this.auditStatus = Common.auditStatus.find(e => e.id === data.auditStatus).name + this.auditStatus = Common.authenticationStatus.find(e => e.id === data.authenticationStatus).name this.enterInfo = data } }, @@ -272,7 +288,8 @@ updateAvatars({ url, userName: '', - openId: this.openId + openId: this.openId, + platformId: this.platformId, }).then(res => { this.getInfo() }).catch(e => {}) @@ -287,9 +304,9 @@ }, // 跳转企业认证 toEnterAuth(platformId) { - const { auditStatus, platformSource } = this.enterInfo + const { authenticationStatus, platformSource } = this.enterInfo // 审核状态(0默认未提交 1.待审核,2.已通过,3.已驳回) - if (auditStatus === 1) { + if (authenticationStatus === 1) { if (platformSource != platformId) { // 如果组织认证已经在审核中的,点击另外一个认证的,弹窗提示“您已提交我是供应商的认证,无法再提交幼儿园认证。 this.$util.errMsg(`您已提交我是${platformId === 5 ? '供应商' : '幼儿园'}的认证,无法再提交${platformId === 5 ? '幼儿园' : '供应商'}认证。`) @@ -297,7 +314,7 @@ this.$util.errMsg('您已提交认证,请等待审核。') } } else { - this.$util.to(auditStatus === 2 ? '/team/certified/certified' : '/team/auth/auth?platformId=' + platformId) + this.$util.to(authenticationStatus === 2 ? '/team/certified/certified' : '/team/auth/auth?platformId=' + platformId) } }, // 提示暂未开放 @@ -402,12 +419,6 @@ width: 25%; margin-bottom: 30rpx; text-align: center; - &:last-child { - image { - width: 50rpx; - height: 50rpx; - } - } } image { width: 60rpx; diff --git a/pages/supplier/supplier.vue b/pages/supplier/supplier.vue index d6f7dca..f8fe482 100644 --- a/pages/supplier/supplier.vue +++ b/pages/supplier/supplier.vue @@ -119,6 +119,9 @@ }, // 列表 getList() { + uni.showLoading({ + title: '加载中' + }) selectEnterpriseCertificationList({ auditStatus: null, authenticationStatus: 2, @@ -132,7 +135,10 @@ const noMore = this.list.length === data.total // 是否加载完所有数据 this.status = noMore ? 'noMore' : 'more' // 加载完了则设置为noMore this.reachBottom = noMore ? -1 : 0 // 加载完了则设置为-1 - }).catch(e => {}) + uni.hideLoading() + }).catch(e => { + uni.hideLoading() + }) }, // keyword清除回调 clearKeyword() { @@ -141,7 +147,7 @@ }, // 跳转学习详情 toDetail(item) { - this.$util.to('/other/supplierDetail/supplierDetail?id=' + item.id) + this.$util.to('/other/supplierDetail/supplierDetail?teamId=' + item.teamId) }, // tab切换 tabChange(tab) { @@ -199,6 +205,7 @@ color: #999; } .meta { + margin: 10rpx 0; font-size: 28rpx; color: #333; } diff --git a/team/auth/auth.vue b/team/auth/auth.vue index 867cddd..131ac3a 100644 --- a/team/auth/auth.vue +++ b/team/auth/auth.vue @@ -114,7 +114,10 @@ if (!form.companyName) return this.$util.errMsg(`请输入${platformName}名称!`) if (!form.creditCode) return this.$util.errMsg('请输入统一社会信用代码!') if (!form.legalPerson) return this.$util.errMsg('请输入法人!') - this.submiting = false + this.submiting = true + uni.showLoading({ + title: '提交中' + }) const data = { ...form, auditStatus: 1, @@ -144,15 +147,15 @@ classificationName: form.companyName }) } + this.$util.sucMsg('提交成功,请重新登录!') + setTimeout(() => { + uni.clearStorageSync() + this.$util.to('/pages/login/login') + }, 1500) } catch(e) { + uni.hideLoading() this.submiting = false } - - this.$util.sucMsg('提交成功,请重新登录!') - setTimeout(() => { - uni.clearStorageSync() - this.$util.to('/pages/login/login') - }, 1500) }, } } diff --git a/team/info/info.vue b/team/info/info.vue index b0b8e90..93c032e 100644 --- a/team/info/info.vue +++ b/team/info/info.vue @@ -92,7 +92,6 @@ getInfo() { queryTeamInfo({ teamId: this.teamId - // teamId: 281 }).then(res => { const data = res.teamInfo if (!data.logoUrl) data.logoUrl = Common.avatar diff --git a/team/infoEdit/infoEdit.vue b/team/infoEdit/infoEdit.vue index 73e7a97..480fb12 100644 --- a/team/infoEdit/infoEdit.vue +++ b/team/infoEdit/infoEdit.vue @@ -123,6 +123,7 @@ provinces: [], cities: [], desPics: [], + submiting: false } }, computed: { @@ -233,18 +234,24 @@ }, // 提交 async submit() { + if (this.submiting) return false const { form } = this if (!form.classificationName) return this.$util.errMsg(`请输入幼儿园名称!`) + this.submiting = true form.pictureUrl = this.desPics.map(e => e.url).join() form.qrCodeOneUrl = this.qrCodeOne.length ? this.qrCodeOne[0].url : '' form.qrCodeTwoUrl = this.qrCodeTwo.length ? this.qrCodeTwo[0].url : '' form.qrCodeThreeUrl = this.qrCodeThree.length ? this.qrCodeThree[0].url : '' - await updateTeamInfo(form) - - this.$util.sucMsg('保存成功!') - setTimeout(() => { - uni.navigateBack() - }, 1500) + try { + await updateTeamInfo(form) + + this.$util.sucMsg('保存成功!') + setTimeout(() => { + uni.navigateBack() + }, 1500) + } catch(e) { + this.submiting = false + } } } } diff --git a/team/personAuth/personAuth.vue b/team/personAuth/personAuth.vue index 43ef43e..16cc265 100644 --- a/team/personAuth/personAuth.vue +++ b/team/personAuth/personAuth.vue @@ -55,7 +55,8 @@ theFrontOfIDCard: 'https://occupationlab.com/images/preschoolEdu/credentials1.png', reverseOfIDCard: 'https://occupationlab.com/images/preschoolEdu/credentials2.png', frontData: {}, - backData: {} + backData: {}, + submiting: false } }, onShow() { @@ -111,9 +112,14 @@ }); }, submit() { + if (this.submiting) return false const { form } = this if (!form.userName) return this.$util.errMsg('请输入姓名!') if (!form.idCardNo) return this.$util.errMsg('请输入证件号!') + this.submiting = true + uni.showLoading({ + title: '提交中' + }) const { frontData } = this const { backData } = this realNameAuthentication({ @@ -136,7 +142,10 @@ url: '/pages/person/person' }) }, 1500) - }).catch(e => {}) + }).catch(e => { + uni.hideLoading() + this.submiting = false + }) }, } } diff --git a/team/userName/userName.vue b/team/userName/userName.vue index 462b92b..a156daa 100644 --- a/team/userName/userName.vue +++ b/team/userName/userName.vue @@ -12,6 +12,7 @@ export default { data() { return { + platformId: uni.getStorageSync('platformId'), info: { userName: '' }, @@ -37,7 +38,8 @@ await updateAvatars({ url: '', userName, - openId: this.openId + openId: this.openId, + platformId: this.platformId, }) this.$util.sucMsg('修改成功!') setTimeout(() => {