// pages/drafts/drafts.js const app = getApp() Page({ /** * 页面的初始数据 */ data: { newData: [], size: 10, content: '------加载中------', hasMoreData: true, }, /** * 生命周期函数--监听页面加载 */ onLoad: function() { this.getMusicInfo(); }, getMusicInfo: function() { var userinfo = wx.getStorageSync("user"); console.log(userinfo) var _this = this; var id = userinfo.id wx.request({ url: app.globalData.url + '/api/businessAggr/draftQuery?page=1&size=' + _this.data.size + '&userId=' + id, 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; case '扫黑除恶': e.iconSrc = app.globalData.imgUrl +'/image/businessManage/saoheichue_b.png'; break; case '公益随手拍': e.iconSrc = app.globalData.imgUrl +'/image/businessManage/suishoupai_b.png'; break; case '联络站': if (e.stationType == 4) { e.businessType = "人大代表联络站"; e.flag = 'renda'; } if (e.stationType == 3) { e.businessType = "特约检察员监督员联络站"; e.flag = 'teyue'; } if (e.stationType == 2) { e.businessType = "政协委员联络员联络站"; e.flag = 'zhengxie'; } if (e.stationType == 1) { e.businessType = "人民监督员联络站"; e.flag = 'renmin'; } e.businessType1 = "联络站"; break; } }); if (res.data.data.totalElements < _this.data.size) { _this.setData({ newData: res.data.data.content, hasMoreData: false, content: '------我是有底线的------' }) } else { _this.setData({ newData: res.data.data.content, hasMoreData: true, content: '------加载更多------', size: _this.data.size + 10 }) } } else { wx.showModal({ title: '提示', content: "请求失败!" }) } } }) }, del: function(event) { var id = event.currentTarget.id; var businessId = this.data.newData[id].businessId; var that = this; wx.showModal({ title: '提示', content: '确定删除吗?', success: function(res) { if (res.confirm) { wx.request({ url: app.globalData.url + '/api/businessAggr/delete?id=' + businessId, success: function(res) { if (res.data.code == 0) { wx.showToast({ title: '删除成功!', icon: 'success', duration: 2000 }, that.getMusicInfo()) } } }) } else if (res.cancel) { console.log('用户点击取消') } } }, ) }, Info: function(event) { var id = event.currentTarget.id; var businessType = this.data.newData[id].businessType; var businessId = this.data.newData[id].businessId; var flag = this.data.newData[id].flag; var businessType1 = this.data.newData[id].businessType1 || ''; console.log(businessType, businessId); if (businessType == "案件进度查询") { wx.navigateTo({ url: '../progressQuery/progressQuery?status=1&id=' + businessId, }) } else if (businessType == "信访预约") { wx.navigateTo({ url: '../petitionLetters/petitionLetters?status=1&id=' + businessId, }) } else if (businessType == "国家赔偿") { wx.navigateTo({ url: '../compensation/compensation?status=1&id=' + businessId, }) } else if (businessType == "司法救助") { wx.navigateTo({ url: '../judicial/judicial?status=1&id=' + businessId, }) } else if (businessType == "在线申诉") { wx.navigateTo({ url: '../complain/complain?status=1&id=' + businessId, }) } else if (businessType == "公益随手拍"){ wx.navigateTo({ url: '../publicSnapshot/publicSnapshot?status=1&id=' + businessId, }) } else if (businessType == "扫黑除恶") { wx.navigateTo({ url: '../scanEvildoing/scanEvildoing?status=1&id=' + businessId, }) } else if (businessType == "投诉建议") { wx.navigateTo({ url: '../complaintAdvice/complaintAdvice?status=1&id=' + businessId, }) } else if (businessType1 == "联络站") { wx.navigateTo({ url: '../junctionStation/junctionStation?status=1&id=' + businessId + '&flag=' + flag, }) }else { wx.showModal({ title: '提示', content: "文件错误!" }) } }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function() { }, /** * 生命周期函数--监听页面显示 */ onShow: function() { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function() { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function() { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function() { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function() { if (this.data.hasMoreData) { this.getMusicInfo(); this.setData({ content: '------加载更多------' }) } else { this.setData({ content: '------我是有底线的------' }) } }, /** * 用户点击右上角分享 */ onShareAppMessage: function() { } })