You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
79 lines
2.0 KiB
79 lines
2.0 KiB
// pages/mall/order-result/index.js
|
|
const event = require('../../../utils/event.js')
|
|
|
|
Page({
|
|
/**
|
|
* 页面的初始数据
|
|
*/
|
|
data: {
|
|
icon: {
|
|
type: 'success',
|
|
color: '#008AFF',
|
|
},
|
|
buttons: [{
|
|
type: 'positive',
|
|
block: true,
|
|
text: '返回',
|
|
}],
|
|
title: '支付成功',
|
|
label: '订单提交成功',
|
|
message: '订单状态返回我的订单查看',
|
|
type: 0 // 0: 订单提交失败; 1:订单提交成功;2:支付成功
|
|
},
|
|
|
|
/**
|
|
* 生命周期函数--监听页面加载
|
|
*/
|
|
onLoad: function (options) {
|
|
this.data.type = Number(options.type)
|
|
if(this.data.type == 0){
|
|
var msg = '订单状态返回我的订单查看'
|
|
if(options.message){
|
|
msg = options.message
|
|
}
|
|
this.setData({
|
|
['icon.type']: 'warn',
|
|
['icon.color']: '#ef473a',
|
|
['buttons[0].type']: 'light',
|
|
title: '支付失败',
|
|
label: '订单提交失败',
|
|
message: msg
|
|
})
|
|
} else if(this.data.type == 1){
|
|
var msg = '订单状态返回我的订单查看'
|
|
if(options.message){
|
|
msg = options.message
|
|
}
|
|
this.setData({
|
|
['icon.type']: 'success',
|
|
['icon.color']: '#008AFF',
|
|
['buttons[0].type']: 'positive',
|
|
title: '下单成功',
|
|
label: '订单提交成功',
|
|
message: msg
|
|
})
|
|
} else if(this.data.type == 2){
|
|
var msg = '订单状态返回我的订单查看'
|
|
if(options.message){
|
|
msg = options.message
|
|
}
|
|
this.setData({
|
|
['icon.type']: 'success',
|
|
['icon.color']: '#008AFF',
|
|
['buttons[0].type']: 'positive',
|
|
title: '支付成功',
|
|
label: '订单提交成功',
|
|
message: msg
|
|
})
|
|
}
|
|
},
|
|
|
|
onClick: function(e) {
|
|
wx.navigateBack()
|
|
},
|
|
// 离开之前发送支付结果的消息
|
|
onUnload: function () {
|
|
event.emit('EventMessage', { what: 10, arg: Number(this.data.type), desc: 'Offer' })
|
|
}
|
|
|
|
})
|