diff --git a/pages/addexam/addexam.scss b/pages/addexam/addexam.scss index 09c8005..632766e 100644 --- a/pages/addexam/addexam.scss +++ b/pages/addexam/addexam.scss @@ -162,7 +162,7 @@ .item { width: 97%; border-bottom: 1rpx solid #D8D4D4; - margin-left: 3%; + margin: 0% auto; .addition { color: #666666; diff --git a/pages/addexam/addexam.vue b/pages/addexam/addexam.vue index 23cb116..f63e8bc 100644 --- a/pages/addexam/addexam.vue +++ b/pages/addexam/addexam.vue @@ -25,15 +25,17 @@ {{personInfo.birthday}} - 电子邮箱(用于接收考试通知): + 电子邮箱: - + {{personInfo.email}} + 通讯地址: - + {{personInfo.address}} + @@ -44,24 +46,29 @@ 最高学历: - + {{personInfo.education==1?'初中':''}} + {{personInfo.education==2?'高中/中专':''}} + {{personInfo.education==3?'大专及以上':''}} + 毕业院校: - + {{personInfo.graduateSchool}} + - 专业(如适用): + 专业: - + {{personInfo.major}} + @@ -98,34 +105,45 @@ - 报考类别(可选): + 考试类型: + + {{personInfo.examType==2?'正式考试':""}} + {{personInfo.examType==3?'补考':""}} + + + + 报考类别: - + {{personInfo.regType == 1?"普通医疗护理员":""}} + {{personInfo.regType == 2?"老年医疗护理员":""}} + {{personInfo.regType == 3?"孕产妇和新生儿医疗护理员":""}} + - 培训经历(如有): + 培训经历: - + 机构名称: - + {{personInfo.trainInstitution}} + - + 培训时间: - 选择时间区间 - - + --> + {{personInfo.trainStartDate+'至'}}{{personInfo.trainEndDate}} - + @@ -137,33 +155,37 @@ 身份证正面: - + 身份证反面: - + - - 近期白底免冠证件照(1寸,JPG格式,<20KB): + + 近期白底免冠证件照: - + - - 学历证明(毕业证或学信网截图): + + 学历证明: - + @@ -269,36 +291,7 @@ token: uni.getStorageSync('examh5token') }, fileList: [], - personInfo: { - "address": "", - "cardBack": "", - "cardCopy": "", // 身份证正反面复印件 - "cardFront": "", - "certificate": "", - "education": 0, - "email": "", - "examId": "", - startTime: undefined, - endTime: undefined, - startDate: undefined, - endDate: undefined, - "graduateSchool": "", - "major": "", - "phone": "", - "photo": "", - "physicalReport": "", //健康体检报告 - "realName": "", - "regTime": "", - "regType": 0, - "signPicture": "", - "title": "", - "trainEndDate": "", - "trainInstitution": "", - "trainStartDate": "", - "userId": "", - "userName": "", - examFee: undefined, - }, + personInfo: {}, } }, onShow() {}, @@ -328,6 +321,7 @@ this.personInfo.startDate = obj[0].startDate this.personInfo.endDate = obj[0].endDate this.personInfo.examFee = obj[0].examFee + this.personInfo.examType = obj[0].examType }, trainDatechange(e) { this.personInfo.trainEndDate = e.endDate @@ -354,6 +348,7 @@ }, //确认 updata() { + this.$delete(this.personInfo, 'id'); save(this.personInfo).then(res => { if (res.code == 0) { this.$refs.uToast.show({ @@ -377,11 +372,12 @@ name: res.data.realName, cardNo: res.data.userName }) - this.personInfo.realName = res.data.realName - this.personInfo.userId = res.data.id - this.personInfo.phone = res.data.phone - this.personInfo.userName = res.data.userName + this.personInfo = { + ...res.data, + ...this.personInfo + } this.personInfo.sex = this.getsex(res.data.userName) + this.personInfo.userId = res.data.id this.personInfo.birthday = this.getbirthday(res.data.userName) } }) @@ -435,66 +431,6 @@ } return '身份证号码长度不正确'; }, - argAdd(arg1, arg2) { - // 加法函数 - var _this = this, - r1 = 0, - r2 = 0, - m = 0; - try { - r1 = arg1.toString().split(".")[1].length - } catch (e) {} - try { - r2 = arg2.toString().split(".")[1].length - } catch (e) {} - m = Math.pow(10, Math.max(r1, r2)) - return _this.argDiv((_this.argMul(arg1, m) + _this.argMul(arg2, m)), m) - }, - argSubtr(arg1, arg2) { - // 减法函数 - var _this = this, - r1 = 0, - r2 = 0, - m = 0; - try { - r1 = arg1.toString().split(".")[1].length - } catch (e) {} - try { - r2 = arg2.toString().split(".")[1].length - } catch (e) {} - m = Math.pow(10, Math.max(r1, r2)); - return _this.argDiv((_this.argMul(arg1, m) - _this.argMul(arg2, m)), m) - }, - argMul(arg1, arg2) { - // 乘法函数 - var _this = this, - m = 0, - s1 = arg1.toString(), - s2 = arg2.toString(); - try { - m += s1.split(".")[1].length - } catch (e) {} - try { - m += s2.split(".")[1].length - } catch (e) {} - return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / Math.pow(10, m) - }, - argDiv(arg1, arg2) { - // 除法函数 - var _this = this, - t1 = 0, - t2 = 0, - r1, r2; - try { - t1 = arg1.toString().split(".")[1].length - } catch (e) {} - try { - t2 = arg2.toString().split(".")[1].length - } catch (e) {} - r1 = Number(arg1.toString().replace(".", "")) - r2 = Number(arg2.toString().replace(".", "")) - return _this.argMul((r1 / r2), Math.pow(10, t2 - t1)); - }, } } diff --git a/pages/register/register.scss b/pages/register/register.scss index 56c9b6d..a53e25f 100644 --- a/pages/register/register.scss +++ b/pages/register/register.scss @@ -1,118 +1,254 @@ - .app { - height:calc(100vh - 44px); - padding:20rpx 0; +.app { + font-size: 34rpx; + padding-top: 10rpx; + height: 100%; + background: #FFFFFF; + padding-bottom: 200rpx; - .Agreement{ - width: 100%; - background-color: #F4F5F7; - text-align: center; - height: 1000rpx; - position: absolute; - top:5%; - font-size: 30rpx; - .title{ - height: 100rpx; - line-height: 100rpx; - border-bottom: 1px solid #eeeeee; - font-size: 34rpx; - margin: 0px auto; - width: 100%; - text-align: center; - } - .scroll-Y{ - height:830rpx ; - overflow-y:scroll; - text-align: left; - text-indent: 2em; - } - .cancel { - height:70rpx; - line-height: 70rpx; - font-size: 32rpx; - background-color: #F4F5F7; - position: absolute; - border-top: 1rpx solid #000000; - bottom:0; - right:0; - width: 50%; - color: #000000; - } - .determine { - height:70rpx; - line-height: 70rpx; - font-size: 32rpx; - width: 50%; - color: #F4F5F7; - background: #4C7BC9; - position: absolute; - bottom:0; - left:0; - } - } - .item{ - font-size: 34rpx; - margin: 0 auto 20rpx; - width: 94%; - height:100rpx; + .title { + height: 100rpx; line-height: 100rpx; - background-color: #fff; - box-shadow: 0px 9rpx 31rpx 9rpx rgba(0,0,0,0.03); - border-radius: 20rpx; - position: relative; - .lefttext{ - position: absolute; - top:50%; - transform: translateY(-50%); - left:3%; - } - .righttext{ - position: absolute; - top:50%; - transform: translateY(-50%); - width: 68%; - left:18%; - height:100rpx; - } - .lefttext,.righttext{ - ::v-deep .uni-input-input{ - font-size: 34rpx; - } - ::v-deep .uni-input-wrapper{ - height:100rpx; - line-height: 100rpx; - } - ::v-deep .uni-input-placeholder { - line-height: 100rpx; - font-size: 34rpx; - font-weight: 400; - color: #C3C1C1; - } - } - .obtaincode { + font-size: 34rpx; + margin: 0px auto; + width: 100%; + font-weight: 600; + text-align: center; + } + + .mask { + .Agreement { + width: 100%; + background-color: #fff; text-align: center; - font-size: 36rpx; - color: #4C7BC9; - line-height: 100rpx; + height: 1000rpx; position: absolute; - right:5%; - top: 0%; + top: 5%; + width: 94%; + left: 3%; + font-size: 30rpx; + + .scroll-Y { + width: 98%; + margin: 0 auto; + height: 830rpx; + overflow-y: scroll; + text-align: left; + text-indent: 2em; + } + + .cancel { + height: 70rpx; + line-height: 70rpx; + font-size: 32rpx; + background-color: #F4F5F7; + position: absolute; + border-top: 1rpx solid #000000; + bottom: 0; + right: 0; + width: 50%; + color: #000000; + } + + .determine { + height: 70rpx; + line-height: 70rpx; + font-size: 32rpx; + width: 50%; + color: #F4F5F7; + background: #4C7BC9; + position: absolute; + bottom: 0; + left: 0; + } } } + + .addressitem { + width: 97%; + border-bottom: 1rpx solid #D8D4D4; + margin-left: 3%; + height: 100%; + + .leftaddress { + width: 15%; + height: 100%; + display: flex; + display: inline-block; + } + + .addition { + color: #666666; + display: inline-block; + line-height: 50rpx; + font-size: 28rpx; + } + } + + .money { + font-size: 32rpx; + color: #D43953; + position: absolute; + right: 5%; + top: 15%; + } + + .user { + width: 100%; + padding: 10rpx; + line-height: 93rpx; + margin-bottom: 10rpx; + + .timeyear{ + .bottomtext{ + -webkit-overflow-scrolling: touch; + width: 96%; + margin: 0 auto; + .items{ + display: flex; + justify-content:flex-start; + flex-wrap: wrap; + text-align: center; + .timeitem{ + width: 21%; + margin: 0 2% 20rpx; + height: 86rpx; + border-radius: 5rpx; + font-size: 28rpx; + line-height: 86rpx; + border: 2rpx solid #DADADA; + } + .timeitemtap{ + width: 21%; + margin: 0 2% 20rpx; + height: 86rpx; + border: 2rpx solid #F44B2F; + border-radius: 5rpx; + font-size: 28rpx; + color: #F44B2F; + line-height: 86rpx; + } + } + } + .toptext{ + -webkit-overflow-scrolling: touch; + padding-top: 10rpx; + display: flex; + justify-content:space-around; + height: 50rpx; + color: #000000; + line-height: 27rpx; + margin-bottom: 30rpx; + text-align: center; + .Soonerorlater{ + width: 200rpx; + font-size: 36rpx; + height: 50rpx; + } + .Soonerorlaterclass{ + font-size: 36rpx; + color: #F44B2F; + width: 200rpx; + height: 50rpx; + } + view:nth-child(2){ + width: 4rpx; + height: 27rpx; + background: #C5C3C3; + border-radius: 2rpx; + } + } + } + + .item { + width: 97%; + border-bottom: 1rpx solid #D8D4D4; + margin-left: 3%; + + .addition { + color: #666666; + line-height: 30rpx; + font-size: 28rpx; + } + } + } + + .remarks { + width: 94%; + margin: 10rpx auto; + padding: 3%; + font-size: 34rpx; + height: 96rpx; + background: #FFFFFF; + border-radius: 20rpx; + margin-top: 20rpx; + position: relative; + + .span { + display: inline-block; + width: 20%; + // overflow: hidden; + // text-overflow: ellipsis; + // white-space: nowrap; + position: absolute; + top:50%; + transform: translateY(-50%); + } + .input-placeholder{ + color: #C5C3C3; + font-size: 30rpx; + } + input { + position: absolute; + top: 50%; + left: 23%; + width: 77%; + transform: translateY(-50%); + } + } + + .priceback { + width: 90%; + background: #FFFFFF; + height: 100rpx; + margin: 0 auto; + + .queren { + width: 100%; + height: 90rpx; + background: #4C7BC9; + border-radius: 26rpx; + margin: 105rpx 0 30rpx; + line-height: 90rpx; + text-align: center; + color: #ffffff; + } + .switch { + font-size: 26rpx; + text-align: center; + line-height: 60rpx; + color: #46ABD7; + } + + } + .radio-content { margin: 50rpx auto; width: 70%; text-align: center; font-size: 28rpx; position: relative; + .agreement { position: absolute; - top:50%; - left:20%; + top: 50%; + left: 20%; transform: translateY(-50%); color: #878987; - } + } + .radio-right { height: 100rpx; + width: 100rpx; .radio { display: inline-block; @@ -121,42 +257,130 @@ border-radius: 70%; border: 2rpx solid #178ffb; position: absolute; - top:50%; - left:5%; + top: 50%; + left: 5%; transform: translateY(-50%); + .radio-active { width: 16rpx; height: 16rpx; border-radius: 50%; background-color: #178ffb; position: absolute; - top:50%; - left:50%; - transform: translate(-50%,-50%); + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + // margin: 0 auto; } } } } - .switch { - text-align: center; - line-height: 60rpx; - color: #46ABD7; - position: absolute; - top: 73%; + + .Consumablespackage .money { + top: 8%; + } + /* 耗材包 */ + .Consumablespackage { + width: 94%; + margin: 10rpx auto; + padding: 3% 0 3% 3%; + font-size: 34rpx; + background: #FFFFFF; + border-radius: 20rpx; + margin-top: 20rpx; + position: relative; + padding-bottom: 40rpx; + ::v-deep .u-checkbox__label{ + width: 100% !important; + } + .detail { + width: 100%; + line-height: 100rpx; + // padding: 20rpx 0 0 40rpx; + position: relative; + .itemConsumabletitle{ + width:55%; + position: absolute; + top:50%; + transform: translateY(-50%); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + display: inline-block; + font-size: 28rpx; + } + /deep/ .u-checkbox{ + margin: 40rpx 0 0; + position: relative; + } + span{ + width: 100%; + display: inline-block; + font-size: 28rpx; + color: #D43953; + text-align: right; + position: absolute; + right:5%; + top:50%; + transform: translateY(-50%); + } + } } - .loginbtn { - width: 70%; - height: 100rpx; - text-align: center; - line-height: 100rpx; - background: #4C7BC9; - border-radius: 51rpx; - font-size: 41rpx; - color: #FFFFFF; - position: absolute; - top: 62%; - left: 15%; + /* 套餐 */ + .Package { + width: 97%; + height: 500rpx; + font-size: 34rpx; + background: #FFFFFF; + border-radius: 20rpx; + margin: 20rpx auto 40rpx; + position: relative; + .uppicture { + border: 1rpx dashed #818181; + width: 90%; + height: 400rpx; + margin: 0 auto; + position: relative; + + image { + width: 100%; + height: 100%; + } + + span { + font-size: 35rpx; + color: #969394; + } + } + + .checkboxs{ + margin-top: 30rpx; + ::v-deep .u-checkbox{ + padding-right: 40rpx; + } + } + .detail { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + line-height: 31rpx; + font-size: 32rpx; + color: #666666; + line-height: 31rpx; + position: absolute; + left: 10%; + top: 60%; + width: 90%; + } } + .message { + width: 94%; + background: white; + border-radius: 20rpx; + margin: 0 auto; + text-align: center; + line-height: 96rpx; + } } \ No newline at end of file diff --git a/pages/register/register.vue b/pages/register/register.vue index d579686..423d5a9 100644 --- a/pages/register/register.vue +++ b/pages/register/register.vue @@ -1,55 +1,184 @@ @@ -57,37 +186,152 @@ import { reg } from '@/api/register/index.js' + import { + getExamList, + save + } from '@/api/addexam/index.js' + import baseurl from '@/api/baseurl.js' + import signature from '@/components/signature/signature.vue' export default { - components: {}, + components: { + signature + }, data() { return { - patientName: '', - realName: "", - phone: '', - password: '', - newpassword: '', + trainDateshow: false, + signatureshow: false, + userSignaturePictureUrl: null, + examlist: [], + educationlist: [{ + name: '初中', + label: 1, + checked: false, + }, + { + name: '高中/中专', + label: 2, + checked: false, + }, + { + name: '大专及以上', + label: 3, + checked: false, + } + ], + regTypelist: [{ + name: '普通医疗护理员', + label: 1, + checked: false, + }, + { + name: '老年医疗护理员', + label: 2, + checked: false, + }, + { + name: '孕产妇和新生儿医疗护理员', + label: 3, + checked: false, + } + ], + action: baseurl + '/exam/api/file/upload', + fileList: [], + personInfo: { + password: undefined, + newpassword: undefined, + "address": "", + "cardBack": "", + "cardCopy": "", // 身份证正反面复印件 + "cardFront": "", + "certificate": "", + "education": 0, + "email": "", + "examId": "", + startTime: undefined, + endTime: undefined, + startDate: undefined, + endDate: undefined, + "graduateSchool": "", + "major": "", + "phone": "", + "photo": "", + "physicalReport": "", //健康体检报告 + "realName": "", + "regTime": "", + "regType": 0, + "signPicture": "", + "title": "", + "trainEndDate": "", + "trainInstitution": "", + "trainStartDate": "", + "userId": "", + "userName": "", + examFee: undefined, + }, verification: '', getCodeText: '获取验证码', //获取验证码的文字 getCodeBtnColor: "#4C7BC9", //获取验证码的color getCodeisWaiting: false, //判断是否在倒计时中 }; }, + onLoad() {}, methods: { + uploadedcertificate(res) { + this.personInfo.certificate = res[0].response.data.url + }, + uploadedphoto(res) { + this.personInfo.photo = res[0].response.data.url + }, + uploadedcardBack(res) { + this.personInfo.cardBack = res[0].response.data.url + }, + uploadedcardFront(res) { + this.personInfo.cardFront = res[0].response.data.url + }, + trainDatechange(e) { + this.personInfo.trainEndDate = e.endDate + this.personInfo.trainStartDate = e.startDate + }, + //签名 + userSignaturePicture(data) { + let that = this + this.userSignaturePictureUrl = data + this.signatureshow = false + uni.uploadFile({ + url: baseurl + '/exam/api/file/upload', + filePath: this.userSignaturePictureUrl, + name: 'file', + formData: { + type: 'signPictureUrl' + }, + timeout: 5000, + success(res) { + that.personInfo.signPicture = JSON.parse(res.data).data.url + } + }) + }, //注册功能 register() { - if (this.password !== this.newpassword) { + if (this.personInfo.password !== this.personInfo.newpassword) { this.$refs.uToast.show({ title: '密码输入不一致,请重新输入', type: 'error', duration: '1500' }) + } else if (!this.validateIDCard(this.personInfo.userName)) { + this.$refs.uToast.show({ + title: '身份证错误,请重新输入', + type: 'error', + duration: '1500' + }) + } else if (!this.validatePhone(this.personInfo.phone)) { + this.$refs.uToast.show({ + title: '手机号错误,请重新输入', + type: 'error', + duration: '1500' + }) } else { - reg({ - password: this.password, - realName: this.realName, - userName: this.patientName, - phone: this.phone - }).then(res => { + reg(this.personInfo).then(res => { if (res.code == 0) { uni.setStorageSync("examh5token", res.data.token) uni.setStorageSync("examh5user", { @@ -115,6 +359,43 @@ }) } }, + // 校验手机号的通用方法 + validatePhone(phone) { + // 简单的手机号正则(匹配11位数字,1开头) + const reg = /^1[3-9]\d{9}$/; + return reg.test(phone); + }, + // 校验身份证号码的通用方法 + validateIDCard(idCard) { + // 15位和18位身份证号码的正则表达式 + const reg15 = /^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$/; + const reg18 = /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/; + // 校验长度 + if (idCard.length === 15) { + return reg15.test(idCard); + } else if (idCard.length === 18) { + // 18位身份证需要校验最后一位校验码 + if (reg18.test(idCard)) { + return this.checkIDCardLastCode(idCard); + } + return false; + } + return false; + }, + // 校验18位身份证最后一位校验码 + checkIDCardLastCode(idCard) { + if (idCard.length !== 18) return false; + // 加权因子 + const weight = [7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2]; + // 校验码 + const checkCode = ['1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2']; + let sum = 0; + for (let i = 0; i < 17; i++) { + sum += parseInt(idCard[i]) * weight[i]; + } + const mod = sum % 11; + return idCard[17].toUpperCase() === checkCode[mod]; + }, //跳转登录页 gologin() { uni.reLaunch({