提交 68b6ef1a authored 作者: 王鹏飞's avatar 王鹏飞

chore: 证书相关接口对接为api/psp

上级 ace04be8
...@@ -73,54 +73,38 @@ export function getApplicationStatus() { ...@@ -73,54 +73,38 @@ export function getApplicationStatus() {
* 获取支付二维码 * 获取支付二维码
*/ */
export function getOrder(params) { export function getOrder(params) {
return httpRequest.get( return httpRequest.get(`/enrollment/v1.0/application-materials/payment-records/request/${projectId}/APPLICATION_FEE`, params)
`/enrollment/v1.0/application-materials/payment-records/request/${projectId}/APPLICATION_FEE`,
params
)
} }
/** /**
* 检查支付状态 * 检查支付状态
*/ */
export function checkPay(id, params) { export function checkPay(id, params) {
return httpRequest.get( return httpRequest.get(`/enrollment/v1.0/application-materials/payment-records/check-status/${projectId}/APPLICATION_FEE/${id}`, params)
`/enrollment/v1.0/application-materials/payment-records/check-status/${projectId}/APPLICATION_FEE/${id}`,
params
)
} }
/** /**
* 写推荐信 * 写推荐信
*/ */
export function addLetter(userId, letterId, data) { export function addLetter(userId, letterId, data) {
return httpRequest.post( return httpRequest.post(`/enrollment/v1.0/application-materials/reco-letters/submit/${projectId}/${userId}/${letterId}/put`, data, {
`/enrollment/v1.0/application-materials/reco-letters/submit/${projectId}/${userId}/${letterId}/put`,
data,
{
headers: { 'Content-Type': 'application/json' } headers: { 'Content-Type': 'application/json' }
} })
)
} }
/** /**
* 更换推荐人 * 更换推荐人
*/ */
export function updateProvider(letterId, data) { export function updateProvider(letterId, data) {
return httpRequest.post( return httpRequest.post(`/enrollment/v1.0/application-materials/reco-letters/change-provider/${projectId}/${letterId}/put`, data, {
`/enrollment/v1.0/application-materials/reco-letters/change-provider/${projectId}/${letterId}/put`,
data,
{
headers: { 'Content-Type': 'application/json' } headers: { 'Content-Type': 'application/json' }
} })
)
} }
/** /**
* 再次邀请 * 再次邀请
*/ */
export function sendToProvider(letterId) { export function sendToProvider(letterId) {
return httpRequest.get( return httpRequest.get(`/enrollment/v1.0/application-materials/reco-letters/send-invitation-to-provider/${projectId}/${letterId}`)
`/enrollment/v1.0/application-materials/reco-letters/send-invitation-to-provider/${projectId}/${letterId}`
)
} }
/** /**
* 退出登录 * 退出登录
...@@ -133,10 +117,7 @@ export function logout() { ...@@ -133,10 +117,7 @@ export function logout() {
* 更改附件状态 * 更改附件状态
*/ */
export function changeFileStatus(userId, recordId, status) { export function changeFileStatus(userId, recordId, status) {
return httpRequest.get( return httpRequest.get(`/enrollment/v1.0/application-materials/attachments/change-status/${projectId}/${userId}/${recordId}`, { status })
`/enrollment/v1.0/application-materials/attachments/change-status/${projectId}/${userId}/${recordId}`,
{ status }
)
} }
/** /**
...@@ -196,53 +177,51 @@ export function getPaymentList() { ...@@ -196,53 +177,51 @@ export function getPaymentList() {
* 获取证书手机验证码 * 获取证书手机验证码
*/ */
export function certSendCode(params) { export function certSendCode(params) {
return httpRequest.get('/certs/v1/prp/send-code', params, { headers: { 'Content-Type': 'application/json' } }) return httpRequest.get('/psp/v1/welfare/send-code', params)
} }
/** /**
* 获取证书地址 * 获取证书地址
*/ */
export function certSearch(params) { export function certSearch(params) {
return httpRequest.get('/certs/v1/prp/search', params, { headers: { 'Content-Type': 'application/json' } }) return httpRequest.get('/psp/v1/welfare/get-certificate', params)
} }
/** /**
* 获取用户名片相关信息 * 获取用户名片相关信息
*/ */
export function getCardInfo() { export function getCardInfo() {
return httpRequest.get('/certs/v1/prp/card-info', {}, { headers: { 'Content-Type': 'application/json' } }) return httpRequest.get('/psp/v1/my/info')
} }
/** /**
* 获取用户名片下载地址 * 获取用户名片下载地址
*/ */
export function getCardUrl(params) { export function getCardUrl(params) {
return httpRequest.post('/certs/v1/prp/get-card', params, { return httpRequest.get('/psp/v1/welfare/get-card', params)
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
})
} }
/** /**
* 获取入学通知书 * 获取入学通知书
*/ */
export function getAdmissionNotice() { export function getAdmissionNotice() {
return httpRequest.get('/certs/v1/prp/get-notice') return httpRequest.get('/psp/v1/admission/get-notice')
} }
/** /**
* 权益人展示列表 * 权益人展示列表
*/ */
export function getAvatarList(data) { export function getAvatarList(data) {
return httpRequest.get('/certs/v1/prp/avatar-list', data) return httpRequest.get('/psp/v1/welfare/avatar-list', data)
} }
/** /**
* 权益人详情 * 权益人详情
*/ */
export function getAvatar() { export function getAvatar() {
return httpRequest.get('/certs/v1/prp/avatar') return httpRequest.get('/psp/v1/my/info')
} }
/** /**
* 上传权益人头像 * 上传权益人头像
*/ */
export function uploadAvatar(data) { export function uploadAvatar(data) {
return httpRequest.post('/certs/v1/prp/avatar', data) return httpRequest.post('/psp/v1/welfare/avatar', data)
} }
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="card" v-if="cardUrl"> <div class="card" v-if="cardUrl">
<embed :src="cardUrl"> <embed :src="cardUrl" />
</div> </div>
</div> </div>
</template> </template>
...@@ -34,7 +34,7 @@ const EMAIL_REG = /^[A-Za-z0-9]+([_.\\-][A-Za-z0-9]+)*@([A-Za-z0-9-]+\.)+[A-Za-z ...@@ -34,7 +34,7 @@ const EMAIL_REG = /^[A-Za-z0-9]+([_.\\-][A-Za-z0-9]+)*@([A-Za-z0-9-]+\.)+[A-Za-z
const checkEmail = (rule, value, callback) => { const checkEmail = (rule, value, callback) => {
if (value) { if (value) {
if (!EMAIL_REG.test(value)) { if (!EMAIL_REG.test(value)) {
callback(new Error('邮箱格式错误')); callback(new Error('邮箱格式错误'))
} else { } else {
callback() callback()
} }
...@@ -82,22 +82,23 @@ export default { ...@@ -82,22 +82,23 @@ export default {
this.fileDownload(this.cardUrl, this.cardUrl) this.fileDownload(this.cardUrl, this.cardUrl)
}, },
async fileDownload(fileUrl, fileName) { async fileDownload(fileUrl, fileName) {
const elink = document.createElement('a')// 创建一个a标签 const elink = document.createElement('a') // 创建一个a标签
elink.download = fileName;// 设置a标签的下载属性 elink.download = fileName // 设置a标签的下载属性
elink.style.display = 'none';// 将a标签设置为隐藏 elink.style.display = 'none' // 将a标签设置为隐藏
elink.href = fileUrl;// 把之前处理好的地址赋给a标签的href elink.href = fileUrl // 把之前处理好的地址赋给a标签的href
document.body.appendChild(elink);// 将a标签添加到body中 document.body.appendChild(elink) // 将a标签添加到body中
elink.click();// 执行a标签的点击方法 elink.click() // 执行a标签的点击方法
// URL.revokeObjectURL(elink.href) // 下载完成释放URL 对象 // URL.revokeObjectURL(elink.href) // 下载完成释放URL 对象
document.body.removeChild(elink)// 移除a标签 document.body.removeChild(elink) // 移除a标签
}, },
fetchCardInfo() { fetchCardInfo() {
this.isLogin = true this.isLogin = true
getCardInfo().then(res => { getCardInfo().then(res => {
if (res.code === 0 && res.data && res.data.sso_id) { if (res.code === 0) {
this.form.name = res.data.name const info = res.data.info
this.form.mobile = res.data.mobile this.form.name = info.name
this.form.number = res.data.number this.form.mobile = info.mobile
this.form.number = info.certificate_number
} else { } else {
this.$message.error(res.message || '请先登录') this.$message.error(res.message || '请先登录')
} }
...@@ -105,13 +106,15 @@ export default { ...@@ -105,13 +106,15 @@ export default {
}, },
fetchCertSearch() { fetchCertSearch() {
const { email, address } = this.form const { email, address } = this.form
getCardUrl({ email, address }).then(res => { getCardUrl({ email, address })
if (res.code === 0 && res.name === 'Bad Request') { .then(res => {
if (res.code === 1) {
this.$message.error(res.message || '获取名片失败') this.$message.error(res.message || '获取名片失败')
} else { } else {
this.cardUrl = res.url this.cardUrl = res.data.url.pdf
} }
}).catch(err => { })
.catch(err => {
console.log(err) console.log(err)
}) })
}, },
...@@ -124,23 +127,23 @@ export default { ...@@ -124,23 +127,23 @@ export default {
} }
</script> </script>
<style scoped> <style scoped>
h5{ h5 {
font-size:20px; font-size: 20px;
line-height:80px; line-height: 80px;
text-align:center; text-align: center;
} }
.rule-form{ .rule-form {
width: 400px; width: 400px;
margin:0 auto; margin: 0 auto;
} }
.card{ .card {
width:1200px; width: 1200px;
height:500px; height: 500px;
margin:0 auto; margin: 0 auto;
padding: 10px 0 30px; padding: 10px 0 30px;
} }
.card embed{ .card embed {
width:100%; width: 100%;
height:100%; height: 100%;
} }
</style> </style>
...@@ -135,16 +135,16 @@ export default { ...@@ -135,16 +135,16 @@ export default {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('验证码发送成功') this.$message.success('验证码发送成功')
} else { } else {
this.$message.error(res.msg || '发送验证码失败') this.$message.error(res.message || '发送验证码失败')
} }
}) })
}, },
fetchCertSearch() { fetchCertSearch() {
certSearch(this.form).then(res => { certSearch(this.form).then(res => {
if (res.code === 0 && res.name === 'Bad Request') { if (res.code === 1) {
this.$message.error(res.message || '获取证书失败') this.$message.error(res.message || '获取证书失败')
} else { } else {
this.certUrl = res.url this.certUrl = res.data.url
} }
}).catch(err => { }).catch(err => {
console.log(err) console.log(err)
......
...@@ -20,7 +20,7 @@ export default { ...@@ -20,7 +20,7 @@ export default {
getAdmissionNotice() { getAdmissionNotice() {
getAdmissionNotice() getAdmissionNotice()
.then(res => { .then(res => {
this.url = res.url this.url = res.data.url
}) })
.catch(error => { .catch(error => {
this.$message.error(error.message) this.$message.error(error.message)
......
...@@ -59,9 +59,9 @@ export default { ...@@ -59,9 +59,9 @@ export default {
}, },
infiniteHandler($state) { infiniteHandler($state) {
getAvatarList({ page: this.page, page_size: 18 }).then(response => { getAvatarList({ page: this.page, page_size: 18 }).then(response => {
if (response.list.length) { if (response.data.list.length) {
this.page += 1 this.page += 1
this.list = this.list.concat(response.list) this.list = this.list.concat(response.data.list)
$state.loaded() $state.loaded()
} else { } else {
$state.complete() $state.complete()
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
{{ form.mobile }} {{ form.mobile }}
</el-form-item> </el-form-item>
<el-form-item label="证书编号"> <el-form-item label="证书编号">
{{ form.number }} {{ form.certificate_number }}
</el-form-item> </el-form-item>
<el-form-item prop="avatar" label="头像"> <el-form-item prop="avatar" label="头像">
<upload-image v-model="form.avatar"></upload-image> <upload-image v-model="form.avatar"></upload-image>
...@@ -49,7 +49,7 @@ export default { ...@@ -49,7 +49,7 @@ export default {
} else if (res.status === 403) { } else if (res.status === 403) {
this.$router.push({ query: { needLogin: Date.now() } }) this.$router.push({ query: { needLogin: Date.now() } })
} else { } else {
this.form = res.date this.form = res.data.info
} }
}) })
}, },
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论