Blame view
ios/GameSDKResources.bundle/PayJs.txt
1.79 KB
|
23a302b86
|
1 |
;(function() {
|
|
0605edc71
|
2 |
var messagingIframe,webInfoIframe, |
|
23a302b86
|
3 4 5 6 7 8 9 10 |
bridge = 'sdk',
CUSTOM_PROTOCOL_SCHEME = 'jscall';
if (window[bridge]) { return }
// 创建隐藏的iframe
function _createQueueReadyIframe(doc) {
|
|
0c287634f
|
11 12 13 14 15 16 |
messagingIframe = doc.createElement('iframe');
messagingIframe.style.display = 'none';
doc.documentElement.appendChild(messagingIframe);
webInfoIframe = doc.createElement('iframe');
webInfoIframe.style,display = 'none';
doc.documentElement.appendChild(webInfoIframe);
|
|
23a302b86
|
17 |
} |
|
0605edc71
|
18 |
|
|
23a302b86
|
19 |
window[bridge] = {};
|
|
0605edc71
|
20 21 22 23 24 25 26 27 28 29 30 |
window[bridge]['webVer'] = function webVer(webVer){
webInfoIframe.src=CUSTOM_PROTOCOL_SCHEME + ':' + arguments.callee.name + ':' + encodeURIComponent(JSON.stringify(arguments));
};
window[bridge]['payWithBlue'] = function payWithBlue(payGateId,price,cardNO,roleId){
messagingIframe.src=CUSTOM_PROTOCOL_SCHEME + ':' + arguments.callee.name + ':' + encodeURIComponent(JSON.stringify(arguments));
};
|
|
23a302b86
|
31 32 33 34 35 |
window[bridge]['closeWin'] = function closeWin(oid,status,extraInfo){
messagingIframe.src=CUSTOM_PROTOCOL_SCHEME + ':' + arguments.callee.name + ':' + encodeURIComponent(JSON.stringify(arguments));
};
|
|
0605edc71
|
36 |
|
|
23a302b86
|
37 38 39 40 41 42 43 44 45 46 47 48 49 |
//var methods = ["closeWin(uid,nick,sessionKey)"];
//var methodsWithoutParam =["closeWin"];
//for (var i=0;i<methods.length;i++){
// var method = methods[i];
// var methodWithoutParam = methodsWithoutParam[i];
// var code = "(window[bridge])[methodWithoutParam] = function " + method + " {var fs =CUSTOM_PROTOCOL_SCHEME + ':' + arguments.callee.name + ':' + encodeURIComponent(JSON.stringify(arguments)); messagingIframe.src = fs;alert('closeWin src:'+messagingIframe.src);}";
// eval(code);
//}
//创建iframe,必须在创建app之后,否则会出现死循环
_createQueueReadyIframe(document);
//通知js开始初始化
if(typeof(onInjectJsOver)=='function')
|
|
0c287634f
|
50 |
onInjectJsOver(); |
|
23a302b86
|
51 |
|
|
0c287634f
|
52 |
})(); |