diff --git a/pages/process/order-info/index.js b/pages/process/order-info/index.js index 69c7b1f..c550b2d 100644 --- a/pages/process/order-info/index.js +++ b/pages/process/order-info/index.js @@ -2,7 +2,6 @@ import Dialog from '../../../components/dialog/dialog' import { repeatOrder, getFactoryOrderInfo, checkingOrder} from "../../../api/saas" const event = require('../../../utils/event') -const math = require('../../../utils/math') const util = require('../../../utils/util') const app = getApp() @@ -61,13 +60,16 @@ Page({ paymentOrder: function(){ const that = this wx.navigateTo({ - url: `/pages/process/payment/index?order=${encodeURIComponent(JSON.stringify(this.data.form))}`, + url: `/pages/process/payment/index?channel=1`, events: { onOrderChange: (data) => { if (data.what == 12) { that.fetchOrderInfo(that.data.form.id) } } + }, + success: function(res) { + res.eventChannel.emit('onParam', that.data.form) } }) }, diff --git a/pages/process/payment-list/index.js b/pages/process/payment-list/index.js index a59cab3..b666016 100644 --- a/pages/process/payment-list/index.js +++ b/pages/process/payment-list/index.js @@ -108,13 +108,16 @@ Page({ var item = this.data.orderList[e.currentTarget.dataset.page][e.currentTarget.dataset.index] const that = this wx.navigateTo({ - url: `/pages/process/payment/index?order=${encodeURIComponent(JSON.stringify(item))}`, + url: `/pages/process/payment/index?channel=1`, events: { onOrderChange: (data) => { if (data.what == 12) { that.onRefreshList(that.data.form.isSameCustomer) } } + }, + success: function(res) { + res.eventChannel.emit('onParam', item) } }) } diff --git a/pages/process/payment/index.js b/pages/process/payment/index.js index f2704d0..04b306e 100644 --- a/pages/process/payment/index.js +++ b/pages/process/payment/index.js @@ -41,9 +41,12 @@ Page({ this.setData({ safeBottom: app.globalData.safeBottom }) util.showToast(err) }) - } else if(options.order){ - var list = [JSON.parse(decodeURIComponent(options.order))] - this.amountList(list) + } else if(options.channel){ + let channel = this.getOpenerEventChannel() + let that = this + channel.on('onParam', function (data) { + that.amountList([data]) + }) } }, amountList: function(orderList){