This commit is contained in:
shijingjing
2022-11-17 14:32:07 +08:00
parent dc1248dd3a
commit c13e90a7f6
2 changed files with 9 additions and 29 deletions

View File

@@ -110,31 +110,25 @@ export default {
}
}
},
computed: {
...mapState(['user'])
},
onLoad() {
uni.setNavigationBarTitle({
title: '申请党员'
});
if(this.user.partyId.length > 0) {
if(this.user.partyId?.length > 0) {
this.getDetail()
}
},
methods: {
onDateChange(e) {
this.form.joinPartyTime = `${e.year}-${e.month}-${e.day}`
},
handleSelectParty(v) {
this.form.partyOrgId = v.id
this.form.partyOrgName = v.name
},
getDetail() {
this.$instance.post(`/app/appparty/detail?id=${this.user.partyId}`).then(res=> {
if(res?.data) {
@@ -142,32 +136,25 @@ export default {
}
})
},
submit() {
if (!this.form.name) {
return this.$toast('请输入党员姓名')
}
if (!this.form.idNumber) {
return this.$toast('身份证号')
}
if (!this.form.phone.length) {
return this.$toast('请输入手机号')
}
if(!this.form.partyOrgId) {
return this.$toast('请选择党组织')
}
if(!this.form.joinPartyTime) {
return this.$toast('请选择入党时间')
}
if(!this.form.partyType) {
return this.$toast('请选择党员类型')
}
this.$loading()
this.$instance.post(`/app/appparty/addOrUpdateForWX`, {
...this.form,
@@ -178,7 +165,7 @@ export default {
this.$store.dispatch('getUserInfo')
uni.clearStorageSync('lastSelectedParty');
setTimeout(() => {
uni.redirectTo({url: "./partyAuthSuccess"})
uni.redirectTo({url: `./partyAuthSuccess`})
}, 600)
}
this.$hideLoading()

View File

@@ -1,11 +1,11 @@
<template>
<div class="partyAuthSuccess">
<template v-if="isSuccess">
<div class="partyAuthSuccess" v-if="pageShow">
<template v-if="user.partyStatusForWX == 2">
<image src="https://cdn.cunwuyun.cn/pingchang/success.png"/>
<h2 v-text="`认证成功!`"/>
<div class="btn" @click="goBack" v-text="`返回`"/>
</template>
<template v-else-if="isFail">
<template v-if="user.partyStatusForWX == 3">
<image src="https://cdn.cunwuyun.cn/pingchang/fail.png"/>
<h2 v-text="`党员认证审核未通过!`"/>
<div class="feedback">
@@ -13,7 +13,7 @@
</div>
<div class="btn" @click="rewrite">重新提交</div>
</template>
<div class="isReview" v-else-if="isReview">
<div class="isReview" v-if="user.partyStatusForWX == 1">
<image src="https://cdn.cunwuyun.cn/pingchang/review.png"/>
<div class="result" v-text="`认证正在审核中,请耐心等待`"/>
<div class="btn" @click="rewrite">重新提交</div>
@@ -26,21 +26,13 @@ import {mapState} from "vuex";
export default {
data() {
return {
details: {}
details: {},
pageShow: false
}
},
computed: {
// 0未认证 1认证中 2已认证 3认证失败
...mapState(['user']),
isSuccess() {
return this.user.partyStatusForWX == 2
},
isFail() {
return this.user.partyStatusForWX == 3
},
isReview() {
return this.user.partyStatusForWX == 1
},
},
onShow() {
uni.setNavigationBarTitle({
@@ -49,6 +41,7 @@ export default {
if(this.user.partyStatusForWX == 3) {
this.getDetail()
}
this.pageShow = true
},
methods: {
rewrite() {