123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130 |
- // pages/tabber/news/index.js
- const app=getApp()
- Page({
- /**
- * 页面的初始数据
- */
- data: {
- taskInfo: {},
- show: false,
- show1: false,
- title:"",
- edit:"",
- id:0,
- remark:"",
- cold:0, // 1:能冻结,2:能解冻
- },
- /**
- * 生命周期函数--监听页面加载
- */
- onLoad: function (options) {
- this.setData({
- id:options.id
- })
- this. gettaskdetail()
- },
- /**
- * 生命周期函数--监听页面初次渲染完成
- */
- onReady: function () {
- },
- show: function () {
- this.setData({
- show: !this.data.show,
- title:'冻结格口',
- edit:'冻结',
- url:'Frozen'
- })
- },
- show3: function () {
- this.setData({
- show: !this.data.show,
- title:'解冻格口',
- edit:'解冻',
- url:'Thaw'
- })
- },
- show1: function () {
- this.setData({
- show: !this.data.show,
- title:'检修开柜',
- edit:'开柜',
- url:'Overhaul'
- })
- },
- gettaskdetail() {
- var that = this
- app.api.useApi(app.globalData.baseAppUrl + "api/admin/LatticeDetails", {
- id: that.data.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();
- // 1:能冻结,2:能解冻
- if(res.message.data.status=='空闲'){
- that.setData({cold: 1})
- }else{
- that.setData({cold: 2})
- }
- 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({
- show: !that.data.show,
- // taskInfo: res.message.data
- })
- that.gettaskdetail()
- }
- }).catch(function (err) {
- console.log(222);
- })
- },
- onChange(event) {
- // event.detail 为当前输入的值
- // console.log(event.detail);
- this.setData({
- remark: event.detail
- })
- },
- })
|