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

1

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