|
@@ -12,13 +12,14 @@ Page({
|
|
|
nameLast: '',
|
|
|
idNum: '',
|
|
|
sex: '',
|
|
|
- idImgFontPath: '',
|
|
|
- idImgBackPath: '',
|
|
|
- diplomaPath:'',
|
|
|
- stuCardPath:'',
|
|
|
- headImgPath:'',
|
|
|
chosedTeachAttr: '',
|
|
|
showIdAttr: false,
|
|
|
+ teachAttrIndex: '',
|
|
|
+ idImgFontPath: '',
|
|
|
+ idImgBackPath: '',
|
|
|
+ diplomaPath: '',
|
|
|
+ stuCardPath: '',
|
|
|
+ headImgPath: '',
|
|
|
shcool: '',
|
|
|
major: '',
|
|
|
chosedEducation: '',
|
|
@@ -27,50 +28,52 @@ Page({
|
|
|
city: '',
|
|
|
county: '',
|
|
|
|
|
|
- attributeList: [{
|
|
|
- 'attr': '专职老师',
|
|
|
- chosed: false
|
|
|
- },
|
|
|
- {
|
|
|
+ teachAttrList: [{
|
|
|
'attr': '在校大学生',
|
|
|
chosed: false
|
|
|
- }
|
|
|
- ],
|
|
|
-
|
|
|
- educationList: [{
|
|
|
- 'edu': '博士毕业',
|
|
|
- chosed: false
|
|
|
- },
|
|
|
- {
|
|
|
- 'edu': '博士在读',
|
|
|
- chosed: false
|
|
|
- },
|
|
|
- {
|
|
|
- 'edu': '硕士毕业',
|
|
|
- chosed: false
|
|
|
},
|
|
|
{
|
|
|
- 'edu': '硕士在读',
|
|
|
- chosed: false
|
|
|
- },
|
|
|
- {
|
|
|
- 'edu': '本科毕业',
|
|
|
- chosed: false
|
|
|
- },
|
|
|
- {
|
|
|
- 'edu': '本科在读',
|
|
|
- chosed: false
|
|
|
- },
|
|
|
- {
|
|
|
- 'edu': '专科毕业',
|
|
|
- chosed: false
|
|
|
- },
|
|
|
- {
|
|
|
- 'edu': '专科在读',
|
|
|
+ 'attr': '专职老师',
|
|
|
chosed: false
|
|
|
}
|
|
|
+ ],
|
|
|
+
|
|
|
+ educationList: [
|
|
|
+ [{
|
|
|
+ 'edu': '博士在读',
|
|
|
+ chosed: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'edu': '硕士在读',
|
|
|
+ chosed: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'edu': '本科在读',
|
|
|
+ chosed: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'edu': '专科在读',
|
|
|
+ chosed: false
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ [{
|
|
|
+ 'edu': '博士毕业',
|
|
|
+ chosed: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'edu': '硕士毕业',
|
|
|
+ chosed: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'edu': '本科毕业',
|
|
|
+ chosed: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'edu': '专科毕业',
|
|
|
+ chosed: false
|
|
|
+ }
|
|
|
+ ]
|
|
|
]
|
|
|
-
|
|
|
},
|
|
|
|
|
|
|
|
@@ -121,7 +124,7 @@ Page({
|
|
|
|
|
|
|
|
|
|
|
|
- if (idLength < 18) {
|
|
|
+ if (idLength != 18) {
|
|
|
this.setData({
|
|
|
sex: ''
|
|
|
})
|
|
@@ -139,6 +142,57 @@ Page({
|
|
|
|
|
|
},
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+ chooseTeachAttr() {
|
|
|
+ this.setData({
|
|
|
+ showIdAttr: true,
|
|
|
+ chosedEducation: ''
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+ onidAttrSelect(e) {
|
|
|
+
|
|
|
+ let index = e.currentTarget.dataset.index
|
|
|
+ let teachAttrList = this.data.teachAttrList
|
|
|
+ for (let i = 0; i < teachAttrList.length; i++) {
|
|
|
+ if (i == index) {
|
|
|
+ teachAttrList[i].chosed = !teachAttrList[i].chosed;
|
|
|
+ } else {
|
|
|
+ teachAttrList[i].chosed = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ this.setData({
|
|
|
+ teachAttrList
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ hiddenTeachId() {
|
|
|
+ this.setData({
|
|
|
+ showIdAttr: false
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ confirmTeachId() {
|
|
|
+ let teachAttrList = this.data.teachAttrList
|
|
|
+ let index
|
|
|
+ for (let i = 0; i < teachAttrList.length; i++) {
|
|
|
+ if (teachAttrList[i].chosed) {
|
|
|
+ index = i
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let chosedTeachAttr = teachAttrList[index]?.attr || ''
|
|
|
+ let teachAttrIndex = index
|
|
|
+
|
|
|
+ this.setData({
|
|
|
+ chosedTeachAttr,
|
|
|
+ teachAttrIndex
|
|
|
+ })
|
|
|
+ this.hiddenTeachId()
|
|
|
+ },
|
|
|
+
|
|
|
|
|
|
chooseIdFront() {
|
|
|
let that = this
|
|
@@ -146,10 +200,10 @@ Page({
|
|
|
count: 1,
|
|
|
mediaType: ['image'],
|
|
|
sourceType: ['album', 'camera'],
|
|
|
- sizeType:['compressed'],
|
|
|
+ sizeType: ['compressed'],
|
|
|
success(res) {
|
|
|
|
|
|
- console.log(res.tempFiles[0].size)
|
|
|
+ console.log(res.tempFiles[0].size)
|
|
|
that.setData({
|
|
|
idImgFontPath: res.tempFiles[0].tempFilePath
|
|
|
})
|
|
@@ -167,7 +221,7 @@ Page({
|
|
|
|
|
|
success(res) {
|
|
|
|
|
|
- console.log(res.tempFiles[0].size)
|
|
|
+ console.log(res.tempFiles[0].size)
|
|
|
that.setData({
|
|
|
idImgBackPath: res.tempFiles[0].tempFilePath
|
|
|
})
|
|
@@ -176,7 +230,7 @@ Page({
|
|
|
},
|
|
|
|
|
|
|
|
|
- chooseDiploma(){
|
|
|
+ chooseDiploma() {
|
|
|
let that = this
|
|
|
wx.chooseMedia({
|
|
|
count: 1,
|
|
@@ -185,7 +239,7 @@ Page({
|
|
|
|
|
|
success(res) {
|
|
|
|
|
|
- console.log(res.tempFiles[0].size)
|
|
|
+ console.log(res.tempFiles[0].size)
|
|
|
that.setData({
|
|
|
diplomaPath: res.tempFiles[0].tempFilePath
|
|
|
})
|
|
@@ -194,7 +248,7 @@ Page({
|
|
|
},
|
|
|
|
|
|
|
|
|
- chooseStuCard(){
|
|
|
+ chooseStuCard() {
|
|
|
let that = this
|
|
|
wx.chooseMedia({
|
|
|
count: 1,
|
|
@@ -203,7 +257,7 @@ Page({
|
|
|
|
|
|
success(res) {
|
|
|
|
|
|
- console.log(res.tempFiles[0].size)
|
|
|
+ console.log(res.tempFiles[0].size)
|
|
|
that.setData({
|
|
|
stuCardPath: res.tempFiles[0].tempFilePath
|
|
|
})
|
|
@@ -211,7 +265,7 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
|
|
|
- chooseHeadImg(){
|
|
|
+ chooseHeadImg() {
|
|
|
let that = this
|
|
|
wx.chooseMedia({
|
|
|
count: 1,
|
|
@@ -220,7 +274,7 @@ Page({
|
|
|
|
|
|
success(res) {
|
|
|
|
|
|
- console.log(res.tempFiles[0].size)
|
|
|
+ console.log(res.tempFiles[0].size)
|
|
|
that.setData({
|
|
|
headImgPath: res.tempFiles[0].tempFilePath
|
|
|
})
|
|
@@ -228,90 +282,59 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
|
|
|
-
|
|
|
- chooseTeachAttr() {
|
|
|
- this.setData({
|
|
|
- showIdAttr: true
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- onidAttrSelect(e) {
|
|
|
-
|
|
|
- let index = e.currentTarget.dataset.index
|
|
|
- let attributeList = this.data.attributeList
|
|
|
- for (let i = 0; i < attributeList.length; i++) {
|
|
|
- if (i == index) {
|
|
|
- attributeList[i].chosed = !attributeList[i].chosed;
|
|
|
- } else {
|
|
|
- attributeList[i].chosed = false
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+ chooseEducation() {
|
|
|
+ if (!this.data.chosedTeachAttr) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '请先选择老师身份',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
}
|
|
|
this.setData({
|
|
|
- attributeList
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- hiddenTeachId() {
|
|
|
- this.setData({
|
|
|
- showIdAttr: false
|
|
|
+ showEdu: true
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
hiddenEdu() {
|
|
|
this.setData({
|
|
|
showEdu: false
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
- confirmTeachId() {
|
|
|
- let attributeList = this.data.attributeList
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- let chosedTeachAttr = attributeList[attributeList.findIndex(item => item.chosed)]?.attr || ''
|
|
|
- this.setData({
|
|
|
- chosedTeachAttr
|
|
|
- })
|
|
|
- this.hiddenTeachId()
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- chooseEducation() {
|
|
|
- this.setData({
|
|
|
- showEdu: true
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
+
|
|
|
onEduSelect(e) {
|
|
|
-
|
|
|
let index = e.currentTarget.dataset.index
|
|
|
let educationList = this.data.educationList
|
|
|
- for (let i = 0; i < educationList.length; i++) {
|
|
|
+ let teachAttrIndex = this.data.teachAttrIndex
|
|
|
+ for (let i = 0; i < educationList[teachAttrIndex].length; i++) {
|
|
|
if (i == index) {
|
|
|
- educationList[i].chosed = !educationList[i].chosed;
|
|
|
+ educationList[teachAttrIndex][i].chosed = !educationList[teachAttrIndex][i].chosed
|
|
|
} else {
|
|
|
- educationList[i].chosed = false
|
|
|
+ educationList[teachAttrIndex][i].chosed = false
|
|
|
}
|
|
|
}
|
|
|
this.setData({
|
|
|
educationList
|
|
|
})
|
|
|
},
|
|
|
-
|
|
|
+
|
|
|
confirmEdu() {
|
|
|
let educationList = this.data.educationList
|
|
|
- let chosedEducation = educationList[educationList.findIndex(item => item.chosed)]?.edu || ''
|
|
|
+ let teachAttrIndex = this.data.teachAttrIndex
|
|
|
+ let index
|
|
|
+ for (let i = 0; i < educationList[teachAttrIndex].length; i++) {
|
|
|
+ if (educationList[teachAttrIndex][i].chosed) {
|
|
|
+ index = i
|
|
|
+ }
|
|
|
+ }
|
|
|
+ let chosedEducation = educationList[teachAttrIndex][index]?.edu || ''
|
|
|
this.setData({
|
|
|
chosedEducation
|
|
|
})
|
|
|
this.hiddenEdu()
|
|
|
},
|
|
|
+
|
|
|
|
|
|
getSchool(e) {
|
|
|
this.setData({
|
|
@@ -417,6 +440,50 @@ Page({
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
+
|
|
|
+ let idImgFontPath = this.data.idImgFontPath
|
|
|
+ let idImgBackPath = this.data.idImgBackPath
|
|
|
+ if (!idImgFontPath || !idImgBackPath) {
|
|
|
+ wx.showToast({
|
|
|
+ title: '身份证照片未传',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ let teachAttrIndex = this.data.teachAttrIndex
|
|
|
+ let stuCardPath = this.data.stuCardPath
|
|
|
+ let diplomaPath = this.data.diplomaPath
|
|
|
+ if(teachAttrIndex == 0){
|
|
|
+ if(!stuCardPath){
|
|
|
+ wx.showToast({
|
|
|
+ title: '学生证未上传',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ this.setData({
|
|
|
+ diplomaPath:''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(teachAttrIndex == 1){
|
|
|
+ if(!diplomaPath){
|
|
|
+ wx.showToast({
|
|
|
+ title: '毕业证未上传',
|
|
|
+ icon: 'none'
|
|
|
+ })
|
|
|
+ return
|
|
|
+ }else{
|
|
|
+ this.setData({
|
|
|
+ stuCardPath:''
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
let school = this.data.school
|
|
|
if (!school) {
|
|
@@ -445,24 +512,7 @@ Page({
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if (chosedTeachAttr == '专职老师') {
|
|
|
- if (chosedEducation == '博士在读' || chosedEducation == '硕士在读' || chosedEducation == '本科在读' || chosedEducation == '专科在读') {
|
|
|
- wx.showToast({
|
|
|
- title: '学历与身份不符',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
- if (chosedTeachAttr == '在校大学生') {
|
|
|
- if (chosedEducation == '博士毕业' || chosedEducation == '硕士毕业' || chosedEducation == '本科毕业' || chosedEducation == '专科毕业') {
|
|
|
- wx.showToast({
|
|
|
- title: '学历与身份不符',
|
|
|
- icon: 'none'
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- }
|
|
|
+
|
|
|
|
|
|
|
|
|
let province = this.data.province
|
|
@@ -501,6 +551,10 @@ Page({
|
|
|
idNum: this.data.idNum,
|
|
|
sex: this.data.sex,
|
|
|
chosedTeachAttr: this.data.chosedTeachAttr,
|
|
|
+ idImgFontPath: this.data.idImgFontPath,
|
|
|
+ idImgBackPath: this.data.idImgBackPath,
|
|
|
+ diplomaPath: this.data.diplomaPath,
|
|
|
+ stuCardPath: this.data.stuCardPath,
|
|
|
shcool: this.data.school,
|
|
|
major: this.data.major,
|
|
|
chosedEducation: this.data.chosedEducation,
|