Browse Source

签到日历接口调用

master
unknown 8 months ago
parent
commit
66570b7db3
  1. 4
      common/js/mixins.js
  2. 6
      config/api.js
  3. 9
      config/utils.js
  4. 6
      pages/carEntry/evaluate/evaluate.vue
  5. 7
      pages/carEntry/signature/signature.vue
  6. 9
      pages/indexEntry/enroll/registInfo/registInfo.vue
  7. 1
      pages/indexEntry/findShcool/coachComment/coachInfo.vue
  8. 1
      pages/indexEntry/findShcool/shcoolDetail/comp/tab1.vue
  9. 1
      pages/indexEntry/findShcool/shcoolDetail/comp/tab3.vue
  10. 53
      pages/indexEntry/signIn/signIn.vue
  11. 4
      pages/mineEntry/myAppointment/comp/comp.scss
  12. 7
      pages/mineEntry/myAppointment/comp/opera.vue
  13. 2
      pages/mineEntry/myAppointment/myAppointment.vue
  14. 3
      pages/tabbar/index/index.vue
  15. 3
      pages/tabbar/learnCar/comp/topInfo.vue
  16. 9
      store/modules/school.js
  17. 6
      uni_modules/zeng-calen/components/zeng-calen/zeng-calen.vue

4
common/js/mixins.js

@ -20,6 +20,10 @@ export default {
setTimeout(()=>{
uni.stopPullDownRefresh()
},1500)
let token = this.$store.state.user.vuex_loginInfo.accessToken
if(token) {
this.$store.dispatch('getCity')
}
},
}

6
config/api.js

@ -208,6 +208,12 @@ export const signOut = (data) => http.post('business/student/sign/out', data)
export const getStudentByPayment = (params={}) => http.get('app/student-record/getStudentByPayment', {params})
// 补签
export const reSignOut = (data) => http.post('business/student/sign/reSignOut', data)
// 学员扫码签到记录 -- 按月查询
export const monthSignRecord = (data) => http.post('business/student/sign/monthSignRecord', data)
// 学员扫码签到记录 -- 按天查询
export const signDetail = (data) => http.post('business/student/sign/signDetail', data)

9
config/utils.js

@ -186,8 +186,15 @@ export function uploadImgApi(filePath, imgName) {
console.log('***********')
console.log(item)
_this.$store.commit('upDateSchoolClass', {})
_this.$store.commit('upDateSchoolCoach', item)
if(obj.QrType==1) {
// 判断是扫教练码来的还是驾校码来的
if(item.id) {
_this.$store.commit('updateSchool', {})
_this.$store.commit('upDateSchoolCoach', item)
}else {
_this.$store.commit('upDateSchoolCoach', {})
_this.$store.commit('updateSchool', item)
}
_this.$u.utils.clickSignUp()
}else {
// 签到的

6
pages/carEntry/evaluate/evaluate.vue

@ -82,7 +82,8 @@ import school from '../../../store/modules/school'
"anonymity": 2,
"userId": 0,
imgArr: [],
coachType: this.coachType
photoPath: this.vuex_userInfo.schoolPhoto,
coachType: 1
}
this.coachInfo = {
tit: '您对教练满意吗?',
@ -104,7 +105,8 @@ import school from '../../../store/modules/school'
"userId": 0,
coachName: '',
imgArr: [],
coachType: this.coachType
photoPath: this.vuex_userInfo.coachPhoto,
coachType: 1
}
if(this.tit=='模拟器老师') {
this.coachInfo.tit = '您对模拟器老师满意吗?'

7
pages/carEntry/signature/signature.vue

@ -26,6 +26,7 @@
</template>
<script>
// import { pathToBase64 } from '@/common/js/jssdk_image_tools.js'
import { uploadImgApi } from '@/config/utils.js'
var x = 20;
var y = 20;
export default {
@ -140,7 +141,7 @@
uni.canvasToTempFilePath({
canvasId: 'mycanvas',
destWidth:160,
success: function(res) {
success: async function (res) {
console.log('图片上传结果')
console.log(res)
if(!res || !res.tempFilePath) {
@ -151,8 +152,8 @@
}else{
that.$emit('closeCanvas', res.tempFilePath);
console.log('这是临时路径?')
console.log(res.tempFilePath)
console.log(that.SignatureImg)
const imgLink = await uploadImgApi(res.tempFilePath, 'signatureImg')
console.log(imgLink)
// //canvasbase64
// pathToBase64(res.tempFilePath).then(re => {
// that.SignatureImg = re;

9
pages/indexEntry/enroll/registInfo/registInfo.vue

@ -331,6 +331,15 @@
this.form.schoolId = schoolCoach.schoolId
if(schoolCoach.teachCarType) this.form.trainType = schoolCoach.teachCarType.slice(0,2)
}
//
let schoolCode = this.$store.state.school.schoolCode
if(schoolCode.schoolId) {
console.log('schoolCode')
console.log(schoolCode)
this.form.school = schoolCode.schoolName
this.form.schoolId = schoolCode.schoolId
}
if(this.form.schoolId) {
this.getSchoolDetailFn()
}

1
pages/indexEntry/findShcool/coachComment/coachInfo.vue

@ -35,6 +35,7 @@
console.log(this.item)
this.$store.commit('upDateSchoolCoach', this.item)
this.$store.commit('upDateSchoolClass', {})
this.$store.commit('updateSchool', {})
this.$u.utils.clickSignUp()
}
},

1
pages/indexEntry/findShcool/shcoolDetail/comp/tab1.vue

@ -20,6 +20,7 @@
methods: {
async goSign(item) {
this.$store.commit('upDateSchoolCoach', {})
this.$store.commit('updateSchool', {})
this.$store.commit('upDateSchoolClass', item)
this.$u.utils.clickSignUp()
}

1
pages/indexEntry/findShcool/shcoolDetail/comp/tab3.vue

@ -43,6 +43,7 @@
//
goPageSign(item) {
this.$store.commit('upDateSchoolClass', {})
this.$store.commit('updateSchool', {})
this.$store.commit('upDateSchoolCoach', item)
this.$u.utils.clickSignUp()
},

53
pages/indexEntry/signIn/signIn.vue

@ -1,13 +1,13 @@
<template>
<view class="pageBg pad">
<zeng-calen :actDay="actDay" :chooseDayLack="chooseDayLack" @onDayClick='onDayClick' :chooseDay="chooseDay"></zeng-calen>
<zeng-calen :actDay="actDay" :chooseDayLack="chooseDayLack" @onDayClick='onDayClick' @changeMonth="changeMonth" :chooseDay="chooseDay"></zeng-calen>
<view class="btnBg" style="margin: 20rpx 0;" @click="scanCodeClick">去签到/去签退</view>
<view class="card">
<view class="card" v-if="list.length">
<view class="h1"><text class="active">签到记录</text></view>
<view class="ul">
<view class="li" v-for="(item,index) in 4" :key="index">
<view class="lab">{{ index%2==0? '签退成功':'签到成功'}}</view>
<view class="date">2024-01-29 11:29</view>
<view class="li" v-for="(item,index) in list" :key="index">
<view class="lab">{{ item.loginStatus==1? '签退成功':'签到成功'}}</view>
<view class="date">{{item.signDate}} <text style="margin-left: 10rpx;">{{ item.time }}</text></view>
</view>
</view>
</view>
@ -17,6 +17,7 @@
<script>
import zengCalen from '@/uni_modules/zeng-calen/components/zeng-calen/zeng-calen'
import { scanCodeFn } from '@/config/utils.js'
import { monthSignRecord, signDetail } from '@/config/api.js'
export default {
components: {zengCalen},
data() {
@ -24,31 +25,37 @@
actDay: [], //
chooseDay: ["2024-01-29", "2024-01-27", "2024-01-19", "2024-01-10"], //
chooseDayLack: ["2024-01-29", ], //
list: [],
signMonth: ''
}
},
onLoad() {
this.signMonth = this.$u.timeFormat(Date.now(), 'yyyy-mm')
this.monthSignRecordFn()
},
methods: {
//
async monthSignRecordFn() {
const {data: res} = await monthSignRecord({signMonth: this.signMonth})
this.chooseDay = res
if(res&&res.length) {
let day = res[res.length-1]
this.actDay = [day]
this.onDayClick(day)
}
},
changeMonth(ym) {
console.log(ym)
this.signMonth = ym
this.monthSignRecordFn(ym)
this.list = []
},
//
onDayClick(data) {
async onDayClick(data) {
this.actDay = [data]
return
// let choose = data.date //
// if (this.actDay.includes(choose)) { //
// //
// const index = this.actDay.indexOf(choose);
// //
// this.actDay.splice(index, 1)
// } else if (this.chooseDay.includes(choose)) { //
// uni.showToast({
// title: "",
// icon: "none"
// })
// } else {
// //
// this.actDay.push(choose)
// }
const {data: res} = await signDetail({signDate: data})
this.list = res || []
},
//
scanCodeClick() {

4
pages/mineEntry/myAppointment/comp/comp.scss

@ -23,6 +23,10 @@
margin-right: 24rpx;
white-space: nowrap;
padding: 10rpx 18rpx;
&.tag2 {
background: rgba(144,12,64,0.1) !important;
color: #F158B9 !important;
}
}

7
pages/mineEntry/myAppointment/comp/opera.vue

@ -3,7 +3,7 @@
<view class="consultItem">
<view class="top_row">
<view class="flex">
<view class="tag">{{item.subject==2?'科目二实操':item.subject==3?'科目三实操':'不限科目'}}</view>
<view class="tag" :class="{tag2: item.subject==2}">{{item.subject==2?'科目二实操':item.subject==3?'科目三实操':'不限科目'}}</view>
<view class="schoolName oneRowText">{{item.siteName}}</view>
</view>
<view class="status">
@ -56,8 +56,5 @@
<style lang="scss" scoped>
@import './comp.scss';
.tag {
background: rgba(144,12,64,0.1) !important;
color: #F158B9 !important;
}
</style>

2
pages/mineEntry/myAppointment/myAppointment.vue

@ -36,7 +36,7 @@
navList: [
{text: '全部', id: -1},
{text: '已签到', id: 1},
{text: '待完成', id: 0},
{text: '已签退', id: 2},
{text: '已取消', id: 9},
{text: '已过期', id: 3},
],

3
pages/tabbar/index/index.vue

@ -206,7 +206,7 @@
},
onPullDownRefresh() {
this.$store.dispatch('getCity')
this.initApi()
},
onShow() {
@ -263,6 +263,7 @@
if(item.text=='学车报名') {
this.$store.commit('upDateSchoolCoach', {})
this.$store.commit('upDateSchoolClass', {})
this.$store.commit('updateSchool', {})
return this.$u.utils.clickSignUp()
}
this.$goPage(item.url)

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

@ -52,7 +52,8 @@
</view>
</view> -->
</view>
<view class="timerFlex" v-if="dynamics.classHourReachStatus">
<!-- v-if="dynamics.classHourReachStatus" -->
<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>

9
store/modules/school.js

@ -4,7 +4,7 @@ const school = {
state: {
schoolCoach: {},
schoolClass: {},
BizToken: uni.getStorageSync('BizToken') ? uni.getStorageSync('BizToken') : ''
schoolCode: {}
},
mutations: {
@ -15,11 +15,8 @@ const school = {
upDateSchoolClass(state, obj) {
state.schoolClass = obj
},
updateBizToken(state, val) {
uni.setStorageSync('BizToken', val)
state.BizToken = val
console.log('保存到store里了')
console.log(state.BizToken)
updateSchool(state, obj) {
state.schoolCode = obj
},
},

6
uni_modules/zeng-calen/components/zeng-calen/zeng-calen.vue

@ -275,11 +275,15 @@
},
//
changYearMonth(y, m) {
console.log('this.dates')
console.log(y,m)
this.dates = this.monthDay(y, m);
this.y = y;
this.m = m;
},
changeMonth(type) {
console.log(this.m)
console.log(this.y)
if (type == 'pre') {
if (this.m + 1 == 2) {
this.m = 12;
@ -295,6 +299,8 @@
this.m = this.m + 1;
}
}
let ym = (this.y.toString().padStart(2, 0))+'-'+(this.m.toString().padStart(2, 0))
this.$emit('changeMonth', ym)
this.dates = this.monthDay(this.y, this.m);
}
}

Loading…
Cancel
Save