xuguohong

9133替换为youyu

Showing 74 changed files with 679 additions and 65 deletions
No preview for this file type
......@@ -105,22 +105,6 @@
android:name=".wxapi.WXEntryActivity"
android:exported="true"
android:launchMode="singleTop" />
<uses-library
android:name="org.simalliance.openmobileapi"
android:required="false" />
<activity
android:name="com.unionpay.uppay.PayActivity"
android:configChanges="orientation|keyboardHidden|keyboard"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.unionpay.UPPayWapActivity"
android:configChanges="orientation|keyboardHidden|fontScale"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize" >
</activity>
<!-- SDK end -->
</application>
......
No preview for this file type
......@@ -2,22 +2,18 @@
<config>
<sdkconfig
YA_APPKEY="a76f1e9968f496a67cd4a1e3f6bc7cce"
YA_APPID="57d1376f665fff4fbea91502"
YA_APPID="58fd78a9834e7246b8dc0eac"
YA_APPKEY="b06b86b79c25774ec758657a7203bae6"
gamesimplename="fytx_test"
sdksimplename="youyu"
sdkversioncode="V1_0"
channelparameter1=""
channelparameter2=""
custom=""
gamechannelid=""
logincheckurl="Xwm2VZk4IZHw4pR8WSu0JRSPl5jMDzA8+5nKH+jNJckQW+5uHcG5Mxl+gMWO6s8PhqrR0VX7irk="
payorderurl="Xwm2VZk4IZHw4pR8WSu0JRSPl5jMDzA8+5nKH+jNJclRWohb/BPqZ4SO5qrmq1RBsIoFXavzUfg="
paycheckurl="Xwm2VZk4IZHw4pR8WSu0JRSPl5jMDzA8+5nKH+jNJclRWohb/BPqZ4ChH88g5ubtvsBW3D32B8c="
sdksimplename="vWVsU5Ogkh8="
sdkversioncode="BVPAQexcXDk="
styleName="4N7gnKed6uk="
usertype="gssaXIIEiL0="
weixinId="x3d4hSeP9KFDTFusyU+iB/9NgyvRyoop" />
logincheckurl="http://login.public.sdk.gzyouai.com/logincheck/check"
paycheckurl="http://pay.public.sdk.gzyouai.com/paycheck/confirm"
payorderurl="http://pay.public.sdk.gzyouai.com/paycheck/create"
usertype="gssaXIIEiL0=" />
</config>
\ No newline at end of file
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
//游戏皮肤对应manifest文件的生成配置文件, 包括基本的第三方库、业务逻辑js、样式
var base_js = [
'js/fastclick.min.1.0.js',
'js/zepto.min.js',
'js/doT.min.js',
'js/iscroll.min.1.0.js'
]
var concat_with_mtime = [
'skin/new_sdk.min.css',
'skin/responsive.min.css',
'js/core.min.js',
'js/loader.min.js',
'js/center.min.js',
'js/pay.min.js',
'js/login.min.js'
]
var htmls = [
'login.html',
'center.html',
'pay.html',
'share.html'
]
var images = 'skin/img';
var target = [
'bllm',
'bwts',
'bwzq',
'fytx',
'hxjh',
'rxxt',
'sgg',
'smlw',
'twzw',
'whj'
]
exports.htmls = htmls;
exports.target = target;
exports.concat_with_mtime = concat_with_mtime;
exports.base_js = base_js;
exports.images = images;
\ 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.
// Laura Doktorova https://github.com/olado/doT
(function(){function o(){var b={"&":"&#38;","<":"&#60;",">":"&#62;",'"':"&#34;","'":"&#39;","/":"&#47;"},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,
"$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")}();
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,
" ").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"+
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: "+
b);throw t;}};j.compile=function(b,a){return j.template(b,null,a)}})();
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
This diff is collapsed. Click to expand it.
(function() {
// 加载数据
var goInit = function() {
if (window.isGetData == 1) {
Core.init();
} else {
window.isGetData = 1;
}
}
var getData = function(url) {
var params = location.hash.slice(1);
var args = params.match(/app_id=(\w*)&?/);
var start_page = params.match(/mod=(\w*)&?/);
var core_server = params.match(/core_server=(.*)&?/);
var appId = '';
var skin_v = '?' + $('#skin').attr('data-v');
if (args && args.length == 2) {
//匹配出app_id
appId = args[1];
}
if(start_page && start_page.length == 2){
//匹配出启动模块
Core.start_page = start_page[1];
console.log(Core.start_page);
}
if (core_server){
Core.server = core_server[1]
}
location.hash = '';
if (appId == '') {
//刷新地址出错
params = localStorage.getItem('params_' + url);
appId = localStorage.getItem('app_id');
} else {
localStorage.setItem('params_' + url, params);
localStorage.setItem('app_id', appId);
}
Core.params = params;
if (!appId) {
//无法获取到app_id
Core.showTips('无法获取app_id!', false, 3000);
goInit();
$('#loading').hide();
return;
}
Core.Data.app_id = appId;
var setSkin = false;
//先尝试设置皮肤,检查是否自动登录
var tryAutoLogin = false;
var _skin = localStorage.getItem('skin_' + appId);
if (_skin) {
$('#skin').attr('href', Core.server + '/static/sdk/skin/' + _skin + '/skin.css' + skin_v);
setSkin = true;
}
if ($('#login').length != 0) {
var auto = localStorage.getItem('auto');
var auto_time = parseInt(localStorage.getItem('auto_time'));
var d = new Date().getTime();
if (auto == 'true' && (d - auto_time) < 600000) {
tryAutoLogin = false;
} else if (auto == null) {
tryAutoLogin = false;
} else {
tryAutoLogin = true;
}
}
//如果不尝试自动登录,直接初始化界面
if (!tryAutoLogin)
goInit();
Core.ajax({
type: 'GET',
url: url + '?' + params,
dataType: 'json',
success: function(data) {
if (data.code == 0) {
// 成功请求
Core.Data = data.msg;
if (Core.Data.face) {
Core.Data.face = Core.server + data.msg.face;
}
//更新server
var lastServer = localStorage.getItem('last_server');
if (Core.Data.new_server) {
if (lastServer && lastServer == Core.Data.new_server) {
//没有变化
} else {
//需要更新server
var s = 'sdk://changeServer?addr=' + Core.Data.new_server;
localStorage.setItem('last_server', Core.Data.new_server);
location.href = s;
}
}
if (!setSkin && data.skin) {
$('#skin').attr('href', Core.server + '/static/sdk/skin/' + data.skin + '/skin.css' + skin_v);
localStorage.setItem('skin_' + appId, data.skin);
}
localStorage.setItem('data_' + url, JSON.stringify(data.msg));
//模块初始化函数,兼容旧版本sdk
if (typeof(window.initFunc) == "function") {
window.initFunc();
}
// 核心初始化
$('#loading').hide();
if (tryAutoLogin) {
goInit();
} else {
var first_mod = Core.start_page? Core.start_page: 'home';
Core.updateMod(first_mod);
}
} else {
//参数出错,没有游戏服什么的.
$('#loading').hide();
$('<h2 class="error_title">出错了,正在努力抢修中...</h2>').appendTo($('.mask'));
Core.showTips(data.msg, false, 6000);
// 核心初始化
Core.loadFinished();
}
},
error: function(xhr, type) {
// 请求失败,服务器崩溃
//尝试从缓存中获取数据
var data_str = localStorage.getItem('data_' + url);
if (data_str && data_str != '') {
var data = JSON.parse(data_str);
if (typeof data == "object") {
Core.Data = data;
if (tryAutoLogin) {
goInit();
} else {
Core.updateMod('home');
}
}
}
Core.showTips('网络出错,请检查网络状态。', false);
// 核心初始化
$('#loading').hide();
}
});
}
window.getData = getData;
})();
\ 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.
/*!
** create by zhangxinxu(.com) 2013-07-15
** a simple method for custom scrolling
** it can be used on both mobile and parts desktop browser IE9+/FF/Chrome/...
*/
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
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
/**
* 动态生成各游戏皮肤下对应的manifest文件。分别将带上修改时间戳的第三方库、业务逻辑js、
* sdk基本样式、指定皮肤样式、皮肤资源文件的路径添加到manifes文件中
* 并将修改时间更新到html文档的资源引用中
* 配置文件:config.js
* 生成文件:skin/xxxx/sdk.manifest
* 运行方法:node makefile.js
**/
var fs = require('fs'),
PATH = require('path'),
config = require('./config.js');
var target = config.target;
var concat_with_mtime = config.concat_with_mtime;
var base_js = config.base_js;
var base_img = config.images;
var htmls = config.htmls;
//读取三个html文件的内容,以便后面更新引用信息
var html_content = [];
for (i = 0, l = htmls.length; i < l; i++) {
html_content.push(fs.readFileSync(htmls[i], 'utf-8'));
}
function formatTime(mtime) {
var date = '';
date += mtime.getFullYear();
var month = mtime.getMonth() + 1;
month < 10 ? date += '0' + month : date += month;
var day = mtime.getDate();
day < 10 ? date += '0' + day : date += day;
var hour = mtime.getHours();
hour < 10 ? date += '0' + hour : date += hour;
var minute = mtime.getMinutes();
minute < 10 ? date += '0' + minute : date += minute;
return date;
}
var content = [];
var path, mtime, jsPath, reg;
content.push('CACHE MANIFEST');
content.push('');
var now = new Date();
content.push('#version=' + formatTime(now));
for(var i=0, l= htmls.length; i<l; i++){
path = htmls[i];
if(PATH.existsSync(path)){
// mtime = formatTime(fs.statSync(path).mtime);
content.push('/static/sdk/' + path);// + '?' + mtime);
}
}
for (i = 0, l = base_js.length; i < l; i++) {
path = base_js[i];
if (PATH.existsSync(path)) {
mtime = formatTime(fs.statSync(path).mtime);
content.push('/static/sdk/' + path + '?' + mtime);
//更新login.html, center.html, pay.html的引用信息的版本号
for (var j = 0, k = html_content.length; j < k; j++) {
reg = new RegExp(path.replace('/', '\\/') + '\\?\\d+')
html_content[j] = html_content[j].replace(reg, path + '?' + mtime);
}
} else {
console.error('指定文件不存在:' + base_js[i]);
}
}
for (i = 0, l = concat_with_mtime.length; i < l; i++) {
path = concat_with_mtime[i];
if (PATH.existsSync(path)) {
mtime = formatTime(fs.statSync(path).mtime);
content.push('/static/sdk/' + path + '?' + mtime);
//更新login.html, center.html, pay.html的引用信息的版本号
for (j = 0, k = html_content.length; j < k; j++) {
reg = new RegExp(path.replace('/', '\\/') + '\\?\\d+')
html_content[j] = html_content[j].replace(reg, path + '?' + mtime);
}
} else {
console.error('指定文件不存在:' + path);
}
}
// 添加sdk基本图片资源
/*
var base_img_files = fs.readdirSync(base_img);
for(i=0,l=base_img_files.length; i<l; i++){
if(base_img_files[i].indexOf('.') == 0) continue;
path = base_img + '/' + base_img_files[i];
content.push('/static/sdk/' + path);
}
*/
//获取皮肤的最大mtime
/*
var skin_mtime = 0;
for(i=0, l= target.length; i<l; i++){
path = 'skin/' + target[i] + '/skin.css';
mtime = parseInt(formatTime(fs.statSync(path).mtime));
if(mtime > skin_mtime) skin_mtime = mtime;
}
*/
//在基础文件上添加对应皮肤的样式和所需要的图片
var skin_content;
for (i = 0, l = target.length; i < l; i++) {
path = 'skin/' + target[i];
skin_content = content.concat();
/*
skin_content.push('/static/sdk/' + path + '/skin.css' + '?' + skin_mtime);
*/
//更新login.html, center.html, pay.html的引用信息的版本号
for (j = 0, k = html_content.length; j < k; j++) {
reg = new RegExp('data-v="\\d+"');
html_content[j] = html_content[j].replace(reg, 'data-v="' + skin_mtime + '"');
}
//push the img fiels if exists
/*
var images = fs.readdirSync(path + '/img');
for (var j = 0, k = images.length; j < k; j++) {
if(images[j].indexOf('.') == 0) continue;
var img_path = path + '/img/' + images[j];
// mtime = formatTime(fs.statSync(img_path).mtime);
skin_content.push('/static/sdk/' + path + '/img/' + images[j]) //+ '?' + mtime);
}
*/
skin_content.push('NETWORK:');
skin_content.push('*');
skin_content = skin_content.join('\n');
fs.writeFileSync(path + '/sdk.manifest', skin_content);
}
content.push('NETWORK:');
content.push('*');
//生成基础的没有皮肤的缓存文件
fs.writeFileSync('skin/sdk.manifest', content.join('\n'));
//将对html文件引用信息的修改写回文件中
for(i=0, l=htmls.length; i<l; i++){
fs.writeFileSync(htmls[i], html_content[i]);
}
\ No newline at end of file
This diff is collapsed. Click to expand it.
date:2017-4-11
author
:lizenghua
instructions
:与星玩SDK同步
date:2017-4-12
author:lizenghua
instructions:修复当账户及密码为空时(本地存储的账号密码数据为空),通过密保找回密码时一直处于加载中无法跳转的问题
date:2017-4-21
author:lizenghua
instructions:
1、当用户是正式用户并绑定了手机后进行实名认证;身份证校验js:identity_id.js
改动的文件有:login.html、login.js(同步在sdk_xingwan、sdk_6)
2、改动注释了pay.js里面的911行到918行:进入sdk要购买的游戏币>0时强制进入渠道充值页面(已同步在sdk_xingwan、sdk_6)
date:2017-4-24
author:lizenghua
instructions:
1、处理绑定手机的手机验证规则(176),
2、手机找回密码中重置密码残留旧密码问题
date:2017-5-3
author:lizenghua
instructions:
1、注释掉pay.html中的“游爱星”兑换入口
2、处理支付方式切换中出现 input_item 为undefind 的bug (将383行的{{?}}移至435行)
3、去掉设置密保中select默认的下拉图标(login.css)
4、如果没有第三方登录则隐藏掉“第三方登录”字眼
date:2017-5-8
author:lizenghua
instructions:处理支付方式点击支付图标出现 input_item 为undefind 的bug(将150行$c改成$(this))
date:2017-5-12
author:lizenghua
instructions:修改充值的界面显示大小
\ No newline at end of file
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, user-scalable=no,target-densitydpi=device-dpi" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
<meta name="format-detection" content="telephone=no">
<meta name="screen-orientation" content="portrait">
<meta name="full-screen" content="yes">
<meta http-equiv="x-ua-compatible" content="IE=edge" />
<link href="skin/new_sdk.min.css?v=20150318002" type="text/css" rel="stylesheet" />
<link id="skin" data-v="20150318001" type="text/css" rel="stylesheet" />
<link href="skin/responsive.min.css?v=20150318001" type="text/css" rel="stylesheet" />
<title>
手游平台登录
</title>
</head>
<body>
<div class="mask">
<div class="container_load" id="loading">
<div class="content">
<div class="circle"></div>
<div class="circle1"></div>
</div>
</div>
<div class="alert alert-success hide" id="alert">
<button type="button" class="close" data-dismiss="alert">&times;</button>
<span></span>
</div>
<section id="home" data-attr="dot" class="hide"></section>
<section id="frame" data-attr="dot" class="hide" ></section>
<script id="frame_template" type="text/x-jquery-tmpl" >
<div class="header">
<span class="title">{{=Core.Data.frame_title}}</span>
<a class="btn pull-left op-back" href="#main">返回</a>
</div>
<div class="container" style="">
<div class="container_load in_frame" id="loading_frame">
<div class="content">
<div class="circle"></div>
<div class="circle1"></div>
</div>
</div>
{{? Core.isIos}}<div class="ios_scroll">{{?}}
<iframe frameborder=0 src="{{=Core.Data.frame_src}}" scrolling="yes" width="100%" height="100%"></iframe>
{{? Core.isIos}}</div>{{?}}
</div>
</script>
<script id="home_template" type="text/x-jquery-tmpl">
<div class="header">
<span class="title">分享游戏</span>
<a class="btn pull-left op-back" href="sdk://exit?action=share">回到游戏</a>
</div>
<div class="container">
<div class="box_info_center">
<div class="share_box1">
<div class="share_game clearfix">
<img class="pull-left game_face" src="{{=Core.Data.icon || ''}}" height="75" width="75">
<textarea class="s_content">{{=Core.Data.content || '这款游戏还不错噢,一起来玩吧!'}}</textarea>
</div>
</div>
<div class="share_box2">
<div class="">
<h3 class="text-info">分享到</h3>
<ul class="other-login inline clearfix">
<li><a href="/sdk/share/game/qq/?app_id={{=Core.Data.app_id || ''}}" class="qq" title="QQ空间分享"></a></li>
<li><a href="/sdk/share/game/sina/?app_id={{=Core.Data.app_id || ''}}" class="sina" title="新浪微博分享"></a></li>
<li><a href="/sdk/share/game/tqq/?app_id={{=Core.Data.app_id || ''}}" class="tqq" title="腾讯微博分享"></a></li>
</ul>
<div class="invite_box">
<h3 class="text-info">奖励说明:</h3>
<p>
1.成功邀请好友一起玩游戏,您可获得<span class="text-info">5{{=Core.Data.game_unit_name}}</span>的奖励。
</p>
<p>
2.好友若充值(限前10),您可获得<span class="text-info">5%</span>充值奖励。
</p>
<p>
3.好友首次充值,因被您邀请可额外获得<span class="text-info">10%</span>充值返利。
</p>
</div>
</div>
</div>
</div>
</div>
</script>
</div>
<script type="text/javascript" src="js/fastclick.min.1.0.js?201309041309"></script>
<script type="text/javascript" src="js/zepto.min.js?201309041309"></script>
<script type="text/javascript" src="js/doT.min.js?201309041309" ></script>
<script type="text/javascript">
window.isGetData = 0;
$(function() {
FastClick.attach(document.body);
});
</script>
<script type="text/javascript" src="js/core.min.js?201403141112" ></script>
<script type="text/javascript">
(function(){
// Home模块
var Home = function(modId) {
Module.call(this, modId);
}
// 继承基础模块
Core.inherit(Home, Module);
Home.prototype.bind = function(){
var that = this;
that.$c.on('click', '.other-login a', function(e){
e.preventDefault();
//分享连接
var $tar = $(e.target);
var content = that.$c.find('.s_content').val();
$tar.attr('params', 'content=' + content);
Core.ajax_do($tar, function(data){
console.log(data);
if(data.code == 0){
if(data.msg.next_url){
// 需要重新授权
var src = data.msg.next_url;
if (Core.isFile) {
src = Core.server + src;
}
Core.Data.frame_title = $tar.attr('title');
Core.Data.frame_src = src;
Core.updateMod('frame');
} else {
//
Core.showTips(data.msg);
}
}
}, that);
});
}
Core.registerMod('home', Home);
var Frame = function(modId) {
Module.call(this, modId);
}
Core.inherit(Frame, Module);
Frame.prototype.show_after = function() {
var that = this;
var _des = Core.last_mod ? Core.last_mod : 'home';
this.$c.find('a.btn.pull-left').attr('href', '#' + _des);
this.$c.find('iframe')[0].onload = function() {
that.$c.find('#loading_frame').hide();
}
}
Core.registerMod('frame', Frame);
})();
</script>
<script type="text/javascript" src="js/loader.min.js?201401151617"></script>
<script type="text/javascript">
(function(){
window.isGetData = 1;
getData('/game/info/');
})();
</script>
</body>
</html>
\ No newline at end of file
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
CACHE MANIFEST
#version=20151112001
/static/sdk_3/login.html?20151112001
/static/sdk_3/center.html?20151112001
/static/sdk_3/pay.html?20151112001
/static/sdk_3/share.html?20151112001
/static/sdk_3/js/fastclick.min.1.0.js?20151112001
/static/sdk_3/js/zepto.min.js?20151112001
/static/sdk_3/js/doT.min.js?20151112001
/static/sdk_3/js/iscroll.min.1.0.js?20151112001
/static/sdk_3/skin/login.css?20151112001
/static/sdk_3/skin/pay.css?20151112001
/static/sdk_3/js/core.min.js?20151112001
/static/sdk_3/js/loader.min.js?20151112001
/static/sdk_3/js/center.min.js?20151112001
/static/sdk_3/js/pay.min.js?20151112001
/static/sdk_3/js/login.min.js?20151112001
/static/sdk_3/images/login_icon.png?20151112001
/static/sdk_3/images/new-sdk-logo.png?20151112001
NETWORK:
*
\ No newline at end of file
#!/bin/sh
#js css压缩,生成更新包打包
CDN_SERVER='http://cdn.9133.com/static'
DIR_PATH="$( cd "$( dirname "$0" )" && pwd )"
echo "$DIR_PATH"
cd $DIR_PATH
VERSION=`cat version.txt`
DIR_NAME=${DIR_PATH##*/}
ZIP_FILE="${DIR_NAME}_${VERSION}.zip"
SAVE_DIR="dst"
MD5=''
echo $DIR_NAME
function make_new_zip_file {
cd $DIR_PATH
mkdir -pv dst
save_zip_file="${SAVE_DIR}/${ZIP_FILE}"
[ -f "$save_zip_file" ] && rm "$save_zip_file" && echo "rm $save_zip_file"
echo "zip $ZIP_FILE"
zip -x 'uglifyjs_sqwish.sh' -x 'v.txt' -x '*.svn/*' -x "${SAVE_DIR}/*" -x "${ZIP_FILE}" -r "${save_zip_file}" ./
MD5=`md5sum dst/${ZIP_FILE} |cut -d ' ' -f1`
}
function make_version_file {
make_new_zip_file
cd $DIR_PATH
URL="${CDN_SERVER}/${DIR_NAME}/${SAVE_DIR}/${ZIP_FILE}"
echo "${VERSION}|${MD5}|${URL}" > v.txt
cat v.txt
}
function uglifyjs_js_css {
cd $DIR_PATH
cd js/
for f in `ls *.js`;do
uglifyjs $f -m -o $f
done
cd ../skin
unalias mv
for f in `ls *.css`;do
if [ -f "$f" ];then
sqwish $f
new_f=`basename $f css`
new_f="$new_f""min.css"
echo " mv $new_f $f"
[ -f "$new_f" ] && mv $new_f $f
fi
done
cd ..
}
uglifyjs_js_css
make_version_file
SERVER_URL=http://sdk.uuufish.com
CDN_SERVER_URL=http://sdk.uuufish.com
SDK_TYPE=.sys_config_youyu
\ No newline at end of file

50.2 KB | W: | H:

50.2 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
No preview for this file type
......@@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-19
target=android-20
......

5.71 KB | W: | H:

5.71 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

6.39 KB | W: | H:

6.39 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

5.59 KB | W: | H:

5.59 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

5.72 KB | W: | H:

5.72 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

382 KB | W: | H:

382 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

6.29 KB | W: | H:

6.29 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin

384 KB | W: | H:

384 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
......@@ -13,7 +13,7 @@
android:background="@drawable/public_sdk_self_ya_bt_selector"
android:onClick="yaOnClick"/>
<Button
<Button
android:id="@+id/ya_switch_account_bt"
android:layout_width="180dp"
android:layout_height="60dp"
......
......@@ -13,13 +13,11 @@ import android.widget.Button;
import com.gzyouai.fengniao.sdk.framework.PoolExitDialogListener;
import com.gzyouai.fengniao.sdk.framework.PoolExitListener;
import com.gzyouai.fengniao.sdk.framework.PoolExpansionListener;
import com.gzyouai.fengniao.sdk.framework.PoolLoginInfo;
import com.gzyouai.fengniao.sdk.framework.PoolLoginListener;
import com.gzyouai.fengniao.sdk.framework.PoolLogoutListener;
import com.gzyouai.fengniao.sdk.framework.PoolPayInfo;
import com.gzyouai.fengniao.sdk.framework.PoolPayListener;
import com.gzyouai.fengniao.sdk.framework.PoolReport;
import com.gzyouai.fengniao.sdk.framework.PoolRoleInfo;
import com.gzyouai.fengniao.sdk.framework.PoolRoleListener;
import com.gzyouai.fengniao.sdk.framework.PoolSDKCallBackListener;
......@@ -34,9 +32,9 @@ public class AppActivity extends Activity {
private Button yaPayBt;
private Button yaSubmitRoleDataBt;
private Button yaChannelCenter;
private Button yaSwitchAccountBt;
private Button yaLogoutBt;
private Button yaForumBt;
private Button yaSwitchAccountBt;
@Override
protected void onCreate(Bundle savedInstanceState) {
......@@ -238,13 +236,13 @@ public class AppActivity extends Activity {
yaChannelCenter = (Button) findViewById(getRedIdByName(
"ya_channel_center", "id"));
yaChannelCenter.setText("渠道中心");
yaSwitchAccountBt = (Button) findViewById(getRedIdByName(
"ya_switch_account_bt", "id"));
yaSwitchAccountBt.setText("切换账号");
PoolSdkLog.logError("" + yaPayBt + "yachannel:" + yaChannelCenter);
yaLogoutBt = (Button) findViewById(getRedIdByName("logout_bt", "id"));
yaSwitchAccountBt = (Button) findViewById(getRedIdByName("ya_switch_account_bt", "id"));
yaSwitchAccountBt.setText("切换账号");
yaForumBt = (Button) findViewById(getRedIdByName("forum_bt", "id"));
}
......@@ -254,29 +252,47 @@ public class AppActivity extends Activity {
} else if (view == yaEnterGameBt) {
setContentView(getRedIdByName("public_sdk_self_game", "layout"));// (R.layout.game);
initGameView();
PoolReport.reportEnterGame("chufan","角色名", 12, "201","服务器名");
} else if (view == yaPayBt) {
pay();
} else if (view == yaSubmitRoleDataBt) {
submitRoleData();
} else if (view == yaChannelCenter) {
channelCenter();
} else if (view == yaSwitchAccountBt) {
switchAccount();
} else if (view == yaLogoutBt){
logout();
} else if (view == yaForumBt){
openForum();
} else if(view == yaSwitchAccountBt){//切换账号
switchAccount();
}
}
/**
* 切换帐号
*/
private void switchAccount() {
if(PoolSdkHelper.hasSwitchAccount()){
PoolSdkHelper.switchAccount(this);
}else if(PoolSdkHelper.hasLogout()){
PoolSdkHelper.logout(this);//在注销监听回调中处理注销
}else if(PoolSdkHelper.hasChannelCenter()){//打开渠道中心看是否有切换账号
PoolSdkHelper.openChannelCenter();
}else{
//直接回到登录界面调用登录
int layoutId = getResources().getIdentifier(
"public_sdk_self_game_login", "layout", getPackageName());
setContentView(layoutId);
initLoginView();
}
}
private void openForum(){
PoolSdkHelper.openForum();
}
private void logout(){
PoolSdkHelper.logout(this);//结果回调通知到PoolLogoutListener
if(PoolSdkHelper.hasLogout()){
PoolSdkHelper.logout(this);//结果回调通知到PoolLogoutListener
}
}
......@@ -329,7 +345,7 @@ public class AppActivity extends Activity {
// 兑换比例
poolPayInfo.setExchange("10");
// 自定义参数
poolPayInfo.setCustom("我是自定义参数");
poolPayInfo.setCustom("operator=xwrw&server_id=39&player_id=2081&cp_order_id=001000100000020811491470345294&dext=2");
// TODO Auto-generated method stub
PoolSdkHelper.pay(poolPayInfo, new PoolPayListener() {
......@@ -388,33 +404,11 @@ public class AppActivity extends Activity {
/**
* 用户中心
*
* 游戏方先调用YASDKHelper.hasChannelCenter()获取是否有用户中心,
* 如果有的话,游戏中需要添加按钮,点击按钮调用YASDKHelper.openChannelCenter();
* 游戏方先调用PoolSdkHelper.hasChannelCenter()获取是否有用户中心,
* 如果有的话,游戏中需要添加按钮,点击按钮调用PoolSdkHelper.openChannelCenter();
* 如果没有,则不需要显示按钮,也不用调用下面的接口
*/
private void channelCenter() {
PoolSdkHelper.openChannelCenter();
}
/**
* 切换帐号
*/
private void switchAccount() {
if(PoolSdkHelper.hasSwitchAccount()){
PoolSdkHelper.switchAccount(this);
}
}
/**
* 扩展接口
*/
private void expansionInterface() {
PoolSdkHelper.expansionInterface("自定义参数", new PoolExpansionListener() {
@Override
public void onSuccess(String paramCustom) {
}
});
}
}
......
No preview for this file type