移动端V1.0
This commit is contained in:
253
pages/dormitory/apply.vue
Normal file
253
pages/dormitory/apply.vue
Normal file
@@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="form-item">
|
||||
<label><text class="tip">*</text>申请类型</label>
|
||||
<picker :range="options" v-model="selectedOptionIndex" @change="onPickerChange">
|
||||
<view class="uni-input">
|
||||
<text class="val">{{options[selectedOptionIndex] || '请选择类型'}}</text>
|
||||
<uni-icons type="down" size="16" color="#202020"></uni-icons>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<label><text class="tip">*</text>申请理由</label>
|
||||
<textarea class="main-his" v-model="deeds" maxlength="500" placeholder="请输入申请理由"></textarea>
|
||||
</view>
|
||||
<!-- 留宿时间 根据选择的申请类型来决定是否显示-->
|
||||
<view class="form-item" v-if="selectedOptionIndex === 1">
|
||||
<label><text class="tip">*</text>留宿开始时间</label>
|
||||
<uni-datetime-picker type="date" :clear-icon="false" v-model="beginData" @maskClick="maskClick"
|
||||
:border="false" />
|
||||
</view>
|
||||
<view class="form-item" v-if="selectedOptionIndex === 1">
|
||||
<label><text class="tip">*</text>留宿结束时间</label>
|
||||
<uni-datetime-picker type="date" :clear-icon="false" v-model="endData" @maskClick="maskClick"
|
||||
:border="false" />
|
||||
</view>
|
||||
<!-- <view class="form-item" v-if="selectedOptionIndex === 1">
|
||||
<text class="label">留宿开始时间:</text>
|
||||
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="date" :clear-icon="false" v-model="beginData" @maskClick="maskClick"
|
||||
:border="false" />
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="form-item" v-if="selectedOptionIndex === 1">
|
||||
<text class="label">留宿结束时间:</text>
|
||||
<view class="example-body">
|
||||
<uni-datetime-picker type="date" :clear-icon="false" v-model="endData" @maskClick="maskClick"
|
||||
:border="false" />
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- 按钮 -->
|
||||
<view class="btn">
|
||||
<button @click="doApply" :disabled="isSubmitting">提交申请</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
addApplication
|
||||
} from "@/api/dms/index.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isSubmitting: false, //表单提交标志位
|
||||
options: ['调宿申请', '退宿申请'], // 奖项选项
|
||||
selectedOptionIndex: -1, //
|
||||
deeds: "",
|
||||
beginData: '',
|
||||
endData: ''
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async doApply() {
|
||||
if (this.selectedOptionIndex == -1) {
|
||||
uni.showToast({
|
||||
title: "请选择申请类型",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.deeds == "") {
|
||||
uni.showToast({
|
||||
title: "请输入申请理由",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
let applyType = this.options[this.selectedOptionIndex];
|
||||
let sdata = {};
|
||||
if (applyType == "调宿申请") {
|
||||
sdata = {
|
||||
type: 1,
|
||||
reason: this.deeds
|
||||
};
|
||||
} else {
|
||||
sdata = {
|
||||
type: 2,
|
||||
reason: this.deeds
|
||||
};
|
||||
}
|
||||
this.isSubmitting = true; // 设置为正在提交
|
||||
let res = await addApplication(sdata);
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "success"
|
||||
});
|
||||
this.isSubmitting = false; // 设置为正在提交
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg,
|
||||
icon: "error"
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 当选择发生变化时触发
|
||||
onPickerChange(event) {
|
||||
this.selectedOptionIndex = event.detail.value;
|
||||
console.log(this.selectedOptionIndex);
|
||||
},
|
||||
// 政治面貌选择改变时触发
|
||||
onPoliticalChange(event) {
|
||||
this.selectedPoliticalIndex = event.detail.value;
|
||||
},
|
||||
maskClick(e) {
|
||||
console.log('maskClick事件:', e);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.container {
|
||||
background-color: #F5F5F7;
|
||||
padding: 10px;
|
||||
padding-bottom: 80px;
|
||||
height:calc(100vh - 44px);
|
||||
}
|
||||
.form-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 22rpx 40rpx;
|
||||
background-color: white;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.tip {
|
||||
color: red;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: 20rpx;
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
input {
|
||||
border: 1px solid #E1E1E1;
|
||||
border-radius: 10rpx;
|
||||
height: 70rpx;
|
||||
padding-left: 30rpx;
|
||||
|
||||
.input-placeholder {
|
||||
color: #b6b6b6;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
border: 1px solid #E1E1E1;
|
||||
border-radius: 10rpx;
|
||||
width: 100%;
|
||||
height:250rpx;
|
||||
padding: 30rpx;
|
||||
&.main-his{
|
||||
height:350rpx;
|
||||
}
|
||||
.input-placeholder {
|
||||
color: #b6b6b6;
|
||||
}
|
||||
}
|
||||
|
||||
picker {
|
||||
border: 1px solid #E1E1E1;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.uni-input {
|
||||
display: flex;
|
||||
color: #797979;
|
||||
|
||||
.val {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// .form-item {
|
||||
// width: 95%;
|
||||
// height: 80rpx;
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// margin-bottom: 20rpx;
|
||||
// justify-content: space-between;
|
||||
// border-bottom: 1px solid #ededee;
|
||||
// }
|
||||
|
||||
// .form-text {
|
||||
// width: 95%;
|
||||
// margin-bottom: 20rpx;
|
||||
// }
|
||||
|
||||
// .txt {
|
||||
// margin-top: 20rpx;
|
||||
// }
|
||||
|
||||
// .label {
|
||||
// text-align: right;
|
||||
// margin-right: 20rpx;
|
||||
// }
|
||||
|
||||
// .select {
|
||||
// color: #888889;
|
||||
// }
|
||||
|
||||
// .uni-input {
|
||||
// color: #888889;
|
||||
// text-align: right;
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// .time {
|
||||
// display: flex;
|
||||
// align-items: center;
|
||||
// justify-content: center;
|
||||
// }
|
||||
|
||||
.btn {
|
||||
padding: 10px;
|
||||
display: flex;
|
||||
background: white;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
|
||||
button {
|
||||
flex: 1;
|
||||
background-color: #1890FF;
|
||||
color: white;
|
||||
|
||||
&[disabled] {
|
||||
opacity: 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</style>
|
326
pages/dormitory/daily.vue
Normal file
326
pages/dormitory/daily.vue
Normal file
@@ -0,0 +1,326 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="Userinformation">
|
||||
<view class="list">
|
||||
<view class="sm-list">
|
||||
<text>宿舍</text>
|
||||
<text>{{dorm}}</text>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
<view class="form-item">
|
||||
<label><text>*</text>打卡图片</label>
|
||||
<view class="upload-img" v-if="tempImgs.length==0" @tap="uploadImg">
|
||||
<view class="add">
|
||||
+ 添加照片
|
||||
</view>
|
||||
<view class="tip">
|
||||
图片要求:最多3张,上限5MB
|
||||
</view>
|
||||
<view class="img-list">
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="img-list" v-else>
|
||||
<view class="imgs">
|
||||
<view class="img" v-for="(img,index) in tempImgs">
|
||||
<image :src="img.path" @tap="previewImg(tempImgs)" mode="aspectFill"></image>
|
||||
<text class="remove" @tap="onRemoveImg(index,img.path)">X</text>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="tempImgs.length<3" class="btn" @tap="uploadImg">
|
||||
+ 添加照片
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button type="primary" @click="doCard">打卡</button>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
getOwnDorm,
|
||||
doCard
|
||||
} from "@/api/dms/daily.js";
|
||||
import {
|
||||
uploadImg,
|
||||
previewImg,
|
||||
removeImg
|
||||
} from "@/utils/uploadImg.js";
|
||||
import uploadFile from "@/plugins/upload.js";
|
||||
import {
|
||||
checkPic
|
||||
} from "@/utils/checkPic.js";
|
||||
import {
|
||||
baseUrl
|
||||
} from "@/config.js";
|
||||
import {
|
||||
isEmpty
|
||||
} from "@/api/helpFunc/index.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dorm: "",
|
||||
formData: {
|
||||
photo: ""
|
||||
},
|
||||
tempImgs: [],
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getOwnDorm();
|
||||
},
|
||||
methods: {
|
||||
async doCard() {
|
||||
let sdata = {
|
||||
...this.formData
|
||||
};
|
||||
if (isEmpty(sdata.photo)) {
|
||||
uni.showToast({
|
||||
mask: true,
|
||||
title: "请上传打卡图片",
|
||||
icon: "none"
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.showLoading({
|
||||
mask: true,
|
||||
title: '加载中',
|
||||
});
|
||||
let res = await doCard(sdata);
|
||||
uni.hideLoading();
|
||||
if (res.code == 200) {
|
||||
uni.showToast({
|
||||
mask: true,
|
||||
icon: "success",
|
||||
title: res.msg
|
||||
});
|
||||
}
|
||||
},
|
||||
async getOwnDorm() {
|
||||
uni.showLoading({
|
||||
title: '加载中',
|
||||
mask: true,
|
||||
});
|
||||
let res = await getOwnDorm();
|
||||
uni.hideLoading();
|
||||
if (res.code == 200) {
|
||||
let data = {
|
||||
...res.data
|
||||
};
|
||||
this.dorm = data.park_name + data.building_name + data.room_no;
|
||||
}
|
||||
},
|
||||
uploadImg() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sourceType: ['camera'],
|
||||
success: async (img) => {
|
||||
let bool = await checkPic(img.tempFiles[0]);
|
||||
if (bool) {
|
||||
uploadFile('/common/upload', img.tempFilePaths[0]).then((res) => {
|
||||
if (this.formData.photo !== "") {
|
||||
this.formData.photo = this.formData.photo + "," +
|
||||
JSON.parse(res)
|
||||
.fileName;
|
||||
} else {
|
||||
this.formData.photo = JSON.parse(res).fileName;
|
||||
}
|
||||
this.tempImgs.push({
|
||||
path: baseUrl + JSON.parse(res).fileName
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
onRemoveImg(index, path) {
|
||||
this.tempImgs.splice(index, 1);
|
||||
let newImgs = this.tempImgs.filter(fileName => fileName.path !== path);
|
||||
newImgs = newImgs.map(img => img.path.replace(baseUrl, ''))
|
||||
newImgs = newImgs.join(",");
|
||||
this.formData.photo = newImgs;
|
||||
},
|
||||
previewImg(imgs) {
|
||||
previewImg(imgs);
|
||||
}
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.Userinformation {
|
||||
margin-bottom: 10rpx;
|
||||
|
||||
.list {
|
||||
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
width: 100%;
|
||||
|
||||
|
||||
|
||||
.sm-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
width: 722rpx;
|
||||
height: 100rpx;
|
||||
border-bottom: 1px solid #EFEFEF;
|
||||
|
||||
text:nth-child(1) {
|
||||
|
||||
color: #0F0F0F;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
|
||||
color: #575757;
|
||||
}
|
||||
|
||||
.password {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
width: 200rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
.form-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 22rpx 40rpx;
|
||||
background-color: white;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
&.tip {
|
||||
justify-content: center;
|
||||
|
||||
text:first-child {
|
||||
color: red;
|
||||
}
|
||||
|
||||
text:last-child {
|
||||
margin-top: 10rpx;
|
||||
color: #FFBA00;
|
||||
}
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: red;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
label {
|
||||
margin-bottom: 20rpx;
|
||||
display: inline-block;
|
||||
|
||||
text {
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
textarea {
|
||||
height: 200rpx;
|
||||
border: 1px solid #E1E1E1;
|
||||
padding: 20rpx;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
input {
|
||||
border: 1px solid #E1E1E1;
|
||||
border-radius: 10rpx;
|
||||
height: 70rpx;
|
||||
padding-left: 30rpx;
|
||||
}
|
||||
|
||||
picker {
|
||||
border: 1px solid #E1E1E1;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
padding: 0 30rpx;
|
||||
|
||||
.uni-input {
|
||||
display: flex;
|
||||
color: #797979;
|
||||
|
||||
.val {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.upload-img {
|
||||
border: 1px solid #E1E1E1;
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
|
||||
.tip {
|
||||
margin-top: 15rpx;
|
||||
color: #7a7a7a;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.img-list {
|
||||
border: 1px solid #D8D8D8;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.imgs {
|
||||
padding: 22rpx;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
.img {
|
||||
position: relative;
|
||||
width: 160rpx;
|
||||
height: 170rpx;
|
||||
margin-bottom: 15rpx;
|
||||
margin-right: 15rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.remove {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
color: white;
|
||||
background-color: rgba(0, 0, 0, 0.4);
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.btn {
|
||||
border-top: 1px solid #D8D8D8;
|
||||
height: 100rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
285
pages/dormitory/index.vue
Normal file
285
pages/dormitory/index.vue
Normal file
@@ -0,0 +1,285 @@
|
||||
<template>
|
||||
<view class="award">
|
||||
<view class="top-bar">
|
||||
<view class="tool">
|
||||
<view class="left" @tap="applydormitory">
|
||||
<svg t="1723014673503" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="1470" width="100" height="100">
|
||||
<path
|
||||
d="M0 0m170.666667 0l682.666666 0q170.666667 0 170.666667 170.666667l0 682.666666q0 170.666667-170.666667 170.666667l-682.666666 0q-170.666667 0-170.666667-170.666667l0-682.666666q0-170.666667 170.666667-170.666667Z"
|
||||
fill="#F3F7FF" p-id="1471"></path>
|
||||
<path
|
||||
d="M826.88 566.613333c5.589333 0 10.496 2.645333 14.592 7.808a29.312 29.312 0 0 1 6.144 18.56v142.634667a41.514667 41.514667 0 1 1-83.072 0v-63.744H266.837333v62.592a42.666667 42.666667 0 0 1-42.666666 42.666667h-3.968a42.666667 42.666667 0 0 1-42.666667-42.666667V277.333333c0-7.168 2.133333-13.354667 6.186667-18.517333 4.138667-5.290667 8.96-7.808 14.592-7.808h47.786666c5.632 0 10.538667 2.602667 14.592 7.808a29.056 29.056 0 0 1 6.144 18.517333v289.322667H826.88z m20.650667-31.402666v-25.344c0-16.981333-3.84-34.133333-28.245334-63.744-24.32-29.696-61.866667-44.117333-96.170666-44.117334H494.933333a18.432 18.432 0 0 0-14.592 7.509334 27.306667 27.306667 0 0 0-6.144 17.834666v107.861334h373.333334z m-474.709334 0a65.493333 65.493333 0 1 0 0-130.986667 65.493333 65.493333 0 0 0 0 130.986667z"
|
||||
fill="#1890FF" p-id="1472"></path>
|
||||
</svg>
|
||||
申请
|
||||
</view>
|
||||
<view class="right" @tap="toPlan">
|
||||
<svg t="1723014605442" class="icon" viewBox="0 0 1024 1024" version="1.1"
|
||||
xmlns="http://www.w3.org/2000/svg" p-id="1215" width="60" height="60">
|
||||
<path
|
||||
d="M665 81v105H369V81h296m20-80H349c-33.1 0-60 26.9-60 60v145c0 33.1 26.9 60 60 60h336c33.1 0 60-26.9 60-60V61c0-33.1-26.9-60-60-60zM298.5 689c-37.2 0-67.5-30.3-67.5-67.5s30.3-67.5 67.5-67.5 67.5 30.3 67.5 67.5-30.3 67.5-67.5 67.5z m0-80c-6.9 0-12.5 5.6-12.5 12.5s5.6 12.5 12.5 12.5 12.5-5.6 12.5-12.5-5.6-12.5-12.5-12.5zM298.5 884c-37.2 0-67.5-30.3-67.5-67.5s30.3-67.5 67.5-67.5 67.5 30.3 67.5 67.5-30.3 67.5-67.5 67.5z m0-80c-6.9 0-12.5 5.6-12.5 12.5s5.6 12.5 12.5 12.5 12.5-5.6 12.5-12.5-5.6-12.5-12.5-12.5zM642 661H477c-22.1 0-40-17.9-40-40s17.9-40 40-40h165c22.1 0 40 17.9 40 40s-17.9 40-40 40zM762 859H477c-22.1 0-40-17.9-40-40s17.9-40 40-40h285c22.1 0 40 17.9 40 40s-17.9 40-40 40zM762 469H477c-22.1 0-40-17.9-40-40s17.9-40 40-40h285c22.1 0 40 17.9 40 40s-17.9 40-40 40z"
|
||||
fill="#1890FF" p-id="1216"></path>
|
||||
<path
|
||||
d="M863 177v767H171V177h118v9c0 44.2 35.8 80 80 80h296c44.2 0 80-35.8 80-80v-9h118m20-80H665v89H369V97H151c-33.1 0-60 26.9-60 60v807c0 33.1 26.9 60 60 60h732c33.1 0 60-26.9 60-60V157c0-33.1-26.9-60-60-60z"
|
||||
fill="#1890FF" p-id="1217"></path>
|
||||
<path
|
||||
d="M298.8 493.6c-10.2 0-20.4-3.9-28.2-11.6l-35.8-35.6c-15.7-15.6-15.8-40.9-0.2-56.6 15.6-15.7 40.9-15.8 56.6-0.2l7.6 7.6 52-51.6c15.7-15.6 41-15.5 56.6 0.2 15.6 15.7 15.5 41-0.2 56.6L327 482c-7.8 7.7-18 11.6-28.2 11.6z"
|
||||
fill="#1890FF" p-id="1218"></path>
|
||||
</svg>
|
||||
调宿计划
|
||||
</view>
|
||||
</view>
|
||||
<view>
|
||||
当前宿舍:{{now_dorm}}
|
||||
</view>
|
||||
</view>
|
||||
<!-- 学生信息结束 -->
|
||||
<scroll-view scroll-y="true" @scrolltolower="scrolltolower">
|
||||
<view class="awardList">
|
||||
<!-- <view class="List" v-for="(item,index) in 10" :key="index">
|
||||
<view class="awardListleft">
|
||||
<text class="title">调宿申请</text>
|
||||
<text>姓名:sophie</text>
|
||||
<text>学号:2013007005</text>
|
||||
<text>申请理由:与黑色有不糊</text>
|
||||
</view>
|
||||
<view class="awardListright">
|
||||
<uni-tag :inverted="true" :text="getStatus(item.status)" type="success" />
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="List" v-for="(item,index) in awardList" :key="index">
|
||||
<view class="awardListleft">
|
||||
<text class="title"> {{item.type == "1" ? "调宿申请" : "退宿申请"}}</text>
|
||||
<text>姓名:{{item.stuName}}</text>
|
||||
<text>学号:{{item.stuNo}}</text>
|
||||
<text>申请理由:{{item.reason}}</text>
|
||||
</view>
|
||||
<view class="awardListright">
|
||||
<uni-tag :inverted="true" :text="getStatus(item.status)" type="success" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="empty" v-if="awardList.length==0&&topLoading==false">
|
||||
<image src="@/static/empty.png" mode="widthFix"></image>
|
||||
暂时没有数据
|
||||
</view>
|
||||
<view class="loading-more-top" v-if="topLoading">
|
||||
<uni-load-more style="padding-top: 90px;" status="loading" />
|
||||
</view>
|
||||
<view class="loading-more" v-if="loading">
|
||||
<uni-load-more status="loading" />
|
||||
</view>
|
||||
<view class="no-more" v-if="!loading&&awardList.length!=0">
|
||||
到底啦~~
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
import {
|
||||
getOwnLog,
|
||||
listOwnApply,
|
||||
getStatus
|
||||
} from "@/api/dms/index.js";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
now_dorm: "暂无",
|
||||
awardList: [],
|
||||
status_list: [],
|
||||
loading: false,
|
||||
topLoading: true,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
async onShow() {
|
||||
await this.getDictStatus();
|
||||
await this.getOwnLog();
|
||||
await this.listOwnApply();
|
||||
},
|
||||
methods: {
|
||||
scrolltolower() {
|
||||
if (this.queryParams.pageNum < this.totalPages) {
|
||||
this.queryParams.pageNum++;
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.listOwnApply()
|
||||
}, 1000)
|
||||
} else {
|
||||
|
||||
}
|
||||
},
|
||||
async getDictStatus() {
|
||||
let res = await getStatus();
|
||||
if (res.code == 200) {
|
||||
this.status_list = [...res.data];
|
||||
}
|
||||
},
|
||||
getStatus(status) {
|
||||
let data = this.status_list.filter(x => x.dictValue == status.toString());
|
||||
if (data != null && data.length != 0) {
|
||||
return data[0].dictLabel;
|
||||
} else {
|
||||
return "无";
|
||||
}
|
||||
},
|
||||
|
||||
async listOwnApply() {
|
||||
let res = await listOwnApply(this.queryParams);
|
||||
if (res.code == 200) {
|
||||
this.loading = false;
|
||||
if (this.queryParams.pageNum == 1) {
|
||||
this.awardList = res.rows;
|
||||
} else {
|
||||
this.awardList = this.awardList.concat(res.rows); // 否则追加新数据到列表中
|
||||
}
|
||||
this.totalPages = Math.ceil(res.total / this.queryParams.pageSize);
|
||||
this.topLoading = false;
|
||||
}
|
||||
},
|
||||
async getOwnLog() {
|
||||
let res = await getOwnLog();
|
||||
if (res.code == 200) {
|
||||
let data = {
|
||||
...res.data
|
||||
};
|
||||
if (data.dormStu != null) {
|
||||
let temp = {
|
||||
...data.dormStu
|
||||
};
|
||||
this.now_dorm = temp.campusName + " " + temp.parkName + " " + temp.buildingName + " " + temp
|
||||
.floorName + "层" + temp.roomNo;
|
||||
}
|
||||
}
|
||||
},
|
||||
applydormitory() {
|
||||
uni.navigateTo({
|
||||
url: "./apply"
|
||||
})
|
||||
},
|
||||
toPlan() {
|
||||
uni.navigateTo({
|
||||
url: "./plan"
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.award {
|
||||
background-color: #F5F5F7;
|
||||
|
||||
.top-bar {
|
||||
background-color: white;
|
||||
position: fixed;
|
||||
z-index: 99;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 80rpx;
|
||||
padding: 20rpx;
|
||||
color: #1890FF;
|
||||
|
||||
.tool {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 15rpx 0 20rpx;
|
||||
|
||||
.left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
svg {
|
||||
margin-right: 8rpx;
|
||||
width: 50rpx;
|
||||
height: 50rpx;
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
|
||||
.right {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
svg {
|
||||
margin-right: 8rpx;
|
||||
width: 35rpx;
|
||||
height: 35rpx;
|
||||
color: red;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&>view:last-child {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
scroll-view {
|
||||
height: calc(100vh - 45px);
|
||||
|
||||
.no-more {
|
||||
text-align: center;
|
||||
color: gray;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: 200rpx;
|
||||
color: #9E9E9E;
|
||||
font-size: 36rpx;
|
||||
|
||||
image {
|
||||
width: 250rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.awardList {
|
||||
margin-top: 200rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
|
||||
|
||||
.List {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 90%;
|
||||
background-color: white;
|
||||
border-radius: 10rpx;
|
||||
padding: 40rpx 30rpx 30rpx 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.awardListleft {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.title {
|
||||
font-size: 40rpx;
|
||||
|
||||
color: black;
|
||||
width: 400rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
width: 400rpx;
|
||||
padding-bottom: 20rpx;
|
||||
color: #9C9C9C;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
171
pages/dormitory/plan.vue
Normal file
171
pages/dormitory/plan.vue
Normal file
@@ -0,0 +1,171 @@
|
||||
<template>
|
||||
<view class="award">
|
||||
<scroll-view scroll-y="true" @scrolltolower="scrolltolower">
|
||||
<view class="awardList">
|
||||
<view class="List" v-for="(item,index) in awardList" :key="item.index">
|
||||
<view class="awardListleft">
|
||||
<text class="title">任务类型: {{item.taskType == "1" ? "调宿申请" : "退宿申请"}}</text>
|
||||
<text>姓名:{{item.stuName}}</text>
|
||||
<text>学号:{{item.stuNo}}</text>
|
||||
<text class="home">旧宿舍:{{item.oldDorm}}</text>
|
||||
<text class="home">新宿舍:{{item.newDorm}}</text>
|
||||
<text class="home">预执行时间:{{item.taskWant}}</text>
|
||||
<text class="home">任务状态:<uni-tag :inverted="true" :text="getStatus(item.taskStatus)"
|
||||
type="success" /></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="empty" v-if="awardList.length==0&&topLoading==false">
|
||||
<image src="@/static/empty.png" mode="widthFix"></image>
|
||||
暂时没有数据
|
||||
</view>
|
||||
<view class="loading-more-top" v-if="topLoading">
|
||||
<uni-load-more style="padding-top: 90px;" status="loading" />
|
||||
</view>
|
||||
<view class="loading-more" v-if="loading">
|
||||
<uni-load-more status="loading" />
|
||||
</view>
|
||||
<view class="no-more" v-if="!loading&&awardList.length!=0">
|
||||
到底啦~~
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listOwnTask,
|
||||
getTaskStatus
|
||||
} from "@/api/dms/index.js";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
awardList: [],
|
||||
task_status_list: [],
|
||||
loading: false,
|
||||
topLoading: true,
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
},
|
||||
}
|
||||
},
|
||||
async onShow() {
|
||||
await this.getTaskStatus();
|
||||
await this.listOwnTask();
|
||||
},
|
||||
methods: {
|
||||
scrolltolower() {
|
||||
if (this.queryParams.pageNum < this.totalPages) {
|
||||
this.queryParams.pageNum++;
|
||||
this.loading = true;
|
||||
setTimeout(() => {
|
||||
this.listOwnTask()
|
||||
}, 1000)
|
||||
} else {}
|
||||
},
|
||||
async getTaskStatus() {
|
||||
let res = await getTaskStatus();
|
||||
if (res.code == 200) {
|
||||
this.task_status_list = [...res.data]
|
||||
}
|
||||
},
|
||||
getStatus(status) {
|
||||
let data = this.task_status_list.filter(x => x.dictValue == status.toString());
|
||||
if (data != null && data.length != 0) {
|
||||
return data[0].dictLabel;
|
||||
} else {
|
||||
return "无";
|
||||
}
|
||||
},
|
||||
async listOwnTask() {
|
||||
let res = await listOwnTask(this.queryParams);
|
||||
if (res.code == 200) {
|
||||
this.loading = false;
|
||||
if (this.queryParams.pageNum == 1) {
|
||||
this.awardList = res.data;
|
||||
} else {
|
||||
this.awardList = this.awardList.concat(res.data); // 否则追加新数据到列表中
|
||||
}
|
||||
this.totalPages = Math.ceil(res.total / this.queryParams.pageSize);
|
||||
this.topLoading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<style lang="less" scoped>
|
||||
.award {
|
||||
width: 100%;
|
||||
min-height: 100vh;
|
||||
background-color: #F5F5F7;
|
||||
|
||||
scroll-view {
|
||||
height: calc(100vh - 45px);
|
||||
|
||||
.no-more {
|
||||
text-align: center;
|
||||
color: gray;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
.empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin-top: 200rpx;
|
||||
color: #9E9E9E;
|
||||
font-size: 36rpx;
|
||||
|
||||
image {
|
||||
width: 250rpx;
|
||||
margin-bottom: 50rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.awardList {
|
||||
width: 100%;
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
|
||||
.List {
|
||||
// align-items: center;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
width: 90%;
|
||||
background-color: white;
|
||||
border-radius: 10rpx;
|
||||
padding: 40rpx 30rpx 30rpx 30rpx;
|
||||
margin-bottom: 30rpx;
|
||||
|
||||
.awardListleft {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
.title {
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
color: black;
|
||||
width: 600rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.home {
|
||||
width: 600rpx;
|
||||
}
|
||||
|
||||
text {
|
||||
padding-bottom: 10rpx;
|
||||
color: #9C9C9C;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</style>
|
Reference in New Issue
Block a user