Showing
74 changed files
with
678 additions
and
64 deletions
publicAndroidSDK/demo/Demo_PoolSdk/.DS_Store
100755 → 100644
No preview for this file type
publicAndroidSDK/demo/Demo_PoolSdk/.classpath
100755 → 100644
File mode changed
publicAndroidSDK/demo/Demo_PoolSdk/.project
100755 → 100644
File mode changed
publicAndroidSDK/demo/Demo_PoolSdk/.pydevproject
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
publicAndroidSDK/demo/Demo_PoolSdk/1_BuildApk.bat
100755 → 100644
File mode changed
publicAndroidSDK/demo/Demo_PoolSdk/AndroidManifest.xml
100755 → 100644
... | @@ -105,22 +105,6 @@ | ... | @@ -105,22 +105,6 @@ |
105 | android:name=".wxapi.WXEntryActivity" | 105 | android:name=".wxapi.WXEntryActivity" |
106 | android:exported="true" | 106 | android:exported="true" |
107 | android:launchMode="singleTop" /> | 107 | android:launchMode="singleTop" /> |
108 | - | ||
109 | - <uses-library | ||
110 | - android:name="org.simalliance.openmobileapi" | ||
111 | - android:required="false" /> | ||
112 | - | ||
113 | - <activity | ||
114 | - android:name="com.unionpay.uppay.PayActivity" | ||
115 | - android:configChanges="orientation|keyboardHidden|keyboard" | ||
116 | - android:screenOrientation="portrait" > | ||
117 | - </activity> | ||
118 | - <activity | ||
119 | - android:name="com.unionpay.UPPayWapActivity" | ||
120 | - android:configChanges="orientation|keyboardHidden|fontScale" | ||
121 | - android:screenOrientation="portrait" | ||
122 | - android:windowSoftInputMode="adjustResize" > | ||
123 | - </activity> | ||
124 | <!-- SDK end --> | 108 | <!-- SDK end --> |
125 | </application> | 109 | </application> |
126 | 110 | ... | ... |
publicAndroidSDK/demo/Demo_PoolSdk/ant.properties
100755 → 100644
File mode changed
publicAndroidSDK/demo/Demo_PoolSdk/assets/.DS_Store
100755 → 100644
No preview for this file type
publicAndroidSDK/demo/Demo_PoolSdk/assets/poolsdk.xml
100755 → 100644
... | @@ -2,22 +2,18 @@ | ... | @@ -2,22 +2,18 @@ |
2 | <config> | 2 | <config> |
3 | 3 | ||
4 | <sdkconfig | 4 | <sdkconfig |
5 | - YA_APPKEY="a76f1e9968f496a67cd4a1e3f6bc7cce" | 5 | + YA_APPID="58fd78a9834e7246b8dc0eac" |
6 | - YA_APPID="57d1376f665fff4fbea91502" | 6 | + YA_APPKEY="b06b86b79c25774ec758657a7203bae6" |
7 | gamesimplename="fytx_test" | 7 | gamesimplename="fytx_test" |
8 | - | 8 | + sdksimplename="youyu" |
9 | + sdkversioncode="V1_0" | ||
9 | channelparameter1="" | 10 | channelparameter1="" |
10 | channelparameter2="" | 11 | channelparameter2="" |
11 | custom="" | 12 | custom="" |
12 | gamechannelid="" | 13 | gamechannelid="" |
13 | - | 14 | + logincheckurl="http://login.public.sdk.gzyouai.com/logincheck/check" |
14 | - logincheckurl="Xwm2VZk4IZHw4pR8WSu0JRSPl5jMDzA8+5nKH+jNJckQW+5uHcG5Mxl+gMWO6s8PhqrR0VX7irk=" | 15 | + paycheckurl="http://pay.public.sdk.gzyouai.com/paycheck/confirm" |
15 | - payorderurl="Xwm2VZk4IZHw4pR8WSu0JRSPl5jMDzA8+5nKH+jNJclRWohb/BPqZ4SO5qrmq1RBsIoFXavzUfg=" | 16 | + payorderurl="http://pay.public.sdk.gzyouai.com/paycheck/create" |
16 | - paycheckurl="Xwm2VZk4IZHw4pR8WSu0JRSPl5jMDzA8+5nKH+jNJclRWohb/BPqZ4ChH88g5ubtvsBW3D32B8c=" | 17 | + usertype="gssaXIIEiL0=" /> |
17 | - sdksimplename="vWVsU5Ogkh8=" | ||
18 | - sdkversioncode="BVPAQexcXDk=" | ||
19 | - styleName="4N7gnKed6uk=" | ||
20 | - usertype="gssaXIIEiL0=" | ||
21 | - weixinId="x3d4hSeP9KFDTFusyU+iB/9NgyvRyoop" /> | ||
22 | 18 | ||
23 | </config> | 19 | </config> |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
No preview for this file type
No preview for this file type
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 | +//游戏皮肤对应manifest文件的生成配置文件, 包括基本的第三方库、业务逻辑js、样式 | ||
2 | + | ||
3 | +var base_js = [ | ||
4 | + 'js/fastclick.min.1.0.js', | ||
5 | + 'js/zepto.min.js', | ||
6 | + 'js/doT.min.js', | ||
7 | + 'js/iscroll.min.1.0.js' | ||
8 | +] | ||
9 | + | ||
10 | +var concat_with_mtime = [ | ||
11 | + 'skin/new_sdk.min.css', | ||
12 | + 'skin/responsive.min.css', | ||
13 | + 'js/core.min.js', | ||
14 | + 'js/loader.min.js', | ||
15 | + 'js/center.min.js', | ||
16 | + 'js/pay.min.js', | ||
17 | + 'js/login.min.js' | ||
18 | +] | ||
19 | + | ||
20 | +var htmls = [ | ||
21 | + 'login.html', | ||
22 | + 'center.html', | ||
23 | + 'pay.html', | ||
24 | + 'share.html' | ||
25 | +] | ||
26 | + | ||
27 | +var images = 'skin/img'; | ||
28 | + | ||
29 | +var target = [ | ||
30 | + 'bllm', | ||
31 | + 'bwts', | ||
32 | + 'bwzq', | ||
33 | + 'fytx', | ||
34 | + 'hxjh', | ||
35 | + 'rxxt', | ||
36 | + 'sgg', | ||
37 | + 'smlw', | ||
38 | + 'twzw', | ||
39 | + 'whj' | ||
40 | +] | ||
41 | +exports.htmls = htmls; | ||
42 | +exports.target = target; | ||
43 | +exports.concat_with_mtime = concat_with_mtime; | ||
44 | +exports.base_js = base_js; | ||
45 | +exports.images = images; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
No preview for this file type
This diff is collapsed. Click to expand it.
No preview for this file type
No preview for this file type

7.05 KB

10.4 KB
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 | +// Laura Doktorova https://github.com/olado/doT | ||
2 | +(function(){function o(){var b={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},a=/&(?!#?\w+;)|<|>|"|'|\//g;return function(f){return f?f.toString().replace(a,function(g){return b[g]||g}):f}}function p(b,a,f){return(typeof a==="string"?a:a.toString()).replace(b.define||h,function(g,e,c,i){if(e.indexOf("def.")===0)e=e.substring(4);if(!(e in f))if(c===":")f[e]=i;else eval("def['"+e+"']="+i);return""}).replace(b.use||h,function(g,e){var c=eval(e);return c?p(b,c,f):c})}function l(b){return b.replace(/\\('|\\)/g, | ||
3 | +"$1").replace(/[\r\t\n]/g," ")}var j={version:"0.2.0",templateSettings:{evaluate:/\{\{([\s\S]+?)\}\}/g,interpolate:/\{\{=([\s\S]+?)\}\}/g,encode:/\{\{!([\s\S]+?)\}\}/g,use:/\{\{#([\s\S]+?)\}\}/g,define:/\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,conditional:/\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,iterate:/\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,varname:"it",strip:true,append:true,selfcontained:false},template:undefined,compile:undefined},m=function(){return this||(0,eval)("this")}(); | ||
4 | +if(typeof module!=="undefined"&&module.exports)module.exports=j;else if(typeof define==="function"&&define.amd)define(function(){return j});else m.doT=j;m.encodeHTML=o();var q={append:{start:"'+(",end:")+'",startencode:"'+encodeHTML("},split:{start:"';out+=(",end:");out+='",startencode:"';out+=encodeHTML("}},h=/$^/;j.template=function(b,a,f){a=a||j.templateSettings;var g=a.append?q.append:q.split,e,c=0,i;if(a.use||a.define){var r=m.def;m.def=f||{};b=p(a,b,m.def);m.def=r}b=("var out='"+(a.strip?b.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g, | ||
5 | +" ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g,""):b).replace(/'|\\/g,"\\$&").replace(a.interpolate||h,function(n,d){return g.start+l(d)+g.end}).replace(a.encode||h,function(n,d){e=true;return g.startencode+l(d)+g.end}).replace(a.conditional||h,function(n,d,k){return d?k?"';}else if("+l(k)+"){out+='":"';}else{out+='":k?"';if("+l(k)+"){out+='":"';}out+='"}).replace(a.iterate||h,function(n,d,k,s){if(!d)return"';} } out+='";c+=1;i=s||"i"+c;d=l(d);return"';var arr"+c+"="+d+";if(arr"+c+"){var "+k+","+i+"=-1,l"+ | ||
6 | +c+"=arr"+c+".length-1;while("+i+"<l"+c+"){"+k+"=arr"+c+"["+i+"+=1];out+='"}).replace(a.evaluate||h,function(n,d){return"';"+l(d)+"out+='"})+"';return out;").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r").replace(/(\s|;|}|^|{)out\+='';/g,"$1").replace(/\+''/g,"").replace(/(\s|;|}|^|{)out\+=''\+/g,"$1out+=");if(e&&a.selfcontained)b="var encodeHTML=("+o.toString()+"());"+b;try{return new Function(a.varname,b)}catch(t){typeof console!=="undefined"&&console.log("Could not create a template function: "+ | ||
7 | +b);throw t;}};j.compile=function(b,a){return j.template(b,null,a)}})(); |
1 | +function FastClick(layer){"use strict";var oldOnClick,self=this;this.trackingClick=false;this.trackingClickStart=0;this.targetElement=null;this.touchStartX=0;this.touchStartY=0;this.lastTouchIdentifier=0;this.touchBoundary=10;this.layer=layer;if(!layer||!layer.nodeType){throw new TypeError("Layer must be a document node")}this.onClick=function(){return FastClick.prototype.onClick.apply(self,arguments)};this.onMouse=function(){return FastClick.prototype.onMouse.apply(self,arguments)};this.onTouchStart=function(){return FastClick.prototype.onTouchStart.apply(self,arguments)};this.onTouchEnd=function(){return FastClick.prototype.onTouchEnd.apply(self,arguments)};this.onTouchCancel=function(){return FastClick.prototype.onTouchCancel.apply(self,arguments)};if(FastClick.notNeeded(layer)){return}if(this.deviceIsAndroid){layer.addEventListener("mouseover",this.onMouse,true);layer.addEventListener("mousedown",this.onMouse,true);layer.addEventListener("mouseup",this.onMouse,true)}layer.addEventListener("click",this.onClick,true);layer.addEventListener("touchstart",this.onTouchStart,false);layer.addEventListener("touchend",this.onTouchEnd,false);layer.addEventListener("touchcancel",this.onTouchCancel,false);if(!Event.prototype.stopImmediatePropagation){layer.removeEventListener=function(type,callback,capture){var rmv=Node.prototype.removeEventListener;if(type==="click"){rmv.call(layer,type,callback.hijacked||callback,capture)}else{rmv.call(layer,type,callback,capture)}};layer.addEventListener=function(type,callback,capture){var adv=Node.prototype.addEventListener;if(type==="click"){adv.call(layer,type,callback.hijacked||(callback.hijacked=function(event){if(!event.propagationStopped){callback(event)}}),capture)}else{adv.call(layer,type,callback,capture)}}}if(typeof layer.onclick==="function"){oldOnClick=layer.onclick;layer.addEventListener("click",function(event){oldOnClick(event)},false);layer.onclick=null}}FastClick.prototype.deviceIsAndroid=navigator.userAgent.indexOf("Android")>0;FastClick.prototype.deviceIsIOS=/iP(ad|hone|od)/.test(navigator.userAgent);FastClick.prototype.deviceIsIOS4=FastClick.prototype.deviceIsIOS&&/OS 4_\d(_\d)?/.test(navigator.userAgent);FastClick.prototype.deviceIsIOSWithBadTarget=FastClick.prototype.deviceIsIOS&&/OS ([6-9]|\d{2})_\d/.test(navigator.userAgent);FastClick.prototype.needsClick=function(target){"use strict";switch(target.nodeName.toLowerCase()){case"button":case"select":case"textarea":if(target.disabled){return true}break;case"input":if(this.deviceIsIOS&&target.type==="file"||target.disabled){return true}break;case"label":case"video":return true}return/\bneedsclick\b/.test(target.className)};FastClick.prototype.needsFocus=function(target){"use strict";switch(target.nodeName.toLowerCase()){case"textarea":case"select":return true;case"input":switch(target.type){case"button":case"checkbox":case"file":case"image":case"radio":case"submit":return false}return!target.disabled&&!target.readOnly;default:return/\bneedsfocus\b/.test(target.className)}};FastClick.prototype.sendClick=function(targetElement,event){"use strict";var clickEvent,touch;if(document.activeElement&&document.activeElement!==targetElement){document.activeElement.blur()}touch=event.changedTouches[0];clickEvent=document.createEvent("MouseEvents");clickEvent.initMouseEvent("click",true,true,window,1,touch.screenX,touch.screenY,touch.clientX,touch.clientY,false,false,false,false,0,null);clickEvent.forwardedTouchEvent=true;targetElement.dispatchEvent(clickEvent)};FastClick.prototype.focus=function(targetElement){"use strict";var length;if(this.deviceIsIOS&&targetElement.setSelectionRange){length=targetElement.value.length;targetElement.setSelectionRange(length,length)}else{targetElement.focus()}};FastClick.prototype.updateScrollParent=function(targetElement){"use strict";var scrollParent,parentElement;scrollParent=targetElement.fastClickScrollParent;if(!scrollParent||!scrollParent.contains(targetElement)){parentElement=targetElement;do{if(parentElement.scrollHeight>parentElement.offsetHeight){scrollParent=parentElement;targetElement.fastClickScrollParent=parentElement;break}parentElement=parentElement.parentElement}while(parentElement)}if(scrollParent){scrollParent.fastClickLastScrollTop=scrollParent.scrollTop}};FastClick.prototype.getTargetElementFromEventTarget=function(eventTarget){"use strict";if(eventTarget.nodeType===Node.TEXT_NODE){return eventTarget.parentNode}return eventTarget};FastClick.prototype.onTouchStart=function(event){"use strict";var targetElement,touch,selection;if(event.targetTouches.length>1){return true}targetElement=this.getTargetElementFromEventTarget(event.target);touch=event.targetTouches[0];if(this.deviceIsIOS){selection=window.getSelection();if(selection.rangeCount&&!selection.isCollapsed){return true}if(!this.deviceIsIOS4){if(touch.identifier===this.lastTouchIdentifier){event.preventDefault();return false}this.lastTouchIdentifier=touch.identifier;this.updateScrollParent(targetElement)}}this.trackingClick=true;this.trackingClickStart=event.timeStamp;this.targetElement=targetElement;this.touchStartX=touch.pageX;this.touchStartY=touch.pageY;if(event.timeStamp-this.lastClickTime<200){event.preventDefault()}return true};FastClick.prototype.touchHasMoved=function(event){"use strict";var touch=event.changedTouches[0],boundary=this.touchBoundary;if(Math.abs(touch.pageX-this.touchStartX)>boundary||Math.abs(touch.pageY-this.touchStartY)>boundary){return true}return false};FastClick.prototype.findControl=function(labelElement){"use strict";if(labelElement.control!==undefined){return labelElement.control}if(labelElement.htmlFor){return document.getElementById(labelElement.htmlFor)}return labelElement.querySelector("button, input:not([type=hidden]), keygen, meter, output, progress, select, textarea")};FastClick.prototype.onTouchEnd=function(event){"use strict";var forElement,trackingClickStart,targetTagName,scrollParent,touch,targetElement=this.targetElement;if(this.touchHasMoved(event)){this.trackingClick=false;this.targetElement=null}if(!this.trackingClick){return true}if(event.timeStamp-this.lastClickTime<200){this.cancelNextClick=true;return true}this.lastClickTime=event.timeStamp;trackingClickStart=this.trackingClickStart;this.trackingClick=false;this.trackingClickStart=0;if(this.deviceIsIOSWithBadTarget){touch=event.changedTouches[0];targetElement=document.elementFromPoint(touch.pageX-window.pageXOffset,touch.pageY-window.pageYOffset)||targetElement;targetElement.fastClickScrollParent=this.targetElement.fastClickScrollParent}targetTagName=targetElement.tagName.toLowerCase();if(targetTagName==="label"){forElement=this.findControl(targetElement);if(forElement){this.focus(targetElement);if(this.deviceIsAndroid){return false}targetElement=forElement}}else if(this.needsFocus(targetElement)){if(event.timeStamp-trackingClickStart>100||this.deviceIsIOS&&window.top!==window&&targetTagName==="input"){this.targetElement=null;return false}this.focus(targetElement);if(!this.deviceIsIOS4||targetTagName!=="select"){this.targetElement=null;event.preventDefault()}return false}if(this.deviceIsIOS&&!this.deviceIsIOS4){scrollParent=targetElement.fastClickScrollParent;if(scrollParent&&scrollParent.fastClickLastScrollTop!==scrollParent.scrollTop){return true}}if(!this.needsClick(targetElement)){event.preventDefault();this.sendClick(targetElement,event)}return false};FastClick.prototype.onTouchCancel=function(){"use strict";this.trackingClick=false;this.targetElement=null};FastClick.prototype.onMouse=function(event){"use strict";if(!this.targetElement){return true}if(event.forwardedTouchEvent){return true}if(!event.cancelable){return true}if(!this.needsClick(this.targetElement)||this.cancelNextClick){if(event.stopImmediatePropagation){event.stopImmediatePropagation()}else{event.propagationStopped=true}event.stopPropagation();event.preventDefault();return false}return true};FastClick.prototype.onClick=function(event){"use strict";var permitted;if(this.trackingClick){this.targetElement=null;this.trackingClick=false;return true}if(event.target.type==="submit"&&event.detail===0){return true}permitted=this.onMouse(event);if(!permitted){this.targetElement=null}return permitted};FastClick.prototype.destroy=function(){"use strict";var layer=this.layer;if(this.deviceIsAndroid){layer.removeEventListener("mouseover",this.onMouse,true);layer.removeEventListener("mousedown",this.onMouse,true);layer.removeEventListener("mouseup",this.onMouse,true)}layer.removeEventListener("click",this.onClick,true);layer.removeEventListener("touchstart",this.onTouchStart,false);layer.removeEventListener("touchend",this.onTouchEnd,false);layer.removeEventListener("touchcancel",this.onTouchCancel,false)};FastClick.notNeeded=function(layer){"use strict";var metaViewport;if(typeof window.ontouchstart==="undefined"){return true}if(/Chrome\/[0-9]+/.test(navigator.userAgent)){if(FastClick.prototype.deviceIsAndroid){metaViewport=document.querySelector("meta[name=viewport]");if(metaViewport&&metaViewport.content.indexOf("user-scalable=no")!==-1){return true}}else{return true}}if(layer.style.msTouchAction==="none"){return true}return false};FastClick.attach=function(layer){"use strict";return new FastClick(layer)};if(typeof define!=="undefined"&&define.amd){define(function(){"use strict";return FastClick})}else if(typeof module!=="undefined"&&module.exports){module.exports=FastClick.attach;module.exports.FastClick=FastClick}else{window.FastClick=FastClick} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 | +(function() { | ||
2 | + // 加载数据 | ||
3 | + var goInit = function() { | ||
4 | + if (window.isGetData == 1) { | ||
5 | + Core.init(); | ||
6 | + } else { | ||
7 | + window.isGetData = 1; | ||
8 | + } | ||
9 | + } | ||
10 | + var getData = function(url) { | ||
11 | + var params = location.hash.slice(1); | ||
12 | + var args = params.match(/app_id=(\w*)&?/); | ||
13 | + var start_page = params.match(/mod=(\w*)&?/); | ||
14 | + var core_server = params.match(/core_server=(.*)&?/); | ||
15 | + var appId = ''; | ||
16 | + | ||
17 | + var skin_v = '?' + $('#skin').attr('data-v'); | ||
18 | + if (args && args.length == 2) { | ||
19 | + //匹配出app_id | ||
20 | + appId = args[1]; | ||
21 | + } | ||
22 | + if(start_page && start_page.length == 2){ | ||
23 | + //匹配出启动模块 | ||
24 | + Core.start_page = start_page[1]; | ||
25 | + console.log(Core.start_page); | ||
26 | + } | ||
27 | + if (core_server){ | ||
28 | + Core.server = core_server[1] | ||
29 | + } | ||
30 | + location.hash = ''; | ||
31 | + if (appId == '') { | ||
32 | + //刷新地址出错 | ||
33 | + params = localStorage.getItem('params_' + url); | ||
34 | + appId = localStorage.getItem('app_id'); | ||
35 | + } else { | ||
36 | + localStorage.setItem('params_' + url, params); | ||
37 | + localStorage.setItem('app_id', appId); | ||
38 | + } | ||
39 | + | ||
40 | + Core.params = params; | ||
41 | + if (!appId) { | ||
42 | + //无法获取到app_id | ||
43 | + Core.showTips('无法获取app_id!', false, 3000); | ||
44 | + goInit(); | ||
45 | + $('#loading').hide(); | ||
46 | + return; | ||
47 | + } | ||
48 | + Core.Data.app_id = appId; | ||
49 | + var setSkin = false; | ||
50 | + //先尝试设置皮肤,检查是否自动登录 | ||
51 | + var tryAutoLogin = false; | ||
52 | + var _skin = localStorage.getItem('skin_' + appId); | ||
53 | + if (_skin) { | ||
54 | + $('#skin').attr('href', Core.server + '/static/sdk/skin/' + _skin + '/skin.css' + skin_v); | ||
55 | + setSkin = true; | ||
56 | + } | ||
57 | + if ($('#login').length != 0) { | ||
58 | + var auto = localStorage.getItem('auto'); | ||
59 | + var auto_time = parseInt(localStorage.getItem('auto_time')); | ||
60 | + var d = new Date().getTime(); | ||
61 | + if (auto == 'true' && (d - auto_time) < 600000) { | ||
62 | + tryAutoLogin = false; | ||
63 | + } else if (auto == null) { | ||
64 | + tryAutoLogin = false; | ||
65 | + } else { | ||
66 | + tryAutoLogin = true; | ||
67 | + } | ||
68 | + } | ||
69 | + //如果不尝试自动登录,直接初始化界面 | ||
70 | + if (!tryAutoLogin) | ||
71 | + goInit(); | ||
72 | + | ||
73 | + | ||
74 | + Core.ajax({ | ||
75 | + type: 'GET', | ||
76 | + url: url + '?' + params, | ||
77 | + dataType: 'json', | ||
78 | + success: function(data) { | ||
79 | + if (data.code == 0) { | ||
80 | + // 成功请求 | ||
81 | + Core.Data = data.msg; | ||
82 | + if (Core.Data.face) { | ||
83 | + Core.Data.face = Core.server + data.msg.face; | ||
84 | + } | ||
85 | + //更新server | ||
86 | + var lastServer = localStorage.getItem('last_server'); | ||
87 | + if (Core.Data.new_server) { | ||
88 | + if (lastServer && lastServer == Core.Data.new_server) { | ||
89 | + //没有变化 | ||
90 | + } else { | ||
91 | + //需要更新server | ||
92 | + var s = 'sdk://changeServer?addr=' + Core.Data.new_server; | ||
93 | + localStorage.setItem('last_server', Core.Data.new_server); | ||
94 | + location.href = s; | ||
95 | + } | ||
96 | + } | ||
97 | + | ||
98 | + if (!setSkin && data.skin) { | ||
99 | + $('#skin').attr('href', Core.server + '/static/sdk/skin/' + data.skin + '/skin.css' + skin_v); | ||
100 | + localStorage.setItem('skin_' + appId, data.skin); | ||
101 | + } | ||
102 | + localStorage.setItem('data_' + url, JSON.stringify(data.msg)); | ||
103 | + | ||
104 | + //模块初始化函数,兼容旧版本sdk | ||
105 | + if (typeof(window.initFunc) == "function") { | ||
106 | + window.initFunc(); | ||
107 | + } | ||
108 | + // 核心初始化 | ||
109 | + $('#loading').hide(); | ||
110 | + if (tryAutoLogin) { | ||
111 | + goInit(); | ||
112 | + } else { | ||
113 | + var first_mod = Core.start_page? Core.start_page: 'home'; | ||
114 | + Core.updateMod(first_mod); | ||
115 | + } | ||
116 | + } else { | ||
117 | + //参数出错,没有游戏服什么的. | ||
118 | + $('#loading').hide(); | ||
119 | + $('<h2 class="error_title">出错了,正在努力抢修中...</h2>').appendTo($('.mask')); | ||
120 | + Core.showTips(data.msg, false, 6000); | ||
121 | + // 核心初始化 | ||
122 | + Core.loadFinished(); | ||
123 | + } | ||
124 | + | ||
125 | + }, | ||
126 | + error: function(xhr, type) { | ||
127 | + // 请求失败,服务器崩溃 | ||
128 | + //尝试从缓存中获取数据 | ||
129 | + var data_str = localStorage.getItem('data_' + url); | ||
130 | + if (data_str && data_str != '') { | ||
131 | + var data = JSON.parse(data_str); | ||
132 | + if (typeof data == "object") { | ||
133 | + Core.Data = data; | ||
134 | + if (tryAutoLogin) { | ||
135 | + goInit(); | ||
136 | + } else { | ||
137 | + Core.updateMod('home'); | ||
138 | + } | ||
139 | + } | ||
140 | + } | ||
141 | + Core.showTips('网络出错,请检查网络状态。', false); | ||
142 | + // 核心初始化 | ||
143 | + $('#loading').hide(); | ||
144 | + } | ||
145 | + | ||
146 | + }); | ||
147 | + } | ||
148 | + window.getData = getData; | ||
149 | +})(); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 | +/*! | ||
2 | +** create by zhangxinxu(.com) 2013-07-15 | ||
3 | +** a simple method for custom scrolling | ||
4 | +** it can be used on both mobile and parts desktop browser IE9+/FF/Chrome/... | ||
5 | +*/ | ||
6 | +var simpScroller=(function(){var c=!((window.DocumentTouch&&document instanceof window.DocumentTouch)||"ontouchstart" in window)*1,b={start:["touchstart","mousedown"][c],move:["touchmove","mousemove"][c],end:["touchend","mouseup"][c]};var a=function(e,l,f){var n="top",o="Top",p="height",g="Height",d="pageY";if(l=="horizontal"){n="left";o="Left";p="width";g="Width";d="pageX"}var i=null;if(f.hideScrollBar==false){i=document.createElement("div");i.className="scroller_"+l;f.container.appendChild(i)}var m=e["client"+g],h=0;var j=function(){if(i==null){return}var r=i.style[p].replace("px",""),q=e["scroll"+o]/(h-m)*(m-r);if(m-r-q<=0){q=m-r}i.style[n]=q+"px"};var k={};e.addEventListener(b.start,function(q){h=this["scroll"+g];k[d]=q.touches?q.touches[0][d]:q[d];k[n]=this["scroll"+o];document.moveFollow=true;if(i&&h>m){i.style.opacity=1;i.style[p]=(m*m/h)+"px";j()}c&&q.preventDefault()});e.addEventListener(b.move,function(q){if(c==false||(document.moveFollow==true)){this["scroll"+o]=k[n]+(k[d]-(q.touches?q.touches[0][d]:q[d]));j();f.onScroll.call(this,q)}q.preventDefault()});e.addEventListener(b.end,function(q){i&&(i.style.opacity=0)});if(c==true){document.addEventListener("mouseup",function(){this.moveFollow=false})}};return function(d,f){f=f||{};var j=new Object({verticalScroll:true,horizontalScroll:false,hideScrollBar:false,onScroll:function(){}}),g;for(g in f){j[g]=f[g]}if(window.getComputedStyle(d).position=="static"){d.style.position="relative"}var i=d.childNodes,e=document.createDocumentFragment();[].slice.call(i).forEach(function(k){e.appendChild(k)});var h=document.createElement("div");h.style.height="100%";h.style.width="100%";h.style.overflow="hidden";d.appendChild(h);h.appendChild(e);j.container=d;if(j.verticalScroll==true){a(h,"vertical",j)}if(j.horizontalScroll==true){a(h,"horizontal",j)}}})(); | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 | +/** | ||
2 | + * 动态生成各游戏皮肤下对应的manifest文件。分别将带上修改时间戳的第三方库、业务逻辑js、 | ||
3 | + * sdk基本样式、指定皮肤样式、皮肤资源文件的路径添加到manifes文件中 | ||
4 | + * 并将修改时间更新到html文档的资源引用中 | ||
5 | + * 配置文件:config.js | ||
6 | + * 生成文件:skin/xxxx/sdk.manifest | ||
7 | + * 运行方法:node makefile.js | ||
8 | + **/ | ||
9 | +var fs = require('fs'), | ||
10 | + PATH = require('path'), | ||
11 | + config = require('./config.js'); | ||
12 | + | ||
13 | +var target = config.target; | ||
14 | +var concat_with_mtime = config.concat_with_mtime; | ||
15 | +var base_js = config.base_js; | ||
16 | +var base_img = config.images; | ||
17 | +var htmls = config.htmls; | ||
18 | +//读取三个html文件的内容,以便后面更新引用信息 | ||
19 | + | ||
20 | +var html_content = []; | ||
21 | +for (i = 0, l = htmls.length; i < l; i++) { | ||
22 | + html_content.push(fs.readFileSync(htmls[i], 'utf-8')); | ||
23 | +} | ||
24 | + | ||
25 | +function formatTime(mtime) { | ||
26 | + var date = ''; | ||
27 | + date += mtime.getFullYear(); | ||
28 | + var month = mtime.getMonth() + 1; | ||
29 | + month < 10 ? date += '0' + month : date += month; | ||
30 | + var day = mtime.getDate(); | ||
31 | + day < 10 ? date += '0' + day : date += day; | ||
32 | + var hour = mtime.getHours(); | ||
33 | + hour < 10 ? date += '0' + hour : date += hour; | ||
34 | + var minute = mtime.getMinutes(); | ||
35 | + minute < 10 ? date += '0' + minute : date += minute; | ||
36 | + return date; | ||
37 | +} | ||
38 | +var content = []; | ||
39 | +var path, mtime, jsPath, reg; | ||
40 | +content.push('CACHE MANIFEST'); | ||
41 | +content.push(''); | ||
42 | + | ||
43 | +var now = new Date(); | ||
44 | +content.push('#version=' + formatTime(now)); | ||
45 | + | ||
46 | +for(var i=0, l= htmls.length; i<l; i++){ | ||
47 | + path = htmls[i]; | ||
48 | + if(PATH.existsSync(path)){ | ||
49 | + // mtime = formatTime(fs.statSync(path).mtime); | ||
50 | + content.push('/static/sdk/' + path);// + '?' + mtime); | ||
51 | + } | ||
52 | +} | ||
53 | +for (i = 0, l = base_js.length; i < l; i++) { | ||
54 | + path = base_js[i]; | ||
55 | + if (PATH.existsSync(path)) { | ||
56 | + mtime = formatTime(fs.statSync(path).mtime); | ||
57 | + content.push('/static/sdk/' + path + '?' + mtime); | ||
58 | + //更新login.html, center.html, pay.html的引用信息的版本号 | ||
59 | + for (var j = 0, k = html_content.length; j < k; j++) { | ||
60 | + reg = new RegExp(path.replace('/', '\\/') + '\\?\\d+') | ||
61 | + html_content[j] = html_content[j].replace(reg, path + '?' + mtime); | ||
62 | + } | ||
63 | + } else { | ||
64 | + console.error('指定文件不存在:' + base_js[i]); | ||
65 | + } | ||
66 | +} | ||
67 | + | ||
68 | +for (i = 0, l = concat_with_mtime.length; i < l; i++) { | ||
69 | + path = concat_with_mtime[i]; | ||
70 | + if (PATH.existsSync(path)) { | ||
71 | + mtime = formatTime(fs.statSync(path).mtime); | ||
72 | + content.push('/static/sdk/' + path + '?' + mtime); | ||
73 | + //更新login.html, center.html, pay.html的引用信息的版本号 | ||
74 | + for (j = 0, k = html_content.length; j < k; j++) { | ||
75 | + reg = new RegExp(path.replace('/', '\\/') + '\\?\\d+') | ||
76 | + html_content[j] = html_content[j].replace(reg, path + '?' + mtime); | ||
77 | + } | ||
78 | + } else { | ||
79 | + console.error('指定文件不存在:' + path); | ||
80 | + } | ||
81 | +} | ||
82 | +// 添加sdk基本图片资源 | ||
83 | +/* | ||
84 | +var base_img_files = fs.readdirSync(base_img); | ||
85 | +for(i=0,l=base_img_files.length; i<l; i++){ | ||
86 | + if(base_img_files[i].indexOf('.') == 0) continue; | ||
87 | + path = base_img + '/' + base_img_files[i]; | ||
88 | + content.push('/static/sdk/' + path); | ||
89 | +} | ||
90 | +*/ | ||
91 | +//获取皮肤的最大mtime | ||
92 | +/* | ||
93 | +var skin_mtime = 0; | ||
94 | +for(i=0, l= target.length; i<l; i++){ | ||
95 | + path = 'skin/' + target[i] + '/skin.css'; | ||
96 | + mtime = parseInt(formatTime(fs.statSync(path).mtime)); | ||
97 | + if(mtime > skin_mtime) skin_mtime = mtime; | ||
98 | +} | ||
99 | +*/ | ||
100 | +//在基础文件上添加对应皮肤的样式和所需要的图片 | ||
101 | + | ||
102 | +var skin_content; | ||
103 | +for (i = 0, l = target.length; i < l; i++) { | ||
104 | + | ||
105 | + path = 'skin/' + target[i]; | ||
106 | + skin_content = content.concat(); | ||
107 | + /* | ||
108 | + skin_content.push('/static/sdk/' + path + '/skin.css' + '?' + skin_mtime); | ||
109 | + */ | ||
110 | + //更新login.html, center.html, pay.html的引用信息的版本号 | ||
111 | + for (j = 0, k = html_content.length; j < k; j++) { | ||
112 | + reg = new RegExp('data-v="\\d+"'); | ||
113 | + html_content[j] = html_content[j].replace(reg, 'data-v="' + skin_mtime + '"'); | ||
114 | + } | ||
115 | + //push the img fiels if exists | ||
116 | + /* | ||
117 | + var images = fs.readdirSync(path + '/img'); | ||
118 | + for (var j = 0, k = images.length; j < k; j++) { | ||
119 | + if(images[j].indexOf('.') == 0) continue; | ||
120 | + var img_path = path + '/img/' + images[j]; | ||
121 | + // mtime = formatTime(fs.statSync(img_path).mtime); | ||
122 | + skin_content.push('/static/sdk/' + path + '/img/' + images[j]) //+ '?' + mtime); | ||
123 | + } | ||
124 | + */ | ||
125 | + skin_content.push('NETWORK:'); | ||
126 | + skin_content.push('*'); | ||
127 | + skin_content = skin_content.join('\n'); | ||
128 | + fs.writeFileSync(path + '/sdk.manifest', skin_content); | ||
129 | +} | ||
130 | + | ||
131 | + | ||
132 | +content.push('NETWORK:'); | ||
133 | +content.push('*'); | ||
134 | +//生成基础的没有皮肤的缓存文件 | ||
135 | +fs.writeFileSync('skin/sdk.manifest', content.join('\n')); | ||
136 | +//将对html文件引用信息的修改写回文件中 | ||
137 | +for(i=0, l=htmls.length; i<l; i++){ | ||
138 | + fs.writeFileSync(htmls[i], html_content[i]); | ||
139 | +} | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed. Click to expand it.
1 | +date:2017-4-11 | ||
2 | +author | ||
3 | +:lizenghua | ||
4 | +instructions | ||
5 | +:与星玩SDK同步 | ||
6 | + | ||
7 | +date:2017-4-12 | ||
8 | +author:lizenghua | ||
9 | +instructions:修复当账户及密码为空时(本地存储的账号密码数据为空),通过密保找回密码时一直处于加载中无法跳转的问题 | ||
10 | + | ||
11 | +date:2017-4-21 | ||
12 | +author:lizenghua | ||
13 | +instructions: | ||
14 | + 1、当用户是正式用户并绑定了手机后进行实名认证;身份证校验js:identity_id.js | ||
15 | + 改动的文件有:login.html、login.js(同步在sdk_xingwan、sdk_6) | ||
16 | + 2、改动注释了pay.js里面的911行到918行:进入sdk要购买的游戏币>0时强制进入渠道充值页面(已同步在sdk_xingwan、sdk_6) | ||
17 | + | ||
18 | +date:2017-4-24 | ||
19 | +author:lizenghua | ||
20 | +instructions: | ||
21 | + 1、处理绑定手机的手机验证规则(176), | ||
22 | + 2、手机找回密码中重置密码残留旧密码问题 | ||
23 | + | ||
24 | + | ||
25 | +date:2017-5-3 | ||
26 | +author:lizenghua | ||
27 | +instructions: | ||
28 | + 1、注释掉pay.html中的“游爱星”兑换入口 | ||
29 | + 2、处理支付方式切换中出现 input_item 为undefind 的bug (将383行的{{?}}移至435行) | ||
30 | + 3、去掉设置密保中select默认的下拉图标(login.css) | ||
31 | + 4、如果没有第三方登录则隐藏掉“第三方登录”字眼 | ||
32 | + | ||
33 | +date:2017-5-8 | ||
34 | +author:lizenghua | ||
35 | +instructions:处理支付方式点击支付图标出现 input_item 为undefind 的bug(将150行$c改成$(this)) | ||
36 | + | ||
37 | +date:2017-5-12 | ||
38 | +author:lizenghua | ||
39 | +instructions:修改充值的界面显示大小 | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +<!DOCTYPE html> | ||
2 | +<html> | ||
3 | +<head> | ||
4 | +<meta name="viewport" content="width=device-width, user-scalable=no,target-densitydpi=device-dpi" /> | ||
5 | +<meta name="apple-mobile-web-app-capable" content="yes" /> | ||
6 | +<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | ||
7 | +<meta http-equiv="Content-type" content="text/html; charset=utf-8" /> | ||
8 | +<meta name="format-detection" content="telephone=no"> | ||
9 | +<meta name="screen-orientation" content="portrait"> | ||
10 | +<meta name="full-screen" content="yes"> | ||
11 | +<meta http-equiv="x-ua-compatible" content="IE=edge" /> | ||
12 | +<link href="skin/new_sdk.min.css?v=20150318002" type="text/css" rel="stylesheet" /> | ||
13 | +<link id="skin" data-v="20150318001" type="text/css" rel="stylesheet" /> | ||
14 | +<link href="skin/responsive.min.css?v=20150318001" type="text/css" rel="stylesheet" /> | ||
15 | +<title> | ||
16 | +手游平台登录 | ||
17 | +</title> | ||
18 | +</head> | ||
19 | +<body> | ||
20 | + | ||
21 | + | ||
22 | +<div class="mask"> | ||
23 | +<div class="container_load" id="loading"> | ||
24 | + <div class="content"> | ||
25 | + <div class="circle"></div> | ||
26 | + <div class="circle1"></div> | ||
27 | + </div> | ||
28 | +</div> | ||
29 | +<div class="alert alert-success hide" id="alert"> | ||
30 | + <button type="button" class="close" data-dismiss="alert">×</button> | ||
31 | + <span></span> | ||
32 | +</div> | ||
33 | +<section id="home" data-attr="dot" class="hide"></section> | ||
34 | +<section id="frame" data-attr="dot" class="hide" ></section> | ||
35 | +<script id="frame_template" type="text/x-jquery-tmpl" > | ||
36 | + <div class="header"> | ||
37 | + <span class="title">{{=Core.Data.frame_title}}</span> | ||
38 | + <a class="btn pull-left op-back" href="#main">返回</a> | ||
39 | + </div> | ||
40 | + <div class="container" style=""> | ||
41 | + <div class="container_load in_frame" id="loading_frame"> | ||
42 | + <div class="content"> | ||
43 | + <div class="circle"></div> | ||
44 | + <div class="circle1"></div> | ||
45 | + </div> | ||
46 | + </div> | ||
47 | + {{? Core.isIos}}<div class="ios_scroll">{{?}} | ||
48 | + <iframe frameborder=0 src="{{=Core.Data.frame_src}}" scrolling="yes" width="100%" height="100%"></iframe> | ||
49 | + {{? Core.isIos}}</div>{{?}} | ||
50 | + </div> | ||
51 | +</script> | ||
52 | +<script id="home_template" type="text/x-jquery-tmpl"> | ||
53 | + <div class="header"> | ||
54 | + <span class="title">分享游戏</span> | ||
55 | + <a class="btn pull-left op-back" href="sdk://exit?action=share">回到游戏</a> | ||
56 | + </div> | ||
57 | + <div class="container"> | ||
58 | + <div class="box_info_center"> | ||
59 | + <div class="share_box1"> | ||
60 | + <div class="share_game clearfix"> | ||
61 | + <img class="pull-left game_face" src="{{=Core.Data.icon || ''}}" height="75" width="75"> | ||
62 | + <textarea class="s_content">{{=Core.Data.content || '这款游戏还不错噢,一起来玩吧!'}}</textarea> | ||
63 | + </div> | ||
64 | + </div> | ||
65 | + <div class="share_box2"> | ||
66 | + <div class=""> | ||
67 | + <h3 class="text-info">分享到</h3> | ||
68 | + <ul class="other-login inline clearfix"> | ||
69 | + <li><a href="/sdk/share/game/qq/?app_id={{=Core.Data.app_id || ''}}" class="qq" title="QQ空间分享"></a></li> | ||
70 | + <li><a href="/sdk/share/game/sina/?app_id={{=Core.Data.app_id || ''}}" class="sina" title="新浪微博分享"></a></li> | ||
71 | + <li><a href="/sdk/share/game/tqq/?app_id={{=Core.Data.app_id || ''}}" class="tqq" title="腾讯微博分享"></a></li> | ||
72 | + </ul> | ||
73 | + <div class="invite_box"> | ||
74 | + <h3 class="text-info">奖励说明:</h3> | ||
75 | + <p> | ||
76 | + 1.成功邀请好友一起玩游戏,您可获得<span class="text-info">5{{=Core.Data.game_unit_name}}</span>的奖励。 | ||
77 | + </p> | ||
78 | + <p> | ||
79 | + 2.好友若充值(限前10笔),您可获得<span class="text-info">5%</span>充值奖励。 | ||
80 | + </p> | ||
81 | + <p> | ||
82 | + 3.好友首次充值,因被您邀请可额外获得<span class="text-info">10%</span>充值返利。 | ||
83 | + </p> | ||
84 | + </div> | ||
85 | + </div> | ||
86 | + </div> | ||
87 | + </div> | ||
88 | + </div> | ||
89 | +</script> | ||
90 | +</div> | ||
91 | + | ||
92 | +<script type="text/javascript" src="js/fastclick.min.1.0.js?201309041309"></script> | ||
93 | +<script type="text/javascript" src="js/zepto.min.js?201309041309"></script> | ||
94 | +<script type="text/javascript" src="js/doT.min.js?201309041309" ></script> | ||
95 | +<script type="text/javascript"> | ||
96 | +window.isGetData = 0; | ||
97 | +$(function() { | ||
98 | +FastClick.attach(document.body); | ||
99 | +}); | ||
100 | +</script> | ||
101 | +<script type="text/javascript" src="js/core.min.js?201403141112" ></script> | ||
102 | +<script type="text/javascript"> | ||
103 | + (function(){ | ||
104 | + // Home模块 | ||
105 | + var Home = function(modId) { | ||
106 | + Module.call(this, modId); | ||
107 | + } | ||
108 | + // 继承基础模块 | ||
109 | + Core.inherit(Home, Module); | ||
110 | + Home.prototype.bind = function(){ | ||
111 | + var that = this; | ||
112 | + that.$c.on('click', '.other-login a', function(e){ | ||
113 | + e.preventDefault(); | ||
114 | + //分享连接 | ||
115 | + var $tar = $(e.target); | ||
116 | + var content = that.$c.find('.s_content').val(); | ||
117 | + $tar.attr('params', 'content=' + content); | ||
118 | + Core.ajax_do($tar, function(data){ | ||
119 | + console.log(data); | ||
120 | + if(data.code == 0){ | ||
121 | + if(data.msg.next_url){ | ||
122 | + // 需要重新授权 | ||
123 | + var src = data.msg.next_url; | ||
124 | + if (Core.isFile) { | ||
125 | + src = Core.server + src; | ||
126 | + } | ||
127 | + Core.Data.frame_title = $tar.attr('title'); | ||
128 | + Core.Data.frame_src = src; | ||
129 | + Core.updateMod('frame'); | ||
130 | + } else { | ||
131 | + // | ||
132 | + Core.showTips(data.msg); | ||
133 | + } | ||
134 | + } | ||
135 | + }, that); | ||
136 | + }); | ||
137 | + } | ||
138 | + Core.registerMod('home', Home); | ||
139 | + var Frame = function(modId) { | ||
140 | + Module.call(this, modId); | ||
141 | + } | ||
142 | + Core.inherit(Frame, Module); | ||
143 | + Frame.prototype.show_after = function() { | ||
144 | + var that = this; | ||
145 | + var _des = Core.last_mod ? Core.last_mod : 'home'; | ||
146 | + this.$c.find('a.btn.pull-left').attr('href', '#' + _des); | ||
147 | + this.$c.find('iframe')[0].onload = function() { | ||
148 | + that.$c.find('#loading_frame').hide(); | ||
149 | + } | ||
150 | + } | ||
151 | + Core.registerMod('frame', Frame); | ||
152 | + })(); | ||
153 | +</script> | ||
154 | +<script type="text/javascript" src="js/loader.min.js?201401151617"></script> | ||
155 | +<script type="text/javascript"> | ||
156 | +(function(){ | ||
157 | + window.isGetData = 1; | ||
158 | + getData('/game/info/'); | ||
159 | +})(); | ||
160 | +</script> | ||
161 | + | ||
162 | +</body> | ||
163 | +</html> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 | +CACHE MANIFEST | ||
2 | + | ||
3 | +#version=20151112001 | ||
4 | +/static/sdk_3/login.html?20151112001 | ||
5 | +/static/sdk_3/center.html?20151112001 | ||
6 | +/static/sdk_3/pay.html?20151112001 | ||
7 | +/static/sdk_3/share.html?20151112001 | ||
8 | +/static/sdk_3/js/fastclick.min.1.0.js?20151112001 | ||
9 | +/static/sdk_3/js/zepto.min.js?20151112001 | ||
10 | +/static/sdk_3/js/doT.min.js?20151112001 | ||
11 | +/static/sdk_3/js/iscroll.min.1.0.js?20151112001 | ||
12 | +/static/sdk_3/skin/login.css?20151112001 | ||
13 | +/static/sdk_3/skin/pay.css?20151112001 | ||
14 | + | ||
15 | +/static/sdk_3/js/core.min.js?20151112001 | ||
16 | +/static/sdk_3/js/loader.min.js?20151112001 | ||
17 | +/static/sdk_3/js/center.min.js?20151112001 | ||
18 | +/static/sdk_3/js/pay.min.js?20151112001 | ||
19 | +/static/sdk_3/js/login.min.js?20151112001 | ||
20 | +/static/sdk_3/images/login_icon.png?20151112001 | ||
21 | +/static/sdk_3/images/new-sdk-logo.png?20151112001 | ||
22 | +NETWORK: | ||
23 | +* | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
1 | +#!/bin/sh | ||
2 | +#js css压缩,生成更新包打包 | ||
3 | + | ||
4 | +CDN_SERVER='http://cdn.9133.com/static' | ||
5 | + | ||
6 | + | ||
7 | +DIR_PATH="$( cd "$( dirname "$0" )" && pwd )" | ||
8 | +echo "$DIR_PATH" | ||
9 | +cd $DIR_PATH | ||
10 | +VERSION=`cat version.txt` | ||
11 | +DIR_NAME=${DIR_PATH##*/} | ||
12 | +ZIP_FILE="${DIR_NAME}_${VERSION}.zip" | ||
13 | +SAVE_DIR="dst" | ||
14 | +MD5='' | ||
15 | +echo $DIR_NAME | ||
16 | + | ||
17 | + | ||
18 | + | ||
19 | +function make_new_zip_file { | ||
20 | + cd $DIR_PATH | ||
21 | + mkdir -pv dst | ||
22 | + save_zip_file="${SAVE_DIR}/${ZIP_FILE}" | ||
23 | + [ -f "$save_zip_file" ] && rm "$save_zip_file" && echo "rm $save_zip_file" | ||
24 | + echo "zip $ZIP_FILE" | ||
25 | + zip -x 'uglifyjs_sqwish.sh' -x 'v.txt' -x '*.svn/*' -x "${SAVE_DIR}/*" -x "${ZIP_FILE}" -r "${save_zip_file}" ./ | ||
26 | + MD5=`md5sum dst/${ZIP_FILE} |cut -d ' ' -f1` | ||
27 | + | ||
28 | +} | ||
29 | +function make_version_file { | ||
30 | + make_new_zip_file | ||
31 | + cd $DIR_PATH | ||
32 | + URL="${CDN_SERVER}/${DIR_NAME}/${SAVE_DIR}/${ZIP_FILE}" | ||
33 | + echo "${VERSION}|${MD5}|${URL}" > v.txt | ||
34 | + cat v.txt | ||
35 | +} | ||
36 | +function uglifyjs_js_css { | ||
37 | + cd $DIR_PATH | ||
38 | + cd js/ | ||
39 | + for f in `ls *.js`;do | ||
40 | + uglifyjs $f -m -o $f | ||
41 | + done | ||
42 | + cd ../skin | ||
43 | + | ||
44 | + unalias mv | ||
45 | + | ||
46 | + for f in `ls *.css`;do | ||
47 | + if [ -f "$f" ];then | ||
48 | + | ||
49 | + sqwish $f | ||
50 | + new_f=`basename $f css` | ||
51 | + new_f="$new_f""min.css" | ||
52 | + echo " mv $new_f $f" | ||
53 | + [ -f "$new_f" ] && mv $new_f $f | ||
54 | + fi | ||
55 | + done | ||
56 | + cd .. | ||
57 | +} | ||
58 | + | ||
59 | + | ||
60 | +uglifyjs_js_css | ||
61 | +make_version_file | ||
62 | + | ||
63 | + | ||
64 | + |
1 | +20170511 |
publicAndroidSDK/demo/Demo_PoolSdk/build.xml
100755 → 100644
File mode changed
File mode changed
File mode changed
publicAndroidSDK/demo/Demo_PoolSdk/ic_launcher-web.png
100755 → 100644
publicAndroidSDK/demo/Demo_PoolSdk/libs/PoolOkhttp.jar
100755 → 100644
No preview for this file type
No preview for this file type
No preview for this file type
publicAndroidSDK/demo/Demo_PoolSdk/libs/android-support-v4.jar
100755 → 100644
No preview for this file type
publicAndroidSDK/demo/Demo_PoolSdk/libs/okio-1.6.0.jar
100755 → 100644
No preview for this file type
publicAndroidSDK/demo/Demo_PoolSdk/libs/poolsdkV2.jar
100755 → 100644
No preview for this file type
publicAndroidSDK/demo/Demo_PoolSdk/lint.xml
100755 → 100644
File mode changed
publicAndroidSDK/demo/Demo_PoolSdk/local.properties
100755 → 100644
File mode changed
publicAndroidSDK/demo/Demo_PoolSdk/proguard-project.txt
100755 → 100644
File mode changed
publicAndroidSDK/demo/Demo_PoolSdk/project.properties
100755 → 100644
... | @@ -11,4 +11,4 @@ | ... | @@ -11,4 +11,4 @@ |
11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | 11 | #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt |
12 | 12 | ||
13 | # Project target. | 13 | # Project target. |
14 | -target=android-19 | 14 | +target=android-20 | ... | ... |
File mode changed
publicAndroidSDK/demo/Demo_PoolSdk/res/drawable/public_sdk_self_ya_login_bt_selector.xml
100755 → 100644
File mode changed
File mode changed
File mode changed
File mode changed
... | @@ -13,13 +13,11 @@ import android.widget.Button; | ... | @@ -13,13 +13,11 @@ import android.widget.Button; |
13 | 13 | ||
14 | import com.gzyouai.fengniao.sdk.framework.PoolExitDialogListener; | 14 | import com.gzyouai.fengniao.sdk.framework.PoolExitDialogListener; |
15 | import com.gzyouai.fengniao.sdk.framework.PoolExitListener; | 15 | import com.gzyouai.fengniao.sdk.framework.PoolExitListener; |
16 | -import com.gzyouai.fengniao.sdk.framework.PoolExpansionListener; | ||
17 | import com.gzyouai.fengniao.sdk.framework.PoolLoginInfo; | 16 | import com.gzyouai.fengniao.sdk.framework.PoolLoginInfo; |
18 | import com.gzyouai.fengniao.sdk.framework.PoolLoginListener; | 17 | import com.gzyouai.fengniao.sdk.framework.PoolLoginListener; |
19 | import com.gzyouai.fengniao.sdk.framework.PoolLogoutListener; | 18 | import com.gzyouai.fengniao.sdk.framework.PoolLogoutListener; |
20 | import com.gzyouai.fengniao.sdk.framework.PoolPayInfo; | 19 | import com.gzyouai.fengniao.sdk.framework.PoolPayInfo; |
21 | import com.gzyouai.fengniao.sdk.framework.PoolPayListener; | 20 | import com.gzyouai.fengniao.sdk.framework.PoolPayListener; |
22 | -import com.gzyouai.fengniao.sdk.framework.PoolReport; | ||
23 | import com.gzyouai.fengniao.sdk.framework.PoolRoleInfo; | 21 | import com.gzyouai.fengniao.sdk.framework.PoolRoleInfo; |
24 | import com.gzyouai.fengniao.sdk.framework.PoolRoleListener; | 22 | import com.gzyouai.fengniao.sdk.framework.PoolRoleListener; |
25 | import com.gzyouai.fengniao.sdk.framework.PoolSDKCallBackListener; | 23 | import com.gzyouai.fengniao.sdk.framework.PoolSDKCallBackListener; |
... | @@ -34,9 +32,9 @@ public class AppActivity extends Activity { | ... | @@ -34,9 +32,9 @@ public class AppActivity extends Activity { |
34 | private Button yaPayBt; | 32 | private Button yaPayBt; |
35 | private Button yaSubmitRoleDataBt; | 33 | private Button yaSubmitRoleDataBt; |
36 | private Button yaChannelCenter; | 34 | private Button yaChannelCenter; |
37 | - private Button yaSwitchAccountBt; | ||
38 | private Button yaLogoutBt; | 35 | private Button yaLogoutBt; |
39 | private Button yaForumBt; | 36 | private Button yaForumBt; |
37 | + private Button yaSwitchAccountBt; | ||
40 | 38 | ||
41 | @Override | 39 | @Override |
42 | protected void onCreate(Bundle savedInstanceState) { | 40 | protected void onCreate(Bundle savedInstanceState) { |
... | @@ -238,13 +236,13 @@ public class AppActivity extends Activity { | ... | @@ -238,13 +236,13 @@ public class AppActivity extends Activity { |
238 | yaChannelCenter = (Button) findViewById(getRedIdByName( | 236 | yaChannelCenter = (Button) findViewById(getRedIdByName( |
239 | "ya_channel_center", "id")); | 237 | "ya_channel_center", "id")); |
240 | yaChannelCenter.setText("渠道中心"); | 238 | yaChannelCenter.setText("渠道中心"); |
241 | - yaSwitchAccountBt = (Button) findViewById(getRedIdByName( | ||
242 | - "ya_switch_account_bt", "id")); | ||
243 | - yaSwitchAccountBt.setText("切换账号"); | ||
244 | PoolSdkLog.logError("" + yaPayBt + "yachannel:" + yaChannelCenter); | 239 | PoolSdkLog.logError("" + yaPayBt + "yachannel:" + yaChannelCenter); |
245 | 240 | ||
246 | yaLogoutBt = (Button) findViewById(getRedIdByName("logout_bt", "id")); | 241 | yaLogoutBt = (Button) findViewById(getRedIdByName("logout_bt", "id")); |
247 | 242 | ||
243 | + yaSwitchAccountBt = (Button) findViewById(getRedIdByName("ya_switch_account_bt", "id")); | ||
244 | + yaSwitchAccountBt.setText("切换账号"); | ||
245 | + | ||
248 | yaForumBt = (Button) findViewById(getRedIdByName("forum_bt", "id")); | 246 | yaForumBt = (Button) findViewById(getRedIdByName("forum_bt", "id")); |
249 | } | 247 | } |
250 | 248 | ||
... | @@ -254,19 +252,37 @@ public class AppActivity extends Activity { | ... | @@ -254,19 +252,37 @@ public class AppActivity extends Activity { |
254 | } else if (view == yaEnterGameBt) { | 252 | } else if (view == yaEnterGameBt) { |
255 | setContentView(getRedIdByName("public_sdk_self_game", "layout"));// (R.layout.game); | 253 | setContentView(getRedIdByName("public_sdk_self_game", "layout"));// (R.layout.game); |
256 | initGameView(); | 254 | initGameView(); |
257 | - PoolReport.reportEnterGame("chufan","角色名", 12, "201","服务器名"); | ||
258 | } else if (view == yaPayBt) { | 255 | } else if (view == yaPayBt) { |
259 | pay(); | 256 | pay(); |
260 | } else if (view == yaSubmitRoleDataBt) { | 257 | } else if (view == yaSubmitRoleDataBt) { |
261 | submitRoleData(); | 258 | submitRoleData(); |
262 | } else if (view == yaChannelCenter) { | 259 | } else if (view == yaChannelCenter) { |
263 | channelCenter(); | 260 | channelCenter(); |
264 | - } else if (view == yaSwitchAccountBt) { | ||
265 | - switchAccount(); | ||
266 | } else if (view == yaLogoutBt){ | 261 | } else if (view == yaLogoutBt){ |
267 | logout(); | 262 | logout(); |
268 | } else if (view == yaForumBt){ | 263 | } else if (view == yaForumBt){ |
269 | openForum(); | 264 | openForum(); |
265 | + } else if(view == yaSwitchAccountBt){//切换账号 | ||
266 | + switchAccount(); | ||
267 | + } | ||
268 | + } | ||
269 | + | ||
270 | + /** | ||
271 | + * 切换帐号 | ||
272 | + */ | ||
273 | + private void switchAccount() { | ||
274 | + if(PoolSdkHelper.hasSwitchAccount()){ | ||
275 | + PoolSdkHelper.switchAccount(this); | ||
276 | + }else if(PoolSdkHelper.hasLogout()){ | ||
277 | + PoolSdkHelper.logout(this);//在注销监听回调中处理注销 | ||
278 | + }else if(PoolSdkHelper.hasChannelCenter()){//打开渠道中心看是否有切换账号 | ||
279 | + PoolSdkHelper.openChannelCenter(); | ||
280 | + }else{ | ||
281 | + //直接回到登录界面调用登录 | ||
282 | + int layoutId = getResources().getIdentifier( | ||
283 | + "public_sdk_self_game_login", "layout", getPackageName()); | ||
284 | + setContentView(layoutId); | ||
285 | + initLoginView(); | ||
270 | } | 286 | } |
271 | } | 287 | } |
272 | 288 | ||
... | @@ -275,8 +291,8 @@ public class AppActivity extends Activity { | ... | @@ -275,8 +291,8 @@ public class AppActivity extends Activity { |
275 | } | 291 | } |
276 | 292 | ||
277 | private void logout(){ | 293 | private void logout(){ |
278 | - PoolSdkHelper.logout(this);//结果回调通知到PoolLogoutListener | ||
279 | if(PoolSdkHelper.hasLogout()){ | 294 | if(PoolSdkHelper.hasLogout()){ |
295 | + PoolSdkHelper.logout(this);//结果回调通知到PoolLogoutListener | ||
280 | } | 296 | } |
281 | } | 297 | } |
282 | 298 | ||
... | @@ -329,7 +345,7 @@ public class AppActivity extends Activity { | ... | @@ -329,7 +345,7 @@ public class AppActivity extends Activity { |
329 | // 兑换比例 | 345 | // 兑换比例 |
330 | poolPayInfo.setExchange("10"); | 346 | poolPayInfo.setExchange("10"); |
331 | // 自定义参数 | 347 | // 自定义参数 |
332 | - poolPayInfo.setCustom("我是自定义参数"); | 348 | + poolPayInfo.setCustom("operator=xwrw&server_id=39&player_id=2081&cp_order_id=001000100000020811491470345294&dext=2"); |
333 | 349 | ||
334 | // TODO Auto-generated method stub | 350 | // TODO Auto-generated method stub |
335 | PoolSdkHelper.pay(poolPayInfo, new PoolPayListener() { | 351 | PoolSdkHelper.pay(poolPayInfo, new PoolPayListener() { |
... | @@ -388,33 +404,11 @@ public class AppActivity extends Activity { | ... | @@ -388,33 +404,11 @@ public class AppActivity extends Activity { |
388 | /** | 404 | /** |
389 | * 用户中心 | 405 | * 用户中心 |
390 | * | 406 | * |
391 | - * 游戏方先调用YASDKHelper.hasChannelCenter()获取是否有用户中心, | 407 | + * 游戏方先调用PoolSdkHelper.hasChannelCenter()获取是否有用户中心, |
392 | - * 如果有的话,游戏中需要添加按钮,点击按钮调用YASDKHelper.openChannelCenter(); | 408 | + * 如果有的话,游戏中需要添加按钮,点击按钮调用PoolSdkHelper.openChannelCenter(); |
393 | * 如果没有,则不需要显示按钮,也不用调用下面的接口 | 409 | * 如果没有,则不需要显示按钮,也不用调用下面的接口 |
394 | */ | 410 | */ |
395 | private void channelCenter() { | 411 | private void channelCenter() { |
396 | PoolSdkHelper.openChannelCenter(); | 412 | PoolSdkHelper.openChannelCenter(); |
397 | } | 413 | } |
398 | - | ||
399 | - /** | ||
400 | - * 切换帐号 | ||
401 | - */ | ||
402 | - private void switchAccount() { | ||
403 | - if(PoolSdkHelper.hasSwitchAccount()){ | ||
404 | - PoolSdkHelper.switchAccount(this); | ||
405 | - } | ||
406 | - } | ||
407 | - | ||
408 | - /** | ||
409 | - * 扩展接口 | ||
410 | - */ | ||
411 | - private void expansionInterface() { | ||
412 | - PoolSdkHelper.expansionInterface("自定义参数", new PoolExpansionListener() { | ||
413 | - | ||
414 | - @Override | ||
415 | - public void onSuccess(String paramCustom) { | ||
416 | - | ||
417 | - } | ||
418 | - }); | ||
419 | - } | ||
420 | } | 414 | } | ... | ... |
publicAndroidSDK/libs/poolsdkV2.jar
100755 → 100644
No preview for this file type
-
Please register or login to post a comment