Authored by 郭成尧

tip-show

... ... @@ -3,7 +3,7 @@
* @Author: Targaryen
* @Date: 2017-01-04 15:17:51
* @Last Modified by: Targaryen
* @Last Modified time: 2017-03-20 13:58:34
* @Last Modified time: 2017-03-20 14:03:48
*/
'use strict';
... ... @@ -129,7 +129,7 @@ const pay = (req, res, next) => {
if (!orderCode || !uid) {
return res.json({
code: 400,
msg: '订单或用户信息不存在!',
message: '订单或用户信息不存在!',
url: '/'
});
}
... ... @@ -144,7 +144,7 @@ const pay = (req, res, next) => {
if (!orderDetail || !orderDetail.data) {
return res.json({
code: 400,
msg: '没有找到该订单!'
message: '没有找到该订单!'
});
}
... ... @@ -153,7 +153,7 @@ const pay = (req, res, next) => {
return res.json({
code: 400,
msg: '订单已经取消',
message: '订单已经取消',
url: url
});
}
... ... @@ -169,13 +169,13 @@ const pay = (req, res, next) => {
if (result && result.data && result.data.href && paymentCode === payModel.payments.alipay) {
return res.json({
code: 200,
msg: '校验成功',
message: '校验成功',
url: result.data.href
});
} else {
return res.json({
code: 400,
msg: '系统错误!',
message: '系统错误!',
url: '/'
});
}
... ...
... ... @@ -23,7 +23,6 @@ var richTip = require('../plugin/rich-tip');
// 点击微信显示加载
var $loadingToast = $('.loading-toast');
/* TODO 影响加载此段 JS */
var theOrderCode = document.getElementById('ordercode') ? document.getElementById('ordercode').value : '';
var wxPayEl = document.getElementById('weixin'),
... ... @@ -137,9 +136,11 @@ function jsApiCall(orderCode, jsApiParameters) {
// 支付宝支付
if ($aliPayEL && $aliPayEL.length > 0 && $aliPayEL.data('href')) {
$aliPayEL.on('click', function() {
$.get($aliPayEL.data('href'), function(result){
$.get($aliPayEL.data('href'), function(result) {
if (result && result.code === 200 && result.url) {
window.location.href = result.url;
} else {
tip.show(result && result.message || '系统错误!');
}
});
});
... ...