// pages/tabber/news/index.js const app=getApp() Page({ /** * 页面的初始数据 */ data: { taskInfo: {}, show: false, show1: false, title:"", edit:"", id:0, remark:"" }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.setData({ id:options.id }) this. gettaskdetail(options.id) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, show: function () { this.setData({ show: !this.data.show, title:'冻结格口', edit:'冻结', url:'Frozen' }) }, show1: function () { this.setData({ show: !this.data.show, title:'检修开柜', edit:'开柜', url:'Overhaul' }) }, gettaskdetail(id) { var that = this app.api.useApi(app.globalData.baseAppUrl + "api/admin/LatticeDetails", { id: id, }, "post").then(function (res) { console.log(res); if (res.code != 200) { wx.showLoading({ title: res.message.msg, }) setTimeout(function () { wx.hideLoading(); }, 1000); } else { wx.hideLoading(); that.setData({ taskInfo: res.message.data }) } }).catch(function (err) { console.log(222); }) }, opentask(e) { var that = this var url=this.data.url app.api.useApi(app.globalData.baseAppUrl + "api/admin/"+url, { id: this.data.id, remark:this.data.remark }, "post").then(function (res) { console.log(res); if (res.code != 200) { wx.showLoading({ title: res.message.msg, }) setTimeout(function () { wx.hideLoading(); }, 1000); } else { wx.hideLoading(); that.setData({ taskInfo: res.message.data }) } }).catch(function (err) { console.log(222); }) }, onChange(event) { // event.detail 为当前输入的值 // console.log(event.detail); this.setData({ remark: event.detail }) }, })