// pages/debitNoteList/debitNoteDetail/debitNoteDetail.js const app = getApp(); var network = require("../../../utils/net.js"); var timechage = require("../../../utils/dateTimeUtil.js"); var getDebitNoteDetail = '/MainSystem/B3MiniProgramRpc/XuRpcs/Customer/DebitNoteRpc/GetDebitNoteDetail' var confirmDebitNote = "/MainSystem/B3MiniProgramRpc/XuRpcs/Customer/DebitNoteRpc/ConfirmDebitNote" Page({ data: { item:{}, ConfirmTime: '', Date: '', orderState:false }, onLoad: function(options) { var that = this; //正常登录流程进入值为0,分享页面直接进入值为1 if (app.globalData.shareInState == 1) { return; } if (app.globalData.shareInParameter.id) { var detailItemID = parseInt(app.globalData.shareInParameter.id); that.setData({ orderState: true, }); } else { var detailItemID = parseInt(options.ID); if (options.State == "未确认") { that.setData({ orderState: true, }); }; } let method = getDebitNoteDetail; let params = [detailItemID]; network.transfer_request(method, params, function (res) { app.globalData.shareInParameter = {}; var backDate = timechage.formatTimeTwo(res.result.Date.substring(6, 19), 'Y/M/D'); if (res.result.ConfirmTime){ var backConfirmTime = timechage.formatTimeTwo(res.result.ConfirmTime.substring(6, 19), 'Y/M/D'); } that.setData({ item: res.result, Date: backDate, ConfirmTime: backConfirmTime, }) }) }, // 新增按钮点击 confirmDebitNoteBtnClicked: function(event) { var orderID = event.currentTarget.dataset.orderid; let method = confirmDebitNote; let params = [orderID]; network.transfer_request(method, params, function (res) { wx.showToast({ title: '操作成功', success: function (res){ wx:wx.navigateBack({ delta: 1, }); } }); }); }, })