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

View File

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