|
|
@@ -81,9 +81,7 @@ function doConnect() {
|
|
|
}
|
|
|
};
|
|
|
wsss.onmessage = function (res) {
|
|
|
- console.log('res', res)
|
|
|
var result = typeof res.data === 'string' ? JSON.parse(res.data) : res.data
|
|
|
- console.log('result.type', result.type)
|
|
|
if (result.type === 'cutting') {
|
|
|
if (result.data.status === 0) {
|
|
|
$.toast('复制成功', "text");
|
|
|
@@ -124,7 +122,6 @@ function doConnect() {
|
|
|
return
|
|
|
}
|
|
|
if (result.type === 'payInitiateEvent') {
|
|
|
- window.location.href = result.data.payUrl
|
|
|
var url = window.location.href;
|
|
|
url = url.split('/');
|
|
|
var baseUrl = url[0] + '//' + url[2];
|
|
|
@@ -138,7 +135,17 @@ function doConnect() {
|
|
|
type: 'POST',
|
|
|
dataType: 'json',
|
|
|
contentType: 'application/json;charset=UTF-8',
|
|
|
- success: function (res) {},
|
|
|
+ success: function (res) {
|
|
|
+ if(result.data.payType === 1) { // 微信
|
|
|
+ if (window.__wxjs_environment === 'miniprogram') { // 小程序
|
|
|
+ // copyUrl(result.data.payUrl);
|
|
|
+ } else {
|
|
|
+ window.location.href = result.data.payUrl
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ window.location.href = result.data.payUrl
|
|
|
+ }
|
|
|
+ },
|
|
|
});
|
|
|
return
|
|
|
}
|