设置中心个人认证企业认证状态

This commit is contained in:
2021-09-25 10:28:54 +08:00
parent f02c1a75b3
commit 8edc92f475
2 changed files with 78 additions and 29 deletions

View File

@@ -71,6 +71,13 @@ const aboutUs = () => {
url: 'articles/about' url: 'articles/about'
}) })
} }
// 获取企业认证状态 -1.未认证0.审核中1.审核通过2.驳回
const companyStatus = () => {
return request({
url: 'companies/applies/query'
})
}
export { export {
login, login,
@@ -80,5 +87,6 @@ export {
agreementLogin, agreementLogin,
resetUserInfo, resetUserInfo,
getUserSettingInfo, getUserSettingInfo,
aboutUs aboutUs,
companyStatus
} }

View File

@@ -33,21 +33,29 @@
<u-icon name="arrow-right" color="#f1f1f1" size="28" /> <u-icon name="arrow-right" color="#f1f1f1" size="28" />
</button> </button>
<!-- 个人认证 --> <!-- 个人认证 -->
<view @click="certification(is_certification)" class="list-item"> <view @click="certificationClick(certification)" class="list-item">
<view class="list-item-left"> <view class="list-item-left">
<image src="/static/imgs/self-icon.png" mode="widthFix" /> <image src="/static/imgs/self-icon.png" mode="widthFix" />
<span>个人认证</span> <span>个人认证</span>
</view> </view>
<view class="input">
<input type="text" :value="certification.is_true?'已认证':''"
:placeholder="certification.is_true?'':'未认证'" disabled="true" maxlength="12" />
<u-icon name="arrow-right" color="#f1f1f1" size="28" /> <u-icon name="arrow-right" color="#f1f1f1" size="28" />
</view> </view>
</view>
<!-- 企业认证 --> <!-- 企业认证 -->
<view @click="company(is_company)" class="list-item"> <view @click="company(companyCode.code)" class="list-item">
<view class="list-item-left"> <view class="list-item-left">
<image src="/static/imgs/company-icon.png" mode="widthFix" /> <image src="/static/imgs/company-icon.png" mode="widthFix" />
<span>企业认证</span> <span>企业认证</span>
</view> </view>
<view class="input">
<input type="text" :value="companyCode.code=== 1?'已认证':''"
:placeholder="companyCode.code !== 1?companyCode.message:''" disabled="true" maxlength="12" />
<u-icon name="arrow-right" color="#f1f1f1" size="28" /> <u-icon name="arrow-right" color="#f1f1f1" size="28" />
</view> </view>
</view>
<!-- 关于我们 --> <!-- 关于我们 -->
<view @click="$router.push({name:'aboutUs'})" class="list-item"> <view @click="$router.push({name:'aboutUs'})" class="list-item">
<view class="list-item-left"> <view class="list-item-left">
@@ -80,7 +88,8 @@
import { import {
wechatbind, wechatbind,
resetUserInfo, resetUserInfo,
getUserSettingInfo getUserSettingInfo,
companyStatus
} from '@/apis/interfaces/setting' } from '@/apis/interfaces/setting'
import { import {
uploads uploads
@@ -96,8 +105,8 @@
showPath: '' showPath: ''
}, },
is_bind: true, // 微信绑定 is_bind: true, // 微信绑定
is_certification: true, // 个人认证 certification: {}, // 个人认证
is_company: true, // 企业认证 companyCode: {}, // 企业认证 -1.未认证0.审核中1.审核通过2.驳回
} }
}, },
onShow() { onShow() {
@@ -107,38 +116,59 @@
} }
}) })
this.getUserInfo() this.getUserInfo()
}, },
onPullDownRefresh() { onPullDownRefresh() {
this.getUserInfo() this.getUserInfo()
}, },
methods: { methods: {
// 是否个人认证 // 是否个人认证
certification(is_certfication) { certificationClick(certfication) {
console.log(is_certfication) console.log(certfication)
if (is_certfication) { if (certfication.is_true) {
// 跳转到个人认证信息完成展示页面 // 跳转到个人认证信息完成展示页面
this.$router.push({ // this.$refs.uToast.show({
name: '' // title: '认证通过!',
// type: 'primary',
// duration: 3000
// })
uni.showModal({
title: '认证信息',
content: '真实姓名:<' + certfication.message.name + '>,身份证号:' + certfication.message.idcard,
showCancel:false
}) })
} else { } else {
// 跳转到个人认证信息页面 // 跳转到个人认证信息页面
this.$router.push({ uni.navigateTo({
name: '' url: '/pages/certification/personal'
}) })
} }
}, },
// 是否展示企业信息 // 是否展示企业信息 企业认证 -1.未认证0.审核中1.审核通过2.驳回
company(is_company) { company(code) {
console.log(is_company) console.log(code, '是否企业认证')
if (is_company) { if (code === -1) {
// 跳转到企业认证完成信息展示页面
this.$router.push({
name: ''
})
} else {
// 跳转到企业认证页面 // 跳转到企业认证页面
this.$router.push({ uni.navigateTo({
name: '' url: '/pages/company/approve'
})
} else if (code === 2) {
// 跳转到企业认证页面
uni.navigateTo({
url: '/pages/company/approve?form_type=put'
})
} else if (code === 0) {
this.$refs.uToast.show({
title: '审核中',
type: 'primary',
duration: 3000
})
} else if (code === 1) {
// 跳转到企业认证页面
this.$refs.uToast.show({
title: '认证通过!',
type: 'primary',
duration: 3000
}) })
} }
}, },
@@ -148,8 +178,7 @@
this.avatar.showPath = res.avatar this.avatar.showPath = res.avatar
this.nickname = res.nickname this.nickname = res.nickname
this.is_bind = res.is_bind this.is_bind = res.is_bind
this.is_certification = res.is_certification this.certification = res.certification
this.is_company = res.is_company
uni.stopPullDownRefresh() uni.stopPullDownRefresh()
}).catch(err => { }).catch(err => {
this.$refs.uToast.show({ this.$refs.uToast.show({
@@ -158,6 +187,17 @@
duration: 3000 duration: 3000
}) })
}) })
// -1.未认证0.审核中1.审核通过2.驳回
companyStatus().then(res => {
console.log(res)
this.companyCode = res
}).catch(err => {
this.$refs.uToast.show({
title: err.message,
type: 'primary',
duration: 3000
})
})
}, },
// 点击绑定用户得授权信息,且绑定带修改 // 点击绑定用户得授权信息,且绑定带修改
getUser() { getUser() {
@@ -385,8 +425,9 @@
flex: 1; flex: 1;
input { input {
padding-right: 30rpx; padding-right: 20rpx;
width: 100%; width: 100%;
font-size: 30rpx;
} }
} }