// pages/yichangchuli/index.js const app = getApp(); Page({ /** * 页面的初始数据 */ data: { id: 0, info: '', }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { this.setData({id: options.id}) }, /** * 生命周期函数--监听页面显示 */ onShow: function () { this.getinfo() }, getinfo() { let that = this; app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/entry/abnormal_details", {id:that.data.id}, "get").then(function (res) { if (res.code != 200) { console.log(res.message.msg) wx.showLoading({ title: res.message.msg, }) } else { that.setData({ info: res.message.data, }) } wx.hideLoading(); }).catch(function (err) { console.log(222); }) }, changeabnormal(e){ let id = e.currentTarget.dataset.id let status = e.currentTarget.dataset.status let that = this; app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/entry/abnormal_status", {id:id,status:status}, "post").then(function (res) { wx.showToast({ title: res.message.msg, icon: 'none', duration: 1100 }) that.getinfo() }).catch(function (err) { console.log(222); }) }, gofj(){ // wx.navigateTo({ // url: '../../sorting/enter/enter?seal_no='+this.data.info.seal_no, // }) }, submit(e){ var that = this; app.api.useApi(app.globalData.baseAppUrl + "api/admin/sorting/entry/submit", { seal_no: that.data.info.seal_no, }, "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(); wx.showLoading({ title: res.message.msg, }) setTimeout(function () { wx.hideLoading(); wx.navigateBack() // wx.navigateTo({ // url: '/pages/sorting/enternext/enternext?status='+res.message.data.status+'&id='+res.message.data.id, // }) }, 500); } }).catch(function (err) { console.log(222); }) }, goback(){ wx.navigateBack() }, gophone(){ wx.makePhoneCall({ phoneNumber: this.data.info.phone }) }, /** * 生命周期函数--监听页面初次渲染完成 */ onReady: function () { }, /** * 生命周期函数--监听页面隐藏 */ onHide: function () { }, /** * 生命周期函数--监听页面卸载 */ onUnload: function () { }, /** * 页面相关事件处理函数--监听用户下拉动作 */ onPullDownRefresh: function () { }, /** * 页面上拉触底事件的处理函数 */ onReachBottom: function () { }, /** * 用户点击右上角分享 */ onShareAppMessage: function () { } })