Browse Source

修改了学车动态和登录

master
unknown 8 months ago
parent
commit
4a3f5a0a9e
  1. 5
      common/js/utils.js
  2. 3
      config/api.js
  3. 20
      pages/indexEntry/enroll/payment/payment.vue
  4. 2
      pages/indexEntry/enroll/signContract/signContract.vue
  5. 2
      pages/mineEntry/myForecastName/myForecastName.vue
  6. 6
      pages/tabbar/index/index.vue
  7. 30
      pages/tabbar/learnCar/comp/subject1.vue
  8. 83
      pages/tabbar/learnCar/comp/subject2.vue
  9. 20
      pages/tabbar/learnCar/comp/subject3.vue
  10. 29
      pages/tabbar/learnCar/comp/subject4.vue
  11. 20
      pages/tabbar/learnCar/comp/topInfo.vue
  12. 74
      pages/tabbar/learnCar/index.vue
  13. 11
      pages/userCenter/login/login.vue
  14. 10
      store/modules/user.js

5
common/js/utils.js

@ -123,7 +123,6 @@ const install = (Vue, vm) => {
store.commit('goLogin')
return
}
return vm.$goPage('/pages/indexEntry/signIn/signAndOut/signAndOut')
// store.commit('updateNonPlatformStudent', false)
if( vm.vuex_userInfo.applyStep<2) {
vm.$goPage('/pages/indexEntry/enroll/enroll')
@ -133,9 +132,7 @@ const install = (Vue, vm) => {
return vm.$goPage('/pages/indexEntry/enroll/registInfo/registInfo')
}
if( vm.vuex_userInfo.applyStep>5) {
return vm.$goPage('/pages/indexEntry/signIn/signAndOut/signAndOut')
}
uni.$u.toast('您已是报名学员')
}
let isImagePath = (path)=> {

3
config/api.js

@ -202,6 +202,9 @@ export const operationSigin = (params={}) => http.get('business/coach/sign/in',
export const vailStudentInfo = (params={}) => http.get('business/coach/sign/vailStudentInfo', {params})
// 签退
export const signOutAuth = (data) => http.post('business/student/sign/outAuth', data)
// 支付
export const getStudentByPayment = (params={}) => http.get('app/student-record/getStudentByPayment', {params})

20
pages/indexEntry/enroll/payment/payment.vue

@ -51,6 +51,26 @@
</template>
<script>
import { getStudentByPayment } from '@/config/api.js'
export default {
data() {
return {
trainingApplyId: '',
}
},
onLoad(options) {
if(options.trainingApplyId) {
this.trainingApplyId = options.trainingApplyId
}
this.getStudentByPayment()
},
methods: {
async getStudentByPayment() {
const {data: res} = await getStudentByPayment({trainingApplyId: this.trainingApplyId})
this.$store.dispatch('getUserInfo')
}
}
}
</script>
<style lang="scss" scoped>

2
pages/indexEntry/enroll/signContract/signContract.vue

@ -101,7 +101,7 @@
if (res.flowStatus == 2) {
uni.navigateTo({
url: '/pages/indexEntry/enroll/payment/payment'
url: '/pages/indexEntry/enroll/payment/payment?trainingApplyId='+this.trainingApplyId
})
if (res.flowStatus > 2) {

2
pages/mineEntry/myForecastName/myForecastName.vue

@ -56,7 +56,7 @@
if(item.applyStep==3) {
this.$goPage('/pages/indexEntry/enroll/signContract/signContract?schoolId='+item.trainingSchoolId+'&trainingApplyId='+ item.trainingApplyId)
}else if(item.applyStep==4) {
return this.$goPage('/pages/indexEntry/enroll/payment/payment')
return this.$goPage('/pages/indexEntry/enroll/payment/payment?trainingApplyId='+ item.trainingApplyId)
}
}
}

6
pages/tabbar/index/index.vue

@ -322,7 +322,11 @@
console.log(item)
_this.$store.commit('upDateSchoolClass', {})
_this.$store.commit('upDateSchoolCoach', item)
_this.$u.utils.clickSignUp()
if(obj.QrType==1) {
_this.$u.utils.clickSignUp()
}else {
_this.$goPage('/pages/indexEntry/signIn/signAndOut/signAndOut')
}
}
// _this.$store.commit('updateWebVeiwUrl', res.result)

30
pages/tabbar/learnCar/comp/subject1.vue

@ -86,6 +86,7 @@
getStudentSubject1Status,
} from '@/config/api.js'
export default {
props: ['subjectStatus'],
data() {
return {
info: {},
@ -94,18 +95,27 @@
}
},
created() {
this.showExam = false,//
this.showAppointment = false,//
this.getStudentSubject1StatusFn()
this.showExam = false//
this.showAppointment = false//
// this.getStudentSubject1StatusFn()
},
watch: {
subjectStatus: {
handler: function(res) {
console.log('obj1改变了')
this.getStudentSubject1StatusFn(res)
},
// immediate: true,
deep: true
}
},
methods: {
async getStudentSubject1StatusFn() {
const {
data: res
} = await getStudentSubject1Status({
studentId: this.studentId
})
async getStudentSubject1StatusFn(res) {
// const {
// data: res
// } = await getStudentSubject1Status({
// studentId: this.studentId
// })
this.info = res
// 1
if(res.studentExamVO&&res.examReservationVO) {

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

@ -4,9 +4,10 @@
<!-- 学习状态 -->
<view class="learnStatus">
<view class="card mt20">
<view class="flex-b" >
<view class="flex-b">
<view class="lab">实操预约</view>
<view class="link-arrow" @click="$goPage('/pages/carEntry/operaAppointment/operaAppointment?subject=2')">
<view class="link-arrow"
@click="$goPage('/pages/carEntry/operaAppointment/operaAppointment?subject=2')">
<view class="txt">去预约</view>
<u-icon name="arrow-right" color="#3776FF" :size="16"></u-icon>
</view>
@ -15,7 +16,7 @@
</view>
<view class="h1"><text class="active">学习状态</text></view>
<!-- 考试结果 -->
<view class="exam" v-if="showExam">
<view class="exam" v-if="showExam">
<view class="card" v-if="info.studentExamVO.pass">
<view class="flex-b padTb">
<view class="lab">科目二考试成绩已通过</view>
@ -23,10 +24,11 @@
{{ $u.timeFormat(info.studentExamVO.examTime, 'yyyy-mm-dd hh:MM:ss') }}
</view>
</view>
<view class="flex-b bg" v-if="!info.studentExamVO.canComment">
<view class="flex-b bg">
<view class="row">
<view class="text">考试成绩{{ info.studentExamVO.examResult }}</view>
<view class="btn" @click="$goPage('/pages/carEntry/evaluate/evaluate?subject=2&coachType=1')">去评价</view>
<view class="btn"
@click="$goPage('/pages/carEntry/evaluate/evaluate?subject=2&coachType=1')" v-if="!info.studentExamVO.canComment">去评价</view>
</view>
</view>
</view>
@ -34,7 +36,8 @@
<view class="card" v-else>
<view class="flex-b padTb">
<view class="lab">科目二考试成绩未通过</view>
<view class="date">{{ $u.timeFormat(info.studentExamVO.examTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
<view class="date">{{ $u.timeFormat(info.studentExamVO.examTime, 'yyyy-mm-dd hh:MM:ss') }}
</view>
</view>
<view class="bg">
@ -63,20 +66,22 @@
<view class="bg">
<view class="row bg">
<view class="text">前往"12123"APP预约考试</view>
<view class="btn" @click="$u.toast('请打开12123App预约')">去预约</view>
<view class="btn" @click="$u.toast('请打开12123App预约')">去预约</view>
</view>
</view>
</view>
<view class="card" v-else>
<view class="flex-b padTb">
<view class="lab">科目二考试预约{{ examReservationStatus[info.examReservationVO.examReservationStatus]}}</view>
<view class="lab">
科目二考试预约{{ examReservationStatus[info.examReservationVO.examReservationStatus]}}</view>
</view>
<view class="bg">
<view class="row">
<view class="text">考试场地{{info.examReservationVO.examAddress}}</view>
</view>
<view class="row">
<view class="text">考试时间{{ $u.timeFormat(info.examReservationVO.examTime, 'yyyy-mm-dd hh:MM:ss') }} </view>
<view class="text">
考试时间{{ $u.timeFormat(info.examReservationVO.examTime, 'yyyy-mm-dd hh:MM:ss') }} </view>
</view>
</view>
</view>
@ -86,9 +91,10 @@
</view> -->
<!-- 预约实操训练 -->
<view class="" v-if="info.operationReservationVO&&info.operationReservationVO.length">
<view class="card" v-for="(item,index) in info.operationReservationVO" :key="index">
<view class="card" v-for="(item,index) in info.operationReservationVO" :key="index">
<view class="flex-b padTb">
<view class="lab">科目二实操训练 {{ item.reservationStatus==9?'已取消': reservationStatus[item.reservationStatus]}}</view>
<view class="lab">科目二实操训练
{{ item.reservationStatus==9?'已取消': reservationStatus[item.reservationStatus]}}</view>
<view class="date">{{ $u.timeFormat(item.joe, 'yyyy-mm-dd hh:MM:ss') }}</view>
</view>
<view class="bg">
@ -96,7 +102,8 @@
<view class="row">预约教练{{item.reservationCoach}}</view>
<view class="row">预约车辆{{item.reservationCar}}</view>
<view class="row">预约时间{{ $u.timeFormat(item.reservationTime, 'yyyy-mm-dd hh:MM:ss') }}</view>
<view class="row" v-if="item.joe">核销时间{{ $u.timeFormat(item.joe, 'yyyy-mm-dd hh:MM:ss') }}</view>
<view class="row" v-if="item.joe">核销时间{{ $u.timeFormat(item.joe, 'yyyy-mm-dd hh:MM:ss') }}
</view>
</view>
</view>
</view>
@ -110,54 +117,70 @@
getStudentSubject2Status,
} from '@/config/api.js'
export default {
props: ['subjectStatus'],
data() {
return {
info: {},
showAppointment: false,//
showAppointmentExam: false,//
showExam: false,//
showAppointment: false, //
showAppointmentExam: false, //
showExam: false, //
reservationStatus: ['未签到', '已签到', '已签退', '已过期'],
examReservationStatus: ['预约失败', '预约通过', '-预约中']
}
},
created() {
this.getStudentSubject2StatusFn()
// this.getStudentSubject2StatusFn()
//
// 1,,
// 2,,,
// 3,
},
watch: {
subjectStatus: {
handler: function(res) {
console.log('obj2改变了')
this.getStudentSubject2StatusFn(res)
},
// immediate: true,
deep: true
}
},
methods: {
changeStep(type) {
this.showAppointment = false,//
this.showAppointmentExam = false,//
this.showExam = false,//
this[type] = true
this.showAppointment = false, //
this.showAppointmentExam = false, //
this.showExam = false, //
this[type] = true
},
async getStudentSubject2StatusFn() {
const {data: res} = await getStudentSubject2Status({studentId: this.studentId})
async getStudentSubject2StatusFn(res) {
// const {
// data: res
// } = await getStudentSubject2Status({
// studentId: this.studentId
// })
let studentExamVO = res.studentExamVO || {} //
let examReservationVO = res.examReservationVO || {} //
let operationReservationVO = res.operationReservationVO?res.operationReservationVO[0] : {} //
if(studentExamVO.pass) {
let operationReservationVO = res.operationReservationVO ? res.operationReservationVO[0] : {} //
if (studentExamVO.pass) {
//
this.changeStep('showExam')
}else if(res.studentClassHourVO.classHourReachStatus) {
} else if (res.studentClassHourVO.classHourReachStatus) {
//
let ExamVOTime = studentExamVO.examTime
let ExamReservationVOTime = examReservationVO.examTime
//
if (!ExamVOTime&&!ExamReservationVOTime) this.changeStep('showAppointmentExam')
if (!ExamVOTime && !ExamReservationVOTime) this.changeStep('showAppointmentExam')
// ,
if(!ExamVOTime&&ExamReservationVOTime) {
if (!ExamVOTime && ExamReservationVOTime) {
this.changeStep('showAppointmentExam')
}
if(ExamVOTime&&!ExamReservationVOTime) {
if (ExamVOTime && !ExamReservationVOTime) {
this.changeStep('showExam')
}
//
if(ExamVOTime&&ExamReservationVOTime) {
ExamVOTime>ExamReservationVOTime?this.changeStep('showExam'):this.changeStep('showAppointmentExam')
if (ExamVOTime && ExamReservationVOTime) {
ExamVOTime > ExamReservationVOTime ? this.changeStep('showExam') : this.changeStep(
'showAppointmentExam')
}
}

20
pages/tabbar/learnCar/comp/subject3.vue

@ -23,10 +23,10 @@
{{ $u.timeFormat(info.studentExamVO.examTime, 'yyyy-mm-dd hh:MM:ss') }}
</view>
</view>
<view class="flex-b bg" v-if="!info.studentExamVO.canComment">
<view class="flex-b bg" >
<view class="row">
<view class="text">考试成绩{{ info.studentExamVO.examResult }}</view>
<view class="btn" @click="$goPage('/pages/carEntry/evaluate/evaluate?subject=3&coachType=1')">去评价</view>
<view class="btn" @click="$goPage('/pages/carEntry/evaluate/evaluate?subject=3&coachType=1')" v-if="!info.studentExamVO.canComment">去评价</view>
</view>
</view>
</view>
@ -101,6 +101,7 @@
getStudentSubject3Status,
} from '@/config/api.js'
export default {
props: ['subjectStatus'],
data() {
return {
info: {},
@ -112,12 +113,21 @@
}
},
created() {
this.getStudentSubject3StatusFn()
//
// 1,,
// 2,,,
// 3,
},
watch: {
subjectStatus: {
handler: function(res) {
console.log('obj3改变了')
this.getStudentSubject3StatusFn(res)
},
// immediate: true,
deep: true
}
},
methods: {
changeStep(type) {
this.showAppointment = false,//
@ -125,8 +135,8 @@
this.showExam = false,//
this[type] = true
},
async getStudentSubject3StatusFn() {
const {data: res} = await getStudentSubject3Status({studentId: this.studentId})
async getStudentSubject3StatusFn(res) {
// const {data: res} = await getStudentSubject3Status({studentId: this.studentId})
let studentExamVO = res.studentExamVO || {} //
let examReservationVO = res.examReservationVO || {} //
let operationReservationVO = res.operationReservationVO?res.operationReservationVO[0] : {} //

29
pages/tabbar/learnCar/comp/subject4.vue

@ -70,6 +70,7 @@
getStudentSubject1Status,
} from '@/config/api.js'
export default {
props: ['subjectStatus'],
data() {
return {
info: {},
@ -79,18 +80,26 @@
}
},
created() {
this.showExam = false,//
this.showAppointment = false,//
this.getStudentSubject1StatusFn()
this.showExam = false//
this.showAppointment = false//
},
watch: {
subjectStatus: {
handler: function(res) {
console.log('obj4改变了')
this.getStudentSubject4StatusFn(res)
},
// immediate: true,
deep: true
}
},
methods: {
async getStudentSubject1StatusFn() {
const {
data: res
} = await getStudentSubject1Status({
studentId: this.studentId
})
async getStudentSubject4StatusFn(res) {
// const {
// data: res
// } = await getStudentSubject1Status({
// studentId: this.studentId
// })
this.info = res
// 1
if(res.studentExamVO&&res.examReservationVO) {

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

@ -4,9 +4,14 @@
<view class="avatar">
<image :src="vuex_userInfo.photoPath" mode="widthFix" v-if="vuex_userInfo.photoPath"></image>
</view>
<view class="rightTxt" @click="showType=true">
<view class="name">{{ vuex_userInfo.name?vuex_userInfo.name:vuex_userInfo.phone?vuex_userInfo.phone:'请登录' }}</view>
<view class="btn_row">
<view class="rightTxt">
<view style="display: flex;align-items: center;">
<view class="name" @click="topClick">{{ vuex_userInfo.name?vuex_userInfo.name:vuex_userInfo.phone?vuex_userInfo.phone:'请先登录 ' }}</view>
<view class="arrowRight" >
<u-icon name="arrow-right" color="#333" size="14" style="margin-top: 4rpx;"></u-icon>
</view>
</view>
<view class="btn_row" @click="showType=true">
<view class="txt">{{ carType }}</view>
<u-icon name="arrow-down-fill" color="#fff" size="10"></u-icon>
</view>
@ -47,7 +52,7 @@
</view>
</view> -->
</view>
<view class="timerFlex">
<view class="timerFlex" v-if="dynamics.classHourReachStatus">
<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>
@ -74,6 +79,13 @@
}
},
methods: {
topClick() {
if(!this.vuex_userInfo.phone) {
this.$store.commit('goLogin')
}else {
this.$goPage('/pages/mineEntry/personaInfo/personaInfo')
}
},
confirmType(val) {
let item = val.value[0]
// console.log(item)

74
pages/tabbar/learnCar/index.vue

@ -5,10 +5,13 @@
<!-- <u-button @click="requestSingleFreshLocationFn">单次定位</u-button> -->
<!-- <u-button @click="getInitFaceVerifyFn">人脸核身</u-button> -->
<topInfo :carType="curObject.name" @changeSubject="changeSubject" :dynamics="subjectStatus.studentClassHourVO"></topInfo>
<subject1 v-if="curObject.id==1"></subject1>
<subject2 v-if="curObject.id==2" :subjectStatus="subjectStatus"></subject2>
<subject3 v-if="curObject.id==3" :subjectStatus="subjectStatus"></subject3>
<subject4 v-if="curObject.id==4" :subjectStatus="subjectStatus"></subject4>
<view class="" v-if="token">
<subject1 v-if="curObject.id==1" :subjectStatus="subjectStatus"></subject1>
<subject2 v-if="curObject.id==2" :subjectStatus="subjectStatus"></subject2>
<subject3 v-if="curObject.id==3" :subjectStatus="subjectStatus"></subject3>
<subject4 v-if="curObject.id==4" :subjectStatus="subjectStatus"></subject4>
</view>
</view>
</template>
@ -30,27 +33,28 @@
dynamics: {},
subjectStatus: {
studentClassHourVO: {}
}
},
token: ''
}
},
onLoad() {
// #ifdef MP-WEIXIN
// initEid();
// #endif
onPullDownRefresh() {
this.init()
},
onShow() {
this.getStudentSubject1StatusFn()
this.init()
// this.getStudentProcessFn()
},
methods: {
init() {
this.token = this.$store.state.user.vuex_loginInfo.accessToken
if(!this.token) return this.$u.toast('请先登录')
this.getStudentSubject1StatusFn()
},
//
changeSubject(val) {
console.log(val)
if(this.curObject==val) return
this.curObject = val
// this.getStudentProcessFn()
this.getStudentSubject1StatusFn()
this.init()
},
async requestSingleFreshLocationFn() {
@ -60,27 +64,27 @@
let arrFn = [getStudentSubject1Status, getStudentSubject2Status, getStudentSubject3Status, getStudentSubject4Status]
const {data: res} = await arrFn[this.curObject.id-1]({studentId: this.studentId})
this.subjectStatus = res
// console.log(res)
console.log(this.subjectStatus.studentClassHourVO)
console.log(res)
// console.log(this.subjectStatus.studentClassHourVO)
},
async getStudentProcessFn() {
const {data: res} = await getStudentProcess({studentId: this.studentId})
let obj = {
ValidTtime: res.subjectOneValidTtime,
TotalTime: res.subjectOneTotalTime
}
if(this.curObject.id==2) {
obj.ValidTtime = res.subjectTwoValidTtime
obj.TotalTime = res.subjectTwoTotalTime
}else if(this.curObject.id==3) {
obj.ValidTtime = res.subjectThreeValidTtime
obj.TotalTime = res.subjectThreeTotalTime
}else if(this.curObject.id==4) {
obj.ValidTtime = res.subjectFourValidTtime
obj.TotalTime = res.subjectFourTotalTime
}
this.dynamics = obj
}
// async getStudentProcessFn() {
// const {data: res} = await getStudentProcess({studentId: this.studentId})
// let obj = {
// ValidTtime: res.subjectOneValidTtime,
// TotalTime: res.subjectOneTotalTime
// }
// if(this.curObject.id==2) {
// obj.ValidTtime = res.subjectTwoValidTtime
// obj.TotalTime = res.subjectTwoTotalTime
// }else if(this.curObject.id==3) {
// obj.ValidTtime = res.subjectThreeValidTtime
// obj.TotalTime = res.subjectThreeTotalTime
// }else if(this.curObject.id==4) {
// obj.ValidTtime = res.subjectFourValidTtime
// obj.TotalTime = res.subjectFourTotalTime
// }
// this.dynamics = obj
// }
}
}
</script>

11
pages/userCenter/login/login.vue

@ -113,14 +113,19 @@
this.$store.commit('update_vuex_loginInfo',res.data)
await this.$store.dispatch('getUserInfo')
let login_front = uni.getStorageSync('login_front')
console.log('login_front')
console.log(login_front)
if(login_front) {
let switchBar = ['/pages/tabbar/index/index', '/pages/tabbar/learnCar/index', '/pages/tabbar/mine/index']
if(switchBar.includes('login_front')) {
uni.switchTab({
if(switchBar.includes(login_front)) {
uni.reLaunch({
url: login_front
})
}else {
this.$goPage(login_front)
// this.$goPage(login_front)
uni.redirectTo({
url: login_front
})
}
}else {
uni.switchTab({

10
store/modules/user.js

@ -37,18 +37,12 @@ const user = {
state.vuex_userInfo = {}
const pages = getCurrentPages();
const page = pages[pages.length - 1].$page.fullPath; //完整路由地址
console.log(pages)
let url = '/pages/userCenter/login/login'
if(page!= url) {
console.log('当前页面')
console.log(type)
console.log(page)
if(page) uni.setStorageSync('login_front', page)
if(type) {
url = url+'?autoBack=yes'
// uni.redirectTo({
// url
// })
}
uni.navigateTo({
url
})

Loading…
Cancel
Save