Commit 7948207f authored by 罗超's avatar 罗超

2

parent b42c30ac
...@@ -344,9 +344,9 @@ export default { ...@@ -344,9 +344,9 @@ export default {
lower(e) { lower(e) {
if (data.msg.pageIndex < data.PageCount) { if (data.msg.pageIndex < data.PageCount) {
data.pageState = "loading"; data.pageState = "loading";
data.msg.pageIndex++;
if (data.timer) clearTimeout(data.timer); if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => { data.timer = setTimeout(() => {
data.msg.pageIndex++;
that.getList(); that.getList();
}, 1000); }, 1000);
} else { } else {
......
<template> <template>
<view class="con"> <view class="con">
<van-empty description="暂无请假申请" v-if="data.length === 0" /> <van-empty description="暂无请假申请" v-if="data.length === 0" />
<scroll-view <scroll-view :scroll-top="0" scroll-y="true" class="scroll-box" @scrolltolower="lower" v-if="data.length > 0">
:scroll-top="0"
scroll-y="true"
class="scroll-box"
@scrolltolower="lower"
v-if="data.length > 0"
>
<view v-for="(item, index) in data" :key="index" class="leave-item"> <view v-for="(item, index) in data" :key="index" class="leave-item">
<view class="top flex flex_start_center" @click="jumpPage(item)"> <view class="top flex flex_start_center" @click="jumpPage(item)">
<van-image <van-image round width="55rpx" fit="cover" height="55rpx"
round :src="userInfo.UserIcon ? userInfo.UserIcon : userInfo.GroupLogo" style="margin-right: 20rpx"
width="55rpx" class="flex flex_start_center" />
fit="cover"
height="55rpx"
:src="userInfo.UserIcon ? userInfo.UserIcon : userInfo.GroupLogo"
style="margin-right: 20rpx"
class="flex flex_start_center"
/>
<view class="grow one_line name">{{ item.CreateByName }}的请假</view> <view class="grow one_line name">{{ item.CreateByName }}的请假</view>
<view class="date">{{ item.CreateTime }}</view> <view class="date">{{ item.CreateTime }}</view>
</view> </view>
<view class="flex flex_between_center margin-t-b-15"> <view class="flex flex_between_center margin-t-b-15">
<view class="flex label-next" <view class="flex label-next">
><view class="label">请假类型</view> <view class="label">请假类型</view>
<text v-if="item.DataObj.LeaveType === 1">事假</text> <text v-if="item.DataObj.LeaveType === 1">事假</text>
<text v-if="item.DataObj.LeaveType === 2">病假</text> <text v-if="item.DataObj.LeaveType === 2">病假</text>
</view> </view>
<view <view class="status" :class="{
class="status"
:class="{
status1: item.VerifyStatus === 4, status1: item.VerifyStatus === 4,
status2: item.VerifyStatus === 6, status2: item.VerifyStatus === 6,
status3: item.VerifyStatus === 0, status3: item.VerifyStatus === 0,
}" }">{{ item.AuditStatusName }}</view>
>{{ item.AuditStatusName }}</view
>
</view> </view>
<view class="flex label-next margin-t-b-15" <view class="flex label-next margin-t-b-15">
><view class="label">开始时间</view <view class="label">开始时间</view>{{ item.DataObj.LeaveInfoList[0].ClassDate }}
>{{ item.DataObj.LeaveInfoList[0].ClassDate }} {{ item.DataObj.LeaveInfoList[0].StartTime }}
{{ item.DataObj.LeaveInfoList[0].StartTime }}</view </view>
> <view class="flex label-next margin-t-b-15">
<view class="flex label-next margin-t-b-15" <view class="label">结束时间</view>{{
><view class="label">结束时间</view
>{{
item.DataObj.LeaveInfoList[item.DataObj.LeaveInfoList.length - 1] item.DataObj.LeaveInfoList[item.DataObj.LeaveInfoList.length - 1]
.ClassDate .ClassDate
}} }}
{{ {{
item.DataObj.LeaveInfoList[item.DataObj.LeaveInfoList.length - 1] item.DataObj.LeaveInfoList[item.DataObj.LeaveInfoList.length - 1]
.EndTime .EndTime
}}</view }}
> </view>
<view class="flex label-next margin-t-b-15 one_line" style="width: 80%" <view class="flex label-next margin-t-b-15 one_line" style="width: 80%">
><view class="label">请假事由</view <view class="label">请假事由</view>{{ item.DataObj.Remarks || "无" }}
>{{ item.DataObj.Remarks || "无" }}</view </view>
>
<van-button <van-button type="danger" size="mini" class="invalid-btn" plain v-if="item.VerifyStatus === 0"
type="danger" @click="invalidApply(item)">作废</van-button>
size="mini"
class="invalid-btn"
plain
v-if="item.VerifyStatus === 0"
@click="invalidApply(item)"
>作废</van-button
>
</view> </view>
<Loadmore :state="pageState" /> <Loadmore :state="pageState" />
</scroll-view> </scroll-view>
...@@ -77,7 +51,7 @@ ...@@ -77,7 +51,7 @@
</template> </template>
<script> <script>
import { import {
ref, ref,
reactive, reactive,
toRefs, toRefs,
...@@ -87,10 +61,13 @@ import { ...@@ -87,10 +61,13 @@ import {
computed, computed,
onMounted, onMounted,
inject, inject,
} from "vue"; } from "vue";
import { getStudentLeaveList, invalidReceiptInfo } from "../../api/index"; import {
import Loadmore from "../../components/loadmore.vue"; getStudentLeaveList,
export default { invalidReceiptInfo
} from "../../api/index";
import Loadmore from "../../components/loadmore.vue";
export default {
components: { components: {
Loadmore, Loadmore,
}, },
...@@ -114,17 +91,16 @@ export default { ...@@ -114,17 +91,16 @@ export default {
let methods = { let methods = {
jumpPage(item) { jumpPage(item) {
uni.navigateTo({ uni.navigateTo({
url: url: "/pages/course/askForLeaveDetail?data=" +
"/pages/course/askForLeaveDetail?data=" +
encodeURIComponent(JSON.stringify(item)), encodeURIComponent(JSON.stringify(item)),
}); });
}, },
lower(e) { lower(e) {
if (data.msg.PageIndex < data.PageCount) { if (data.msg.PageIndex < data.PageCount) {
data.pageState = "loading"; data.pageState = "loading";
data.msg.PageIndex++;
if (data.timer) clearTimeout(data.timer); if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => { data.timer = setTimeout(() => {
data.msg.PageIndex++;
that.getList(); that.getList();
}, 1000); }, 1000);
} else { } else {
...@@ -143,7 +119,7 @@ export default { ...@@ -143,7 +119,7 @@ export default {
if (data.msg.PageIndex === 1) { if (data.msg.PageIndex === 1) {
data.data = res.Data.PageData; data.data = res.Data.PageData;
} else { } else {
data.data = [...res.Data.PageData, ...data.data]; data.data = [...data.data, ...res.Data.PageData];
} }
if (data.msg.PageIndex >= res.Data.PageCount) { if (data.msg.PageIndex >= res.Data.PageCount) {
data.pageState = "none"; data.pageState = "none";
...@@ -188,18 +164,19 @@ export default { ...@@ -188,18 +164,19 @@ export default {
title: "请假列表", title: "请假列表",
}); });
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.con { .con {
height: 100vh; height: 100vh;
box-sizing: border-box; box-sizing: border-box;
font-family: PingFang SC; font-family: PingFang SC;
padding: 30rpx 0; padding: 30rpx 0;
} }
.leave-item {
.leave-item {
box-sizing: border-box; box-sizing: border-box;
width: 690rpx; width: 690rpx;
padding: 20rpx 30rpx; padding: 20rpx 30rpx;
...@@ -207,64 +184,76 @@ export default { ...@@ -207,64 +184,76 @@ export default {
margin-bottom: 30rpx; margin-bottom: 30rpx;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(36, 36, 36, 0.2); box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(36, 36, 36, 0.2);
position: relative; position: relative;
} }
.top {
.top {
border-bottom: 1rpx solid #e2e2e2; border-bottom: 1rpx solid #e2e2e2;
padding-bottom: 20rpx; padding-bottom: 20rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;
} }
.name {
.name {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
color: #111111; color: #111111;
} }
.date {
.date {
font-size: 22rpx; font-size: 22rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #999999; color: #999999;
} }
.status {
.status {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #00df9f; color: #00df9f;
} }
.status1 {
.status1 {
color: #ff3816; color: #ff3816;
} }
.status2 {
.status2 {
color: #111111; color: #111111;
} }
.status3 {
.status3 {
color: #4fc08d; color: #4fc08d;
} }
.label {
.label {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #999999; color: #999999;
margin-right: 30rpx; margin-right: 30rpx;
} }
.label-next {
.label-next {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #111111; color: #111111;
} }
.margin-t-b-15 {
.margin-t-b-15 {
margin-top: 15rpx; margin-top: 15rpx;
margin-bottom: 15rpx; margin-bottom: 15rpx;
} }
.scroll-box {
.scroll-box {
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
.invalid-btn {
.invalid-btn {
position: absolute; position: absolute;
right: 30rpx; right: 30rpx;
bottom: 20rpx; bottom: 20rpx;
z-index: 10; z-index: 10;
} }
</style> </style>
...@@ -140,9 +140,9 @@ export default { ...@@ -140,9 +140,9 @@ export default {
lower(e) { lower(e) {
if (data.msg.PageIndex < data.PageCount) { if (data.msg.PageIndex < data.PageCount) {
data.pageState = "loading"; data.pageState = "loading";
data.msg.PageIndex++;
if (data.timer) clearTimeout(data.timer); if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => { data.timer = setTimeout(() => {
data.msg.PageIndex++;
that.getList(); that.getList();
}, 1000); }, 1000);
} else { } else {
...@@ -158,7 +158,7 @@ export default { ...@@ -158,7 +158,7 @@ export default {
if (data.msg.PageIndex === 1) { if (data.msg.PageIndex === 1) {
data.examList = res.Data.PageData; data.examList = res.Data.PageData;
} else { } else {
data.examList = [...res.Data.PageData, ...data.examList]; data.examList = [...data.examList,...res.Data.PageData];
} }
if (data.msg.PageIndex >= res.Data.PageCount) { if (data.msg.PageIndex >= res.Data.PageCount) {
data.pageState = "none"; data.pageState = "none";
......
...@@ -3,19 +3,10 @@ ...@@ -3,19 +3,10 @@
<van-toast id="van-toast" /> <van-toast id="van-toast" />
<view class="list-con"> <view class="list-con">
<van-empty description="暂无数据" v-if="dataList.length === 0" /> <van-empty description="暂无数据" v-if="dataList.length === 0" />
<scroll-view <scroll-view :scroll-top="0" scroll-y="true" class="scroll-box" @scrolltolower="lower"
:scroll-top="0" v-if="dataList.length > 0">
scroll-y="true" <view v-for="(item, index) in dataList" :key="index" class="list-item flex flex_between_center"
class="scroll-box" @click="jumpPage(item.Id)">
@scrolltolower="lower"
v-if="dataList.length > 0"
>
<view
v-for="(item, index) in dataList"
:key="index"
class="list-item flex flex_between_center"
@click="jumpPage(item.Id)"
>
<image class="left" :src="item.Img"></image> <image class="left" :src="item.Img"></image>
<view class="right"> <view class="right">
<view class="one_line title">{{ item.Title }}</view> <view class="one_line title">{{ item.Title }}</view>
...@@ -29,11 +20,20 @@ ...@@ -29,11 +20,20 @@
</template> </template>
<script> <script>
import { reactive, toRefs, getCurrentInstance, onMounted } from "vue"; import {
import { getLearningGardenList } from "../../api/index"; reactive,
import { debounce } from "../../utils/index"; toRefs,
import Loadmore from "../../components/loadmore.vue"; getCurrentInstance,
export default { onMounted
} from "vue";
import {
getLearningGardenList
} from "../../api/index";
import {
debounce
} from "../../utils/index";
import Loadmore from "../../components/loadmore.vue";
export default {
components: { components: {
Loadmore, Loadmore,
}, },
...@@ -67,7 +67,7 @@ export default { ...@@ -67,7 +67,7 @@ export default {
if (data.msg.PageIndex === 1) { if (data.msg.PageIndex === 1) {
data.dataList = res.Data.PageData; data.dataList = res.Data.PageData;
} else { } else {
data.dataList = [...res.Data.PageData, ...data.dataList]; data.dataList = [...data.dataList, ...res.Data.PageData];
} }
data.pageCount = res.Data.PageCount; data.pageCount = res.Data.PageCount;
if (data.msg.PageIndex >= res.Data.PageCount) { if (data.msg.PageIndex >= res.Data.PageCount) {
...@@ -80,9 +80,9 @@ export default { ...@@ -80,9 +80,9 @@ export default {
lower(e) { lower(e) {
if (data.msg.PageIndex < data.pageCount) { if (data.msg.PageIndex < data.pageCount) {
data.pageState = "loading"; data.pageState = "loading";
data.msg.PageIndex++;
if (data.timer) clearTimeout(data.timer); if (data.timer) clearTimeout(data.timer);
data.timer = setTimeout(() => { data.timer = setTimeout(() => {
data.msg.PageIndex++;
that.getList(); that.getList();
}, 1000); }, 1000);
} else { } else {
...@@ -104,45 +104,51 @@ export default { ...@@ -104,45 +104,51 @@ export default {
title: this.pageTitle, title: this.pageTitle,
}); });
}, },
}; };
</script> </script>
<style scoped> <style scoped>
.list-con { .list-con {
height: calc(100vh - 20rpx); height: calc(100vh - 20rpx);
box-sizing: border-box; box-sizing: border-box;
padding: 15rpx 30rpx; padding: 15rpx 30rpx;
margin-top: 10rpx; margin-top: 10rpx;
} }
.scroll-box {
.scroll-box {
height: 100%; height: 100%;
width: 100%; width: 100%;
} }
.list-item {
.list-item {
margin: 20rpx 0; margin: 20rpx 0;
} }
.left {
.left {
width: 220rpx; width: 220rpx;
height: 120rpx; height: 120rpx;
border-radius: 20rpx; border-radius: 20rpx;
box-shadow: 0rpx 10rpx 30rpx 0rpx rgba(36, 36, 36, 0.2); box-shadow: 0rpx 10rpx 30rpx 0rpx rgba(36, 36, 36, 0.2);
} }
.right {
.right {
width: 440rpx; width: 440rpx;
height: 120rpx; height: 120rpx;
} }
.right .title {
.right .title {
font-size: 30rpx; font-size: 30rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: bold; font-weight: bold;
color: #111111; color: #111111;
line-height: 70rpx; line-height: 70rpx;
} }
.right .digest {
.right .digest {
font-size: 24rpx; font-size: 24rpx;
font-family: PingFang SC; font-family: PingFang SC;
font-weight: 500; font-weight: 500;
color: #999999; color: #999999;
line-height: 30rpx; line-height: 30rpx;
} }
</style> </style>
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