Browse Source

【PC端】初心互助活动发布、随手记发布添加违规校验逻辑-王公峰-2020-08-05

master
wanggongfeng 5 years ago
parent
commit
acfed20858
  1. 29
      src/views/modules/heart/actinfo-add-or-update.vue
  2. 28
      src/views/modules/workRecord/dailyrecordinfoDetail.vue

29
src/views/modules/heart/actinfo-add-or-update.vue

@ -352,7 +352,8 @@ export default {
reward: '', reward: '',
isBanner: '1', isBanner: '1',
actUserDefaultState: '1', actUserDefaultState: '1',
bannerUrl: '' bannerUrl: '',
isConReview: false
}, },
isSignupEndTime: { isSignupEndTime: {
disabledDate (time) { disabledDate (time) {
@ -405,7 +406,8 @@ export default {
return time.getTime() < new Date(EndDateVal).getTime() return time.getTime() < new Date(EndDateVal).getTime()
} }
} }
} },
isFirst: true
} }
}, },
created () { created () {
@ -563,6 +565,7 @@ export default {
}, },
init () { init () {
this.visible = true this.visible = true
this.dataForm.isConReview = false
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
if (this.dataForm.id) { if (this.dataForm.id) {
@ -675,8 +678,26 @@ export default {
} }
this.isAble = true this.isAble = true
this.$http[!this.dataForm.id ? 'post' : 'put']('/heart/actinfo/', this.dataForm).then(({ data: res }) => { this.$http[!this.dataForm.id ? 'post' : 'put']('/heart/actinfo/', this.dataForm).then(({ data: res }) => {
this.isAble = false if (!this.isFirst && res.code === 533) {
if (res.code !== 0) { //
this.$confirm('您提交的内容再次被判定为违规, 是否继续提交?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
}).then(() => {
this.dataForm.isConReview = true
//
this.dataFormSubmitHandle()
}).catch(() => {
this.isAble = false
})
return false
} else if (res.code === 533) {
this.isFirst = false
this.isAble = false
return this.$message.error(res.msg)
} else if (res.code !== 0) {
this.isAble = false
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }
this.$message({ this.$message({

28
src/views/modules/workRecord/dailyrecordinfoDetail.vue

@ -120,7 +120,8 @@ export default {
address: '', address: '',
joinNum: '', joinNum: '',
content: '', content: '',
images: [] images: [],
isConReview: false
}, },
isAble: false, isAble: false,
meetTypeArr: [], meetTypeArr: [],
@ -133,7 +134,8 @@ export default {
loading: false, loading: false,
dialogImageUrl: '', dialogImageUrl: '',
dialogVisible: false, dialogVisible: false,
options: [] options: [],
isFirst: true
} }
}, },
computed: { computed: {
@ -227,6 +229,7 @@ export default {
}, },
init () { init () {
this.dataForm.id = this.$route.query.id this.dataForm.id = this.$route.query.id
this.dataForm.isConReview = false
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dataForm'].resetFields() this.$refs['dataForm'].resetFields()
@ -333,9 +336,26 @@ export default {
return false return false
} }
this.isAble = true this.isAble = true
console.log(this.dataForm)
this.$http[!this.dataForm.id ? 'post' : 'put']('/workRecord/dailyrecordinfo/', this.dataForm).then(({ data: res }) => { this.$http[!this.dataForm.id ? 'post' : 'put']('/workRecord/dailyrecordinfo/', this.dataForm).then(({ data: res }) => {
if (res.code !== 0) { if (!this.isFirst && res.code === 533) {
//
this.$confirm('您提交的内容再次被判定为违规, 是否继续提交?', '提示', {
confirmButtonText: '是',
cancelButtonText: '否',
type: 'warning'
}).then(() => {
this.dataForm.isConReview = true
//
this.dataFormSubmitHandle()
}).catch(() => {
this.isAble = false
})
return false
} else if (res.code === 533) {
this.isFirst = false
this.isAble = false
return this.$message.error(res.msg)
} else if (res.code !== 0) {
this.isAble = false this.isAble = false
return this.$message.error(res.msg) return this.$message.error(res.msg)
} }

Loading…
Cancel
Save