头像采集和身体条件须知

main
zhangqun 3 years ago
parent 280eddbe5c
commit bebd780088
  1. BIN
      src/assets/image/avatar.png
  2. BIN
      src/assets/image/avatar_icon01.png
  3. BIN
      src/assets/image/avatar_icon02.png
  4. BIN
      src/assets/image/avatar_icon03.png
  5. 217
      src/views/Guidance.vue
  6. 340
      src/views/examProject.vue

Binary file not shown.

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

@ -6,25 +6,11 @@
<div class="guide_actBtn" @click="doCancel">取消</div> <div class="guide_actBtn" @click="doCancel">取消</div>
<div class="guide_actBtn blue" @click="doRead">已阅读</div> <div class="guide_actBtn blue" @click="doRead">已阅读</div>
</div> </div>
<!-- 采集头像弹框 -->
<van-overlay :show="isShowAvatar">
<div class="wrapper" @click.stop>
<div class="img_box">
<img :src="avatar" alt="">
</div>
<div class="tips">头像采集</div>
<div class="tip_txt">上传近期半身本人照片</div>
<!-- <div class="btn" @click="chooseAvatar">上传照片</div> -->
<div v-if="avatar == ''" class="btn" @click="chooseAvatar">上传照片</div>
<div v-else class="btn" @click="doRead">去预约</div>
</div>
<div class="close_box" @click="isShowAvatar = false"><img src="~@/assets/image/close.png" alt=""></div>
</van-overlay>
</div> </div>
</template> </template>
<script> <script>
import { queryArticleDetail, getCupImg, saveCupImg } from "@/api/hospital"; import { queryArticleDetail } from "@/api/hospital";
export default { export default {
data() { data() {
return { return {
@ -33,139 +19,14 @@ export default {
title: '', title: '',
content: '' content: ''
},// },//
isShowAvatar: false,//
avatar: '',//
userInfo: null,//
} }
}, },
mounted() { mounted() {
if (this.$route.query.deptId) { if (this.$route.query.deptId) {
this.queryAticle(this.$route.query.deptId); this.queryAticle(this.$route.query.deptId);
} }
let userInfo = sessionStorage.getItem('userInfo') ? JSON.parse(sessionStorage.getItem('userInfo')) : null;
if (userInfo) {
this.userInfo = userInfo;
this.queryCupImg();//
}
}, },
methods: { methods: {
//
queryCupImg() {
this.$toast.loading({
message: '加载中',
duration: 0,
})
if (this.GlobalConfig.appMode) {
vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczdhqwzxq", JSON.stringify({ cupCardNo: this.Base64.encode(this.userInfo.papersnumber) }), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => {
this.$toast.clear();
let retData = JSON.parse(value);
if (retData.code == 200) {
this.avatar = retData.data;
}
}, err => {
this.$toast.clear();
})
} else {
getCupImg(this.Base64.encode(this.userInfo.papersnumber)).then(res => {
this.$toast.clear();
if (res.code == 200) {
this.avatar = res.data;
}
}, err => {
this.$toast.clear();
})
}
},
//
chooseAvatar() {
lightAppJssdk.media.chooseImage({
arg: '200',
type: '1',
success: (data) => {
//
if (data.picPath.length > 1) {
this.$toast('头像只能选择一张');
}
else {
// this.compress(data.picPath[0]);
// //
let avatar = 'data:image/jpg;base64,' + data.picPath[0];
this.saveCupImg(avatar);
}
},
fail: (data) => {
//
}
});
},
//
saveCupImg(avatar) {
let param = { data: { cupCardNo: this.Base64.encode(this.userInfo.papersnumber), cupImg: avatar } };
this.$toast.loading({
message: '请求中',
duration: 0,
})
try {
if (this.GlobalConfig.appMode) {
vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczdhqwzxq", JSON.stringify(param), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => {
this.$toast.clear();
let retData = JSON.parse(value);
if (retData.code == 200) {
this.$toast('采集成功');
this.avatar = vatar;
} else {
this.$toast(retData.msg);
}
}, err => {
this.$toast.clear();
})
}
else {
saveCupImg(JSON.stringify(param)).then(res => {
this.$toast.clear();
if (res.code == 200) {
this.$toast('采集成功');
this.avatar = avatar;
} else {
this.$toast(res.msg);
}
}, err => {
this.$toast.clear();
})
}
} catch (error) {
this.$toast.clear();
}
},
//
compress(base64) {
var newImage = new Image();
var quality = 0.6; //0-1
newImage.src = 'data:image/jpg;base64,' + base64;
newImage.setAttribute("crossOrigin", 'Anonymous'); //url
newImage.onload = () => {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
canvas.width = 700;
canvas.height = 920;
quality = 0.7;
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(newImage, 0, 0, canvas.width, canvas.height);
var compressBase64 = canvas.toDataURL("image/jpeg", quality); //
// ,50-150kbquality
// while (base64.length / 1024 > 150) {
// quality -= 0.01;
// base64 = canvas.toDataURL("image/jpeg", quality);
// }
// quality
// while (base64.length / 1024 < 50) {
// quality += 0.001;
// base64 = canvas.toDataURL("image/jpeg", quality);
// }
//
this.saveCupImg(compressBase64);
}
},
// //
queryAticle(id) { queryAticle(id) {
this.$toast.loading({ this.$toast.loading({
@ -206,15 +67,7 @@ export default {
}, },
// //
doRead() { doRead() {
// this.isShowAvatar = true; this.$router.replace({ name: 'examination', query: { id: this.$route.query.deptId } });
// return;
//
if (this.avatar == '') {
this.isShowAvatar = true;
} else {
this.isShowAvatar = false;
this.$router.replace({ name: 'examination', query: { id: this.$route.query.deptId } });
}
// let readBox = this.$refs.scrollView; // let readBox = this.$refs.scrollView;
// console.log(readBox.scrollHeight, parseInt(readBox.scrollTop), readBox.clientHeight) // console.log(readBox.scrollHeight, parseInt(readBox.scrollTop), readBox.clientHeight)
// if (readBox.scrollHeight - parseInt(readBox.scrollTop) !== readBox.clientHeight) { // if (readBox.scrollHeight - parseInt(readBox.scrollTop) !== readBox.clientHeight) {
@ -313,71 +166,5 @@ export default {
} }
} }
} }
.wrapper {
width: 5.98rem;
height: 6.66rem;
background: #FFFFFF;
border-radius: 0.16rem;
margin: 0 auto;
margin-top: 2.76rem;
.img_box {
display: flex;
justify-content: center;
img {
width: 2.4rem;
height: 2.7rem;
margin-top: 0.6rem;
}
}
.tips {
display: flex;
justify-content: center;
font-size: 0.34rem;
color: #000;
font-weight: bold;
margin: 0.56rem 0 0.2rem 0;
font-family: PingFang SC-Regular, PingFang SC;
}
.tip_txt {
width: 3.8rem;
color: #666;
font-size: 0.24rem;
text-align: center;
font-family: PingFang SC-Regular, PingFang SC;
margin: 0 auto;
}
.btn {
width: 3rem;
height: 0.8rem;
background: #1677FF;
border-radius: 0.08rem;
margin: 0 auto;
margin-top: 0.6rem;
font-size: 0.3rem;
color: #fff;
display: flex;
align-items: center;
justify-content: center;
font-family: PingFang SC-Regular, PingFang SC;
}
}
.close_box {
display: flex;
justify-content: center;
margin-top: 0.6rem;
img {
width: 0.5rem;
height: 0.5rem;
}
}
} }
</style> </style>

@ -24,7 +24,7 @@
</div> </div>
</div> </div>
<div class="act_box"> <div class="act_box">
<div class="act_btn" @click="confirmProject">确认</div> <div class="act_btn" @click="isShowCon = true">确认</div>
</div> </div>
<van-overlay :show="isShow"> <van-overlay :show="isShow">
<div class="wrapper" @click.stop v-show="isSuccess"> <div class="wrapper" @click.stop v-show="isSuccess">
@ -33,11 +33,10 @@
</div> </div>
<div class="tips">预约成功</div> <div class="tips">预约成功</div>
<div class="tip_txt" style="text-align: left;padding:0 0.5rem;"> <div class="tip_txt" style="text-align: left;padding:0 0.5rem;">
<!-- <div>预约成功后若不能按时体检请在开始时间</div> <div>
<div>前30分钟取消该预约</div> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;预约成功后若不能按时体检请在开始时间前30分钟取消该预约未按期体检{{
<div>未按期体检{{blacklistOutDate}}次后将被拉黑</div> timesToBlacklist }}次后将被拉黑被拉黑的用户请于{{ blacklistOutDate }}日后再次预约
<div>被拉黑的用户请于{{blacklistOutDate}}日后再次预约</div> --> </div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;预约成功后若不能按时体检请在开始时间前30分钟取消该预约未按期体检{{timesToBlacklist}}次后将被拉黑被拉黑的用户请于{{blacklistOutDate}}日后再次预约</div>
</div> </div>
<div class="btn" @click="clickSucc">知道了</div> <div class="btn" @click="clickSucc">知道了</div>
</div> </div>
@ -51,18 +50,77 @@
</div> </div>
<div class="btn" @click="clickFail">知道了</div> <div class="btn" @click="clickFail">知道了</div>
</div> </div>
<div v-show="isShowCon" @click.stop class="wrapper">
<div class="tips">请确认您了解以下情况</div>
<div class="btn" @click="confirm">已了解</div>
</div>
<div class="close_box" @click="clickClose"><img src="~@/assets/image/close.png" alt=""></div> <div class="close_box" @click="clickClose"><img src="~@/assets/image/close.png" alt=""></div>
</van-overlay>
<!-- 预约须知 -->
<van-overlay :show="isShowCon" :lock-scroll="false">
<div @click.stop class="confirm_box">
<div class="confirm_txt">
<div style="color:#f00;">请确认您符合以下身体条件</div>
<div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.身高申请大型客车重型牵引挂车城市公交车大型货车无轨电车准驾车型的身高为155厘米以上申请中型客车准驾车型的身高为150厘米以上
</div>
<div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2.视力申请大型客车重型牵引挂车城市公交车中型客车大型货车无轨电车或者有轨电车准驾车型的两眼裸视力或者矫正视力达到对数视力表5.0以上申请其他准驾车型的两眼裸视力或者矫正视力达到对数视力表4.9以上单眼视力障碍优眼裸视力或者矫正视力达到对数视力表5.0以上且水平视野达到150度的可以申请小型汽车小型自动挡汽车低速载货汽车三轮汽车残疾人专用小型自动挡载客汽车准驾车型的机动车驾驶证
</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3.辨色力无红绿色盲</div>
<div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;4.听力两耳分别距音叉50厘米能辨别声源方向有听力障碍但佩戴助听设备能够达到以上条件的可以申请小型汽车小型自动挡汽车准驾车型的机动车驾驶证
</div>
<div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5.上肢双手拇指健全每只手其他手指必须有三指健全肢体和手指运动功能正常但手指末节残缺或者左手有三指健全且双手手掌完整的可以申请小型汽车小型自动挡汽车低速载货汽车三轮汽车准驾车型的机动车驾驶证
</div>
<div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;6.下肢双下肢健全且运动功能正常不等长度不得大于5厘米单独左下肢缺失或者丧失运动功能但右下肢正常的可以申请小型自动挡汽车准驾车型的机动车驾驶证
</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;7.躯干颈部无运动功能障碍</div>
<div>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;8.右下肢双下肢缺失或者丧失运动功能但能够自主坐立且上肢符合本项第5目规定的可以申请残疾人专用小型自动挡载客汽车准驾车型的机动车驾驶证一只手掌缺失另一只手拇指健全其他手指有两指健全上肢和手指运动功能正常且下肢符合本项第6目规定的可以申请残疾人专用小型自动挡载客汽车准驾车型的机动车驾驶证
</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;9.
年龄在70周岁以上能够通过记忆力判断力反应力等能力测试的可以申请小型汽车小型自动挡汽车残疾人专用小型自动挡载客汽车轻便摩托车准驾车型的机动车驾驶证</div>
</div>
<div class="confirm_btn">
<div class="confirm_actBtn" @click="isShowCon = false">上一步</div>
<div class="confirm_actBtn blue" @click="isShowCon = false; isShowAvatar = true">确认</div>
</div>
</div>
</van-overlay>
<!-- 采集头像弹框 -->
<van-overlay :show="isShowAvatar">
<div class="confirm_box avatar" @click.stop>
<div class="img_box"
:style="{ backgroundImage: `${avatar.length > 0 ? 'url(' + avatar + ')' : 'url(' + require('@/assets/image/avatar.png') + ')'}` }">
</div>
<div class="img_txt">请上传近期半身本人照片</div>
<div class="img_btn" @click="chooseAvatar">开始上传</div>
<div class="img_tips">
<div>
<img src="@/assets/image/avatar_icon01.png" />
<div>人脸置于轮廓内</div>
</div>
<div>
<img src="@/assets/image/avatar_icon02.png" />
<div>请保持无表情</div>
</div>
<div>
<img src="@/assets/image/avatar_icon03.png" />
<div>保持光线充足</div>
</div>
</div>
<div class="confirm_btn">
<div class="confirm_actBtn" @click="isShowCon = true; isShowAvatar = false">上一步</div>
<div class="confirm_actBtn blue" @click="doConfirmSubmit">确认</div>
</div>
</div>
</van-overlay> </van-overlay>
</div> </div>
</template> </template>
<script> <script>
import { postExam } from "@/api/examination"; import { postExam } from "@/api/examination";
import { saveCupImg } from "@/api/hospital";
export default { export default {
data() { data() {
return { return {
@ -70,36 +128,139 @@ export default {
proArr: [], proArr: [],
isShow: false, isShow: false,
isSuccess: false, isSuccess: false,
isShowCon:false, isShowCon: false,
isFail:false, isFail: false,
userInfo: {}, userInfo: {},
failTips: '', failTips: '',
blacklistOutDate:'', blacklistOutDate: '',
timesToBlacklist:'',// timesToBlacklist: '',//
isShowAvatar: false,//
avatar: '',//
}; };
}, },
mounted() { mounted() {
console.log('query', this.$route.query); console.log('query', this.$route.query);
this.userInfo = JSON.parse(sessionStorage.getItem('userInfo')) this.userInfo = JSON.parse(sessionStorage.getItem('userInfo'))
console.log(this.userInfo); console.log(this.userInfo);
this.proData = this.$route.query; if (this.userInfo) {
let selectArr = JSON.parse(this.proData.selectArr); this.proData = this.$route.query;
selectArr.map(item => { let selectArr = JSON.parse(this.proData.selectArr);
this.proArr.push({ selectArr.map(item => {
apmDay: this.proData.time.replace(/\//g, '-'), this.proArr.push({
createDept: this.proData.createDept, apmDay: this.proData.time.replace(/\//g, '-'),
project: item.name, createDept: this.proData.createDept,
cuAddr: item.posi, project: item.name,
period: item.time.substr(0, 2), cuAddr: item.posi,
timeFrame: item.time.substr(3), period: item.time.substr(0, 2),
cupName: this.Base64.encode(this.userInfo.name), timeFrame: item.time.substr(3),
cupPhone: this.Base64.encode(this.userInfo.mobile), cupName: this.Base64.encode(this.userInfo.name),
cupCardNo: this.Base64.encode(this.userInfo.papersnumber) cupPhone: this.Base64.encode(this.userInfo.mobile),
cupCardNo: this.Base64.encode(this.userInfo.papersnumber)
})
}) })
}) }
// console.log("proArr",this.proArr) // console.log("proArr",this.proArr)
}, },
methods: { methods: {
// -
doConfirmSubmit() {
if (this.avatar) {
this.confirm();
}
},
//
chooseAvatar() {
lightAppJssdk.media.chooseImage({
arg: '200',
type: '1',
success: (data) => {
//
if (data.picPath.length > 1) {
this.$toast('头像只能选择一张');
}
else {
// this.compress(data.picPath[0]);
// //
let avatar = 'data:image/jpg;base64,' + data.picPath[0];
this.saveCupImg(avatar.replace(/\s/g, encodeURIComponent(' ')));
}
},
fail: (data) => {
alert(data)
console.log('fail img',data)
//
}
});
},
//
saveCupImg(avatar) {
let param = { data: { cupCardNo: this.Base64.encode(this.userInfo.papersnumber), cupImg: avatar } };
this.$toast.loading({
message: '请求中',
duration: 0,
})
try {
if (this.GlobalConfig.appMode) {
vaildInterfacefn("cgstjyyxuwxt", "qdsgajjtjczdhqwzxq", JSON.stringify(param), "2", "https://" + this.GlobalConfig.urlCreatesign, "https://" + this.GlobalConfig.urlGateway).then((value) => {
this.$toast.clear();
let retData = JSON.parse(value);
if (retData.code == 200) {
this.$toast('采集成功');
this.avatar = avatar;
} else {
this.$toast(retData.msg);
}
}, err => {
this.$toast.clear();
})
}
else {
saveCupImg(JSON.stringify(param)).then(res => {
this.$toast.clear();
if (res.code == 200) {
this.$toast('采集成功');
this.avatar = avatar;
console.log(this.avatar)
} else {
this.$toast(res.msg);
}
}, err => {
this.$toast.clear();
})
}
} catch (error) {
this.$toast.clear();
}
},
//
compress(base64) {
var newImage = new Image();
var quality = 0.6; //0-1
newImage.src = 'data:image/jpg;base64,' + base64;
newImage.setAttribute("crossOrigin", 'Anonymous'); //url
newImage.onload = () => {
var canvas = document.createElement("canvas");
var ctx = canvas.getContext("2d");
canvas.width = 700;
canvas.height = 920;
quality = 0.7;
ctx.clearRect(0, 0, canvas.width, canvas.height);
ctx.drawImage(newImage, 0, 0, canvas.width, canvas.height);
var compressBase64 = canvas.toDataURL("image/jpeg", quality); //
// ,50-150kbquality
// while (base64.length / 1024 > 150) {
// quality -= 0.01;
// base64 = canvas.toDataURL("image/jpeg", quality);
// }
// quality
// while (base64.length / 1024 < 50) {
// quality += 0.001;
// base64 = canvas.toDataURL("image/jpeg", quality);
// }
//
this.saveCupImg(compressBase64);
}
},
cancelButton(idx) { cancelButton(idx) {
this.proArr.splice(idx, 1); this.proArr.splice(idx, 1);
// this.proArr = this.proArr.filter(item => item.name != val.name) // this.proArr = this.proArr.filter(item => item.name != val.name)
@ -123,16 +284,10 @@ export default {
// }); // });
}, },
confirmProject(){
console.log('ces')
this.isShow = true
this.isShowCon = true
},
confirm() { confirm() {
let param = this.proArr; let param = this.proArr;
console.log(param) console.log(param)
this.isShowCon = false this.isShowAvatar = false
this.$toast.loading({ this.$toast.loading({
message: '请求中', message: '请求中',
duration: 0, duration: 0,
@ -398,6 +553,119 @@ export default {
} }
} }
//
.confirm_box {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
background-color: #fff;
.tips {
font-size: 0.34rem;
color: #000;
font-weight: bold;
font-family: PingFang SC-Regular, PingFang SC;
text-align: center;
padding-top: 0.24rem;
}
.confirm_txt {
position: absolute;
left: 0.24rem;
top: 0.24rem;
right: 0.24rem;
bottom: 2rem;
font-size: 0.24rem;
color: #666;
font-family: PingFang SC-Regular, PingFang SC;
text-align: left;
line-height: 0.42rem;
overflow: scroll;
}
.confirm_btn {
position: absolute;
left: 0.4rem;
right: 0.4rem;
bottom: calc(20px + 0.24rem);
.confirm_actBtn {
float: left;
display: inline-block;
width: 3rem;
color: #999999;
font-size: 0.3rem;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
line-height: 0.98rem;
text-align: center;
background: #FFFFFF;
border-radius: 0.08rem;
border: 0.02rem solid #E1E1E1;
&.blue {
float: right;
color: #fff;
background: #1677FF;
border-color: #1677FF;
}
}
}
//
&.avatar {
.img_box {
width: 3.6rem;
height: 3.6rem;
background: url('../assets/image/avatar.png') no-repeat;
background-size: cover;
margin: 1.42rem auto 0;
}
.img_txt {
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
font-size: 0.26rem;
line-height: 0.45rem;
text-align: center;
margin: 0.3rem auto 0.46rem;
}
.img_btn {
width: 3rem;
line-height: 0.8rem;
background: #1677FF;
border-radius: 0.4rem;
margin: 0 auto 1.46rem;
font-size: 0.3rem;
font-family: PingFang SC-Bold, PingFang SC;
font-weight: bold;
color: #fff;
text-align: center;
}
.img_tips {
display: flex;
justify-content: space-around;
font-size: 0.24rem;
font-family: PingFang SC-Regular, PingFang SC;
font-weight: 400;
color: #999999;
line-height: 0.34rem;
text-align: center;
img {
width: 0.82rem;
height: 0.82rem;
margin-bottom: 0.24rem;
}
}
}
}
.close_box { .close_box {
display: flex; display: flex;
justify-content: center; justify-content: center;

Loading…
Cancel
Save