Commit b4d21f1b authored by 罗超's avatar 罗超

1

parent 4d4c3e84
import request from '../utils/request.js'
/**
* 账号密码登录
* @param {JSON参数} data
*/
export function login(data) {
return request({
url: '/AppletLogin/Login',
method: 'post',
data
})
}
/**
* 获取首页信息
* @param {JSON参数} data
*/
export function getIndexInfo(data) {
return request({
url: '/AppletIndex/GetIndexInfo',
method: 'post',
data
})
}
/**
* 获取课表信息
* @param {JSON参数} data
*/
export function getStundentPlanStatistical(data) {
return request({
url: '/AppletIndex/GetStundentPlanStatistical',
method: 'post',
data
})
}
/**
* 获取我的课程
* @param {JSON参数} data
*/
export function getCourse(data) {
return request({
url: '/AppletIndex/GetChapterTree',
method: 'post',
data
})
}
\ No newline at end of file
<template>
<view class="flex flex_center_center">
<van-loading
type="spinner"
size="26rpx"
text-size="22rpx"
v-if="state === 'loading'"
>加载中...</van-loading
>
<view class="text" v-if="state === 'more'">--上拉加载更多--</view>
<view class="text" v-if="state === 'none'">--没有更多了--</view>
</view>
</template>
<script>
import { reactive, toRefs, onMounted } from "vue";
export default {
name: "",
props: {
state: String,
},
components: {},
setup(props) {
let data = reactive({});
let methods = {
jumpPage(url) {
uni.navigateTo({
url: url,
});
},
};
onMounted(() => {
// console.log(38, props);
});
return {
...toRefs(data),
...methods,
};
},
};
</script>
<style scoped>
.text {
font-size: 22rpx;
color: #969799;
}
</style>
\ No newline at end of file
<template>
<view class="con">
<view class="cell cell-1 flex flex_between_center mb-30" @click="show">
<view class="flex flex_between_center label">
<view class="dot"></view> 请假类型
</view>
<view class="label-next">{{ data.type }}</view>
</view>
<van-action-sheet
description="请假类型"
cancel-text="取消"
:close-on-click-action="false"
:show="showType"
:actions="actions"
@cancel="onClose"
@select="onSelect"
/>
<view class="cell mb-30">
<view class="cell-2 flex flex_between_center" @click="ShowTimeChoose(1)">
<view class="flex flex_between_center label">
<view class="dot"></view> 开始时间
</view>
<view class="label-next"
>{{ data.startTime }}
<van-icon name="arrow" style="margin-left: 30rpx" />
</view>
</view>
<!-- 时间选择 -->
<van-popup
:show="TimeChoose"
round
position="bottom"
custom-style="height: 50%"
@close="closeTimeChoose"
>
<van-datetime-picker
type="date"
:value="curDate"
@cancel="closeTimeChoose"
@confirm="ConfirmTimeChoose"
/>
</van-popup>
<view class="cell-2 flex flex_between_center" @click="ShowTimeChoose(2)">
<view class="flex flex_between_center label">
<view class="dot"></view> 结束时间
</view>
<view class="label-next"
>{{ data.endTime }}
<van-icon name="arrow" style="margin-left: 30rpx" />
</view>
</view>
<view class="course-time-box">
<van-checkbox-group :value="checkboxVal">
<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)"
>
<van-checkbox
:name="item.name"
checked-color="#00ACF9"
use-icon-slot
>
<view class="checkbox-text">{{ item.text }}</view>
<i
slot="icon"
class="iconfont"
:class="
checkboxVal.find((e) => e == item.name)
? 'icon-radio1 fontcolor'
: 'icon-radio'
"
></i>
</van-checkbox>
</view>
</view>
</van-checkbox-group>
<view
class="more-checkbox"
v-if="checkboxListAll.length > 4"
@click="showAllCheck"
>
<van-icon name="arrow-down" v-if="!isShowAllCheck" />
<van-icon name="arrow-up" v-if="isShowAllCheck" />
</view>
</view>
<view class="cell-2 flex flex_between_center">
<view class="flex flex_between_center label">
<view class="dot"></view> 课时
</view>
<view class="label-next"
>课时
<van-icon name="arrow" style="margin-left: 30rpx" />
</view>
</view>
</view>
<view class="cell cell-3 mb-30">
<view class="flex flex_start_center label" style="margin-bottom: 20rpx">
<view class="dot"></view> 请假事由
</view>
<van-field
:value="data.reason"
placeholder="请输入请假事由"
:border="false"
type="textarea"
@input="reason"
:autosize="{ minHeight: '100rpx' }"
input-class="textareaClass"
/>
</view>
<view class="cell cell-4 mb-30">
<view class="flex flex_start_center label" style="margin-bottom: 25rpx">
<view class="dot"></view> 图片
</view>
<view style="padding-left: 10rpx">
<van-uploader :file-list="fileList" preview-size="120rpx" />
</view>
</view>
<van-button block custom-class="submit-btn">提交</van-button>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
import { getdate } from "../../utils/date";
export default {
setup() {
let data = reactive({
showType: false,
TimeChoose: false,
curDate: new Date().getTime(),
timeType: 1, //1开始时间,2结束时间
checkboxVal: [],
actions: [
{
name: "事假",
},
{
name: "病假",
},
],
data: {
type: "事假",
startTime: getdate(new Date()),
endTime: getdate(new Date()),
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",
},
],
fileList: [
{
url: "https://img.yzcdn.cn/vant/leaf.jpg",
status: "uploading",
message: "上传中",
},
{
url: "https://img.yzcdn.cn/vant/tree.jpg",
status: "failed",
message: "上传失败",
},
{
url: "https://img.yzcdn.cn/vant/tree.jpg",
status: "failed",
message: "上传失败",
},
{
url: "https://img.yzcdn.cn/vant/tree.jpg",
status: "failed",
},
],
});
let methods = {
//显示请假类型弹出层
show() {
data.showType = true;
},
//关闭请假类型弹出层
onClose() {
data.showType = false;
},
//选择请假类型
onSelect(val) {
data.data.type = val.detail.name;
data.showType = false;
},
// 显示日期选择弹出层
ShowTimeChoose(type) {
data.TimeChoose = true;
data.timeType = type;
},
// 关闭日期选择弹出层
closeTimeChoose() {
data.TimeChoose = false;
},
// 选择开始/结束日期
ConfirmTimeChoose(val) {
let date = getdate(val.detail);
if (data.timeType === 1) {
data.data.startTime = date;
} else if (data.timeType === 2) {
data.data.endTime = date;
}
data.TimeChoose = false;
console.log(141, data.data);
},
// 请假理由
reason(val) {
data.data.reason = val.detail;
},
//课程多选
checkChange(val) {
let res = data.checkboxVal.indexOf(val);
if (res != -1) {
data.checkboxVal.splice(res, 1);
} else {
data.checkboxVal.push(val);
}
},
//显示课时
showAllCheck() {
data.isShowAllCheck = !data.isShowAllCheck;
if (data.isShowAllCheck) {
data.checkboxList = JSON.parse(JSON.stringify(data.checkboxListAll));
} else {
data.checkboxList = data.checkboxListAll.slice(0, 4);
}
console.log(249, data.checkboxList);
},
};
onMounted(() => {
data.checkboxList = data.checkboxListAll.slice(0, 4);
});
return {
...toRefs(data),
...methods,
};
},
onLoad() {
uni.setNavigationBarTitle({
title: "请假",
});
},
};
</script>
<style scoped>
.con {
box-sizing: border-box;
font-family: PingFang SC;
padding: 30rpx;
}
.mb-30 {
margin-bottom: 30rpx;
}
.cell {
padding: 0 30rpx;
background-color: #ffffff;
border-radius: 12rpx;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(36, 36, 36, 0.2);
}
.cell-1 {
height: 90rpx;
}
.dot {
width: 6rpx;
height: 6rpx;
background-color: #00acf9;
border-radius: 50%;
margin-right: 10rpx;
}
.label {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.label-next {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
}
.cell-2 {
height: 80rpx;
}
.cell-3 {
padding: 30rpx;
}
/deep/.van-cell {
padding: 0;
}
/deep/.textareaClass {
font-size: 24rpx;
padding-left: 10rpx;
}
.cell-4 {
padding: 30rpx;
margin-bottom: 40rpx;
}
/deep/.submit-btn {
width: 600rpx;
height: 90rpx;
background-color: #00acf9;
border-radius: 12rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 500;
color: #ffffff;
margin: auto;
}
/deep/.van-action-sheet__item {
font-size: 28rpx !important;
}
.course-time-box {
width: 630rpx;
/* height: 280rpx; */
background-color: #f7f8fc;
border-radius: 6rpx;
box-sizing: border-box;
padding: 20rpx;
}
.checkbox-item {
width: 290rpx;
height: 80rpx;
background: #ffffff;
border-radius: 6rpx;
box-sizing: border-box;
padding: 0 20rpx;
margin-bottom: 30rpx;
}
.course-time-box .checkbox-item:nth-child(odd) {
margin-right: 10rpx;
/* background-color: #00acf9; */
}
.more-checkbox {
text-align: center;
color: #00acf9;
}
.checkbox-text {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.fontcolor {
color: #00acf9;
}
</style>
<template>
<view class="con">
<view class="leave-item">
<view class="top flex flex_start_center">
<van-image
round
width="55rpx"
height="55rpx"
src="https://img.yzcdn.cn/vant/cat.jpeg"
style="margin-right: 20rpx"
class="flex flex_start_center"
/>
<view class="grow one_line name">{{ data.name }}的请假</view>
<view class="status">{{ data.status }}</view>
</view>
<view class="flex label-next margin-t-b-15"
><view class="label">请假类型</view>{{ data.type }}</view
>
<view class="flex label-next margin-t-b-15"
><view class="label">开始时间</view>{{ data.startTime }}</view
>
<view class="flex label-next margin-t-b-15"
><view class="label">结束时间</view>{{ data.endTime }}</view
>
<view class="flex label-next margin-t-b-15"
><view class="label">课时</view>{{ data.times }}</view
>
<view class="flex label-next margin-t-b-15"
><view class="label">请假事由</view>{{ data.reason }}</view
>
</view>
<view class="Approval-box">
<view class="flex flex_start_center">
<view class="grow one_line name">{{ data.name }} 发起申请</view>
<view class="date">{{ data.createTime }}</view>
</view>
<view
v-for="(item, index) in Approval"
:key="index"
class="Approval-item"
>
<view class="height-line"></view>
<view class="flex flex_between_center">
<view class="flex flex_start_center">
<van-image
round
width="55rpx"
height="55rpx"
src="https://img.yzcdn.cn/vant/cat.jpeg"
style="margin-right: 20rpx"
class="flex flex_start_center"
/>
<view style="margin-right: 20rpx" class="name">
{{ item.ApprovalMan }}
</view>
<view class="status">
{{ item.status }}
</view>
</view>
<view class="date">{{ item.time }}</view>
</view>
</view>
</view>
<view class="Approval-box">
<view class="flex flex_start_center">
<view class="title">抄送人</view>
<text class="copy-tip">(审批通过后,通知抄送人)</text>
</view>
<view v-for="(item, index) in copy" :key="index" class="copy-item">
<view class="flex flex_between_center">
<view class="flex flex_start_center">
<van-image
round
width="55rpx"
height="55rpx"
src="https://img.yzcdn.cn/vant/cat.jpeg"
style="margin-right: 20rpx"
class="flex flex_start_center"
/>
<view style="margin-right: 20rpx" class="name flex">
<view style="margin-right: 20rpx">抄送人</view>
{{ item.name }}
</view>
</view>
<view class="date">{{ item.time }}</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
export default {
setup() {
let data = reactive({
data: {
name: "李思思",
headerImg: "",
createTime: "2021.08.20",
type: "事假",
startTime: "2021-07-20 09:35",
endTime: "2021-07-20 09:35",
reason: "家中有事",
status: "审批已通过",
times: 2,
},
Approval: [
{
ApprovalMan: "李琴",
img: "",
time: "2021.08.20 09:50",
status: "审核通过",
},
{
ApprovalMan: "李琴",
img: "",
time: "2021.08.20 09:50",
status: "审核通过",
},
],
copy: [
{
name: "校长",
headImg: "",
time: "2021.08.20 09:50",
},
{
name: "校长",
headImg: "",
time: "2021.08.20 09:50",
},
],
});
let methods = {};
return {
...toRefs(data),
...methods,
};
},
onLoad() {
uni.setNavigationBarTitle({
title: "请假",
});
},
};
</script>
<style scoped>
.con {
box-sizing: border-box;
font-family: PingFang SC;
padding: 30rpx;
}
.leave-item {
padding: 20rpx 30rpx;
margin-bottom: 30rpx;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(36, 36, 36, 0.2);
}
.top {
border-bottom: 1rpx solid #e2e2e2;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.name {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.status {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #00df9f;
}
.label {
width: 100rpx;
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
margin-right: 30rpx;
text-align-last: justify;
}
.label-next {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.margin-t-b-15 {
margin-top: 15rpx;
margin-bottom: 15rpx;
}
.Approval-box {
padding: 20rpx 30rpx;
margin-bottom: 30rpx;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(36, 36, 36, 0.2);
}
.date {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
}
.Approval-item {
height: 115rpx;
}
.height-line {
height: 60rpx;
width: 2rpx;
margin-left: 26rpx;
background-color: #e2e2e2;
}
.title {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.copy-tip {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: bold;
color: #999999;
}
.copy-item {
margin-top: 30rpx;
}
</style>
<template>
<view class="con">
<view
v-for="(item, index) in data"
:key="index"
class="leave-item"
@click="jumpPage"
>
<view class="top flex flex_start_center">
<van-image
round
width="55rpx"
height="55rpx"
src="https://img.yzcdn.cn/vant/cat.jpeg"
style="margin-right: 20rpx"
class="flex flex_start_center"
/>
<view class="grow one_line name">{{ item.name }}</view>
<view class="date">{{ item.createTime }}</view>
</view>
<view class="flex flex_between_center margin-t-b-15">
<view class="flex label-next"
><view class="label">请假类型</view>{{ item.type }}</view
>
<view class="status">{{ item.status }}</view>
</view>
<view class="flex label-next margin-t-b-15"
><view class="label">开始时间</view>{{ item.startTime }}</view
>
<view class="flex label-next margin-t-b-15"
><view class="label">结束时间</view>{{ item.endTime }}</view
>
<view class="flex label-next margin-t-b-15"
><view class="label">请假事由</view>{{ item.reason }}</view
>
</view>
</view>
</template>
<script>
import {
ref,
reactive,
toRefs,
toRef,
getCurrentInstance,
watch,
computed,
onMounted,
} from "vue";
export default {
setup() {
let data = reactive({
data: [
{
name: "李思思的请假",
headerImg: "",
createTime: "2021.08.20",
type: "事假",
startTime: "2021-07-20 09:35",
endTime: "2021-07-20 09:35",
reason: "家中有事",
status: "审批已通过",
},
{
name: "李思思的请假",
headerImg: "",
createTime: "2021.08.20",
type: "事假",
startTime: "2021-07-20 09:35",
endTime: "2021-07-20 09:35",
reason: "家中有事",
status: "审批已通过",
},
],
msg: {
pageIndex: 1,
pageSize: 20,
},
});
let methods = {
jumpPage() {
uni.navigateTo({
url: "/pages/course/askForLeaveDetail",
});
},
};
onMounted(() => {
console.log("12343434");
});
return {
...toRefs(data),
...methods,
};
},
onLoad() {
uni.setNavigationBarTitle({
title: "请假",
});
},
};
</script>
<style scoped>
.con {
box-sizing: border-box;
font-family: PingFang SC;
padding: 30rpx;
}
.leave-item {
padding: 20rpx 30rpx;
margin-bottom: 30rpx;
box-shadow: 0rpx 4rpx 10rpx 0rpx rgba(36, 36, 36, 0.2);
}
.top {
border-bottom: 1rpx solid #e2e2e2;
padding-bottom: 20rpx;
margin-bottom: 20rpx;
}
.name {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: bold;
color: #111111;
}
.date {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
}
.status {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #00df9f;
}
.label {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #999999;
margin-right: 30rpx;
}
.label-next {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 500;
color: #111111;
}
.margin-t-b-15 {
margin-top: 15rpx;
margin-bottom: 15rpx;
}
</style>
@font-face {
font-family: "iconfont"; /* Project id 2734547 */
src: url('//at.alicdn.com/t/font_2734547_pm8b8gxb0qp.woff2?t=1628578983453') format('woff2'),
url('//at.alicdn.com/t/font_2734547_pm8b8gxb0qp.woff?t=1628578983453') format('woff'),
url('//at.alicdn.com/t/font_2734547_pm8b8gxb0qp.ttf?t=1628578983453') format('truetype');
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-Text1:before {
content: "\e71c";
}
.icon-password:before {
content: "\e63b";
}
.icon-radio:before {
content: "\e7c9";
}
.icon-user2:before {
content: "\e654";
}
.icon-radio1:before {
content: "\e600";
}
//获取设备信息
export let getSystemInfo = (callback) => {
uni.getSystemInfo({
success: (res) => {
callback(res)
}
})
}
\ 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