|
|
@ -1,7 +1,7 @@ |
|
|
// pages/process/payment/index.js
|
|
|
// pages/process/payment/index.js
|
|
|
import Scene from '../../index/scene' |
|
|
import Scene from '../../index/scene' |
|
|
import Dialog from '../../../components/dialog/dialog' |
|
|
import Dialog from '../../../components/dialog/dialog' |
|
|
import { getPeymentList, paymentOrder, getFactoryOrderInfo } from "../../../api/saas" |
|
|
|
|
|
|
|
|
import { getPeymentList, paymentOrder, getFactoryOrderInfo, getSideOrderInfo } from "../../../api/saas" |
|
|
const event = require('../../../utils/event') |
|
|
const event = require('../../../utils/event') |
|
|
const util = require('../../../utils/util') |
|
|
const util = require('../../../utils/util') |
|
|
const math = require('../../../utils/math') //导入模块
|
|
|
const math = require('../../../utils/math') //导入模块
|
|
|
@ -12,6 +12,7 @@ Scene({ |
|
|
* 页面的初始数据 |
|
|
* 页面的初始数据 |
|
|
*/ |
|
|
*/ |
|
|
data: { |
|
|
data: { |
|
|
|
|
|
id: null, |
|
|
height: app.globalData.fragmentHeight, |
|
|
height: app.globalData.fragmentHeight, |
|
|
safeBottom: app.globalData.safeBottom, |
|
|
safeBottom: app.globalData.safeBottom, |
|
|
form: { |
|
|
form: { |
|
|
@ -53,6 +54,26 @@ Scene({ |
|
|
channel.on('onParam', function (data) { |
|
|
channel.on('onParam', function (data) { |
|
|
that.amountList([data]) |
|
|
that.amountList([data]) |
|
|
}) |
|
|
}) |
|
|
|
|
|
} else if(options.id){ |
|
|
|
|
|
this.data.id = options.id |
|
|
|
|
|
wx.showLoading({ title: '正在获取', mask: true }) |
|
|
|
|
|
getSideOrderInfo({id: options.id}).then(result => { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
this.data.amount = 0 |
|
|
|
|
|
for (let index = 0; index < result.data.productCategoryInfos.length; index++) { |
|
|
|
|
|
const element = result.data.productCategoryInfos[index] |
|
|
|
|
|
element.fileList = [] |
|
|
|
|
|
for (let k = 0; k < element.weightNoteImages.length; k++) { |
|
|
|
|
|
element.fileList.push({url: element.weightNoteImages[k]}) |
|
|
|
|
|
} |
|
|
|
|
|
element.settlePrice = math.times(element.settleWeight, element.settleUnitPrice) |
|
|
|
|
|
this.data.amount = math.plus(this.data.amount, element.settlePrice) |
|
|
|
|
|
} |
|
|
|
|
|
this.setData({ orderList: [result.data], amount: this.data.amount, orderStatus: result.data.orderStatus }) |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
util.showToast(err) |
|
|
|
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
amountList: function(orderList){ |
|
|
amountList: function(orderList){ |
|
|
|