// pages/list/list.js var authGET = require('../../utils/authGET') var authDELETE = require('../../utils/authDELETE') var authRESULT = require('../../utils/authRESULT') const { $Message } = require('../../dist/base/index'); const app = getApp() function formatNumber(n) { n = n.toString() return n[1] ? n : '0' + n } Page({ data: { taskid:new Array,taskidstring:'', taskDetail:new Array,taskddlist:new Array, planid:new Array,planidstring:'', planDetail:new Array,planddllist:new Array, failids:[],failplanids:[],allocstatus:[],Pallocstatus:[], current: 'tab1',current_scroll: 'tab1', visible2: false,toggle : false,toggle2 : false, actions : [ { name : '删除', width : 100, color : '#fff', fontsize : '20', icon : 'trash', background : '#ed3f14' }, ], press : false, loading: true, }, listenPress: function (res) { this.setData({ press: true, }) let that = this; setTimeout(function(){ that.setData({ press: false, }) },15) }, onLoad: function (e) { }, onReady: function () { let that = this; }, onShow:function(){ let that = this; app.listenLoading(function (res) { that.Query() }) }, onPullDownRefresh: function () { let that = this; app.listenLoading(function (res) { that.Query() }) }, stopPullDownRefresh(){ wx.stopPullDownRefresh() $Message({ content: '拉取数据成功', type: 'success' }); }, Query:function(){ this.onRESULTS() this.onGETALL() }, onRESULTS: function () { var that = this authRESULT.authRESULTS({ url : "task", success: function (res) { that.setData({ failids:res.data.failedIds, }) console.log("failid",that.data.failids) }, fail: function (res) { console.log(res) } }) authRESULT.authRESULTS({ url : "plan", success: function (res) { that.setData({ failplanids:res.data.failedIds, }) console.log("failplanid",that.data.failplanids) }, fail: function (res) { console.log(res) } }) }, onGETALL:function () { var that = this authGET.authGETALL({ url : "task", data: { }, success: function (res) { console.log("返回t",res.data) if(res.data.length>0){ that.setData({ loading: false, taskid:res.data, taskidstring:res.data.join(',') }) that.onGETDETAIL(); } else{ that.setData({ loading: false, taskid:res.data, taskidstring:"" }) } }, fail: function (res) { console.log(res) } }), authGET.authGETALL({ url : "plan", data: { }, success: function (res) { console.log("返回p",res.data) if(res.data.length>0){ that.setData({ loading:false, planid:res.data, planidstring:res.data.join(',') }) that.onGETDETAIL(); } else{ that.setData({ loading:false, planid:res.data, planidstring:"" }) } }, fail: function (res) { console.log(res) } }) }, onGETDETAIL:function(){ var that = this authGET.authGETDETAIL({ url : "task", data:{ "ids":this.data.taskidstring, }, success: function (res) { console.log("taskDetail",res.data) var ddllist = new Array var _alloc =[] for(var i = 0;i