const app = getApp()
|
Page({
|
|
/**
|
* 页面的初始数据
|
*/
|
data: {
|
loading: app.globalData.imgUrl +'/image/loading.svg',
|
navbar: ['全部', '未完成', '已完成'],
|
currentTab: 0,
|
size: 10,
|
size1: 10,
|
size2: 10,
|
content: '------加载中------',
|
hasMoreData: true,
|
createTime: '',
|
dataSet: []
|
},
|
|
navbarTap: function (e) {
|
this.setData({
|
currentTab: e.currentTarget.dataset.idx
|
})
|
this.showList(this.data.currentTab)
|
|
},
|
|
showList: function (tab) {
|
var userinfo = wx.getStorageSync("user");
|
var that = this;
|
var id = userinfo.id
|
var str;
|
var sizeQty;
|
switch (tab) {
|
case 0:
|
str = "&status=";
|
sizeQty = 'size';
|
break;
|
case 1:
|
str = "&status=1";
|
sizeQty = 'size1';
|
break;
|
case 2:
|
str = "&status=2";
|
sizeQty = 'size2';
|
break;
|
}
|
wx.request({
|
url: app.globalData.url + '/api/businessAggr/draftQuery?page=1&size=' + that.data[sizeQty] + '&userId=' + id + '&flag=business' + str,
|
success: function (res) {
|
if (res.data.code == 0) {
|
(res.data.data.content).forEach(e => {
|
(e.createTime) = app.formatDate(e.createTime)
|
switch (e.businessType) {
|
case '案件进度查询':
|
e.iconSrc = app.globalData.imgUrl +'/image/businessManage/jindu_b.png';
|
break;
|
case '司法救助':
|
e.iconSrc = app.globalData.imgUrl +'/image/businessManage/jiuzhu_b.png';
|
break;
|
case '信访预约':
|
e.iconSrc = app.globalData.imgUrl +'/image/businessManage/yuyue_b.png';
|
break;
|
case '国家赔偿':
|
e.iconSrc = app.globalData.imgUrl +'/image/businessManage/peichang_b.png';
|
break;
|
case '在线申诉':
|
e.iconSrc = app.globalData.imgUrl +'/image/businessManage/shensu_b.png';
|
break;
|
}
|
});
|
console.log(sizeQty)
|
if (res.data.data.totalElements < that.data[sizeQty]) {
|
that.setData({
|
dataSet: res.data.data.content,
|
hasMoreData: false,
|
content: '------我是有底线的------'
|
})
|
} else {
|
that.setData({
|
dataSet: res.data.data.content,
|
hasMoreData: true,
|
content: '------加载更多------',
|
[sizeQty]: that.data[sizeQty] + 10
|
})
|
}
|
} else {
|
wx.showModal({
|
title: '提示',
|
content: "请求失败!"
|
})
|
}
|
}
|
})
|
},
|
|
businessSchedule: function (event) {
|
var id = event.currentTarget.id;
|
var businessType = this.data.dataSet[id].businessType;
|
var businessId = this.data.dataSet[id].businessId;
|
if (businessType == "案件进度查询") {
|
wx.navigateTo({
|
url: '../progressQuery/progressQuery?id=' + businessId,
|
})
|
} else if (businessType == "信访预约") {
|
wx.navigateTo({
|
url: '../petitionLetters/petitionLetters?id=' + businessId,
|
})
|
} else if (businessType == "国家赔偿") {
|
wx.navigateTo({
|
url: '../compensation/compensation?id=' + businessId,
|
})
|
} else if (businessType == "司法救助") {
|
wx.navigateTo({
|
url: '../judicial/judicial?id=' + businessId,
|
})
|
} else if (businessType == "在线申诉") {
|
wx.navigateTo({
|
url: '../complain/complain?id=' + businessId + '&status=3',
|
})
|
} else {
|
wx.showModal({
|
title: '提示',
|
content: "文件错误!"
|
})
|
}
|
},
|
|
onLoad: function () {
|
this.showList(0)
|
},
|
|
/**
|
* 页面上拉触底事件的处理函数
|
*/
|
onReachBottom: function () {
|
if (this.data.hasMoreData) {
|
this.showList(this.data.currentTab)
|
this.setData({
|
content: '------加载更多------'
|
})
|
} else {
|
this.setData({
|
content: '------我是有底线的------'
|
})
|
}
|
},
|
|
})
|