Commit 8dacc23b authored by 王宝峰's avatar 王宝峰

Merge branch 'dev' of http://gitlab.91isoft.com:90/wyf/tjty-app into dev

parents 2120b7e2 f568be8c
......@@ -69,7 +69,8 @@
getAreaList,
getPeople,
dailyQuestion,
selectexamType
selectexamType,
selectRegisterList
} from '@/api/dailyAnswer.js'
import {
getActivity
......@@ -81,6 +82,7 @@
export default {
data() {
return {
registerPeopleNum: 0, //本微信报名人数
examCount: '', //题库试卷判断
idFlag: '',
color: 'background:#EEEEEE',
......@@ -219,20 +221,56 @@
},
computed: {
...mapState('m_user', ['userInfo'])
},
onLoad(options) {
this.info.activityId = options.activityId
this.info.wechatId = this.userInfo.wechatId
this.getArea()
this.getActivityDetial(options.activityId)
this.getPerson()
uni.setStorageSync('pages', 'ans_info')
},
onShow() {
this.getPerson()
this.getRegisterListLength()
},
onHide() {
this.info.areaId = 1
this.getArea()
this.cityIndex = this.cityList.length - 1
this.cityCode = ''
this.info.cityId = ''
this.areaIndex = 16
this.areaDisable = true
this.areaCode = ''
this.info.cityAreaId = ''
this.schoolIndex = -1
this.schoolCode = ''
this.info.schoolId = ''
this.schoolDisable = true
this.info.idFlag = false
this.info.areaId = 1
this.info.parentName = ''
this.info.name = ''
this.info.phone = ''
this.info.idCard = ''
this.info.cityId = ''
this.info.cityAreaId = ''
this.info.schoolId = ''
},
onReady() {
this.$refs.form.setRules(this.rules)
},
methods: {
//获取报名人数
getRegisterListLength() {
selectRegisterList(this.info.wechatId, this.info.activityId).then(res => {
if (res.code === 200) {
console.log("本微信号报名信息", res);
this.registerPeopleNum = res.data.length
}
})
},
IdChange(e) {
// console.log(e);
let idCareReg =
......@@ -295,6 +333,29 @@
if (this.info.idFlag) {
return
}
if (this.registerPeopleNum === 3) {
return uni.$showMsg('每个答题活动最多只能报名三人!')
this.cityIndex = this.cityList.length - 1
this.cityCode = ''
this.info.cityId = ''
this.areaIndex = 16
this.areaDisable = true
this.areaCode = ''
this.info.cityAreaId = ''
this.schoolIndex = -1
this.schoolCode = ''
this.info.schoolId = ''
this.schoolDisable = true
this.info.idFlag = false
this.info.areaId = 1
this.info.parentName = ''
this.info.name = ''
this.info.phone = ''
this.info.idCard = ''
this.info.cityId = ''
this.info.cityAreaId = ''
this.info.schoolId = ''
}
addTjtActivitySignupExams(this.info).then(res => {
console.log(res);
if (res >= 0 && res !== '') {
......@@ -311,9 +372,9 @@
dailyQuestion(res, time).then(res1 => {
console.log("试卷", res1);
if (res1.data.length > 0) {
if(this.examCount === 0){
if (this.examCount === 0) {
return uni.$showMsg('报名成功,暂无试卷!')
}else{
} else {
uni.showToast({
title: '报名成功!',
icon: 'none'
......@@ -339,6 +400,7 @@
}).catch(err => {
this.info.idFlag = this.idFlag
console.log(this.info.idFlag);
this.getPerson()
console.log('表单错误信息:', err);
})
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment