Commit 34e3cc0a authored by 罗超's avatar 罗超

1

parent b4d21f1b
...@@ -46,4 +46,52 @@ export function getCourse(data) { ...@@ -46,4 +46,52 @@ export function getCourse(data) {
method: 'post', method: 'post',
data data
}) })
}
/**
* 获取我的电子合同
* @param {JSON参数} data
*/
export function getContract(data) {
return request({
url: '/AppletIndex/GetContractList',
method: 'post',
data
})
}
/**
* 获取我的课程进度
* @param {JSON参数} data
*/
export function getProgress(data) {
return request({
url: '/AppletIndex/GetStundentScheduleList',
method: 'post',
data
})
}
/**
* 获取剩余时间
* @param {JSON参数} data
*/
export function getStundentSurplus(data) {
return request({
url: '/AppletIndex/GetStundentSurplus',
method: 'post',
data
})
}
/**
* 学生申请请假
* @param {JSON参数} data
*/
export function setStudentLeave(data) {
return request({
url: '/AppletIndex/SetStudentLeave',
method: 'post',
data
})
} }
\ No newline at end of file
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
"pages": [{ "pages": [{
"path": "course" //课程 "path": "course" //课程
}, },
{
"path": "chapter" //章节内容
},
{ {
"path": "timeTable", //课表 "path": "timeTable", //课表
"style": { "style": {
......
<template> <template>
<view class="course-box"> <view class="course-box">
<van-toast id="van-toast" />
<view class="top-bar flex"> <view class="top-bar flex">
<view class="top-left flex flex_between_center"> <view class="top-left flex flex_between_center">
<view class="top-title"> 电子合同 </view> <view class="top-title"> 电子合同 </view>
...@@ -11,24 +12,27 @@ ...@@ -11,24 +12,27 @@
/> />
</view> </view>
<view class="top-right flex_grow"> <view class="top-right flex_grow">
<view class="course-name"> 这里不知写课程名称还是写合同 </view> <view class="course-name"> 合同 </view>
<view class="section-name"> 5个合同 </view> <view class="section-name"> {{ data.length }}个合同 </view>
</view> </view>
</view> </view>
<view v-for="(item, index) in data" :key="index" class="data-item"> <view v-for="(item, index) in data" :key="index" class="data-item">
<view class="contract-name" <view class="contract-name"
><van-icon name="description" style="margin-right: 10rpx" /> ><van-icon name="description" style="margin-right: 10rpx" />
{{ item.name }}</view {{ item.ContractNo }}</view
> >
<view class="contract-con">{{ item.con }}</view> <view class="contract-con" v-if="item.Type === 1">订单合同</view>
<view class="contract-con" v-if="item.Type === 2">退课合同</view>
<van-image <van-image
width="80rpx" width="80rpx"
height="80rpx" height="80rpx"
fit="cover" fit="cover"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/contract.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/contract.png"
class="contract-icon" class="contract-icon"
v-if="item.IsCompanySeal === 1"
/> />
</view> </view>
<van-skeleton title row="10" :loading="pageloading" />
</view> </view>
</template> </template>
...@@ -43,25 +47,32 @@ import { ...@@ -43,25 +47,32 @@ import {
computed, computed,
onMounted, onMounted,
} from "vue"; } from "vue";
import { getContract } from "../../api/index";
export default { export default {
setup() { setup() {
let data = reactive({ let data = reactive({
data: [ pageloading: false,
{ data: [],
name: "电子合同的名称",
con: "一点小内容吧,放在这里,一点小内容吧",
},
{
name: "电子合同的名称",
con: "一点小内容吧,放在这里,一点小内容吧",
},
{
name: "电子合同的名称",
con: "一点小内容吧,放在这里,一点小内容吧",
},
],
}); });
let methods = {}; let methods = {
async getdata() {
let res = await getContract({});
if (res) {
if (res.Data.length === 0) {
data.pageloading = true;
} else {
data.pageloading = false;
}
console.log(69, res);
data.data = res.Data;
}
},
};
onMounted(() => {
that.getdata();
});
let that = methods;
return { return {
...toRefs(data), ...toRefs(data),
...methods, ...methods,
...@@ -135,7 +146,7 @@ export default { ...@@ -135,7 +146,7 @@ export default {
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
color: #111111; color: #111111;
margin-bottom: 30rpx; margin-bottom: 20rpx;
} }
.contract-con { .contract-con {
max-width: 80%; max-width: 80%;
...@@ -145,4 +156,7 @@ export default { ...@@ -145,4 +156,7 @@ export default {
color: #999999; color: #999999;
margin-left: 30rpx; margin-left: 30rpx;
} }
/deep/.van-skeleton {
padding: 0;
}
</style> </style>
<template> <template>
<view class="con"> <view class="con">
<van-toast id="van-toast" />
<view class="cell cell-1 flex flex_between_center mb-30" @click="show"> <view class="cell cell-1 flex flex_between_center mb-30" @click="show">
<view class="flex flex_between_center label"> <view class="flex flex_between_center label">
<view class="dot"></view> 请假类型 <view class="dot"></view> 请假类型
...@@ -38,6 +39,7 @@ ...@@ -38,6 +39,7 @@
<van-datetime-picker <van-datetime-picker
type="date" type="date"
:value="curDate" :value="curDate"
:min-date="minDate"
@cancel="closeTimeChoose" @cancel="closeTimeChoose"
@confirm="ConfirmTimeChoose" @confirm="ConfirmTimeChoose"
/> />
...@@ -136,12 +138,14 @@ import { ...@@ -136,12 +138,14 @@ import {
onMounted, onMounted,
} from "vue"; } from "vue";
import { getdate } from "../../utils/date"; import { getdate } from "../../utils/date";
import { getStundentPlanStatistical, setStudentLeave } from "../../api/index";
export default { export default {
setup() { setup() {
let data = reactive({ let data = reactive({
showType: false, showType: false,
TimeChoose: false, TimeChoose: false,
curDate: new Date().getTime(), curDate: new Date().getTime() + 24 * 60 * 60 * 1000,
minDate: new Date().getTime() + 24 * 60 * 60 * 1000,
timeType: 1, //1开始时间,2结束时间 timeType: 1, //1开始时间,2结束时间
checkboxVal: [], checkboxVal: [],
actions: [ actions: [
...@@ -154,8 +158,8 @@ export default { ...@@ -154,8 +158,8 @@ export default {
], ],
data: { data: {
type: "事假", type: "事假",
startTime: getdate(new Date()), startTime: getdate(new Date(), 1),
endTime: getdate(new Date()), endTime: getdate(new Date(), 1),
reason: "", reason: "",
}, },
isShowAllCheck: false, isShowAllCheck: false,
...@@ -203,6 +207,7 @@ export default { ...@@ -203,6 +207,7 @@ export default {
status: "failed", status: "failed",
}, },
], ],
courseMsg: {},
}); });
let methods = { let methods = {
//显示请假类型弹出层 //显示请假类型弹出层
...@@ -261,6 +266,9 @@ export default { ...@@ -261,6 +266,9 @@ export default {
} }
console.log(249, data.checkboxList); console.log(249, data.checkboxList);
}, },
getCourseTime() {
// getStundentPlanStatistical(data.courseMsg);
},
}; };
onMounted(() => { onMounted(() => {
data.checkboxList = data.checkboxListAll.slice(0, 4); data.checkboxList = data.checkboxListAll.slice(0, 4);
......
<template> <template>
<view class="con"> <view class="con">
<van-toast id="van-toast" />
<view class="leave-item"> <view class="leave-item">
<view class="top flex flex_start_center"> <view class="top flex flex_start_center">
<van-image <van-image
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
><view class="label">请假事由</view>{{ item.reason }}</view ><view class="label">请假事由</view>{{ item.reason }}</view
> >
</view> </view>
<van-toast id="van-toast" />
</view> </view>
</template> </template>
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
v-for="(_item, _index) in item.ChildList" v-for="(_item, _index) in item.ChildList"
:key="_index" :key="_index"
class="course-list one_line" class="course-list one_line"
@click="openLayer(_item.ChapterContent)" @click="jumpPage(_item)"
> >
{{ _item.ChapterName }} {{ _item.ChapterName }}
</view> </view>
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<view <view
class="chapter" class="chapter"
v-if="item.ChildList.length == 0" v-if="item.ChildList.length == 0"
@click="openLayer(item.ChapterContent)" @click="jumpPage(item)"
> >
<view class="flex flex_between_center"> <view class="flex flex_between_center">
<view class="flex flex_between_center"> <view class="flex flex_between_center">
...@@ -46,41 +46,8 @@ ...@@ -46,41 +46,8 @@
</view> </view>
<view class="course-time"> {{ item.StudyHours }}课时 </view> <view class="course-time"> {{ item.StudyHours }}课时 </view>
</view> </view>
<!-- <view
v-if="item.ChildList.length 0"
v-for="(_item, _index) in item.ChildList"
:key="_index"
class="course-list one_line"
@click="openLayer(_item.ChapterContent)"
>
{{ _item.ChapterName }}
</view> -->
</view> </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">
<rich-text :nodes="richTextNode" />
</view>
<view class="Know-btn flex flex_center_center" @click="closeLayer">
我知道了
</view>
</view>
</view>
</view>
</van-overlay>
</view> </view>
</template> </template>
...@@ -100,38 +67,20 @@ import { getCourse } from "../../api/index"; ...@@ -100,38 +67,20 @@ import { getCourse } from "../../api/index";
export default { export default {
setup() { setup() {
let data = reactive({ let data = reactive({
showLayer: false, data: [],
data: [
{
name: "第一次课",
coursetime: "4课时",
children: [
{
name: "4.1 第一课活动篇****你好",
},
{
name: "4.2 第一课理解篇****平假名",
},
],
},
],
msg: { msg: {
CourseId: 0, CourseId: 0,
}, },
richTextNode: "",
}); });
let methods = { let methods = {
openLayer(item) { jumpPage(item) {
data.richTextNode = decodeURIComponent(item); let data = encodeURIComponent(JSON.stringify(item));
data.showLayer = true; uni.navigateTo({
console.log("105", data.richTextNode); url: "/pages/course/chapter?con=" + data,
}, });
closeLayer() {
data.showLayer = false;
}, },
async getdata() { async getdata() {
let res = await getCourse(data.msg); let res = await getCourse(data.msg);
console.log("114", res);
if (res) { if (res) {
data.data = res.Data; data.data = res.Data;
} }
...@@ -238,76 +187,4 @@ export default { ...@@ -238,76 +187,4 @@ export default {
font-weight: 500; font-weight: 500;
color: #111111; color: #111111;
} }
.wrapper {
display: flex;
align-items: center;
justify-content: center;
height: 100%;
}
.info {
width: 544rpx;
height: 700rpx;
background-color: #fff;
border-radius: 12rpx;
overflow: hidden;
}
.info-top {
height: 90rpx;
background-color: #b4ddfe;
box-sizing: border-box;
padding: 0 30rpx;
}
.left-icon {
width: 6rpx;
height: 22rpx;
background-image: linear-gradient(180deg, #00acf9, #ffffff);
margin-right: 10rpx;
}
.wrapper-title {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.info-main {
height: 610rpx;
padding-top: 30rpx;
}
.wrapper-section {
padding-left: 50rpx;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
margin-bottom: 30rpx;
}
.wrapper-section .left-bot {
width: 8rpx;
height: 8rpx;
background-color: #00acf9;
border-radius: 50%;
margin-right: 10rpx;
}
.info-con {
height: 340rpx;
padding-left: 65rpx;
padding-right: 55rpx;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
overflow-y: scroll;
}
.Know-btn {
width: 300rpx;
height: 90rpx;
background-color: #00acf9;
border-radius: 12rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
margin: 40rpx auto 0;
}
</style> </style>
<template> <template>
<view <view>
class="timetable-item" <view
v-for="(item, index) in data.PlanTimeList" class="timetable-item"
:key="index" v-for="(item, index) in data.PlanTimeList"
> :key="index"
<view class="flex flex_start_center title-row"> >
<view class="class-time">{{ item.StartTime }} </view> <view class="flex flex_start_center title-row">
<view class="circle"></view> <view class="class-time">{{ item.StartTime }} </view>
<view class="class-title one_line flex"> <view class="circle"></view>
{{ data.ClassName }} <view class="class-title one_line flex">
<view v-for="(_item, _index) in data.Chapter" :key="_index"> {{ data.ClassName }}
{{ _item.ChapterName }} <view v-for="(_item, _index) in data.Chapter" :key="_index">
<text v-if="_index !== data.Chapter.length - 1">,</text> {{ _item.ChapterName }}
<text v-if="_index !== data.Chapter.length - 1">,</text>
</view>
</view> </view>
</view> </view>
</view> <view class="left-line"></view>
<view class="left-line"></view> <view class="class-con flex">
<view class="class-con flex"> <van-image
<van-image round
round width="84rpx"
width="84rpx" height="84rpx"
height="84rpx" fit="cover"
fit="cover" :src="item.UserIcon"
:src="item.UserIcon" class="teacherimg"
class="teacherimg" />
/> <view class="class-right flex_grow flex flex_start_center">
<view class="class-right flex_grow flex flex_start_center"> <!-- <view class="study-con"> 今日学习课程内容 </view> -->
<!-- <view class="study-con"> 今日学习课程内容 </view> --> <view class="teacher-name flex flex_start-center">
<view class="teacher-name flex flex_start-center"> {{ item.TeacherName }}</view
{{ item.TeacherName }}</view >
</view>
</view>
<view class="btn-box">
<van-button
custom-class="leave-btn"
@click="jumpPage('/pages/course/askForLeave')"
v-if="item.IsLeave === 1"
>请假</van-button
>
<van-button
custom-class="already-leave-btn one_line"
v-if="item.IsLeave === 0"
>已请假</van-button
> >
</view> </view>
</view> </view>
<view class="btn-box">
<van-button
custom-class="leave-btn"
@click="jumpPage('/pages/course/askForLeave')"
v-if="item.IsLeave === 1"
>请假</van-button
>
<van-button
custom-class="already-leave-btn one_line"
v-if="item.IsLeave === 0"
>已请假</van-button
>
</view>
</view> </view>
</template> </template>
......
...@@ -87,8 +87,12 @@ ...@@ -87,8 +87,12 @@
</view> </view>
</view> </view>
<view class="Timetable-box"> <view class="Timetable-box">
<!-- <Item /> --> <van-empty description="暂无数据" v-if="dataList.length === 0" />
<view v-for="(item, index) in dataList" :key="index"> <view
v-for="(item, index) in dataList"
:key="index"
v-if="dataList.length > 0"
>
<Item :data="item" /> <Item :data="item" />
</view> </view>
</view> </view>
...@@ -200,7 +204,6 @@ export default { ...@@ -200,7 +204,6 @@ export default {
let res = await getStundentPlanStatistical(data.msg); let res = await getStundentPlanStatistical(data.msg);
if (res) { if (res) {
data.dataList = res.Data; data.dataList = res.Data;
console.log(199, data);
} }
}, },
jumpPage(url) { jumpPage(url) {
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
</view> </view>
</view> </view>
</view> </view>
<van-toast id="van-toast" />
</view> </view>
</template> </template>
......
...@@ -16,12 +16,14 @@ ...@@ -16,12 +16,14 @@
@click="jumpPage('/pages/login/login')" @click="jumpPage('/pages/login/login')"
/> />
<view class="grow"> <view class="grow">
<view class="name"> 樱桃爱草莓 </view> <view class="name"> {{ userinfo.AccountName }} </view>
<view class="phone"> 138****0000 </view> <view class="phone">
{{ userinfo.EnterPhone }}
</view>
</view> </view>
<view class="saleInfo"> <view class="saleInfo">
<view class="info1"> <van-icon name="contact" />服务人员 </view> <view class="info1"> <van-icon name="contact" />服务人员</view>
<view class="info2 one_line"> 销售138****0000 </view> <view class="info2 one_line"> 销售{{ userinfo.EnterPhone2 }}</view>
</view> </view>
</view> </view>
<view class="baseInfo flex flex_wrap"> <view class="baseInfo flex flex_wrap">
...@@ -128,7 +130,7 @@ import { ...@@ -128,7 +130,7 @@ import {
provide, provide,
} from "vue"; } from "vue";
import { getIndexInfo } from "../../api/index"; import { getIndexInfo } from "../../api/index";
import { getSystemInfo } from "../../utils/index"; import { getSystemInfo, desensitization } from "../../utils/index";
export default { export default {
name: "", name: "",
props: {}, props: {},
...@@ -136,6 +138,7 @@ export default { ...@@ -136,6 +138,7 @@ export default {
setup(props) { setup(props) {
let data = reactive({ let data = reactive({
statusBarHeight: 0, statusBarHeight: 0,
userinfo: {},
indexData: {}, indexData: {},
baseInfo: [ baseInfo: [
{ {
...@@ -216,8 +219,11 @@ export default { ...@@ -216,8 +219,11 @@ export default {
data.baseInfo[1].desc = res.Data.CourseName; data.baseInfo[1].desc = res.Data.CourseName;
data.baseInfo[1].jumpUrl = data.baseInfo[1].jumpUrl =
"/pages/course/course?id=" + res.Data.CourseId; "/pages/course/course?id=" + res.Data.CourseId;
// data.baseInfo[2].desc = res.Data.SName; data.baseInfo[2].jumpUrl =
"/pages/progress/progress?id=" + res.Data.ClassId;
data.baseInfo[3].desc = res.Data.SurplusHours + "课时"; data.baseInfo[3].desc = res.Data.SurplusHours + "课时";
data.baseInfo[3].jumpUrl =
"/pages/surplusTime/surplusTime?id=" + res.Data.ClassId;
data.baseInfo[4].desc = res.Data.ContractNum; data.baseInfo[4].desc = res.Data.ContractNum;
data.baseInfo[5].desc = res.Data.TeacherName; data.baseInfo[5].desc = res.Data.TeacherName;
} }
...@@ -229,6 +235,13 @@ export default { ...@@ -229,6 +235,13 @@ export default {
data.statusBarHeight = res.statusBarHeight; data.statusBarHeight = res.statusBarHeight;
}); });
that.getIndexdata(); that.getIndexdata();
data.userinfo = uni.getStorageSync("userInfo");
console.log("tag", data.userinfo);
data.userinfo.EnterPhone2 = desensitization(
data.userinfo.EnterPhone,
3,
-4
);
}); });
let that = methods; let that = methods;
return { return {
......
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
/** /**
* 因为 props 是响应式的,你不能使用 ES6 解构,因为它会消除 prop 的响应性。 * 因为 props 是响应式的,你不能使用 ES6 解构,因为它会消除 prop 的响应性。
如果需要解构 prop,可以通过使用 setup 函数中的 toRefs 来完成此操作 如果需要解构 prop,可以通过使用 setup 函数中的 toRefs 来完成此操作
* // ref和reactive的区别: ref()传入的是js的基本数据类型; reactive()中传入的是object普通对象 * // ref和reactive的区别: ref()传入的是js的基本数据类型; reactive()中传入的是object普通对象,------------reactive对象不能直接赋值--------------
*@reactive:处理的是对象的双向绑定, 对象不能被***解构或展开***,一旦被解构或者展开,返回的值将失去响应式 *@reactive:处理的是对象的双向绑定, 对象不能被***解构或展开***,一旦被解构或者展开,返回的值将失去响应式,需用...toRef()
* @getCurrentInstance,获取当前页面实例,使用const { ctx,proxy } = getCurrentInstance(); ctx或proxy.$挂载的方法 * 没有this 通过 @getCurrentInstance,获取当前页面实例,使用const { ctx,proxy } = getCurrentInstance(); ctx或proxy.$挂载的方法
*/ */
import { import {
ref, ref,
...@@ -23,16 +23,8 @@ export default { ...@@ -23,16 +23,8 @@ export default {
props: {}, props: {},
components: {}, components: {},
setup(props) { setup(props) {
let { titles } = toRefs(props);
let { ctx } = getCurrentInstance(); let { ctx } = getCurrentInstance();
let title = ref("hello"); let data = ref(0);
let count = ref(0);
let yzm = ref(1234);
let add = () => {
count.value++;
name.firstname += "x";
console.log(58, titles);
};
let name = reactive({ let name = reactive({
firstname: "x", firstname: "x",
lastname: "w", lastname: "w",
...@@ -53,31 +45,17 @@ export default { ...@@ -53,31 +45,17 @@ export default {
// 高级用法: 可以修改值 // 高级用法: 可以修改值
const fullName2 = computed({ const fullName2 = computed({
get: () => name.firstname + name.lastname, get: () => name.firstname + name.lastname,
set: (val) => { set: (val) => {},
title.value = val;
},
}); });
fullName2.value = 7;
console.log(76, fullName2);
onMounted(() => { onMounted(() => {
console.log(84, "onmounted"); console.log("onmounted");
}); });
return { return {
title, data,
count,
add,
yzm,
// name,
...toRefs(name), ...toRefs(name),
fullName, fullName,
fullName2, fullName2,
}; };
}, },
onLoad() {
console.log("index load");
},
onShow() {
console.log("index Show");
},
}; };
</script> </script>
...@@ -20,22 +20,33 @@ ...@@ -20,22 +20,33 @@
<view class="flex flex_between_center"> <view class="flex flex_between_center">
<view class="flex flex_between_center"> <view class="flex flex_between_center">
<view class="dot"></view> <view class="dot"></view>
<text class="chapter-name">{{ item.name }}</text> <text class="chapter-name">{{
item.ChapterTreeInfo.ChapterName
}}</text>
</view> </view>
<view class="course-time"> {{ item.coursetime }} </view> <view class="course-time" v-if="item.IsStudy === 0">
{{ item.ChapterTreeInfo.StudyHours }}课时
</view>
<van-image
width="40rpx"
height="25rpx"
fit="cover"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/finish.png"
v-if="item.IsStudy === 1"
/>
</view> </view>
<view <view
v-for="(_item, _index) in item.children" v-for="(_item, _index) in item.ChapterTreeInfo.ChildList"
:key="_index" :key="_index"
class="course-list" class="course-list"
> >
{{ _item.name }} {{ _item.ChapterName }}
</view> </view>
</view> </view>
</view> </view>
<!-- 章节内容 --> <!-- 章节内容 -->
<van-overlay :show="showLayer"> <!-- <van-overlay :show="showLayer">
<view class="wrapper"> <view class="wrapper">
<view class="info"> <view class="info">
<view class="info-top flex flex_start_center"> <view class="info-top flex flex_start_center">
...@@ -63,7 +74,8 @@ ...@@ -63,7 +74,8 @@
</view> </view>
</view> </view>
</view> </view>
</van-overlay> </van-overlay> -->
<van-toast id="van-toast" />
</view> </view>
</template> </template>
...@@ -78,10 +90,14 @@ import { ...@@ -78,10 +90,14 @@ import {
computed, computed,
onMounted, onMounted,
} from "vue"; } from "vue";
import { getProgress } from "../../api/index";
export default { export default {
setup() { setup() {
let data = reactive({ let data = reactive({
showLayer: false, showLayer: false,
msg: {
ClassId: 0,
},
data: [ data: [
{ {
name: "第一次课", name: "第一次课",
...@@ -104,16 +120,24 @@ export default { ...@@ -104,16 +120,24 @@ export default {
closeLayer() { closeLayer() {
data.showLayer = false; data.showLayer = false;
}, },
async getData() {
let res = await getProgress(data.msg);
data.data = res.Data;
console.log(113, data);
},
}; };
return { return {
...toRefs(data), ...toRefs(data),
...methods, ...methods,
}; };
}, },
onLoad() { onLoad(options) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "进度", title: "进度",
}); });
let { ctx } = getCurrentInstance();
ctx.msg.ClassId = parseInt(options.id);
ctx.getData();
}, },
}; };
</script> </script>
......
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
<view class="section-name"> 下面内容章节 </view> <view class="section-name"> 下面内容章节 </view>
</view> </view>
</view> </view>
<view v-for="(item, index) in data" :key="index"> <van-empty description="暂无内容" v-if="data.length === 0" />
<view v-for="(item, index) in data" :key="index" v-if="data.length > 0">
<view class="chapter" @click="openLayer"> <view class="chapter" @click="openLayer">
<view class="flex flex_start_center"> <view class="flex flex_start_center">
<van-image <van-image
...@@ -25,15 +26,16 @@ ...@@ -25,15 +26,16 @@
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/classroom.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/classroom.png"
style="margin-right: 10rpx" style="margin-right: 10rpx"
/> />
<text class="mr-30 classroom">{{ item.classroom }}</text> <text class="mr-30 classroom">{{ item.RoomName }}</text>
<van-image <van-image
width="18rpx" width="18rpx"
height="22rpx" height="22rpx"
fit="cover" fit="cover"
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/user.png" :src="item.UserIcon"
style="margin-right: 10rpx" style="margin-right: 10rpx"
/> />
<text class="mr-30 teacherName">{{ item.teacherName }}</text> <!-- https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/user.png -->
<text class="mr-30 teacherName">{{ item.TeacherName }}</text>
<van-image <van-image
width="24rpx" width="24rpx"
height="22rpx" height="22rpx"
...@@ -41,10 +43,10 @@ ...@@ -41,10 +43,10 @@
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/calendar.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/calendar.png"
style="margin-right: 10rpx" style="margin-right: 10rpx"
/> />
<text class="date">{{ item.date }}</text> <text class="date">{{ item.ClassDateStr }}</text>
</view> </view>
<view <view
v-for="(_item, _index) in item.children" v-for="(_item, _index) in item.PlanTimeList"
:key="_index" :key="_index"
class="course-list" class="course-list"
> >
...@@ -55,10 +57,11 @@ ...@@ -55,10 +57,11 @@
src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/time.png" src="https://viitto-1301420277.cos.ap-chengdu.myqcloud.com/Static/educationStu/time.png"
style="margin-right: 10rpx" style="margin-right: 10rpx"
/> />
{{ _item.name }} {{ _item.StartTime }}-{{ _item.EndTime }}
</view> </view>
</view> </view>
</view> </view>
<van-toast id="van-toast" />
</view> </view>
</template> </template>
...@@ -73,25 +76,13 @@ import { ...@@ -73,25 +76,13 @@ import {
computed, computed,
onMounted, onMounted,
} from "vue"; } from "vue";
import { getStundentSurplus } from "../../api/index";
export default { export default {
setup() { setup() {
let data = reactive({ let data = reactive({
showLayer: false, showLayer: false,
data: [ msg: { ClassId: 0 },
{ data: [],
classroom: "奈良",
teacherName: "李琴",
date: "2021-08-02",
children: [
{
name: "1节课 09:30-11:00 / 2节课 11:30-12:45",
},
{
name: "1节课 09:30-11:00 / 2节课 11:30-12:45",
},
],
},
],
}); });
let methods = { let methods = {
openLayer() { openLayer() {
...@@ -100,16 +91,25 @@ export default { ...@@ -100,16 +91,25 @@ export default {
closeLayer() { closeLayer() {
data.showLayer = false; data.showLayer = false;
}, },
async getData() {
let res = await getStundentSurplus(data.msg);
if (res) {
data.data = res.Data;
}
},
}; };
return { return {
...toRefs(data), ...toRefs(data),
...methods, ...methods,
}; };
}, },
onLoad() { onLoad(options) {
uni.setNavigationBarTitle({ uni.setNavigationBarTitle({
title: "剩余时间", title: "剩余时间",
}); });
let { ctx } = getCurrentInstance();
ctx.msg.ClassId = parseInt(options.id);
ctx.getData();
}, },
}; };
</script> </script>
......
...@@ -37,12 +37,15 @@ export let getToday = (y, m, d) => { ...@@ -37,12 +37,15 @@ export let getToday = (y, m, d) => {
} }
} }
export let getdate = (time) => { export let getdate = (time, tomorrow) => {
let date = new Date(time) let date = new Date(time)
let year = date.getFullYear() let year = date.getFullYear()
let month = date.getMonth() < 9 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1 let month = date.getMonth() < 9 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
let day = date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate() let day = date.getDate() < 10 ? '0' + (date.getDate()) : date.getDate()
if (tomorrow === 1) {
day = date.getDate() < 9 ? '0' + (date.getDate() + 1) : date.getDate() + 1
}
let d = year + "-" + month + '-' + day let d = year + "-" + month + '-' + day
// let curMonth = year + "-" + month console.log(50, d, tomorrow)
return d return d
} }
...@@ -5,4 +5,20 @@ export let getSystemInfo = (callback) => { ...@@ -5,4 +5,20 @@ export let getSystemInfo = (callback) => {
callback(res) callback(res)
} }
}) })
}
//脱敏
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;
} }
\ 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