提交 2462bfdf 编写于 作者: VK1688's avatar VK1688

修复uni-pay支付成功页面显示NaN的问题

上级 ae840ac1
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
adpid: "", adpid: "",
order_no: "", order_no: "",
out_trade_no: "", out_trade_no: "",
total_fee: null, total_fee: 0,
pay_date: "", pay_date: "",
return_url: "" return_url: ""
} as UTSJSONObject, } as UTSJSONObject,
...@@ -55,9 +55,11 @@ ...@@ -55,9 +55,11 @@
// 监听 - 页面每次【加载时】执行(如:前进) // 监听 - 页面每次【加载时】执行(如:前进)
onLoad(options) { onLoad(options) {
this.myOptions['adpid'] = options['adpid']; this.myOptions['adpid'] = options['adpid'];
this.myOptions['order_no'] = options['order_no']; this.myOptions['order_no'] = options['order_no'] != null ? options['order_no'] : "-";
this.myOptions['out_trade_no'] = options['out_trade_no']; this.myOptions['out_trade_no'] = options['out_trade_no'];
this.myOptions['total_fee'] = parseFloat(options['total_fee'] as string); if (options['total_fee'] != null) {
this.myOptions['total_fee'] = parseFloat(options['total_fee'] as string);
}
this.myOptions['pay_date'] = options['pay_date']; this.myOptions['pay_date'] = options['pay_date'];
this.myOptions['return_url'] = options['return_url']; this.myOptions['return_url'] = options['return_url'];
}, },
...@@ -84,7 +86,7 @@ ...@@ -84,7 +86,7 @@
console.log("ad-error", e); console.log("ad-error", e);
}, },
amountFormat(totalFee : number | null) :string{ amountFormat(totalFee : number | null) :string{
if (totalFee == null) { if (totalFee == null || totalFee == 0) {
return "0"; return "0";
} else { } else {
return (totalFee / 100).toFixed(2) return (totalFee / 100).toFixed(2)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册