Commit 2a24d8e8 authored by 罗超's avatar 罗超

1

parent ca5477bc
......@@ -90,7 +90,7 @@ export function getStundentSurplus(data) {
*/
export function setStudentLeave(data) {
return request({
url: '/AppletIndex/SetStudentLeave',
url: '/LeaveStudent/SetStudentLeave',
method: 'post',
data
})
......
......@@ -8,17 +8,23 @@
width="58rpx"
height="66rpx"
fit="cover"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/icon2.png"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/icon5.png"
/>
</view>
<view class="top-right flex_grow">
<view class="course-name"> 合同 </view>
<view class="course-name"> {{ CourseName }} </view>
<view class="section-name"> {{ data.length }}个合同 </view>
</view>
</view>
<view v-for="(item, index) in data" :key="index" class="data-item">
<view class="contract-name"
><van-icon name="description" style="margin-right: 10rpx" />
<view class="contract-name">
<van-image
width="22rpx"
height="24rpx"
fit="cover"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/contracticon.png"
style="margin-right: 10rpx"
/>
{{ item.ContractNo }}</view
>
<view class="contract-con" v-if="item.Type === 1">订单合同</view>
......@@ -48,16 +54,17 @@ import {
onMounted,
} from "vue";
import { getContract } from "../../api/index";
let { CourseName } = uni.getStorageSync("indexData");
export default {
setup() {
let data = reactive({
pageloading: false,
CourseName,
data: [],
});
let methods = {
async getdata() {
let res = await getContract({});
if (res) {
if (res.Data.length === 0) {
data.pageloading = true;
......
......@@ -54,25 +54,34 @@
</view>
</view>
<view class="course-time-box">
<van-checkbox-group :value="checkboxVal">
<view v-if="checkboxList.length === 0" class="no-course">暂无课程</view>
<van-checkbox-group :value="checkboxVal" v-if="checkboxList.length > 0">
<view class="flex flex_wrap">
<view
v-for="(item, index) in checkboxList"
:key="index"
class="checkbox-item flex flex_between_center"
@click="checkChange(item.name)"
class="flex flex_wrap flex_start_center"
>
<view
v-for="(_item, _index) in item.PlanTimeList"
:key="_index"
class="checkbox-item flex flex_wrap flex_between_center"
@click="checkChange(_item.ClassTimeId)"
>
<van-checkbox
:name="item.name"
:name="_item.ClassTimeId"
checked-color="#00ACF9"
use-icon-slot
>
<view class="checkbox-text">{{ item.text }}</view>
<view class="checkbox-text"
>{{ item.DateMonth }}-{{ item.DateDay }}
{{ _item.StartTime }}-{{ _item.EndTime }}</view
>
<i
slot="icon"
class="iconfont"
:class="
checkboxVal.find((e) => e == item.name)
checkboxVal.find((e) => e == _item.ClassTimeId)
? 'icon-radio1 fontcolor'
: 'icon-radio'
"
......@@ -80,10 +89,11 @@
</van-checkbox>
</view>
</view>
</view>
</van-checkbox-group>
<view
class="more-checkbox"
v-if="checkboxListAll.length > 4"
v-if="checkboxListAll.length > 2"
@click="showAllCheck"
>
<van-icon name="arrow-down" v-if="!isShowAllCheck" />
......@@ -95,7 +105,7 @@
<view class="dot"></view> 课时
</view>
<view class="label-next"
>课时
>{{ totalLeaveTimes }}课时
<van-icon name="arrow" style="margin-left: 30rpx" />
</view>
</view>
......@@ -105,7 +115,7 @@
<view class="dot"></view> 请假事由
</view>
<van-field
:value="data.reason"
:value="leaveMsg.Remarks"
placeholder="请输入请假事由"
:border="false"
type="textarea"
......@@ -119,10 +129,21 @@
<view class="dot"></view> 图片
</view>
<view style="padding-left: 10rpx">
<van-uploader :file-list="fileList" preview-size="120rpx" />
<van-uploader
multiple
accept="all"
:file-list="fileList"
preview-size="120rpx"
@after-read="customUpload"
/>
</view>
</view>
<van-button block custom-class="submit-btn">提交</van-button>
<van-button block custom-class="submit-btn" @click="submitLeave"
>提交</van-button
>
<!-- <van-button block custom-class="submit-btn" @click="uniimage"
>unippimg</van-button
> -->
</view>
</template>
......@@ -136,12 +157,15 @@ import {
watch,
computed,
onMounted,
inject,
} from "vue";
import { getdate } from "../../utils/date";
import { upload } from "../../utils/index";
import { getStundentPlanStatistical, setStudentLeave } from "../../api/index";
let { ClassId } = uni.getStorageSync("indexData");
export default {
setup() {
let Toast = inject("$toast");
let data = reactive({
showType: false,
TimeChoose: false,
......@@ -152,9 +176,11 @@ export default {
actions: [
{
name: "事假",
id: 1,
},
{
name: "病假",
id: 2,
},
],
......@@ -162,32 +188,10 @@ export default {
type: "事假",
startTime: getdate(new Date(), 1),
endTime: getdate(new Date(), 1),
reason: "",
},
isShowAllCheck: false,
checkboxList: [],
checkboxListAll: [
{
name: "a",
text: "08-06 09:00-11:00",
},
{
name: "b",
text: "b",
},
{
name: "c",
text: "c",
},
{
name: "d",
text: "d",
},
{
name: "e",
text: "e",
},
],
checkboxListAll: [],
fileList: [
{
url: "https://img.yzcdn.cn/vant/leaf.jpg",
......@@ -199,16 +203,18 @@ export default {
status: "failed",
message: "上传失败",
},
{
url: "https://img.yzcdn.cn/vant/tree.jpg",
status: "failed",
message: "上传失败",
},
{
url: "https://img.yzcdn.cn/vant/tree.jpg",
status: "failed",
},
],
totalLeaveTimes: 0,
leaveMsg: {
Id: 0,
ClassId: 0,
CourseId: 0,
OrderGuestId: 0,
Remarks: "",
LeaveType: 1, //请假类型
LeaveInfoList: [],
ReceiptFileList: [],
},
});
let methods = {
//显示请假类型弹出层
......@@ -222,7 +228,9 @@ export default {
//选择请假类型
onSelect(val) {
data.data.type = val.detail.name;
console.log("214", val);
data.showType = false;
data.leaveMsg.LeaveType = val.detail.id;
},
// 显示日期选择弹出层
ShowTimeChoose(type) {
......@@ -237,17 +245,25 @@ export default {
ConfirmTimeChoose(val) {
let date = getdate(val.detail);
if (data.timeType === 1) {
if (val.detail > Date.parse(data.data.endTime)) {
Toast("开始时间不能大于结束时间");
return;
}
data.data.startTime = date;
} else if (data.timeType === 2) {
if (val.detail < Date.parse(data.data.startTime)) {
Toast("结束时间不能小于开始时间");
return;
}
data.data.endTime = date;
}
data.TimeChoose = false;
that.getCourseTime();
console.log(141, data.data);
},
// 请假理由
reason(val) {
data.data.reason = val.detail;
data.leaveMsg.Remarks = val.detail;
console.log("239", data.leaveMsg);
},
//课程多选
checkChange(val) {
......@@ -264,7 +280,7 @@ export default {
if (data.isShowAllCheck) {
data.checkboxList = JSON.parse(JSON.stringify(data.checkboxListAll));
} else {
data.checkboxList = data.checkboxListAll.slice(0, 4);
data.checkboxList = data.checkboxListAll.slice(0, 2);
}
console.log(249, data.checkboxList);
},
......@@ -275,13 +291,68 @@ export default {
EndTime: data.data.endTime,
ClassId: ClassId,
};
console.log(276, msg);
let res = await getStundentPlanStatistical(msg);
console.log(280, res);
data.isShowAllCheck = true;
data.checkboxListAll = res.Data;
data.checkboxList = res.Data;
if (res.Data.length > 0) {
data.leaveMsg.ClassId = res.Data[0].ClassId;
data.leaveMsg.CourseId = res.Data[0].CourseId;
data.leaveMsg.OrderGuestId = res.Data[0].PlanTimeList[0].OrderGuestId;
}
},
customUpload(event) {
const { file } = event.detail;
upload(file, (res) => {
console.log("305s", res);
});
},
async submitLeave() {
if (data.leaveMsg.LeaveInfoList.length === 0) {
Toast("至少选择一节课程");
return;
}
let res = await setStudentLeave(data.leaveMsg);
console.log("293", res);
},
uniimage() {
uni.chooseImage({
count: 6, //默认9
sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
sourceType: ["album"], //从相册选择
success: function (res) {
console.log(JSON.stringify(res.tempFilePaths));
},
});
},
};
watch(data.checkboxVal, (newVal) => {
data.totalLeaveTimes = 0;
data.leaveMsg.LeaveInfoList = [];
data.checkboxListAll.map((item) => {
item.PlanTimeList.map((_item) => {
newVal.map((e) => {
let res = e === _item.ClassTimeId;
if (res) {
data.totalLeaveTimes += _item.TimeHour;
let obj = {
ClassPlanId: _item.ClassPlanId,
ClassTimeId: _item.ClassTimeId,
ClassDate:
item.DateYear + "-" + item.DateMonth + "-" + item.DateDay,
StartTime: _item.StartTime,
EndTime: _item.EndTime,
TimeHour: _item.TimeHour,
};
data.leaveMsg.LeaveInfoList.push(obj);
}
});
});
});
console.log("296", data.leaveMsg);
});
onMounted(() => {
data.checkboxList = data.checkboxListAll.slice(0, 4);
that.getCourseTime();
});
const that = methods;
return {
......@@ -296,8 +367,6 @@ export default {
},
};
</script>
<style scoped>
.con {
box-sizing: border-box;
......@@ -400,4 +469,11 @@ export default {
.fontcolor {
color: #00acf9;
}
.no-course {
text-align: center;
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 500;
color: #666;
}
</style>
......@@ -11,8 +11,8 @@
/>
</view>
<view class="top-right flex_grow">
<view class="course-name"> 0到N3直通车(公司内部班) </view>
<view class="section-name"> 下面内容章节 </view>
<view class="course-name"> {{ CourseName }} </view>
<view class="section-name"> {{ data.length }}章节 </view>
</view>
</view>
<view v-for="(item, index) in data" :key="index">
......@@ -64,6 +64,7 @@ import {
inject,
} from "vue";
import { getCourse } from "../../api/index";
let { CourseName } = uni.getStorageSync("indexData");
export default {
setup() {
let data = reactive({
......@@ -71,6 +72,7 @@ export default {
msg: {
CourseId: 0,
},
CourseName,
});
let methods = {
jumpPage(item) {
......
......@@ -43,8 +43,11 @@
<van-button
custom-class="already-leave-btn one_line"
v-if="item.IsLeave === 0"
>已请假</van-button
>
<view v-if="item.IsCheck === -1">去上课</view>
<view v-if="item.IsCheck === 0">正常</view>
<view v-if="item.IsCheck === 1">缺勤</view>
</van-button>
</view>
</view>
</view>
......@@ -73,7 +76,6 @@ export default {
});
},
};
console.log(57, props);
return {
...toRefs(props),
...methods,
......
......@@ -172,14 +172,14 @@ export default {
{
name: "电子合同",
desc: "5个",
img: "https://img.yzcdn.cn/vant/cat.jpeg",
img: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/icon5.png",
bgcolor: "#D9FAF1",
jumpUrl: "/pages/contract/contract",
},
{
name: "我的老师",
desc: "李琴",
img: "https://img.yzcdn.cn/vant/cat.jpeg",
img: "https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/icon6.png",
bgcolor: "#FFE7E6",
jumpUrl: "",
},
......@@ -235,9 +235,7 @@ export default {
getSystemInfo((res) => {
data.statusBarHeight = res.statusBarHeight;
});
data.userinfo = uni.getStorageSync("userInfo");
console.log("tag", data.userinfo);
data.userinfo.EnterPhone2 = desensitization(
data.userinfo.EnterPhone,
3,
......@@ -358,17 +356,20 @@ export default {
.timetable {
height: 360rpx;
background-image: linear-gradient(0deg, #ffffff, #00adfd);
background-image: url("https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/coursebg.png");
background-size: cover;
background-repeat: no-repeat;
background-position: center;
border-radius: 20rpx;
overflow: hidden;
box-sizing: border-box;
padding: 33rpx 30rpx 0 50rpx;
padding: 30rpx 30rpx 0 50rpx;
margin-bottom: 50rpx;
}
.timetable_item {
color: #fff;
margin-bottom: 25rpx;
margin-bottom: 20rpx;
}
.timetable_title {
......@@ -385,7 +386,7 @@ export default {
.timetable_item2 {
color: #fff;
margin-bottom: 25rpx;
margin-bottom: 20rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 500;
......
......@@ -11,8 +11,8 @@
/>
</view>
<view class="top-right flex_grow">
<view class="course-name"> 0到N3直通车(公司内部班) </view>
<view class="section-name"> 下面内容章节 </view>
<view class="course-name"> {{ CourseName }} </view>
<view class="section-name"> {{ data.length }}章节 </view>
</view>
</view>
<view v-for="(item, index) in data" :key="index">
......@@ -44,37 +44,6 @@
</view>
</view>
</view>
<!-- 章节内容 -->
<!-- <van-overlay :show="showLayer">
<view class="wrapper">
<view class="info">
<view class="info-top flex flex_start_center">
<view class="left-icon"></view>
<view class="wrapper-title"> 第一次课 五十音图 </view>
</view>
<view class="info-main">
<view class="flex flex flex_start_center wrapper-section">
<view class="left-bot"></view>
章节学习内容
</view>
<view class="info-con">
1、章节学习的具体内容,比如活动篇什
么什么,理解篇什么什么,语法什么。
2、章节学习的具体内容,比如活动篇什
么什么,理解篇什么什么,语法什么。
3、章节学习的具体内容,比如活动篇什
么什么,理解篇什么什么,语法什么。
4、章节学习的具体内容,比如活动篇什
么什么,理解篇什么什么,语法什么。
</view>
<view class="Know-btn flex flex_center_center" @click="closeLayer">
我知道了
</view>
</view>
</view>
</view>
</van-overlay> -->
<van-toast id="van-toast" />
</view>
</template>
......@@ -91,6 +60,7 @@ import {
onMounted,
} from "vue";
import { getProgress } from "../../api/index";
let { CourseName } = uni.getStorageSync("indexData");
export default {
setup() {
let data = reactive({
......@@ -112,6 +82,7 @@ export default {
],
},
],
CourseName,
});
let methods = {
openLayer() {
......
......@@ -11,8 +11,8 @@
/>
</view>
<view class="top-right flex_grow">
<view class="course-name"> 0到N3直通车(公司内部班) </view>
<view class="section-name"> 下面内容章节 </view>
<view class="course-name"> {{ CourseName }} </view>
<view class="section-name"> {{ SurplusHours }}课时 </view>
</view>
</view>
<van-empty description="暂无内容" v-if="data.length === 0" />
......@@ -31,10 +31,9 @@
width="18rpx"
height="22rpx"
fit="cover"
:src="item.UserIcon"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/user.png"
style="margin-right: 10rpx"
/>
<!-- https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/user.png -->
<text class="mr-30 teacherName">{{ item.TeacherName }}</text>
<van-image
width="24rpx"
......@@ -77,10 +76,13 @@ import {
onMounted,
} from "vue";
import { getStundentSurplus } from "../../api/index";
let { CourseName, SurplusHours } = uni.getStorageSync("indexData");
export default {
setup() {
let data = reactive({
showLayer: false,
CourseName,
SurplusHours,
msg: { ClassId: 0 },
data: [],
});
......
......@@ -9,16 +9,54 @@ export let getSystemInfo = (callback) => {
//脱敏
export let desensitization = (str, beginLen, endLen) => {
let len = str.length;
let firstStr = str.substr(0, beginLen);
let lastStr = str.substr(endLen);
let middleStr = str.substring(beginLen, len - Math.abs(endLen)).replace(/[\s\S]/ig, '*');
let tempStr = firstStr + middleStr + lastStr;
return tempStr;
}
export let upload = (file, successCallback) => {
let { UploadConfig } = uni.getStorageSync('userInfo')
for (let i = 0; i < file.length; i++) {
urlTobase64(file[i].url, (base64Str) => {
console.log(23, base64Str)
uni.uploadFile({
url: UploadConfig.UploadDomain + "/UploadBase64",
filePath: base64Str,
name: 'myfile',
success(res) {
successCallback(res.data)
},
fail(err) {
console.log("uploadErr", err)
}
});
})
}
}
// let strTobase64 = (str) => {
// var buf = new ArrayBuffer(str.length * 2);
// var bufView = new Uint16Array(buf);
// for (var i = 0, strlen = str.length; i < strlen; i++) {
// bufView[i] = str.charCodeAt(i);
// }
// var base64 = uni.arrayBufferToBase64(buf);
// base64 = 'data:image/jpeg;base64,' + base64;
// return base64;
// }
let urlTobase64 = (file, suc) => {
uni.getFileSystemManager().readFile({
filePath: file, //选择图片返回的相对路径
encoding: 'base64', //编码格式
success: (res) => { //成功的回调
let data = res.data;
let base64 = 'data:image/png;base64,' + data
suc(base64);
}
});
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment