Browse Source

签到接接口

master
unknown 9 months ago
parent
commit
fbdd6366e7
  1. 7
      common/js/utils.js
  2. 14
      config/api.js
  3. 4
      config/request.js
  4. 9
      pages.json
  5. 1
      pages/carEntry/operaAppointment/comp/step1.vue
  6. 233
      pages/carEntry/signature/signature.vue
  7. 75
      pages/indexEntry/enroll/enroll.vue
  8. 2
      pages/indexEntry/enroll/registInfo/registInfo.vue
  9. 97
      pages/indexEntry/signIn/signAndOut/signAndOut.vue
  10. 5
      pages/mineEntry/myAppointment/myAppointment.vue
  11. 19
      pages/tabbar/index/index.vue
  12. 7
      pages/tabbar/learnCar/comp/subject2.vue
  13. 21
      pages/tabbar/learnCar/comp/topInfo.vue

7
common/js/utils.js

@ -123,7 +123,8 @@ const install = (Vue, vm) => {
store.commit('goLogin')
return
}
store.commit('updateNonPlatformStudent', false)
return vm.$goPage('/pages/indexEntry/signIn/signAndOut/signAndOut')
// store.commit('updateNonPlatformStudent', false)
if( vm.vuex_userInfo.applyStep<2) {
vm.$goPage('/pages/indexEntry/enroll/enroll')
}
@ -131,6 +132,10 @@ const install = (Vue, vm) => {
if( vm.vuex_userInfo.applyStep&& vm.vuex_userInfo.applyStep<5) {
return vm.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
}
if( vm.vuex_userInfo.applyStep>5) {
return vm.$goPage('/pages/indexEntry/signIn/signAndOut/signAndOut')
}
}
let isImagePath = (path)=> {

14
config/api.js

@ -196,6 +196,20 @@ export const getStudentSubject2Status = (data) => http.post('app/student-process
export const getStudentSubject3Status = (data) => http.post('app/student-process/getStudentSubject3Status', data)
// 获得科目四学习状态
export const getStudentSubject4Status = (data) => http.post('app/student-process/getStudentSubject4Status', data)
// 实操签到
export const operationSigin = (params={}) => http.get('business/coach/sign/in', {params})
// 学员签到信息校验接口
export const vailStudentInfo = (params={}) => http.get('business/coach/sign/vailStudentInfo', {params})
// 签退
export const signOutAuth = (data) => http.post('business/student/sign/outAuth', data)

4
config/request.js

@ -63,7 +63,9 @@ module.exports = (vm) => {
// 自定义参数
const custom = response.config?.custom
if (data.code !== 0&&data.code!=406) {
if (data.code !== 0&&data.code!=406&&data.code!='200240213') {
console.log('不正常的code')
console.log(data)
// 如果没有显式定义custom的toast参数为false的话,默认对报错进行toast弹出提示
if (custom.toast !== false) {
uni.$u.toast(data.msg)

9
pages.json

@ -335,8 +335,15 @@
"enablePullDownRefresh": false,
"backgroundTextStyle": "dark"
}
},
{
"path": "signature/signature",
"style": {
"navigationBarTitleText": "签名",
"enablePullDownRefresh": false,
"backgroundTextStyle": "dark"
}
}
]
},
{

1
pages/carEntry/operaAppointment/comp/step1.vue

@ -85,6 +85,7 @@
// padding: 32rpx;
// width: 100%;
// background: #F6F6F6;
margin-top: 20rpx;
.btn_row {
display: flex;
align-items: center;

233
pages/carEntry/signature/signature.vue

@ -0,0 +1,233 @@
<template>
<view class="pageBg">
<view class="signature-box">
<view class="topTps">需要您签名确认学时</view>
<!-- 签名 -->
<view class="signature">
<canvas ref="mycanvas" class="mycanvas" canvas-id="mycanvas" @touchstart="touchstart" @touchmove="touchmove"
@touchend="touchend"></canvas>
</view>
<view class="footBox">
<view class="checkCon">
<u-checkbox-group>
<!-- <u-checkbox v-model="checked">本人 {{realName}} 承诺以上签名真实有效</u-checkbox> -->
<u-checkbox :checked="checked" :label="`本人【 ${realName} 】承诺以上签名真实有效`" :labelSize="12" @change="checkedchange" ></u-checkbox>
</u-checkbox-group>
</view>
<view class="footBtn">
<view class="btn border" @click="clear">重签</view>
<view class="btn" @click="finish">提交</view>
</view>
</view>
</view>
</view>
</template>
<script>
// import { pathToBase64 } from '@/common/js/jssdk_image_tools.js'
var x = 20;
var y = 20;
export default {
data() {
return {
//
ctx: '',
//
points: [],
//
SignatureImg: '',
hasSign: false,
realName: '',
checked: false,
};
},
mounted() {
this.createCanvas();
this.realName = this.vuex_userInfo.name
console.log(this.vuex_userInfo.name)
},
methods: {
checkedchange(val) {
this.checked = val
},
//
close() {
this.$emit('closeCanvas');
this.clear();
},
//
createCanvas() {
this.ctx = uni.createCanvasContext('mycanvas', this); //
this.ctx.setFillStyle('#000000')
this.ctx.fillStyle = '#000000'
//
this.ctx.lineWidth = 6;
this.ctx.lineCap = 'round';
this.ctx.lineJoin = 'round';
},
//
touchstart(e) {
let startX = e.changedTouches[0].x;
let startY = e.changedTouches[0].y;
let startPoint = {
X: startX,
Y: startY
};
this.points.push(startPoint);
//
this.ctx.beginPath();
},
//
touchmove(e) {
let moveX = e.changedTouches[0].x;
let moveY = e.changedTouches[0].y;
let movePoint = {
X: moveX,
Y: moveY
};
this.points.push(movePoint); //
let len = this.points.length;
if (len >= 2) {
this.draw(); //
}
},
//
touchend() {
this.points = [];
},
//
draw() {
let point1 = this.points[0];
let point2 = this.points[1];
this.points.shift();
this.ctx.moveTo(point1.X, point1.Y);
this.ctx.lineTo(point2.X, point2.Y);
this.ctx.stroke();
this.ctx.draw(true);
this.hasSign = true
},
//
clear() {
this.hasSign = false
let that = this;
this.createCanvas();
uni.getSystemInfo({
success: function(res) {
let canvasw = res.windowWidth;
let canvash = res.windowHeight;
that.ctx.clearRect(0, 0, canvasw, canvash);
that.ctx.draw(true);
}
});
},
//
finish() {
if(!this.checked) {
return this.$u.toast('请勾选承诺')
}
if (!this.hasSign) {
uni.showToast({
title: '签名为空不能保存',
icon: 'none',
duration: 2000
})
return
}
let that = this;
uni.canvasToTempFilePath({
canvasId: 'mycanvas',
destWidth:160,
success: function(res) {
console.log('图片上传结果')
console.log(res)
if(!res || !res.tempFilePath) {
console.log('没来这里?')
that.SignatureImg = res.tempFilePath;
console.log(that.SignatureImg)
// that.$emit('closeCanvas', that.SignatureImg);
}else{
that.$emit('closeCanvas', res.tempFilePath);
console.log('这是临时路径?')
console.log(res.tempFilePath)
console.log(that.SignatureImg)
// //canvasbase64
// pathToBase64(res.tempFilePath).then(re => {
// that.SignatureImg = re;
// that.$emit('getCanvasImg', that.SignatureImg);
// })
}
},
});
}
}
};
</script>
<style lang="scss" scoped>
.signature-box {
padding: 0 32rpx;
display: flex;
flex-direction: column;
width: 100%;
// height: 98%;
height: calc(100vh - 150rpx);
background: #fff;
.topTps {
width: 100%;
border-radius: 8rpx;
background-color: #f1f1f1;
height: 110rpx;
line-height: 110rpx;
text-align: center;
font-size: 34rpx;
color: #333;
}
.footBox {
.checkCon {
width: 100%;
height: 100rpx;
display: flex;
align-items: center;
}
.footBtn {
display: flex;
justify-content: space-between;
.btn {
width: 49%;
font-size: 32rpx;
line-height: 90rpx;
height: 90rpx;
color: #fff;
border-radius: 14rpx;
background: linear-gradient(180deg, #3593FB 0%, #53D3E5 100%);;
text-align: center;
&.border {
border: 1rpx solid #218dff ;
color: #218dff;
background: #fff;
}
}
}
}
//
.signature {
flex: 1;
// height: 0;
// width: 0;
//canvas
.mycanvas {
width:100%;
height:100%;
background-color: #fff;
border-radius: 10px 10px 0 0;
}
}
}
</style>

75
pages/indexEntry/enroll/enroll.vue

@ -139,32 +139,8 @@
this.form.typeName = item.label
this.showType = false
},
async getpersonfaceFn() {
const {data: res} = await getpersonface({MerchantId: '0NSJ2312271333064407'})
let obj = JSON.parse(res)
// this.link = obj.Url
// this.$store.commit('updateBizToken', obj.BizToken)
this.EidToken = obj.EidToken
return obj.EidToken
// #ifdef H5
window.open(this.link, '_blank')
// #endif
// var regex = /\[.*?\]/;
// alert(obj.BizToken)
// #ifdef MP-WEIXIN
this.$store.commit('updateWebVeiwUrl', this.link)
uni.navigateTo({
url: '/pages/indexEntry/enroll/realName/webView'
})
// #endif
console.log(obj)
},
async goNext() {
this.getInitFaceVerifyFn()
return
// if(!this.form.value) return this.$u.toast('')
// this.$goPage('/pages/indexEntry/enroll/signContract/signContract?schoolId='+this.vuex_userInfo.schoolId)
// return
@ -174,41 +150,40 @@
// }
// return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
//
if(this.vuex_userInfo.applyStep==2) {
if(this.title=='学员信息') {
//
return this.$goPage('/pages/indexEntry/NonPlatformStudentInfo/NonPlatformStudentInfo')
}
return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
}
// if(this.vuex_userInfo.applyStep==2) {
// return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
// }
//
// if(this.vuex_userInfo.applyStep==4||this.vuex_userInfo.applyStep==5) {
// return this.$goPage('/pages/indexEntry/enroll/payment/payment')
// }
if(this.vuex_userInfo.applyStep>1&&this.vuex_userInfo.applyStep<5) {
return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
}
//
if(this.form.value!=1) {
for(let key in this.formToast) {
if(!this.form[key]) {
return this.$u.toast(this.formToast[key])
//
if(!this.vuex_userInfo.applyStep||this.vuex_userInfo.applyStep<2) {
//
if(this.form.value!=1) {
for(let key in this.formToast) {
if(!this.form[key]) {
return this.$u.toast(this.formToast[key])
}
}
this.vuex_userInfo.address = this.form.address
this.vuex_userInfo.name = this.form.name
this.vuex_userInfo.sex = this.form.sex
this.vuex_userInfo.idcard = this.form.idcard
this.vuex_userInfo.nationality = (this.form.value==7||this.form.value==2)?'外国':'中国'
this.vuex_userInfo.cardType = this.form.value
return this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
}else {
this.getInitFaceVerifyFn()
}
this.vuex_userInfo.address = this.form.address
this.vuex_userInfo.name = this.form.name
this.vuex_userInfo.sex = this.form.sex
this.vuex_userInfo.idcard = this.form.idcard
this.vuex_userInfo.nationality = (this.form.value==7||this.form.value==2)?'外国':'中国'
this.vuex_userInfo.cardType = this.form.value
return this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
}
//
if(!this.vuex_userInfo.applyStep||this.vuex_userInfo.applyStep<2) {
this.getInitFaceVerifyFn()
//
if(this.vuex_userInfo.applyStep>1&&this.vuex_userInfo.applyStep<5) {
return this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
}
// this.$goPage('/pages/indexEntry/enroll/signContract/signContract')
// this.$goPage('/pages/indexEntry/enroll/uploadAvatar/uploadAvatar')
},

2
pages/indexEntry/enroll/registInfo/registInfo.vue

@ -329,7 +329,7 @@
this.form.coachId = schoolCoach.id
this.form.school = schoolCoach.schoolName
this.form.schoolId = schoolCoach.schoolId
this.form.trainType = schoolCoach.teachCarType.slice(0,2)
if(schoolCoach.teachCarType) this.form.trainType = schoolCoach.teachCarType.slice(0,2)
}
if(this.form.schoolId) {
this.getSchoolDetailFn()

97
pages/indexEntry/signIn/signAndOut/signAndOut.vue

@ -55,7 +55,7 @@
</view>
<view class="footBtn">
<view class="oneBtn" :class="{active: btnActive}" v-if="!step1" @click="getInitFaceVerifyFn">重新认证</view>
<view class="oneBtn" :class="{active: btnActive}" v-if="!step1" @click="Recertification">重新认证</view>
<view class="oneBtn" :class="{active: step3}" v-else @click="goBack">我知道了</view>
</view>
@ -64,7 +64,7 @@
</template>
<script>
import { getInitBodyFaceVerify, getDescribeBodyFaceVerify } from '@/config/api.js'
import { getInitBodyFaceVerify, getDescribeBodyFaceVerify, operationSigin, vailStudentInfo, signOutAuth } from '@/config/api.js'
export default {
data() {
return {
@ -73,13 +73,47 @@
step1: false,
step2: false,
step3: false,
btnActive: false
params: {}
}
},
onLoad(options) {
this.vailStudentInfoFn()
},
computed: {
btnActive() {
if(this.step1&&(!this.step2||!this.step3)) {
return true
}else {
return false
}
}
},
methods: {
//
async vailStudentInfoFn() {
// await this.$store.dispatch('getCity')
if(!this.vuex_cityInfo.lat) return
let schoolCoach = this.$store.state.school.schoolCoach
this.params = {
coachId: schoolCoach.coachId||'1760856426781200385',
stduentId: this.studentId,
lng: this.vuex_cityInfo.lng,
lat: this.vuex_cityInfo.lat,
key: schoolCoach.key||'f83d5b1c-5524-43c7-bb2c-8540dba69ccb',
type: schoolCoach.QrType
}
console.log(this.params)
const res = await vailStudentInfo(this.params)
if(res.code=='200240213') {
this.stepFailureReason = res.msg
}
if(res.data==true) {
this.step1 = true
this.getInitFaceVerifyFn()
}
console.log(res)
},
//
async getInitFaceVerifyFn() {
const verifyPlugin = uni.requireNativePlugin('AP-FaceDetectModule');
var metaInfo = verifyPlugin.getMetaInfo()
@ -100,33 +134,42 @@
console.log(response)
if(response.code==1000) {
getDescribeBodyFaceVerify({certifyId,}).then((useRes)=>{
console.log('成功')
console.log(useRes)
// let userInfo1 = JSON.parse(useRes.data.body.resultObject.materialInfo)
// console.log(userInfo1)
// if(useRes.code==0) {
// let materialInfo = JSON.parse(useRes.data.body.resultObject.materialInfo)
// let userInfo = materialInfo.ocrIdCardInfo
// let obj = {
// address: userInfo.address,
// name: userInfo.certName,
// idcard: userInfo.certNo,
// nationality: userInfo.nationality,
// cardType: '1',
// sex: userInfo.sex==''?'2': '1'
// }
// let info = Object.assign(_this.$store.state.user.vuex_userInfo, obj)
// _this.$store.commit('update_vuex_userInfo', info)
// console.log('')
// console.log(_this.$store.state.user.vuex_userInfo)
// _this.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
// }
_this.step2 = true
_this.siginFn()
})
}else if(response.code==2006) {
this.$u.toast('认证失败!请确定是本人后再重试')
}
});
},
// 退
async siginFn() {
let fn = operationSigin
if(this.params.type==3) {
fn = signOutAuth
}
const res = fn(this.params)
if(res.code=='200240213') {
this.$u.toast(res.msg)
}
if(res.data==true) {
this.step3 = true
let msg = '签到成功'
if(this.params.type==2) this.$u.toast('签退成功')
setTimeout(()=>{
uni.navigateBack()
},1000)
}
},
//
Recertification() {
if(!this.step2) {
getInitFaceVerifyFn()
}
if(!this.step3) {
this.siginFn()
}
}
}
}
</script>
@ -200,10 +243,10 @@
height: 56rpx;
border-radius: 50%;
font-size: 24rpx;
color: #fff;
color: #333;
text-align: center;
line-height: 56rpx;
// background: url('../../../../static/images/carIcon/home_icon_weidao@2x.png');
background: url('../../../../static/images/carIcon/home_icon_weidao@2x.png');
background-size: 100% 100%;
}

5
pages/mineEntry/myAppointment/myAppointment.vue

@ -8,7 +8,7 @@
<view class="navs">
<view class="nav" v-for="(item,index) in navList" :key="index" :class="{active: currentNav===item.id}" @click="changeNav(item)">{{ item.text }}</view>
</view>
<view class="recordTotal" v-if="total">{{total}}条记录</view>
<view class="recordTotal" ><text v-if="total">{{total}}条记录</text></view>
<view class="card" v-for="(item,index) in list" :key="index" @click="$goPage('/pages/mineEntry/myAppointment/detail/detail?type=2&id='+item.id)">
<opera :item="item"></opera>
@ -141,7 +141,6 @@
justify-content: space-between;
color: #fff;
font-size: 28rpx;
padding:0rpx 0 40rpx 0;
color: $themC;
.nav {
height: 80rpx;
@ -166,7 +165,7 @@
}
.recordTotal {
font-size: 24rpx;
padding: 0rpx 0 28rpx 0;
padding: 20rpx 0 20rpx 0;
text-align: right;
}
.pad {

19
pages/tabbar/index/index.vue

@ -205,6 +205,7 @@
},
onPullDownRefresh() {
this.$store.dispatch('getCity')
this.initApi()
},
onShow() {
@ -299,25 +300,29 @@
scanCodeFn() {
let _this = this
uni.scanCode({
scanType: ['qrCode'],
success: function(res) {
console.log('条码类型:' + res.scanType);
console.log('条码内容6:' + res.result);
console.log('条码内容:' + res.result);
let obj = JSON.parse(res.result)
console.log(obj)
//
if(obj.coachId) {
obj.nickname = decodeURIComponent(obj.nickname)
obj.schoolName = decodeURIComponent(obj.schoolName)
if(obj.QrType) {
let item = {
schoolName: obj.schoolName,
schoolId: obj.schoolId,
name: obj.nickname,
id: obj.coachId
name: obj.coachName,
id: obj.coachId,
teachCarType: obj.teachCarType,
key: obj.key,
QrType: obj.QrType
}
console.log('***********')
console.log(item)
_this.$store.commit('upDateSchoolClass', {})
_this.$store.commit('upDateSchoolCoach', item)
_this.$goPage('/pages/indexEntry/enroll/enroll')
_this.$u.utils.clickSignUp()
}
// _this.$store.commit('updateWebVeiwUrl', res.result)

7
pages/tabbar/learnCar/comp/subject2.vue

@ -36,6 +36,7 @@
<view class="lab">科目二考试成绩未通过</view>
<view class="date">{{ $u.timeFormat(info.studentExamVO.examTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
</view>
<view class="bg">
<view class="row bg">
<view class="text">前往"12123"APP预约考试</view>
@ -53,6 +54,12 @@
<view class="flex-b padTb">
<view class="lab">科目二学习进度已通过</view>
</view>
<!-- <view class="bg">
<view class="row bg">
<view class="text">预约考试前请确认学时</view>
<view class="btn" @click="$goPage('/pages/carEntry/signature/signature')">学时确认</view>
</view>
</view> -->
<view class="bg">
<view class="row bg">
<view class="text">前往"12123"APP预约考试</view>

21
pages/tabbar/learnCar/comp/topInfo.vue

@ -47,6 +47,12 @@
</view>
</view> -->
</view>
<view class="timerFlex">
<view class="link-arrow" @click="$goPage('/pages/carEntry/signature/signature')">
<view class="txt">确认学时</view>
<u-icon name="arrow-right" color="#3776FF" :size="16"></u-icon>
</view>
</view>
<u-picker :show="showType" :columns="typeArr" keyName="name" @confirm="confirmType" @cancel="showType=false"></u-picker>
</view>
</template>
@ -166,4 +172,19 @@
}
}
}
.timerFlex {
display: flex;
justify-content: flex-end;
padding: 20rpx 0 0 0;
.link-arrow {
display: flex;
align-items: center;
font-size: 28rpx;
color: $themC;
height: 50rpx;
.txt {
margin-right: 4rpx;
}
}
}
</style>
Loading…
Cancel
Save