|
@@ -38,24 +38,39 @@
|
|
|
payParams.success = function (res) {
|
|
payParams.success = function (res) {
|
|
|
showDialog({
|
|
showDialog({
|
|
|
title: '支付成功',
|
|
title: '支付成功',
|
|
|
|
|
+ message: '',
|
|
|
confirm: function () {
|
|
confirm: function () {
|
|
|
window.close();
|
|
window.close();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
};
|
|
};
|
|
|
payParams.fail = function (e) {
|
|
payParams.fail = function (e) {
|
|
|
|
|
+ console.log(e);
|
|
|
showDialog({
|
|
showDialog({
|
|
|
title: '支付取消',
|
|
title: '支付取消',
|
|
|
|
|
+ message: '',
|
|
|
confirm: function () {
|
|
confirm: function () {
|
|
|
window.close();
|
|
window.close();
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
console.log(payParams);
|
|
console.log(payParams);
|
|
|
- document.onload = function () {
|
|
|
|
|
- setTimeout(function () {
|
|
|
|
|
|
|
+ window.onload = function () {
|
|
|
|
|
+ $.get('/wx/jsapiSign', {url: encodeURI(window.location.href.split('#')[0]),}, function (res) {
|
|
|
|
|
+ res.debug = true;
|
|
|
|
|
+ res.jsApiList = [
|
|
|
|
|
+ 'chooseWXPay',
|
|
|
|
|
+ 'updateAppMessageShareData',
|
|
|
|
|
+ 'updateTimelineShareData',
|
|
|
|
|
+ 'hideAllNonBaseMenuItem',
|
|
|
|
|
+ 'scanQRCode',
|
|
|
|
|
+ ];
|
|
|
|
|
+ wx.config(res);
|
|
|
|
|
+ });
|
|
|
|
|
+ wx.ready(function (res) {
|
|
|
|
|
+ console.log('jssdk ready', res);
|
|
|
wx.chooseWXPay(payParams);
|
|
wx.chooseWXPay(payParams);
|
|
|
- }, 300);
|
|
|
|
|
|
|
+ });
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function showDialog(options) {
|
|
function showDialog(options) {
|