|
@@ -5,22 +5,27 @@ Page({
|
|
* 页面的初始数据
|
|
* 页面的初始数据
|
|
*/
|
|
*/
|
|
data: {
|
|
data: {
|
|
- phoneNum: '',
|
|
|
|
- weChatNum: '',
|
|
|
|
- englishName: '',
|
|
|
|
- nameFirst: '',
|
|
|
|
- nameLast: '',
|
|
|
|
- idNum: '',
|
|
|
|
- sex: '',
|
|
|
|
- chosedTeachAttr: '',
|
|
|
|
- showIdAttr: false,
|
|
|
|
- shcool: '',
|
|
|
|
- major: '',
|
|
|
|
- chosedEducation: '',
|
|
|
|
- showEdu: false,
|
|
|
|
- province: '',
|
|
|
|
- city: '',
|
|
|
|
- county: '',
|
|
|
|
|
|
+ phoneNum: '', //电话号码
|
|
|
|
+ weChatNum: '', //微信号码
|
|
|
|
+ englishName: '', //英文名称
|
|
|
|
+ nameFirst: '', //老师的姓
|
|
|
|
+ nameLast: '', //老师的名字
|
|
|
|
+ idNum: '', //身份证号
|
|
|
|
+ sex: '', //性别,根据输入的身份证号自动判断
|
|
|
|
+ idImgFontPath: '', //身份证正面照片的地址
|
|
|
|
+ idImgBackPath: '', //身份证背面照片的地址
|
|
|
|
+ diplomaPath:'', //毕业证书照片的地址
|
|
|
|
+ stuCardPath:'', //学生证照片的地址
|
|
|
|
+ headImgPath:'', //头像照片的地址
|
|
|
|
+ chosedTeachAttr: '', //老师的身份
|
|
|
|
+ showIdAttr: false, //老师的身份选项是否展示
|
|
|
|
+ shcool: '', //毕业后就读的学校
|
|
|
|
+ major: '', //所学专业
|
|
|
|
+ chosedEducation: '', //学历
|
|
|
|
+ showEdu: false, //学历的选项是否展示
|
|
|
|
+ province: '', //籍贯的省份
|
|
|
|
+ city: '', //籍贯的城市
|
|
|
|
+ county: '', //籍贯的区县
|
|
// 老师身份列表
|
|
// 老师身份列表
|
|
attributeList: [{
|
|
attributeList: [{
|
|
'attr': '专职老师',
|
|
'attr': '专职老师',
|
|
@@ -134,6 +139,95 @@ Page({
|
|
// console.log(this.data.sex)
|
|
// console.log(this.data.sex)
|
|
},
|
|
},
|
|
|
|
|
|
|
|
+ // 选择身份证的正面照片
|
|
|
|
+ chooseIdFront() {
|
|
|
|
+ let that = this
|
|
|
|
+ wx.chooseMedia({
|
|
|
|
+ count: 1,
|
|
|
|
+ mediaType: ['image'],
|
|
|
|
+ sourceType: ['album', 'camera'],
|
|
|
|
+ sizeType:['compressed'],
|
|
|
|
+ success(res) {
|
|
|
|
+ // console.log(res.tempFiles[0].tempFilePath)
|
|
|
|
+ console.log(res.tempFiles[0].size)
|
|
|
|
+ that.setData({
|
|
|
|
+ idImgFontPath: res.tempFiles[0].tempFilePath
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 选择身份证的背面照片
|
|
|
|
+ chooseIdBack() {
|
|
|
|
+ let that = this
|
|
|
|
+ wx.chooseMedia({
|
|
|
|
+ count: 1,
|
|
|
|
+ mediaType: ['image'],
|
|
|
|
+ sourceType: ['album', 'camera'],
|
|
|
|
+ // sizeType:['compressed'],
|
|
|
|
+ success(res) {
|
|
|
|
+ // console.log(res.tempFiles[0].tempFilePath)
|
|
|
|
+ console.log(res.tempFiles[0].size)
|
|
|
|
+ that.setData({
|
|
|
|
+ idImgBackPath: res.tempFiles[0].tempFilePath
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 选择毕业证
|
|
|
|
+ chooseDiploma(){
|
|
|
|
+ let that = this
|
|
|
|
+ wx.chooseMedia({
|
|
|
|
+ count: 1,
|
|
|
|
+ mediaType: ['image'],
|
|
|
|
+ sourceType: ['album', 'camera'],
|
|
|
|
+ // sizeType:['compressed'],
|
|
|
|
+ success(res) {
|
|
|
|
+ // console.log(res.tempFiles[0].tempFilePath)
|
|
|
|
+ console.log(res.tempFiles[0].size)
|
|
|
|
+ that.setData({
|
|
|
|
+ diplomaPath: res.tempFiles[0].tempFilePath
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
|
|
+ // 选择学生证
|
|
|
|
+ chooseStuCard(){
|
|
|
|
+ let that = this
|
|
|
|
+ wx.chooseMedia({
|
|
|
|
+ count: 1,
|
|
|
|
+ mediaType: ['image'],
|
|
|
|
+ sourceType: ['album', 'camera'],
|
|
|
|
+ // sizeType:['compressed'],
|
|
|
|
+ success(res) {
|
|
|
|
+ // console.log(res.tempFiles[0].tempFilePath)
|
|
|
|
+ console.log(res.tempFiles[0].size)
|
|
|
|
+ that.setData({
|
|
|
|
+ stuCardPath: res.tempFiles[0].tempFilePath
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 选择头像
|
|
|
|
+ chooseHeadImg(){
|
|
|
|
+ let that = this
|
|
|
|
+ wx.chooseMedia({
|
|
|
|
+ count: 1,
|
|
|
|
+ mediaType: ['image'],
|
|
|
|
+ sourceType: ['album', 'camera'],
|
|
|
|
+ // sizeType:['compressed'],
|
|
|
|
+ success(res) {
|
|
|
|
+ // console.log(res.tempFiles[0].tempFilePath)
|
|
|
|
+ console.log(res.tempFiles[0].size)
|
|
|
|
+ that.setData({
|
|
|
|
+ headImgPath: res.tempFiles[0].tempFilePath
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+
|
|
// 选择老师身份属性
|
|
// 选择老师身份属性
|
|
chooseTeachAttr() {
|
|
chooseTeachAttr() {
|
|
this.setData({
|
|
this.setData({
|
|
@@ -316,7 +410,7 @@ Page({
|
|
}
|
|
}
|
|
// 判断身份是否为空
|
|
// 判断身份是否为空
|
|
let chosedTeachAttr = this.data.chosedTeachAttr
|
|
let chosedTeachAttr = this.data.chosedTeachAttr
|
|
- if(!chosedTeachAttr){
|
|
|
|
|
|
+ if (!chosedTeachAttr) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '您还未选择身份',
|
|
title: '您还未选择身份',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
@@ -325,7 +419,7 @@ Page({
|
|
}
|
|
}
|
|
// 判断学校是否为空
|
|
// 判断学校是否为空
|
|
let school = this.data.school
|
|
let school = this.data.school
|
|
- if(!school){
|
|
|
|
|
|
+ if (!school) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '学校不能为空',
|
|
title: '学校不能为空',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
@@ -334,7 +428,7 @@ Page({
|
|
}
|
|
}
|
|
// 判断专业是否为空
|
|
// 判断专业是否为空
|
|
let major = this.data.major
|
|
let major = this.data.major
|
|
- if(!major){
|
|
|
|
|
|
+ if (!major) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '专业不能为空',
|
|
title: '专业不能为空',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
@@ -344,15 +438,15 @@ Page({
|
|
// 判断学历
|
|
// 判断学历
|
|
let chosedEducation = this.data.chosedEducation
|
|
let chosedEducation = this.data.chosedEducation
|
|
// 学历不能为空
|
|
// 学历不能为空
|
|
- if(!chosedEducation){
|
|
|
|
|
|
+ if (!chosedEducation) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '您还未选择学历',
|
|
title: '您还未选择学历',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
})
|
|
})
|
|
return
|
|
return
|
|
}
|
|
}
|
|
- if(chosedTeachAttr == '专职老师'){
|
|
|
|
- if(chosedEducation == '博士在读' || chosedEducation == '硕士在读' || chosedEducation == '本科在读' || chosedEducation == '专科在读'){
|
|
|
|
|
|
+ if (chosedTeachAttr == '专职老师') {
|
|
|
|
+ if (chosedEducation == '博士在读' || chosedEducation == '硕士在读' || chosedEducation == '本科在读' || chosedEducation == '专科在读') {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '学历与身份不符',
|
|
title: '学历与身份不符',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
@@ -360,8 +454,8 @@ Page({
|
|
return
|
|
return
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(chosedTeachAttr == '在校大学生'){
|
|
|
|
- if(chosedEducation == '博士毕业' || chosedEducation == '硕士毕业' || chosedEducation == '本科毕业' || chosedEducation == '专科毕业'){
|
|
|
|
|
|
+ if (chosedTeachAttr == '在校大学生') {
|
|
|
|
+ if (chosedEducation == '博士毕业' || chosedEducation == '硕士毕业' || chosedEducation == '本科毕业' || chosedEducation == '专科毕业') {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '学历与身份不符',
|
|
title: '学历与身份不符',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
@@ -372,7 +466,7 @@ Page({
|
|
// 判断籍贯是否为空
|
|
// 判断籍贯是否为空
|
|
// 判断省份是否为空
|
|
// 判断省份是否为空
|
|
let province = this.data.province
|
|
let province = this.data.province
|
|
- if(!province){
|
|
|
|
|
|
+ if (!province) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '省份不能为空',
|
|
title: '省份不能为空',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
@@ -381,7 +475,7 @@ Page({
|
|
}
|
|
}
|
|
// 判断地市是否为空
|
|
// 判断地市是否为空
|
|
let city = this.data.city
|
|
let city = this.data.city
|
|
- if(!city){
|
|
|
|
|
|
+ if (!city) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '地市不能为空',
|
|
title: '地市不能为空',
|
|
icon: 'none'
|
|
icon: 'none'
|
|
@@ -390,7 +484,7 @@ Page({
|
|
}
|
|
}
|
|
// 判断区县是否为空
|
|
// 判断区县是否为空
|
|
let county = this.data.county
|
|
let county = this.data.county
|
|
- if(!county){
|
|
|
|
|
|
+ if (!county) {
|
|
wx.showToast({
|
|
wx.showToast({
|
|
title: '区县不能为空',
|
|
title: '区县不能为空',
|
|
icon: 'none'
|
|
icon: 'none'
|