// pages/process/order-check/index.js import Scene from '../../index/scene' import { pricingOrder, getSideOrderInfo} from "../../../api/saas" const event = require('../../../utils/event') const util = require('../../../utils/util') const app = getApp() Scene({ /** * 页面的初始数据 */ data: { id: null, form: null }, /** * 生命周期函数--监听页面加载 */ onLoad: function (options) { if(options.id){ this.data.id = options.id wx.showLoading({ title: '正在获取', mask: true }) getSideOrderInfo({id: options.id}).then(result => { wx.hideLoading() this.setData({ form: result.data, admin: app.userInfo.type && app.userInfo.type.indexOf('ADMIN') >= 0 }) }).catch(err => { wx.hideLoading() util.showToast(err) }) } }, checkForm: function(){ wx.redirectTo({url: `/pages/process/outside-check/index?id=${this.data.id}` }) }, submitForm: function(){ wx.showLoading({ title: '处理中', mask: true }) pricingOrder(this.data.form).then(result => { wx.hideLoading() util.showBackToast('定价成功') event.emit('OrderMessage', { what: 12, desc: 'pricingOrder' }) }).catch(err => { wx.hideLoading() util.showToast(err) }) } })