unknown 7 months ago
parent
commit
232a731f4f
  1. 4
      components/appointItem-student/appointItem-student.vue
  2. 8
      config/api.js
  3. 5
      config/site.config.js
  4. 44
      config/utils.js
  5. 1
      manifest.json
  6. 18
      pages.json
  7. 23
      pages/recordEntry/student/studentDetail/comp/list.vue
  8. 44
      pages/recordEntry/student/studentDetail/studentDetail.vue
  9. 3
      pages/tabbar/mine/index.vue
  10. 43
      pages/tabbar/statistics/index.vue
  11. 3
      pages/userCenter/scanCode/scanCodeSchool.vue
  12. 253
      pages/userCenter/signature/signature.vue

4
components/appointItem-student/appointItem-student.vue

@ -31,12 +31,12 @@
</view>
<view class="name">报名班型{{item.className}}</view>
</view>
<view class="row">
<!-- <view class="row">
<view class="iconImg">
<image src="@/static/images/index/newSatus.png" mode=""></image>
</view>
<view class="name">最新状态<text>就先放着不做</text> </view>
</view>
</view> -->
</view>
</view>

8
config/api.js
File diff suppressed because it is too large
View File

5
config/site.config.js

@ -2,8 +2,9 @@ const VUE_APP_PLATFORM = process.env.VUE_APP_PLATFORM;
// localIp = false
module.exports = {
H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理
WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.43:8318/',//非代理地址
TEMP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.39:48082/',
// WX_API: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.37:8318/',//非代理地址
WX_API: VUE_APP_PLATFORM === 'h5' ? '/' : 'http://work.lyjppt.com:8099/',//非代理地址
// TEMP_HOST: VUE_APP_PLATFORM === 'h5' ? '' : 'http://192.168.1.39:48082/',
httpPrefix: 'app-api/',
imgUrl: 'http://jxtemp.oss-cn-hangzhou.aliyuncs.com/defaultImages/admin/bigImg/'
};

44
config/utils.js

@ -1,3 +1,8 @@
import { WX_API, H5_API, httpPrefix } from './site.config.js';
var _url = H5_API+ WX_API + httpPrefix
import store from '@/store/index.js'
export function checkToken(vm) {
let expiresTime = vm.$store.state.user.vuex_loginInfo.expiresTime
let nowTime = new Date() * 1
@ -48,4 +53,41 @@ export function getDates(startDate, endDate) {
currentDate.setDate(currentDate.getDate() + 1);
}
return dateRangeFn(dates)
}
}
export function uploadImgApi(filePath, imgName, imgLink='image') {
console.log(filePath)
let token = 'Bearer '+ store.state.user.vuex_loginInfo.accessToken
let timer = new Date() * 1
return new Promise((reslove, reject)=>{
// 上传图片到服务器
uni.uploadFile({
url: _url + 'infra/file/upload',//接口
filePath: filePath,//要上传的图片的本地路径
name: 'file',
// complain
formData: {
path: imgLink+'/'+ uni.$u.date(timer, 'yyyy-mm-dd')+'/'+timer + '-'+ imgName,
type: 1,
fileSuffix: "png"
},
header: {
Authorization: token,
// 'tenant-id': '1704459882232553474'
},
success(res) {
console.log('上传成功??')
console.log(res)
let res2 = JSON.parse(res.data)
reslove(res2.data)
},
fail() {
reject(0)
},
complete: (err)=> {
uni.hideLoading();
}
})
})
}

1
manifest.json

@ -87,6 +87,7 @@
"proxy" : {
"/api" : {
"target" : "http://192.168.1.43:8318/",
// "target" : "http://work.lyjppt.com:8099/",
"changeOrigin" : true,
"secure" : true,
"pathRewrite" : {

18
pages.json

@ -194,7 +194,15 @@
{
"root": "pages/userCenter",
"pages": [
{
"path": "signature/signature",
"style": {
"navigationBarTitleText": "签名",
// "navigationStyle": "custom",
"enablePullDownRefresh": false,
"backgroundTextStyle": "dark"
}
},
{
"path": "forgetPwd/forgetPwd",
"style": {
@ -319,7 +327,7 @@
],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "学车小程序",
"navigationBarTitleText": "洛阳学车",
"navigationBarBackgroundColor": "#F8F8F8",
"backgroundColor": "#F8F8F8"
},
@ -335,12 +343,6 @@
"selectedIconPath": "static/images/tabbar/tjActive.png"
},
{
"pagePath": "pages/tabbar/examSimulation/index",
"text": "考场模拟",
"iconPath": "static/images/tabbar/kc.png",
"selectedIconPath": "static/images/tabbar/kcActive.png"
},
{
"pagePath": "pages/tabbar/operateTrain/index",
"text": "实操训练",
"iconPath": "static/images/tabbar/sc.png",

23
pages/recordEntry/student/studentDetail/comp/list.vue

@ -2,34 +2,37 @@
<view class="comp">
<!-- 学习状态 -->
<view class="learnStatus">
<view class="card">
<!-- <view class="card">
<view class="flex-b">
<view class="lab">模拟器训练学时报审</view>
<view class="date">2023/08/09 22:52:12</view>
</view>
</view>
<view class="card">
</view> -->
<view class="card" v-for="(item,index) in list" :key="index">
<view class="flex-b">
<view class="lab">模拟器训练已预约</view>
<view class="date">2023/08/09 22:52:12</view>
<view class="lab">{{item.dynamicsName}}</view>
<view class="date">{{item.dynamicsTime}}</view>
</view>
<view class="bg">
<view class="row">
<view class="text">模拟驾驶馆某某模拟驾驶馆</view>
</view>
<view class="row">
<view class="text">模拟器编号00001</view>
<view class="text">地点{{item.examSite}}</view>
</view>
<view class="row">
<view class="text">预约时间2023/08/23 10:00:00</view>
<view class="text">时间{{item.examTime}}</view>
</view>
</view>
</view>
<nodata v-if="!list.length"></nodata>
</view>
</view>
</template>
<script>
export default {
props: ['list']
}
</script>
<style lang="scss" scoped>

44
pages/recordEntry/student/studentDetail/studentDetail.vue

@ -4,15 +4,15 @@
<view class="pad">
<cardNav :navData="navData" :currentNav="currentNav" @changeNav="changeNav"></cardNav>
</view>
<scrollNav @changeTab="changeTab" :currentTab="currentTab" :tabData="tabData" />
<view class="pad">
<view class="con" v-if="currentNav==1">
<list></list>
<list :list="list"></list>
</view>
<view class="con" v-else>
<info :id="studentId"/>
<info :id="studentId" />
</view>
</view>
</view>
@ -21,6 +21,9 @@
<script>
import list from './comp/list'
import info from './comp/info'
import {
getStudentDynamics
} from '@/config/api.js'
export default {
components: {
list,
@ -32,32 +35,24 @@
currentNav: 1,
tabData: [{
text: '全部',
id: 10
},
{
text: '阶段一',
id: 0
},
{
text: '阶段二',
text: '科目一',
id: 1
},
{
text: '阶段三',
text: '科目二',
id: 2
},
{
text: '阶段四',
text: '科目三',
id: 3
},
{
text: '阶段五',
text: '科目四',
id: 4
},
{
text: '阶段六',
id: 5
},
],
navData: [{
text: '学车进展',
@ -68,13 +63,28 @@
id: 2
},
],
studentId: ''
studentId: '',
list: []
}
},
onLoad(options) {
this.studentId = options.id
this.getStudentDynamicsFn()
},
methods: {
async getStudentDynamicsFn() {
let obj = {
"studentId": this.studentId,
"subject": this.currentTab,
"coachId": this.vuex_coachId
}
if(obj.subject==0) delete obj.subject
const {
data: res
} = await getStudentDynamics(obj)
console.log(res)
this.list = res
},
changeTab(id) {
this.currentTab = id
},

3
pages/tabbar/mine/index.vue

@ -58,6 +58,7 @@
// url: item.url
// })
// }
console.log(item.url)
this.$goPage(item.url)
},
//
@ -76,7 +77,7 @@
{text: '我的车辆', icon: require('../../../static/images/coach/ic_cheliang.png'), id: 3, url: '/pages/userCenter/myCar/myCar'},
{text: '学员评价', icon: require('../../../static/images/coach/ic_pingjia.png'), id: 5, url: '/pages/userCenter/studentComment/studentComment'},
{text: '教学数据', icon: require('../../../static/images/coach/ic_shuju.png'), id: 6, url: '/pages/userCenter/teachingData/teachingData'},
// {text: '', icon: require('../../../static/images/coach/ic_daijiesuan.png'), id: 1, url: '/pages/tabbar/statistics/index'},
{text: '我的签名', icon: require('../../../static/images/coach/ic_daijiesuan.png'), id: 1, url: '/pages/userCenter/signature/signature'},
// {text: '退', icon: require('../../../static/images/coach/ic_tuikuan.png'), id: 7, url: '/pages/userCenter/refund/refund'},
]

43
pages/tabbar/statistics/index.vue

@ -1,8 +1,16 @@
<template>
<view class="main" :style="{ background: `url(${imgUrl}) #f6f6f6 no-repeat`, backgroundSize: backgroundSize }">
<operateCoach v-if="identity=='实操教练'"/>
<principal v-if="identity=='校长'||identity=='驾校财务'"/>
<UserTab name ='统计'></UserTab>
<u-popup :show="show" mode="center" round="20rpx">
<view class="box">
<view class="tit">您还未上传签名请尽快上传!</view>
<view class="btnBg" @click="goPage">去签名</view>
</view>
</u-popup>
</view>
</template>
@ -10,6 +18,7 @@
import operateCoach from './comp/operateCoach'
import principal from './comp/principal'
import { imgUrl } from '@/config/site.config'
import { needSign } from '@/config/api.js'
export default {
components: {
operateCoach,
@ -19,11 +28,45 @@
return {
imgUrl: imgUrl+'indexTopBanner.png',
backgroundSize: '100% 492rpx',
show: false,
}
},
onShow() {
uni.hideTabBar();
},
onLoad() {
this.needSignFn()
},
methods: {
async needSignFn() {
const {data: res} = await needSign()
if(res) {
this.show = true
}
},
goPage() {
this.show = false
this.$goPage('/pages/userCenter/signature/signature')
}
}
}
</script>
<style lang="scss" scoped>
.box {
padding: 40rpx 50rpx;
text-align: center;
font-size: 28rpx;
color: #333;
.tit {
padding: 30rpx 0 60rpx 0;
color: $themC;
font-weight: 700;
}
.btnBg {
width: 370rpx;
margin: auto;
}
}
</style>

3
pages/userCenter/scanCode/scanCodeSchool.vue

@ -41,7 +41,8 @@
qr.data = JSON.stringify({
schoolId,
schoolName: encodeURIComponent(schoolName),
QrType: 1
QrType: 1,
isSchool: 1,
})
// canvas

253
pages/userCenter/signature/signature.vue

@ -0,0 +1,253 @@
<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'
import { uploadImgApi } from '@/config/utils.js'
import { addSign } from '@/config/api.js'
var x = 20;
var y = 20;
export default {
data() {
return {
//
ctx: '',
//
points: [],
//
SignatureImg: '',
hasSign: false,
realName: '',
checked: false,
subject: 1,
};
},
onLoad(options) {
this.subject = options.subject
},
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: async 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('这是临时路径?')
const imgLink = await uploadImgApi(res.tempFilePath, 'signatureImg', 'sign')
console.log(imgLink)
that.periodConfirmFn(imgLink)
// //canvasbase64
// pathToBase64(res.tempFilePath).then(re => {
// that.SignatureImg = re;
// that.$emit('getCanvasImg', that.SignatureImg);
// })
}
},
});
},
async periodConfirmFn(signUrl) {
const obj = {
signUrl,
}
const {data: res} = await addSign(obj)
if(res) {
this.$u.toast('签名成功啦')
setTimeout(()=>{
uni.switchTab({
url: '/pages/tabbar/statistics/index'
})
},1000)
}
}
}
};
</script>
<style lang="scss" scoped>
.signature-box {
padding: 0 32rpx;
display: flex;
flex-direction: column;
width: 100%;
// height: 98%;
height: calc(100vh - 50rpx);
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>
Loading…
Cancel
Save