Commit a48bfcc4 by liuzhanxin

列表加载

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