Commit a48bfcc4 by liuzhanxin

列表加载

parent bc67f334
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
}, },
dataList: [], dataList: [],
upOption: { upOption: {
use: false, // 是否启用上拉加载; 默认true use: true, // 是否启用上拉加载; 默认true
}, },
showProject:false, showProject:false,
showDrawer:false, showDrawer:false,
...@@ -118,12 +118,23 @@ ...@@ -118,12 +118,23 @@
uni.$off('refreshTaskList', function(data) {}) uni.$off('refreshTaskList', function(data) {})
}, },
/*下拉刷新的回调 */ /*下拉刷新的回调 */
downCallback() { downCallback() {
this.mescroll.endSuccess(); this.pageIndex = 0;
if(this.showProject){
this.loadData("project");
}else{
this.loadData("lab");
}
}, },
/*上拉加载的回调 */ /*上拉加载的回调 */
upCallback(page) { upCallback(page) {
console.log("upppppppppp")
this.pageIndex ++ ;
if(this.showProject){
this.loadData("project");
}else{
this.loadData("lab");
}
}, },
onNavigationBarButtonTap() { onNavigationBarButtonTap() {
if(this.showDrawer == false){ if(this.showDrawer == false){
...@@ -186,8 +197,9 @@ ...@@ -186,8 +197,9 @@
var data = JSON.parse(res.data.rowDatas); var data = JSON.parse(res.data.rowDatas);
console.log(data); console.log(data);
data.map((setting)=>{ data.map((setting)=>{
setting.startTime = setting.startDate.split(" ")[0]; console.log(setting.startDate)
setting.endTime = setting.endDate.split(" ")[0]; setting.startTime = setting.startDate?setting.startDate.split(" ")[0]:"";
setting.endTime = setting.endDate?setting.endDate.split(" ")[0]:"";
var projects = setting.projects; var projects = setting.projects;
var projectName = "" var projectName = ""
if(projects&&projects.length>0){ if(projects&&projects.length>0){
...@@ -217,7 +229,12 @@ ...@@ -217,7 +229,12 @@
setting.locationName = locationName == ""?"暂无":locationName setting.locationName = locationName == ""?"暂无":locationName
return setting return setting
}) })
this.dataList = data; if(this.pageIndex == 0){
this.dataList = data;
}else{
this.dataList = data.concat(this.dataList);
}
this.mescroll.endSuccess(data.length, true);
} }
}) })
}, },
...@@ -267,6 +284,7 @@ ...@@ -267,6 +284,7 @@
// }, // },
showProjectList(){ showProjectList(){
this.showProject = true this.showProject = true
this.pageIndex = 0;
this.loadData("project"); this.loadData("project");
}, },
showLabList(){ showLabList(){
......
...@@ -35,7 +35,8 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue" ...@@ -35,7 +35,8 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue"
submitShow:false, submitShow:false,
description:"", description:"",
labInfo:{}, labInfo:{},
courseInfo:[] courseInfo:[],
canSubmit:true
} }
}, },
onLoad(option) { onLoad(option) {
...@@ -51,6 +52,11 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue" ...@@ -51,6 +52,11 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue"
}, },
methods: { methods: {
onSubmitClick(){ onSubmitClick(){
var that = this;
if(!this.canSubmit){
return
}
this.canSubmit = false;
var timetableUuids = []; var timetableUuids = [];
this.calendarInfo.map((opt)=>{ this.calendarInfo.map((opt)=>{
if(opt.checked){ if(opt.checked){
...@@ -78,6 +84,7 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue" ...@@ -78,6 +84,7 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue"
isClick:false isClick:false
}); });
setTimeout(()=>{ setTimeout(()=>{
that.canSubmit = true
uni.navigateBack({ uni.navigateBack({
}) })
},1000) },1000)
...@@ -86,6 +93,7 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue" ...@@ -86,6 +93,7 @@ import FormAlert from "@/components/form-alert/h-form-alert.vue"
},1500) },1500)
}else{ }else{
var errmessage = res.data.message; var errmessage = res.data.message;
that.canSubmit = true
this.$refs.popup.open({ this.$refs.popup.open({
type:'err', type:'err',
content:errmessage, content:errmessage,
......
...@@ -56,11 +56,14 @@ ...@@ -56,11 +56,14 @@
<text class="datacontent">{{endTime !=""?endTime:"请选择开始时间"}}</text> <text class="datacontent">{{endTime !=""?endTime:"请选择开始时间"}}</text>
<image class="tip" src="../../static/common/arrow_right_gray.png"> <image class="tip" src="../../static/common/arrow_right_gray.png">
</view> </view>
</view> </view>
<view style="display: flex;justify-content: center;align-items: center;width: 100%;margin-top: 80px;"> <view style="display: flex;justify-content: center;align-items: center;align-self: flex-end;width: 100%;position: absolute;bottom:0">
<view hover-class="submithover" @click="onSubmitClick" class="submit-button"> <view hover-class="submithover" @click="onClearClick" class="clear-button">
<text class="submittext">提交</text> <view><text class="cleartext">清空</text></view>
</view> </view>
<view hover-class="submithover" @click="onSubmitClick" class="submit-button">
<view><text class="submittext">确定</text></view>
</view>
</view> </view>
</view> </view>
</view> </view>
...@@ -139,7 +142,8 @@ ...@@ -139,7 +142,8 @@
methods: { methods: {
closeDrawer() {}, closeDrawer() {},
close() { close() {
this.showDrawer = false; this.showDrawer = false;
// this.
}, },
onNavigationBarButtonTap() { onNavigationBarButtonTap() {
this.showDrawer = true; this.showDrawer = true;
...@@ -323,6 +327,13 @@ ...@@ -323,6 +327,13 @@
} }
this.showDrawer = false; this.showDrawer = false;
this.loadData(); this.loadData();
},
onClearClick(){
this.curTask = {};
this.curLab = {};
this.startTime = "";
this.endTime = "";
this.curStatus = {};
} }
} }
} }
...@@ -469,7 +480,7 @@ ...@@ -469,7 +480,7 @@
height: 30upx height: 30upx
} }
.submit-button { /* .submit-button {
display: flex; display: flex;
width: 500upx; width: 500upx;
height: 60upx; height: 60upx;
...@@ -480,7 +491,7 @@ ...@@ -480,7 +491,7 @@
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
margin-bottom: 40upx; margin-bottom: 40upx;
} } */
.submittext { .submittext {
font-size: 14px; font-size: 14px;
...@@ -507,5 +518,22 @@ ...@@ -507,5 +518,22 @@
.detailtext { .detailtext {
padding-right: 20px; padding-right: 20px;
}
.submit-button {
width:50%;
height:50px;
display: flex;
background-color: #409C9C;
justify-content: center;
align-items: center;
}
.clear-button {
display: flex;
width:50%;
height:50px;
background-color: #F8FAFA;
border-color: 1px solid #DDDEE1;
justify-content: center;
align-items: center;
} }
</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