新增音萌商店包
This commit is contained in:
2862
view/mew/common/js/JQuery.datetime.js
Normal file
2862
view/mew/common/js/JQuery.datetime.js
Normal file
File diff suppressed because it is too large
Load Diff
1
view/mew/common/js/JQuery.datetime.min.js
vendored
Normal file
1
view/mew/common/js/JQuery.datetime.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
31
view/mew/common/js/baiduStatis.js
Normal file
31
view/mew/common/js/baiduStatis.js
Normal file
@@ -0,0 +1,31 @@
|
||||
var _hmt = _hmt || [];
|
||||
(function() {
|
||||
var hostObj = hostCheck();
|
||||
|
||||
console.log(hostObj);
|
||||
var src = '';
|
||||
if(hostObj.isRealTuTu || hostObj.isBetaTuTu){
|
||||
src = 'https://hm.baidu.com/hm.js?3d537e5bc5d69ff509bbd31502f0c899';
|
||||
}else if(hostObj.isOutside){
|
||||
src = 'https://hm.baidu.com/hm.js?a544f687a1fb6602746c3f5700d8484c';
|
||||
}else{
|
||||
src = '';
|
||||
}
|
||||
|
||||
if(src){
|
||||
var hm = document.createElement("script");
|
||||
hm.src = src;
|
||||
var s = document.getElementsByTagName("script")[0];
|
||||
s.parentNode.insertBefore(hm, s);
|
||||
}
|
||||
})();
|
||||
|
||||
|
||||
function hostCheck() {
|
||||
var host = window.location.host;
|
||||
return {
|
||||
isRealTuTu: host.match('api.qxjiaoyou'),
|
||||
isBetaTuTu: host.match('apibeta.qxjiaoyou'),
|
||||
isOutside: host.match('www.18pk')
|
||||
}
|
||||
}
|
1
view/mew/common/js/bootstrap-datetimepicker.min.js
vendored
Normal file
1
view/mew/common/js/bootstrap-datetimepicker.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
9
view/mew/common/js/bootstrap-table.min.js
vendored
Normal file
9
view/mew/common/js/bootstrap-table.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
view/mew/common/js/bootstrap.min.js
vendored
Normal file
7
view/mew/common/js/bootstrap.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
view/mew/common/js/clipboard.min.js
vendored
Normal file
7
view/mew/common/js/clipboard.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
460
view/mew/common/js/common.js
Normal file
460
view/mew/common/js/common.js
Normal file
@@ -0,0 +1,460 @@
|
||||
function render(templateId, templateData, target) {
|
||||
var html = template(templateId, templateData);
|
||||
target.innerHTML += html;
|
||||
}
|
||||
var tranUrl = 'https://h5.nnbc123.cn';
|
||||
|
||||
function dateFormat(date, fmt) {
|
||||
date = new Date(date);
|
||||
var o = {
|
||||
'M+': date.getMonth() + 1,
|
||||
'd+': date.getDate(),
|
||||
'h+': date.getHours(),
|
||||
'm+': date.getMinutes(),
|
||||
's+': date.getSeconds()
|
||||
};
|
||||
|
||||
// 补全0
|
||||
function padLeftZero(str) {
|
||||
return ('00' + str).substr(str.length);
|
||||
}
|
||||
|
||||
// 年份
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
||||
}
|
||||
|
||||
// 月日时分秒
|
||||
for (var k in o) {
|
||||
if (new RegExp('(' + k + ')').test(fmt)) {
|
||||
var str = o[k] + '';
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
|
||||
}
|
||||
}
|
||||
|
||||
date = o = padLeftZero = null;
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function convert(_url) {
|
||||
var patt = /\d+/;
|
||||
var num = _url.match(patt);
|
||||
var rs = {};
|
||||
rs.uid = num[0];
|
||||
return rs;
|
||||
}
|
||||
|
||||
// 传递分享信息给客户端,showUrl为分享的页面链接,为空时表示不分享
|
||||
// function shareInfo () {
|
||||
// var _url = 'https://api.kawayisound.xyz/modules/bonus/fight.html';
|
||||
// var res = EnvCheck();
|
||||
// if (res == 'test'){
|
||||
// _url = 'http://apibeta.kawayisound.xyz/modules/bonus/fight.html';
|
||||
// }
|
||||
// var info = {
|
||||
// title: '轻寻与你一起红',
|
||||
// imgUrl: 'https://img.erbanyy.com/qingxunlogo-256.png',
|
||||
// desc: '登录即送20红包,每天还有分享红包,邀请红包,分成红包,四重红包大礼等你来拿',
|
||||
// showUrl: _url
|
||||
// };
|
||||
// return JSON.stringify(info);
|
||||
// }
|
||||
|
||||
// 根据域名适配环境
|
||||
function EnvCheck() {
|
||||
if (window.location.href) {
|
||||
var _url = window.location.href;
|
||||
var res = _url.match(/uat/);
|
||||
var res1 = _url.match(/120.79.211.243/);
|
||||
var res2 = _url.match(/192.168.9.50/)
|
||||
var res3 = _url.match(/127.0/)
|
||||
if (res || res1 || res2 || res3) {
|
||||
return 'test';
|
||||
} else {
|
||||
return 'live';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 根据域名判断是本地打开还是服务器打开
|
||||
function locateJudge() {
|
||||
if (window.location.href) {
|
||||
var _url = window.location.href;
|
||||
var res = _url.match(/test|localhost/);
|
||||
if (res) {
|
||||
return '/api';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取地址栏参数
|
||||
function getQueryString() {
|
||||
var _url = location.search;
|
||||
if(_url.indexOf('%') != -1){
|
||||
_url = _url.replace(/%/g, '%25')
|
||||
}
|
||||
var theRequest = new Object();
|
||||
if (_url.indexOf('?') != -1) {
|
||||
var str = _url.substr(1);
|
||||
strs = str.split('&');
|
||||
for (var i in strs) {
|
||||
theRequest[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
|
||||
}
|
||||
}
|
||||
|
||||
return theRequest;
|
||||
}
|
||||
|
||||
// 判断浏览器内核,手机类型
|
||||
function checkVersion() {
|
||||
var u = navigator.userAgent,
|
||||
app = navigator.appVersion;
|
||||
return {
|
||||
trident: u.indexOf('Trident') > -1, //IE内核
|
||||
presto: u.indexOf('Presto') > -1, //opera内核
|
||||
webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
|
||||
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
|
||||
mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
|
||||
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
|
||||
android: u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, //android终端
|
||||
iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
|
||||
iPad: u.indexOf('iPad') > -1, //是否iPad
|
||||
webApp: u.indexOf('Safari') > -1, //是否web应该程序,没有头部与底部
|
||||
weixin: u.indexOf('MicroMessenger') > -1, //是否微信
|
||||
qq: u.match(/\sQQ/i) == " qq", //是否QQ
|
||||
tutuApp: u.match('tutuApp'),
|
||||
app: u.match('tutuApp') //是否在app内
|
||||
};
|
||||
}
|
||||
|
||||
// 图片预加载
|
||||
function preloadImage(obj) {
|
||||
console.log(obj)
|
||||
var loadLength = 0,
|
||||
newImages = [];
|
||||
for (var i = 0; i < obj.imageArr.length; i++) {
|
||||
newImages[i] = new Image();
|
||||
newImages[i].src = obj.imageArr[i];
|
||||
newImages[i].onload = newImages[i].onerror = function() {
|
||||
loadLength++;
|
||||
typeof obj.preloadPreFunc === 'function' && obj.preloadPreFunc(loadLength);
|
||||
if (loadLength == obj.imageArr.length) {
|
||||
typeof obj.doneFunc === 'function' && obj.doneFunc();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 判断是否在App内
|
||||
function isApp() {
|
||||
var androidBol = false;
|
||||
var osBol = false;
|
||||
if (window.androidJsObj && typeof window.androidJsObj === 'object') {
|
||||
androidBol = true;
|
||||
}
|
||||
if (window.webkit) {
|
||||
console.log(window.webkit);
|
||||
osBol = true;
|
||||
}
|
||||
return (androidBol || osBol);
|
||||
|
||||
}
|
||||
|
||||
function UrlSearch() {
|
||||
var name, value;
|
||||
var str = location.href;
|
||||
var num = str.indexOf("?")
|
||||
str = str.substr(num + 1);
|
||||
var arr = str.split("&");
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
num = arr[i].indexOf("=");
|
||||
if (num > 0) {
|
||||
name = arr[i].substring(0, num);
|
||||
value = arr[i].substr(num + 1);
|
||||
this[name] = value;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function erbanMask(channel, tags, params) {
|
||||
//此函数用于一般的轻寻底层面罩
|
||||
var browser = checkVersion();
|
||||
var env = EnvCheck();
|
||||
// params = params? params:0;
|
||||
var bol = $.isEmptyObject(params);
|
||||
var keyId = "978cd79c98264f836450afda1228762e";
|
||||
if (browser.ios) {
|
||||
if (env == 'test') {
|
||||
keyId = '33f560a83c9c40d465711c0038653ca0'
|
||||
}
|
||||
console.log('ios_linkedme_keyId:', keyId)
|
||||
}
|
||||
var jsonStr = '';
|
||||
if (!bol) {
|
||||
jsonStr = JSON.stringify(params);
|
||||
}
|
||||
if (!browser.app) {
|
||||
$('#mask').css('display', 'flex');
|
||||
var linkData = {
|
||||
type: env,
|
||||
channel: channel,
|
||||
tags: tags,
|
||||
// ios_custom_url: "https://itunes.apple.com/cn/app/id1252542069?mt=8",
|
||||
params: jsonStr
|
||||
};
|
||||
|
||||
linkedme.init(keyId, {
|
||||
type: env
|
||||
}, null);
|
||||
|
||||
linkedme.link(linkData, function(err, response) {
|
||||
if (err) {
|
||||
// 生成深度链接失败,返回错误对象err
|
||||
console.log('err:', err);
|
||||
} else {
|
||||
console.log(response);
|
||||
$('#download a').attr("href", response.url);
|
||||
$('.download a').attr('href', response.url);
|
||||
}
|
||||
}, false);
|
||||
} else {
|
||||
$('#mask').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function wxConfig() {
|
||||
var wxurl = encodeURIComponent(location.href.split('#')[0]);
|
||||
var data = "url=" + wxurl;
|
||||
console.log(data);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/wx/config',
|
||||
data: data,
|
||||
asyc: true,
|
||||
success: function(data) {
|
||||
if (data.code = 200) {
|
||||
wx.config({
|
||||
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
||||
appId: 'wx009d793f92c24eec', // 必填,公众号的唯一标识
|
||||
timestamp: data.data.timestamp, // 必填,生成签名的时间戳
|
||||
nonceStr: data.data.nonceStr, // 必填,生成签名的随机串
|
||||
signature: data.data.signature, // 必填,签名,见附录1
|
||||
jsApiList: data.data.jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
|
||||
});
|
||||
wx.error(function(res) {
|
||||
console.log('config error,msg:' + res);
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(res) {
|
||||
console.log('config error,msg:' + res);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function refreshWeb() {
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
|
||||
function shareInfo(urlMsg) {
|
||||
if (urlMsg) {
|
||||
var env = EnvCheck();
|
||||
if (env == 'test') {
|
||||
return 'http://apibeta.kawayisound.xyz/' + urlMsg;
|
||||
} else {
|
||||
return 'https://api.kawayisound.xyz/' + urlMsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initNav(obj) {
|
||||
if ($.isEmptyObject(obj)) {
|
||||
return;
|
||||
}
|
||||
var browser = checkVersion();
|
||||
console.log(browser);
|
||||
if (browser.app) {
|
||||
if (browser.ios) {
|
||||
window.webkit.messageHandlers.initNav.postMessage(obj);
|
||||
} else if (browser.android) {
|
||||
var json = JSON.stringify(obj);
|
||||
window.androidJsObj.initNav(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var tools = {
|
||||
cookieUtils: {
|
||||
set: function(key, val, time) {
|
||||
var date = new Date();
|
||||
var expiresDays = time;
|
||||
date.setTime(date.getTime() + expiresDays * 24 * 3600 * 1000);
|
||||
document.cookie = key + '=' + val + ';expires=' + date.toGMTString();
|
||||
},
|
||||
|
||||
get: function(key) {
|
||||
var getCookie = document.cookie.replace(/[ ]/g, "");
|
||||
var arrCookie = getCookie.split(';');
|
||||
var val;
|
||||
for (var i = 0; i < arrCookie.length; i++) {
|
||||
var arr = arrCookie[i].split('=');
|
||||
if (key === arr[0]) {
|
||||
val = arr[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return val;
|
||||
},
|
||||
|
||||
delete: function(key) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() - 10000);
|
||||
document.cookie = key + "+v; expires =" + date.toGMTString();
|
||||
}
|
||||
},
|
||||
|
||||
nativeUtils: {
|
||||
jumpAppointPage: function(type, val) {
|
||||
// routerType 跳转名称
|
||||
// routerVal 跳转需要传的参数
|
||||
|
||||
var browser = checkVersion();
|
||||
var jumpObj = {};
|
||||
jumpObj.routerType = routeTypeConstant[type];
|
||||
if (val) {
|
||||
jumpObj.routerVal = val;
|
||||
}
|
||||
|
||||
if (browser.app) {
|
||||
if (browser.ios) {
|
||||
if (type.indexOf('_') > -1) {
|
||||
window.webkit.messageHandlers.jumpAppointPage.postMessage(jumpObj);
|
||||
} else {
|
||||
if (val) {
|
||||
window.webkit.messageHandlers.type.postMessage(val);
|
||||
} else {
|
||||
window.webkit.messageHandlers.type.postMessage(null);
|
||||
}
|
||||
}
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
if (type.indexOf('_') > -1) {
|
||||
window.androidJsObj.jumpAppointPage(JSON.stringify(jumpObj));
|
||||
} else {
|
||||
if (val) {
|
||||
window.androidJsObj.type(val);
|
||||
} else {
|
||||
window.androidJsObj.type();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getUid: function() {
|
||||
var browser = checkVersion();
|
||||
console.log(browser);
|
||||
var val;
|
||||
if (browser.app) {
|
||||
if (browser.ios) {
|
||||
val = tools.cookieUtils.get('uid');
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
val = parseInt(window.androidJsObj.getUid());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var locate = getQueryString();
|
||||
if (!locate.uid && !locate.shareUid) {
|
||||
val = 901189;
|
||||
} else {
|
||||
if (locate.shareUid) {
|
||||
val = locate.shareUid;
|
||||
} else {
|
||||
val = locate.uid;
|
||||
}
|
||||
}
|
||||
}
|
||||
return val;
|
||||
|
||||
},
|
||||
|
||||
getTicket: function() {
|
||||
var browser = checkVersion();
|
||||
var val;
|
||||
if (browser.app) {
|
||||
if (browser.ios) {
|
||||
val = window.webkit.messageHandlers.getTicket.postMessage(null);
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
val = window.androidJsObj.getTicket();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
val = 'app外'
|
||||
}
|
||||
return val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 透明loading层
|
||||
var $Loading = {
|
||||
count: 0,
|
||||
isFadeOut: false,
|
||||
show: function() {
|
||||
this.count++;
|
||||
if ($('#loadingToast').length >= 1) {
|
||||
if (this.isFadeOut) {
|
||||
this.isFadeOut = false;
|
||||
$('#loadingToast').stop(true).fadeTo(0, 1);
|
||||
}
|
||||
} else {
|
||||
$('body').append('<div id="loadingToast" style="display: none; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 9999;"></div>')
|
||||
$('#loadingToast').fadeIn(100);
|
||||
}
|
||||
},
|
||||
hide: function() {
|
||||
this.count--;
|
||||
if (this.count === 0) {
|
||||
this.isFadeOut = true;
|
||||
$('#loadingToast').fadeOut(200, function() {
|
||||
$Loading.isFadeOut = false;
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
var requestBaseUrl = locateJudge();
|
||||
// ajax
|
||||
function request(type, option) {
|
||||
return $.ajax({
|
||||
type: type,
|
||||
url: requestBaseUrl + option.url,
|
||||
data: option.data,
|
||||
headers: option.headers,
|
||||
beforeSend: function(xhr) {
|
||||
!option.isHideLoading && $Loading.show();
|
||||
},
|
||||
success: function(res, status, xhr) {
|
||||
!option.isHideLoading && $Loading.hide();
|
||||
typeof option.success === 'function' && option.success(res, status, xhr);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
!option.isHideLoading && $Loading.hide();
|
||||
typeof option.error === 'function' && option.error(xhr, status, error);
|
||||
}
|
||||
})
|
||||
}
|
||||
// ajax get
|
||||
function getJSON(option) {
|
||||
request('get', option)
|
||||
}
|
||||
// ajax post
|
||||
function postJSON(option) {
|
||||
request('post', option);
|
||||
}
|
676
view/mew/common/js/common2.js
Normal file
676
view/mew/common/js/common2.js
Normal file
@@ -0,0 +1,676 @@
|
||||
let productUrl = 'https://api.nnbc123.cn'; // 正式环境
|
||||
const testUrl = 'http://beta.api.nnbc123.cn'; // 测试环境
|
||||
|
||||
|
||||
function render (templateId, templateData, target) {
|
||||
var html = template(templateId, templateData);
|
||||
target.innerHTML += html;
|
||||
}
|
||||
// 访问页面域名
|
||||
var tranUrl = 'https://h5.nnbc123.cn';
|
||||
|
||||
function dateFormat (date, fmt) {
|
||||
date = new Date(date);
|
||||
var o = {
|
||||
'M+': date.getMonth() + 1,
|
||||
'd+': date.getDate(),
|
||||
'h+': date.getHours(),
|
||||
'm+': date.getMinutes(),
|
||||
's+': date.getSeconds()
|
||||
};
|
||||
|
||||
// 补全0
|
||||
function padLeftZero (str) {
|
||||
return ('00' + str).substr(str.length);
|
||||
}
|
||||
|
||||
// 年份
|
||||
if (/(y+)/.test(fmt)) {
|
||||
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + '').substr(4 - RegExp.$1.length));
|
||||
}
|
||||
|
||||
// 月日时分秒
|
||||
for (var k in o) {
|
||||
if (new RegExp('(' + k + ')').test(fmt)) {
|
||||
var str = o[k] + '';
|
||||
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? str : padLeftZero(str));
|
||||
}
|
||||
}
|
||||
|
||||
date = o = padLeftZero = null;
|
||||
return fmt;
|
||||
}
|
||||
|
||||
function convert (_url) {
|
||||
var patt = /\d+/;
|
||||
var num = _url.match(patt);
|
||||
var rs = {};
|
||||
rs.uid = num[0];
|
||||
return rs;
|
||||
}
|
||||
|
||||
// 传递分享信息给客户端,showUrl为分享的页面链接,为空时表示不分享
|
||||
// function shareInfo () {
|
||||
// var _url = 'https://api.kawayisound.xyz/modules/bonus/fight.html';
|
||||
// var res = EnvCheck();
|
||||
// if (res == 'test'){
|
||||
// _url = 'http://apibeta.kawayisound.xyz/modules/bonus/fight.html';
|
||||
// }
|
||||
// var info = {
|
||||
// title: '轻寻与你一起红',
|
||||
// imgUrl: 'https://img.erbanyy.com/qingxunlogo-256.png',
|
||||
// desc: '登录即送20红包,每天还有分享红包,邀请红包,分成红包,四重红包大礼等你来拿',
|
||||
// showUrl: _url
|
||||
// };
|
||||
// return JSON.stringify(info);
|
||||
// }
|
||||
|
||||
// 根据域名适配环境
|
||||
function EnvCheck () {
|
||||
if (window.location.href) {
|
||||
var _url = window.location.href;
|
||||
var res = _url.match(/uat/);
|
||||
var res1 = _url.match(/120.79.211.243/);
|
||||
var res2 = _url.match(/192.168./)
|
||||
var res3 = _url.match(/127.0/)
|
||||
var res4 = _url.match(/beta/)
|
||||
var res5 = _url.match(/h5dev/)
|
||||
if (res || res1 || res2 || res3 || res4 || res5) {
|
||||
tranUrl = 'http://beta.api.nnbc123.cn';
|
||||
return 'test';
|
||||
} else {
|
||||
tranUrl = 'https://h5.nnbc123.cn';
|
||||
return 'live';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 根据域名判断 正式环境(含www)/测试环境(含beta), 并返回所需url前缀
|
||||
// written by zxfxiong
|
||||
function getUrlPrefix () {
|
||||
if (!EnvCheck()) return undefined;
|
||||
return EnvCheck() === 'live' ? productUrl : testUrl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 根据域名判断是本地打开还是服务器打开
|
||||
function locateJudge () {
|
||||
if (window.location.href) {
|
||||
var _url = window.location.href;
|
||||
var res = _url.match(/test|localhost/);
|
||||
if (res) {
|
||||
return '/api';
|
||||
} else {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 获取地址栏参数
|
||||
function getQueryString () {
|
||||
var _url = location.search;
|
||||
var theRequest = new Object();
|
||||
if (_url.indexOf('?') != -1) {
|
||||
var str = _url.substr(1);
|
||||
strs = str.split('&');
|
||||
for (var i in strs) {
|
||||
theRequest[strs[i].split('=')[0]] = decodeURI(strs[i].split('=')[1]);
|
||||
}
|
||||
}
|
||||
return theRequest;
|
||||
}
|
||||
|
||||
// 判断浏览器内核,手机类型
|
||||
function checkVersion () {
|
||||
var u = navigator.userAgent,
|
||||
app = navigator.appVersion;
|
||||
return {
|
||||
trident: u.indexOf('Trident') > -1, //IE内核
|
||||
presto: u.indexOf('Presto') > -1, //opera内核
|
||||
webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
|
||||
gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
|
||||
mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
|
||||
ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
|
||||
android: u.indexOf('Android') > -1 || u.indexOf('Adr') > -1, //android终端
|
||||
iPhone: u.indexOf('iPhone') > -1, //是否为iPhone或者QQHD浏览器
|
||||
iPad: u.indexOf('iPad') > -1, //是否iPad
|
||||
webApp: u.indexOf('Safari') > -1, //是否web应该程序,没有头部与底部
|
||||
weixin: u.indexOf('MicroMessenger') > -1, //是否微信
|
||||
qq: u.match(/\sQQ/i) == " qq", //是否QQ
|
||||
tutuApp: u.match('tutuApp'),
|
||||
app: u.match('tutuApp') //是否在app内
|
||||
};
|
||||
}
|
||||
|
||||
// 图片预加载
|
||||
function preloadImage (obj) {
|
||||
console.log(obj)
|
||||
var loadLength = 0,
|
||||
newImages = [];
|
||||
for (var i = 0; i < obj.imageArr.length; i++) {
|
||||
newImages[i] = new Image();
|
||||
newImages[i].src = obj.imageArr[i];
|
||||
newImages[i].onload = newImages[i].onerror = function () {
|
||||
loadLength++;
|
||||
typeof obj.preloadPreFunc === 'function' && obj.preloadPreFunc(loadLength);
|
||||
if (loadLength == obj.imageArr.length) {
|
||||
typeof obj.doneFunc === 'function' && obj.doneFunc();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 判断是否在App内
|
||||
function isApp () {
|
||||
var androidBol = false;
|
||||
var osBol = false;
|
||||
if (window.androidJsObj && typeof window.androidJsObj === 'object') {
|
||||
androidBol = true;
|
||||
}
|
||||
if (window.webkit) {
|
||||
console.log(window.webkit);
|
||||
osBol = true;
|
||||
}
|
||||
return (androidBol || osBol);
|
||||
|
||||
}
|
||||
|
||||
function UrlSearch () {
|
||||
var name, value;
|
||||
var str = location.href;
|
||||
var num = str.indexOf("?")
|
||||
str = str.substr(num + 1);
|
||||
var arr = str.split("&");
|
||||
for (var i = 0; i < arr.length; i++) {
|
||||
num = arr[i].indexOf("=");
|
||||
if (num > 0) {
|
||||
name = arr[i].substring(0, num);
|
||||
value = arr[i].substr(num + 1);
|
||||
this[name] = value;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
function erbanMask (channel, tags, params) {
|
||||
//此函数用于一般的轻寻底层面罩
|
||||
var browser = checkVersion();
|
||||
var env = EnvCheck();
|
||||
// params = params? params:0;
|
||||
var bol = $.isEmptyObject(params);
|
||||
var keyId = "978cd79c98264f836450afda1228762e";
|
||||
if (browser.ios) {
|
||||
if (env == 'test') {
|
||||
keyId = '33f560a83c9c40d465711c0038653ca0'
|
||||
}
|
||||
console.log('ios_linkedme_keyId:', keyId)
|
||||
}
|
||||
var jsonStr = '';
|
||||
if (!bol) {
|
||||
jsonStr = JSON.stringify(params);
|
||||
}
|
||||
if (!browser.app) {
|
||||
$('#mask').css('display', 'flex');
|
||||
var linkData = {
|
||||
type: env,
|
||||
channel: channel,
|
||||
tags: tags,
|
||||
// ios_custom_url: "https://itunes.apple.com/cn/app/id1252542069?mt=8",
|
||||
params: jsonStr
|
||||
};
|
||||
|
||||
linkedme.init(keyId, {
|
||||
type: env
|
||||
}, null);
|
||||
|
||||
linkedme.link(linkData, function (err, response) {
|
||||
if (err) {
|
||||
// 生成深度链接失败,返回错误对象err
|
||||
console.log('err:', err);
|
||||
} else {
|
||||
console.log(response);
|
||||
$('#download a').attr("href", response.url);
|
||||
$('.download a').attr('href', response.url);
|
||||
}
|
||||
}, false);
|
||||
} else {
|
||||
$('#mask').hide();
|
||||
}
|
||||
}
|
||||
|
||||
function wxConfig () {
|
||||
var wxurl = encodeURIComponent(location.href.split('#')[0]);
|
||||
var data = "url=" + wxurl;
|
||||
console.log(data);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/wx/config',
|
||||
data: data,
|
||||
asyc: true,
|
||||
success: function (data) {
|
||||
if (data.code = 200) {
|
||||
wx.config({
|
||||
debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。
|
||||
appId: 'wx009d793f92c24eec', // 必填,公众号的唯一标识
|
||||
timestamp: data.data.timestamp, // 必填,生成签名的时间戳
|
||||
nonceStr: data.data.nonceStr, // 必填,生成签名的随机串
|
||||
signature: data.data.signature, // 必填,签名,见附录1
|
||||
jsApiList: data.data.jsApiList // 必填,需要使用的JS接口列表,所有JS接口列表见附录2
|
||||
});
|
||||
wx.error(function (res) {
|
||||
console.log('config error,msg:' + res);
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function (res) {
|
||||
console.log('config error,msg:' + res);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
function refreshWeb () {
|
||||
window.location.href = window.location.href;
|
||||
}
|
||||
|
||||
function shareInfo (urlMsg) {
|
||||
if (urlMsg) {
|
||||
var env = EnvCheck();
|
||||
if (env == 'test') {
|
||||
return 'http://apibeta.kawayisound.xyz/' + urlMsg;
|
||||
} else {
|
||||
return 'https://api.kawayisound.xyz/' + urlMsg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initNav (obj) {
|
||||
if ($.isEmptyObject(obj)) {
|
||||
return;
|
||||
}
|
||||
var browser = checkVersion();
|
||||
console.log(browser);
|
||||
if (browser.app) {
|
||||
if (browser.ios) {
|
||||
window.webkit.messageHandlers.initNav.postMessage(obj);
|
||||
} else if (browser.android) {
|
||||
var json = JSON.stringify(obj);
|
||||
window.androidJsObj.initNav(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var tools = {
|
||||
cookieUtils: {
|
||||
set: function (key, val, time) {
|
||||
var date = new Date();
|
||||
var expiresDays = time;
|
||||
date.setTime(date.getTime() + expiresDays * 24 * 3600 * 1000);
|
||||
document.cookie = key + '=' + val + ';expires=' + date.toGMTString();
|
||||
},
|
||||
|
||||
get: function (key) {
|
||||
var getCookie = document.cookie.replace(/[ ]/g, "");
|
||||
var arrCookie = getCookie.split(';');
|
||||
var val;
|
||||
for (var i = 0; i < arrCookie.length; i++) {
|
||||
var arr = arrCookie[i].split('=');
|
||||
if (key === arr[0]) {
|
||||
val = arr[1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
return val;
|
||||
},
|
||||
|
||||
delete: function (key) {
|
||||
var date = new Date();
|
||||
date.setTime(date.getTime() - 10000);
|
||||
document.cookie = key + "+v; expires =" + date.toGMTString();
|
||||
}
|
||||
},
|
||||
|
||||
nativeUtils: {
|
||||
jumpAppointPage: function (type, val) {
|
||||
// routerType 跳转名称
|
||||
// routerVal 跳转需要传的参数
|
||||
|
||||
var browser = checkVersion();
|
||||
var jumpObj = {};
|
||||
jumpObj.routerType = routeTypeConstant[type];
|
||||
if (val) {
|
||||
jumpObj.routerVal = val;
|
||||
}
|
||||
|
||||
if (browser.app) {
|
||||
if (browser.ios) {
|
||||
if (type.indexOf('_') > -1) {
|
||||
window.webkit.messageHandlers.jumpAppointPage.postMessage(jumpObj);
|
||||
} else {
|
||||
if (val) {
|
||||
window.webkit.messageHandlers.type.postMessage(val);
|
||||
} else {
|
||||
window.webkit.messageHandlers.type.postMessage(null);
|
||||
}
|
||||
}
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
if (type.indexOf('_') > -1) {
|
||||
window.androidJsObj.jumpAppointPage(JSON.stringify(jumpObj));
|
||||
} else {
|
||||
if (val) {
|
||||
window.androidJsObj.type(val);
|
||||
} else {
|
||||
window.androidJsObj.type();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
getUid: function () {
|
||||
var browser = checkVersion();
|
||||
console.log(browser);
|
||||
var val;
|
||||
if (browser.app) {
|
||||
if (browser.ios) {
|
||||
val = tools.cookieUtils.get('uid');
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
val = parseInt(window.androidJsObj.getUid());
|
||||
}
|
||||
}
|
||||
} else {
|
||||
var locate = getQueryString();
|
||||
if (!locate.uid && !locate.shareUid) {
|
||||
val = 901189;
|
||||
} else {
|
||||
if (locate.shareUid) {
|
||||
val = locate.shareUid;
|
||||
} else {
|
||||
val = locate.uid;
|
||||
}
|
||||
}
|
||||
}
|
||||
return val;
|
||||
|
||||
},
|
||||
|
||||
getTicket: function () {
|
||||
var browser = checkVersion();
|
||||
var val;
|
||||
if (browser.app) {
|
||||
if (browser.ios) {
|
||||
val = window.webkit.messageHandlers.getTicket.postMessage(null);
|
||||
} else if (browser.android) {
|
||||
if (androidJsObj && typeof androidJsObj === 'object') {
|
||||
val = window.androidJsObj.getTicket();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
val = 'app外'
|
||||
}
|
||||
return val;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 透明loading层
|
||||
var $Loading = {
|
||||
count: 0,
|
||||
isFadeOut: false,
|
||||
show: function () {
|
||||
this.count++;
|
||||
if ($('#loadingToast').length >= 1) {
|
||||
if (this.isFadeOut) {
|
||||
this.isFadeOut = false;
|
||||
$('#loadingToast').stop(true).fadeTo(0, 1);
|
||||
}
|
||||
} else {
|
||||
$('body').append('<div id="loadingToast" style="display: none; position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 9999;"></div>')
|
||||
$('#loadingToast').fadeIn(100);
|
||||
}
|
||||
},
|
||||
hide: function () {
|
||||
this.count--;
|
||||
if (this.count === 0) {
|
||||
this.isFadeOut = true;
|
||||
$('#loadingToast').fadeOut(200, function () {
|
||||
$Loading.isFadeOut = false;
|
||||
$(this).remove();
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
var requestBaseUrl = locateJudge();
|
||||
// ajax
|
||||
function request (type, option) {
|
||||
return $.ajax({
|
||||
type: type,
|
||||
url: requestBaseUrl + option.url,
|
||||
data: option.data,
|
||||
headers: option.headers,
|
||||
beforeSend: function (xhr) {
|
||||
!option.isHideLoading && $Loading.show();
|
||||
},
|
||||
success: function (res, status, xhr) {
|
||||
!option.isHideLoading && $Loading.hide();
|
||||
typeof option.success === 'function' && option.success(res, status, xhr);
|
||||
},
|
||||
error: function (xhr, status, error) {
|
||||
!option.isHideLoading && $Loading.hide();
|
||||
typeof option.error === 'function' && option.error(xhr, status, error);
|
||||
}
|
||||
})
|
||||
}
|
||||
// ajax get
|
||||
function getJSON (option) {
|
||||
request('get', option)
|
||||
}
|
||||
// ajax post
|
||||
function postJSON (option) {
|
||||
request('post', option);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 封装 获取公共参数的方法(客户端提供)
|
||||
// written by zxfxiong
|
||||
const methodsFromClient = {
|
||||
// 注意:ios 提供的方法属异步操作
|
||||
"uid": {
|
||||
android: () => window.androidJsObj.getUid(),
|
||||
ios: function () {
|
||||
window.webkit.messageHandlers.getUid.postMessage(null);
|
||||
|
||||
// let allcookies = document.cookie;
|
||||
// let $uid = allcookies.match(/\d+/);
|
||||
// console.log($uid[0]);
|
||||
|
||||
}
|
||||
},
|
||||
"ticket": {
|
||||
android: () => window.androidJsObj.getTicket(),
|
||||
ios: function () {
|
||||
window.webkit.messageHandlers.getTicket.postMessage(null);
|
||||
}
|
||||
},
|
||||
"roomUid": {
|
||||
android: () => window.androidJsObj.getRoomUid(),
|
||||
ios: function () {
|
||||
window.webkit.messageHandlers.getRoomUid.postMessage(null);
|
||||
}
|
||||
},
|
||||
"deviceId": {
|
||||
android: () => window.androidJsObj.getDeviceId(),
|
||||
ios: function () {
|
||||
window.webkit.messageHandlers.getDeviceId.postMessage(null);
|
||||
}
|
||||
},
|
||||
"deviceInfo": {
|
||||
android: () => window.androidJsObj.getDeviceInfo(),
|
||||
ios: function () {
|
||||
window.webkit.messageHandlers.getDeviceInfo.postMessage(null);
|
||||
}
|
||||
},
|
||||
"encryptPwd": {
|
||||
android: (data) => window.androidJsObj.encryptPwd(data),
|
||||
ios: function (data) {
|
||||
window.webkit.messageHandlers.encryptPwd.postMessage(data);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 全局获取并配置公共参数
|
||||
// written by zxfxiong
|
||||
const pubInfo = {};
|
||||
function getInfoFromClient () {
|
||||
const browser = checkVersion();
|
||||
if (browser.app) {
|
||||
console.log('从客户端获取了用户信息(设备信息),此信息来源:common2.js');
|
||||
if (browser.android) {
|
||||
pubInfo.uid = methodsFromClient.uid.android();
|
||||
pubInfo.ticket = methodsFromClient.ticket.android();
|
||||
pubInfo.deviceId = methodsFromClient.deviceId.android();
|
||||
pubInfo.deviceInfo = methodsFromClient.deviceInfo.android();
|
||||
} else {
|
||||
methodsFromClient.uid.ios();
|
||||
methodsFromClient.ticket.ios();
|
||||
methodsFromClient.deviceId.ios();
|
||||
methodsFromClient.deviceInfo.ios();
|
||||
}
|
||||
|
||||
} else {
|
||||
// 非app环境调试参数
|
||||
pubInfo.uid = 0;
|
||||
pubInfo.ticket = "";
|
||||
// pubInfo.uid = "";
|
||||
// pubInfo.ticket = "";
|
||||
|
||||
pubInfo.deviceId = "0";
|
||||
pubInfo.deviceInfo = {
|
||||
app: 'mew',
|
||||
appVersion: '0.0.0',
|
||||
os: '0.0.0',
|
||||
osVersion: '0.0.0',
|
||||
channel: 'browser',
|
||||
client: 'h5'
|
||||
};
|
||||
}
|
||||
setTimeout(function () {
|
||||
if (browser.android) {
|
||||
if (JSON.parse(pubInfo.deviceInfo).app == 'yinbao') {
|
||||
productUrl = 'https://mew.api.shengxuanwangluo.com';
|
||||
}
|
||||
} else {
|
||||
console.log(pubInfo.deviceInfo.app);
|
||||
if (JSON.parse(pubInfo.deviceInfo.app == 'yinbao')) {
|
||||
productUrl = 'https://mew.api.shengxuanwangluo.com';
|
||||
}
|
||||
}
|
||||
}, 50);
|
||||
};
|
||||
// 控制body是否可以滑动
|
||||
function bodyScroolFun (bool) {
|
||||
if (bool) {
|
||||
$('body').css('overflow', 'hidden');
|
||||
} else {
|
||||
$('body').css('overflow', 'auto');
|
||||
|
||||
}
|
||||
}
|
||||
// 封装数值超过最大数位处理单位
|
||||
function unitProcessing (val, num, toFixeds, text) { //值 以什么为单位 保留几位小数 单位后最w
|
||||
return val >= num ? (Math.floor(val / 1000) / 10).toFixed(toFixeds) + text : val;
|
||||
}
|
||||
// 封装 在ios环境中 配置公共参数的回调函数
|
||||
// 配合 methodsFromClient[infoName].ios 方法
|
||||
// written by zxfxiong
|
||||
function getMessage (key, value) {
|
||||
pubInfo[key] = value;
|
||||
}
|
||||
|
||||
function objToParam (a) {
|
||||
var s = [],
|
||||
rbracket = /\[\]$/,
|
||||
isArray = function (obj) {
|
||||
return Object.prototype.toString.call(obj) === '[object Array]';
|
||||
},
|
||||
add = function (k, v) {
|
||||
v = typeof v === 'function' ? v() : v === null ? '' : v === undefined ? '' : v;
|
||||
s[s.length] = encodeURIComponent(k) + '=' + encodeURIComponent(v);
|
||||
},
|
||||
buildParams = function (prefix, obj) {
|
||||
var i, len, key;
|
||||
|
||||
if (prefix) {
|
||||
if (isArray(obj)) {
|
||||
for (i = 0, len = obj.length; i < len; i++) {
|
||||
if (rbracket.test(prefix)) {
|
||||
add(prefix, obj[i]);
|
||||
} else {
|
||||
buildParams(prefix + '[' + (typeof obj[i] === 'object' ? i : '') + ']', obj[i]);
|
||||
}
|
||||
}
|
||||
} else if (obj && String(obj) === '[object Object]') {
|
||||
for (key in obj) {
|
||||
buildParams(prefix + '[' + key + ']', obj[key]);
|
||||
}
|
||||
} else {
|
||||
add(prefix, obj);
|
||||
}
|
||||
} else if (isArray(obj)) {
|
||||
for (i = 0, len = obj.length; i < len; i++) {
|
||||
add(obj[i].name, obj[i].value);
|
||||
}
|
||||
} else {
|
||||
for (key in obj) {
|
||||
buildParams(key, obj[key]);
|
||||
}
|
||||
}
|
||||
return s;
|
||||
};
|
||||
|
||||
return buildParams('', a).join('&').replace(/%20/g, '+');
|
||||
}
|
||||
|
||||
// 封装 jquery 请求
|
||||
// written by zxfxiong
|
||||
function networkRequest (reqObj = {}, type) {
|
||||
// 关于reqObj内部参数:与 调用原生$.ajax()时传参一致
|
||||
// 调用该函数前:须保证事先调用了 getInfoFromClient()
|
||||
if (typeof pubInfo.deviceInfo === 'string') {
|
||||
pubInfo.deviceInfo = JSON.parse(pubInfo.deviceInfo);
|
||||
};
|
||||
const pubHeader = {
|
||||
app: type != 'yinbaos' ? pubInfo.deviceInfo.app : 'yinbao',
|
||||
// app: 'mew',
|
||||
// app: pubInfo.deviceInfo.app.indexOf('mew') != -1 ? 'mew' : 'PlanetStar',
|
||||
appVersion: pubInfo.deviceInfo.appVersion || '',
|
||||
os: pubInfo.deviceInfo.os || '',
|
||||
os_version: pubInfo.deviceInfo.osVersion || '',
|
||||
channel: pubInfo.deviceInfo.channel || '',
|
||||
client: 'h5',
|
||||
pub_uid: pubInfo.uid,
|
||||
pub_ticket: pubInfo.ticket
|
||||
};
|
||||
|
||||
const url = reqObj.url;
|
||||
const commParams = objToParam(pubHeader);
|
||||
if (url.indexOf('?') >= 0) {
|
||||
reqObj.url = `${url}&${commParams}`
|
||||
} else {
|
||||
reqObj.url = `${url}?${commParams}`
|
||||
}
|
||||
|
||||
if (!reqObj.headers || typeof reqObj.headers !== 'object') {
|
||||
reqObj.headers = {};
|
||||
};
|
||||
Object.assign(reqObj.headers, pubHeader);
|
||||
|
||||
const response = $.ajax(reqObj);
|
||||
return response;
|
||||
}
|
6191
view/mew/common/js/crypto-js.js
Normal file
6191
view/mew/common/js/crypto-js.js
Normal file
File diff suppressed because it is too large
Load Diff
2825
view/mew/common/js/datetime.js
Normal file
2825
view/mew/common/js/datetime.js
Normal file
File diff suppressed because it is too large
Load Diff
1
view/mew/common/js/datetime.min.js
vendored
Normal file
1
view/mew/common/js/datetime.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
109
view/mew/common/js/flexible.js
Normal file
109
view/mew/common/js/flexible.js
Normal file
@@ -0,0 +1,109 @@
|
||||
;(function(win, lib) {
|
||||
var doc = win.document;
|
||||
var docEl = doc.documentElement;
|
||||
var metaEl = doc.querySelector('meta[name="viewport"]');
|
||||
var flexibleEl = doc.querySelector('meta[name="flexible"]');
|
||||
var dpr = 0;
|
||||
var scale = 0;
|
||||
var tid;
|
||||
var flexible = lib.flexible || (lib.flexible = {});
|
||||
|
||||
if (metaEl) {
|
||||
console.warn('将根据已有的meta标签来设置缩放比例');
|
||||
var match = metaEl.getAttribute('content').match(/initial\-scale=([\d\.]+)/);
|
||||
if (match) {
|
||||
scale = parseFloat(match[1]);
|
||||
dpr = parseInt(1 / scale);
|
||||
}
|
||||
} else if (flexibleEl) {
|
||||
var content = flexibleEl.getAttribute('content');
|
||||
if (content) {
|
||||
var initialDpr = content.match(/initial\-dpr=([\d\.]+)/);
|
||||
var maximumDpr = content.match(/maximum\-dpr=([\d\.]+)/);
|
||||
if (initialDpr) {
|
||||
dpr = parseFloat(initialDpr[1]);
|
||||
scale = parseFloat((1 / dpr).toFixed(2));
|
||||
}
|
||||
if (maximumDpr) {
|
||||
dpr = parseFloat(maximumDpr[1]);
|
||||
scale = parseFloat((1 / dpr).toFixed(2));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!dpr && !scale) {
|
||||
var isAndroid = win.navigator.appVersion.match(/android/gi);
|
||||
var isIPhone = win.navigator.appVersion.match(/iphone/gi);
|
||||
var devicePixelRatio = win.devicePixelRatio;
|
||||
if (isIPhone) {
|
||||
// iOS下,对于2和3的屏,用2倍的方案,其余的用1倍方案
|
||||
if (devicePixelRatio >= 3 && (!dpr || dpr >= 3)) {
|
||||
dpr = 3;
|
||||
} else if (devicePixelRatio >= 2 && (!dpr || dpr >= 2)){
|
||||
dpr = 2;
|
||||
} else {
|
||||
dpr = 1;
|
||||
}
|
||||
} else {
|
||||
// 其他设备下,仍旧使用1倍的方案
|
||||
dpr = 1;
|
||||
}
|
||||
scale = 1 / dpr;
|
||||
}
|
||||
docEl.setAttribute('data-dpr', dpr);
|
||||
if (!metaEl) {
|
||||
metaEl = doc.createElement('meta');
|
||||
metaEl.setAttribute('name', 'viewport');
|
||||
metaEl.setAttribute('content', 'initial-scale=' + scale + ', maximum-scale=' + scale + ', minimum-scale=' + scale + ', user-scalable=no');
|
||||
if (docEl.firstElementChild) {
|
||||
docEl.firstElementChild.appendChild(metaEl);
|
||||
} else {
|
||||
var wrap = doc.createElement('div');
|
||||
wrap.appendChild(metaEl);
|
||||
doc.write(wrap.innerHTML);
|
||||
}
|
||||
}
|
||||
function refreshRem(){
|
||||
var width = docEl.getBoundingClientRect().width;
|
||||
if (width / dpr > 540) {
|
||||
width = 540 * dpr;
|
||||
}
|
||||
var rem = width / 10;
|
||||
docEl.style.fontSize = rem + 'px';
|
||||
flexible.rem = win.rem = rem;
|
||||
}
|
||||
win.addEventListener('resize', function() {
|
||||
clearTimeout(tid);
|
||||
tid = setTimeout(refreshRem, 300);
|
||||
}, false);
|
||||
win.addEventListener('pageshow', function(e) {
|
||||
if (e.persisted) {
|
||||
clearTimeout(tid);
|
||||
tid = setTimeout(refreshRem, 300);
|
||||
}
|
||||
}, false);
|
||||
if (doc.readyState === 'complete') {
|
||||
doc.body.style.fontSize = 12 * dpr + 'px';
|
||||
} else {
|
||||
doc.addEventListener('DOMContentLoaded', function(e) {
|
||||
doc.body.style.fontSize = 12 * dpr + 'px';
|
||||
}, false);
|
||||
}
|
||||
|
||||
refreshRem();
|
||||
flexible.dpr = win.dpr = dpr;
|
||||
flexible.refreshRem = refreshRem;
|
||||
flexible.rem2px = function(d) {
|
||||
var val = parseFloat(d) * this.rem;
|
||||
if (typeof d === 'string' && d.match(/rem$/)) {
|
||||
val += 'px';
|
||||
}
|
||||
return val;
|
||||
}
|
||||
flexible.px2rem = function(d) {
|
||||
var val = parseFloat(d) / this.rem;
|
||||
if (typeof d === 'string' && d.match(/px$/)) {
|
||||
val += 'rem';
|
||||
}
|
||||
return val;
|
||||
}
|
||||
})(window, window['lib'] || (window['lib'] = {}));
|
2197
view/mew/common/js/iscroll-probe.js
Normal file
2197
view/mew/common/js/iscroll-probe.js
Normal file
File diff suppressed because it is too large
Load Diff
2170
view/mew/common/js/iscroll.js
Normal file
2170
view/mew/common/js/iscroll.js
Normal file
File diff suppressed because it is too large
Load Diff
22
view/mew/common/js/jQueryExtend.js
Normal file
22
view/mew/common/js/jQueryExtend.js
Normal file
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Created by raymondjack on 2019/1/18.
|
||||
* jQuery extends function
|
||||
*/
|
||||
(function ($) {
|
||||
jQuery.fn.extend({
|
||||
addEvent: function (type, handle, bool) {
|
||||
var el,thisLen = this.length;
|
||||
bool = bool ? bool : false;
|
||||
if(thisLen == 1){
|
||||
el = this[0];
|
||||
el.addEventListener ? el.addEventListener(type,handle,bool):el.attachEvent('on' + type,handle);
|
||||
}else{
|
||||
for(var i = 0;i < thisLen;i++){
|
||||
el = this[i];
|
||||
el.addEventListener ? el.addEventListener(type, handle, bool ):
|
||||
el.attachEvent('on'+type, handle);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
})(jQuery);
|
339
view/mew/common/js/jQueryRotate.js
Normal file
339
view/mew/common/js/jQueryRotate.js
Normal file
@@ -0,0 +1,339 @@
|
||||
// VERSION: 2.3 LAST UPDATE: 11.07.2013
|
||||
/*
|
||||
* Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* Made by Wilq32, wilq32@gmail.com, Wroclaw, Poland, 01.2009
|
||||
* Website: http://code.google.com/p/jqueryrotate/
|
||||
*/
|
||||
|
||||
(function($) {
|
||||
var supportedCSS,supportedCSSOrigin, styles=document.getElementsByTagName("head")[0].style,toCheck="transformProperty WebkitTransform OTransform msTransform MozTransform".split(" ");
|
||||
for (var a = 0; a < toCheck.length; a++) if (styles[toCheck[a]] !== undefined) { supportedCSS = toCheck[a]; }
|
||||
if (supportedCSS) {
|
||||
supportedCSSOrigin = supportedCSS.replace(/[tT]ransform/,"TransformOrigin");
|
||||
if (supportedCSSOrigin[0] == "T") supportedCSSOrigin[0] = "t";
|
||||
}
|
||||
|
||||
// Bad eval to preven google closure to remove it from code o_O
|
||||
eval('IE = "v"=="\v"');
|
||||
|
||||
jQuery.fn.extend({
|
||||
rotate:function(parameters)
|
||||
{
|
||||
if (this.length===0||typeof parameters=="undefined") return;
|
||||
if (typeof parameters=="number") parameters={angle:parameters};
|
||||
var returned=[];
|
||||
for (var i=0,i0=this.length;i<i0;i++)
|
||||
{
|
||||
var element=this.get(i);
|
||||
if (!element.Wilq32 || !element.Wilq32.PhotoEffect) {
|
||||
|
||||
var paramClone = $.extend(true, {}, parameters);
|
||||
var newRotObject = new Wilq32.PhotoEffect(element,paramClone)._rootObj;
|
||||
|
||||
returned.push($(newRotObject));
|
||||
}
|
||||
else {
|
||||
element.Wilq32.PhotoEffect._handleRotation(parameters);
|
||||
}
|
||||
}
|
||||
return returned;
|
||||
},
|
||||
getRotateAngle: function(){
|
||||
var ret = [];
|
||||
for (var i=0,i0=this.length;i<i0;i++)
|
||||
{
|
||||
var element=this.get(i);
|
||||
if (element.Wilq32 && element.Wilq32.PhotoEffect) {
|
||||
ret[i] = element.Wilq32.PhotoEffect._angle;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
},
|
||||
stopRotate: function(){
|
||||
for (var i=0,i0=this.length;i<i0;i++)
|
||||
{
|
||||
var element=this.get(i);
|
||||
if (element.Wilq32 && element.Wilq32.PhotoEffect) {
|
||||
clearTimeout(element.Wilq32.PhotoEffect._timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Library agnostic interface
|
||||
|
||||
Wilq32=window.Wilq32||{};
|
||||
Wilq32.PhotoEffect=(function(){
|
||||
|
||||
if (supportedCSS) {
|
||||
return function(img,parameters){
|
||||
img.Wilq32 = {
|
||||
PhotoEffect: this
|
||||
};
|
||||
|
||||
this._img = this._rootObj = this._eventObj = img;
|
||||
this._handleRotation(parameters);
|
||||
}
|
||||
} else {
|
||||
return function(img,parameters) {
|
||||
this._img = img;
|
||||
this._onLoadDelegate = [parameters];
|
||||
|
||||
this._rootObj=document.createElement('span');
|
||||
this._rootObj.style.display="inline-block";
|
||||
this._rootObj.Wilq32 =
|
||||
{
|
||||
PhotoEffect: this
|
||||
};
|
||||
img.parentNode.insertBefore(this._rootObj,img);
|
||||
|
||||
if (img.complete) {
|
||||
this._Loader();
|
||||
} else {
|
||||
var self=this;
|
||||
// TODO: Remove jQuery dependency
|
||||
jQuery(this._img).bind("load", function(){ self._Loader(); });
|
||||
}
|
||||
}
|
||||
}
|
||||
})();
|
||||
|
||||
Wilq32.PhotoEffect.prototype = {
|
||||
_setupParameters : function (parameters){
|
||||
this._parameters = this._parameters || {};
|
||||
if (typeof this._angle !== "number") { this._angle = 0 ; }
|
||||
if (typeof parameters.angle==="number") { this._angle = parameters.angle; }
|
||||
this._parameters.animateTo = (typeof parameters.animateTo === "number") ? (parameters.animateTo) : (this._angle);
|
||||
|
||||
this._parameters.step = parameters.step || this._parameters.step || null;
|
||||
this._parameters.easing = parameters.easing || this._parameters.easing || this._defaultEasing;
|
||||
this._parameters.duration = parameters.duration || this._parameters.duration || 1000;
|
||||
this._parameters.callback = parameters.callback || this._parameters.callback || this._emptyFunction;
|
||||
this._parameters.center = parameters.center || this._parameters.center || ["50%","50%"];
|
||||
if (typeof this._parameters.center[0] == "string") {
|
||||
this._rotationCenterX = (parseInt(this._parameters.center[0],10) / 100) * this._imgWidth * this._aspectW;
|
||||
} else {
|
||||
this._rotationCenterX = this._parameters.center[0];
|
||||
}
|
||||
if (typeof this._parameters.center[1] == "string") {
|
||||
this._rotationCenterY = (parseInt(this._parameters.center[1],10) / 100) * this._imgHeight * this._aspectH;
|
||||
} else {
|
||||
this._rotationCenterY = this._parameters.center[1];
|
||||
}
|
||||
|
||||
if (parameters.bind && parameters.bind != this._parameters.bind) { this._BindEvents(parameters.bind); }
|
||||
},
|
||||
_emptyFunction: function(){},
|
||||
_defaultEasing: function (x, t, b, c, d) { return -c * ((t=t/d-1)*t*t*t - 1) + b },
|
||||
_handleRotation : function(parameters, dontcheck){
|
||||
if (!supportedCSS && !this._img.complete && !dontcheck) {
|
||||
this._onLoadDelegate.push(parameters);
|
||||
return;
|
||||
}
|
||||
this._setupParameters(parameters);
|
||||
if (this._angle==this._parameters.animateTo) {
|
||||
this._rotate(this._angle);
|
||||
}
|
||||
else {
|
||||
this._animateStart();
|
||||
}
|
||||
},
|
||||
|
||||
_BindEvents:function(events){
|
||||
if (events && this._eventObj)
|
||||
{
|
||||
// Unbinding previous Events
|
||||
if (this._parameters.bind){
|
||||
var oldEvents = this._parameters.bind;
|
||||
for (var a in oldEvents) if (oldEvents.hasOwnProperty(a))
|
||||
// TODO: Remove jQuery dependency
|
||||
jQuery(this._eventObj).unbind(a,oldEvents[a]);
|
||||
}
|
||||
|
||||
this._parameters.bind = events;
|
||||
for (var a in events) if (events.hasOwnProperty(a))
|
||||
// TODO: Remove jQuery dependency
|
||||
jQuery(this._eventObj).bind(a,events[a]);
|
||||
}
|
||||
},
|
||||
|
||||
_Loader:(function()
|
||||
{
|
||||
if (IE)
|
||||
return function() {
|
||||
var width=this._img.width;
|
||||
var height=this._img.height;
|
||||
this._imgWidth = width;
|
||||
this._imgHeight = height;
|
||||
this._img.parentNode.removeChild(this._img);
|
||||
|
||||
this._vimage = this.createVMLNode('image');
|
||||
this._vimage.src=this._img.src;
|
||||
this._vimage.style.height=height+"px";
|
||||
this._vimage.style.width=width+"px";
|
||||
this._vimage.style.position="absolute"; // FIXES IE PROBLEM - its only rendered if its on absolute position!
|
||||
this._vimage.style.top = "0px";
|
||||
this._vimage.style.left = "0px";
|
||||
this._aspectW = this._aspectH = 1;
|
||||
|
||||
/* Group minifying a small 1px precision problem when rotating object */
|
||||
this._container = this.createVMLNode('group');
|
||||
this._container.style.width=width;
|
||||
this._container.style.height=height;
|
||||
this._container.style.position="absolute";
|
||||
this._container.style.top="0px";
|
||||
this._container.style.left="0px";
|
||||
this._container.setAttribute('coordsize',width-1+','+(height-1)); // This -1, -1 trying to fix ugly problem with small displacement on IE
|
||||
this._container.appendChild(this._vimage);
|
||||
|
||||
this._rootObj.appendChild(this._container);
|
||||
this._rootObj.style.position="relative"; // FIXES IE PROBLEM
|
||||
this._rootObj.style.width=width+"px";
|
||||
this._rootObj.style.height=height+"px";
|
||||
this._rootObj.setAttribute('id',this._img.getAttribute('id'));
|
||||
this._rootObj.className=this._img.className;
|
||||
this._eventObj = this._rootObj;
|
||||
var parameters;
|
||||
while (parameters = this._onLoadDelegate.shift()) {
|
||||
this._handleRotation(parameters, true);
|
||||
}
|
||||
}
|
||||
else return function () {
|
||||
this._rootObj.setAttribute('id',this._img.getAttribute('id'));
|
||||
this._rootObj.className=this._img.className;
|
||||
|
||||
this._imgWidth=this._img.naturalWidth;
|
||||
this._imgHeight=this._img.naturalHeight;
|
||||
var _widthMax=Math.sqrt((this._imgHeight)*(this._imgHeight) + (this._imgWidth) * (this._imgWidth));
|
||||
this._width = _widthMax * 3;
|
||||
this._height = _widthMax * 3;
|
||||
|
||||
this._aspectW = this._img.offsetWidth/this._img.naturalWidth;
|
||||
this._aspectH = this._img.offsetHeight/this._img.naturalHeight;
|
||||
|
||||
this._img.parentNode.removeChild(this._img);
|
||||
|
||||
|
||||
this._canvas=document.createElement('canvas');
|
||||
this._canvas.setAttribute('width',this._width);
|
||||
this._canvas.style.position="relative";
|
||||
this._canvas.style.left = -this._img.height * this._aspectW + "px";
|
||||
this._canvas.style.top = -this._img.width * this._aspectH + "px";
|
||||
this._canvas.Wilq32 = this._rootObj.Wilq32;
|
||||
|
||||
this._rootObj.appendChild(this._canvas);
|
||||
this._rootObj.style.width=this._img.width*this._aspectW+"px";
|
||||
this._rootObj.style.height=this._img.height*this._aspectH+"px";
|
||||
this._eventObj = this._canvas;
|
||||
|
||||
this._cnv=this._canvas.getContext('2d');
|
||||
var parameters;
|
||||
while (parameters = this._onLoadDelegate.shift()) {
|
||||
this._handleRotation(parameters, true);
|
||||
}
|
||||
}
|
||||
})(),
|
||||
|
||||
_animateStart:function()
|
||||
{
|
||||
if (this._timer) {
|
||||
clearTimeout(this._timer);
|
||||
}
|
||||
this._animateStartTime = +new Date;
|
||||
this._animateStartAngle = this._angle;
|
||||
this._animate();
|
||||
},
|
||||
_animate:function()
|
||||
{
|
||||
var actualTime = +new Date;
|
||||
var checkEnd = actualTime - this._animateStartTime > this._parameters.duration;
|
||||
|
||||
// TODO: Bug for animatedGif for static rotation ? (to test)
|
||||
if (checkEnd && !this._parameters.animatedGif)
|
||||
{
|
||||
clearTimeout(this._timer);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this._canvas||this._vimage||this._img) {
|
||||
var angle = this._parameters.easing(0, actualTime - this._animateStartTime, this._animateStartAngle, this._parameters.animateTo - this._animateStartAngle, this._parameters.duration);
|
||||
this._rotate((~~(angle*10))/10);
|
||||
}
|
||||
if (this._parameters.step) {
|
||||
this._parameters.step(this._angle);
|
||||
}
|
||||
var self = this;
|
||||
this._timer = setTimeout(function()
|
||||
{
|
||||
self._animate.call(self);
|
||||
}, 10);
|
||||
}
|
||||
|
||||
// To fix Bug that prevents using recursive function in callback I moved this function to back
|
||||
if (this._parameters.callback && checkEnd){
|
||||
this._angle = this._parameters.animateTo;
|
||||
this._rotate(this._angle);
|
||||
this._parameters.callback.call(this._rootObj);
|
||||
}
|
||||
},
|
||||
|
||||
_rotate : (function()
|
||||
{
|
||||
var rad = Math.PI/180;
|
||||
if (IE)
|
||||
return function(angle)
|
||||
{
|
||||
this._angle = angle;
|
||||
this._container.style.rotation=(angle%360)+"deg";
|
||||
this._vimage.style.top = -(this._rotationCenterY - this._imgHeight/2) + "px";
|
||||
this._vimage.style.left = -(this._rotationCenterX - this._imgWidth/2) + "px";
|
||||
this._container.style.top = this._rotationCenterY - this._imgHeight/2 + "px";
|
||||
this._container.style.left = this._rotationCenterX - this._imgWidth/2 + "px";
|
||||
|
||||
}
|
||||
else if (supportedCSS)
|
||||
return function(angle){
|
||||
this._angle = angle;
|
||||
this._img.style[supportedCSS]="rotate("+(angle%360)+"deg)";
|
||||
this._img.style[supportedCSSOrigin]=this._parameters.center.join(" ");
|
||||
}
|
||||
else
|
||||
return function(angle)
|
||||
{
|
||||
this._angle = angle;
|
||||
angle=(angle%360)* rad;
|
||||
// clear canvas
|
||||
this._canvas.width = this._width;//+this._widthAdd;
|
||||
this._canvas.height = this._height;//+this._heightAdd;
|
||||
|
||||
// REMEMBER: all drawings are read from backwards.. so first function is translate, then rotate, then translate, translate..
|
||||
this._cnv.translate(this._imgWidth*this._aspectW,this._imgHeight*this._aspectH); // at least center image on screen
|
||||
this._cnv.translate(this._rotationCenterX,this._rotationCenterY); // we move image back to its orginal
|
||||
this._cnv.rotate(angle); // rotate image
|
||||
this._cnv.translate(-this._rotationCenterX,-this._rotationCenterY); // move image to its center, so we can rotate around its center
|
||||
this._cnv.scale(this._aspectW,this._aspectH); // SCALE - if needed ;)
|
||||
this._cnv.drawImage(this._img, 0, 0); // First - we draw image
|
||||
}
|
||||
|
||||
})()
|
||||
}
|
||||
|
||||
if (IE)
|
||||
{
|
||||
Wilq32.PhotoEffect.prototype.createVMLNode=(function(){
|
||||
document.createStyleSheet().addRule(".rvml", "behavior:url(#default#VML)");
|
||||
try {
|
||||
!document.namespaces.rvml && document.namespaces.add("rvml", "urn:schemas-microsoft-com:vml");
|
||||
return function (tagName) {
|
||||
return document.createElement('<rvml:' + tagName + ' class="rvml">');
|
||||
};
|
||||
} catch (e) {
|
||||
return function (tagName) {
|
||||
return document.createElement('<' + tagName + ' xmlns="urn:schemas-microsoft.com:vml" class="rvml">');
|
||||
};
|
||||
}
|
||||
})();
|
||||
}
|
||||
|
||||
})(jQuery);
|
2
view/mew/common/js/jquery-1.8.3.min.js
vendored
Normal file
2
view/mew/common/js/jquery-1.8.3.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
4
view/mew/common/js/jquery-3.2.1.min.js
vendored
Normal file
4
view/mew/common/js/jquery-3.2.1.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
7
view/mew/common/js/jquery.copy.min copy.js
Normal file
7
view/mew/common/js/jquery.copy.min copy.js
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* [点击复制内容移动端全兼容(专治各种移动端浏览器)]
|
||||
* @author majiang by beijing
|
||||
* @createtime 2018-11-17
|
||||
* @blog http://www.love85g.com
|
||||
*/
|
||||
;(function($){var defaults={imgUrl:"",text:"复制成功",copyUrl:"",tipTime:2000,copyId:""};$.extend({copy:function(option){var options=$.extend({},defaults,option);var URL=options.copyUrl==""?window.location.href.split('#')[0]:options.copyUrl;var cId=options.copyId==""?'#copy':options.copyId;var IMG=options.imgUrl==""?"":'<img style="width: 22px;" src="'+options.imgUrl+'">';var tipsHtml='<div id="share-tips" style="position: fixed;top: 50%;left:50%;background: rgba(0,0,0,.5);border-radius: 4px;margin: 0 auto;color: #fff;z-index: 9999;padding: 5px 10px;font-size: 14px;text-align: center;transform: translate(-50%,-50%);">'+IMG+'<p>'+options.text+'</p></div>';var u=navigator.userAgent;var isAndroid=u.indexOf('Android')>-1||u.indexOf('Adr')>-1;var isiOS=!!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);var aEle=document.querySelectorAll(cId);if(isAndroid||(!isAndroid&&!isiOS)){$(aEle).each(function(){var index=$(this).attr("id").split("y")[1];$('body').append('<textarea id="selector'+index+'" style="position:absolute;top:-9999px;left:-9999px;" readonly>'+URL+'</textarea>');$(this)[0].onclick=function(event){$("#selector"+index).select();document.execCommand("copy",false,null);$("body").append(tipsHtml);setTimeout(function(){$("#share-tips").remove()},options.tipTime)}})}if(isiOS){$(aEle).each(function(){var index=$(this).attr("id").split("y")[1];$('body').append('<a id="selector'+index+'" style="position:absolute;top:-9999px;left:-9999px;">'+URL+'</a>');this.addEventListener('click',function(){var copyDOM=document.querySelectorAll('#selector'+index);var range=document.createRange();range.selectNode(copyDOM[0]);window.getSelection().removeAllRanges();window.getSelection().addRange(range);document.execCommand('copy');$("body").append(tipsHtml);setTimeout(function(){$("#share-tips").remove()},options.tipTime)},false)})}}})})(jQuery);
|
7
view/mew/common/js/jquery.copy.min.js
vendored
Normal file
7
view/mew/common/js/jquery.copy.min.js
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/**
|
||||
* [点击复制内容移动端全兼容(专治各种移动端浏览器)]
|
||||
* @author majiang by beijing
|
||||
* @createtime 2018-11-17
|
||||
* @blog http://www.love85g.com
|
||||
*/
|
||||
;(function($){var defaults={imgUrl:"",text:"复制成功",copyUrl:"",tipTime:2000,copyId:""};$.extend({copy:function(option){var options=$.extend({},defaults,option);var URL=options.copyUrl==""?window.location.href.split('#')[0]:options.copyUrl;var cId=options.copyId==""?'#copy':options.copyId;var IMG=options.imgUrl==""?"":'<img style="width: 22px;" src="'+options.imgUrl+'">';var tipsHtml='<div id="share-tips" style="position: fixed;top: 50%;left:50%;background: rgba(0,0,0,.5);border-radius: 4px;margin: 0 auto;color: #fff;z-index: 9999;padding: 5px 10px;font-size: 14px;text-align: center;transform: translate(-50%,-50%);">'+IMG+'<p>'+options.text+'</p></div>';var u=navigator.userAgent;var isAndroid=u.indexOf('Android')>-1||u.indexOf('Adr')>-1;var isiOS=!!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);var aEle=document.querySelectorAll(cId);if(isAndroid||(!isAndroid&&!isiOS)){$(aEle).each(function(){var index=$(this).attr("id").split("y")[1];$('body').append('<textarea id="selector'+index+'" style="position:absolute;top:-9999px;left:-9999px;" readonly>'+URL+'</textarea>');$(this)[0].onclick=function(event){$("#selector"+index).select();document.execCommand("copy",false,null);$("body").append(tipsHtml);setTimeout(function(){$("#share-tips").remove()},options.tipTime)}})}if(isiOS){$(aEle).each(function(){var index=$(this).attr("id").split("y")[1];$('body').append('<a id="selector'+index+'" style="position:absolute;top:-9999px;left:-9999px;">'+URL+'</a>');this.addEventListener('click',function(){var copyDOM=document.querySelectorAll('#selector'+index);var range=document.createRange();range.selectNode(copyDOM[0]);window.getSelection().removeAllRanges();window.getSelection().addRange(range);document.execCommand('copy');$("body").append(tipsHtml);setTimeout(function(){$("#share-tips").remove()},options.tipTime)},false)})}}})})(jQuery);
|
2
view/mew/common/js/layer.js
Normal file
2
view/mew/common/js/layer.js
Normal file
@@ -0,0 +1,2 @@
|
||||
/*! layer mobile-v2.0 弹层组件移动版 License LGPL http://layer.layui.com/mobile By 贤心 */
|
||||
;!function(a){"use strict";var b=document,c="querySelectorAll",d="getElementsByClassName",e=function(a){return b[c](a)},f={type:0,shade:!0,shadeClose:!0,fixed:!0,anim:"scale"},g={extend:function(a){var b=JSON.parse(JSON.stringify(f));for(var c in a)b[c]=a[c];return b},timer:{},end:{}};g.touch=function(a,b){a.addEventListener("click",function(a){b.call(this,a)},!1)};var h=0,i=["layui-m-layer"],j=function(a){var b=this;b.config=g.extend(a),b.view()};j.prototype.view=function(){var a=this,c=a.config,f=b.createElement("div");a.id=f.id=i[0]+h,f.setAttribute("class",i[0]+" "+i[0]+(c.type||0)),f.setAttribute("index",h);var g=function(){var a="object"==typeof c.title;return c.title?'<h3 style="'+(a?c.title[1]:"")+'">'+(a?c.title[0]:c.title)+"</h3>":""}(),j=function(){"string"==typeof c.btn&&(c.btn=[c.btn]);var a,b=(c.btn||[]).length;return 0!==b&&c.btn?(a='<span yes type="1">'+c.btn[0]+"</span>",2===b&&(a='<span no type="0">'+c.btn[1]+"</span>"+a),'<div class="layui-m-layerbtn">'+a+"</div>"):""}();if(c.fixed||(c.top=c.hasOwnProperty("top")?c.top:100,c.style=c.style||"",c.style+=" top:"+(b.body.scrollTop+c.top)+"px"),2===c.type&&(c.content='<i></i><i class="layui-m-layerload"></i><i></i><p>'+(c.content||"")+"</p>"),c.skin&&(c.anim="up"),"msg"===c.skin&&(c.shade=!1),f.innerHTML=(c.shade?"<div "+("string"==typeof c.shade?'style="'+c.shade+'"':"")+' class="layui-m-layershade"></div>':"")+'<div class="layui-m-layermain" '+(c.fixed?"":'style="position:static;"')+'><div class="layui-m-layersection"><div class="layui-m-layerchild '+(c.skin?"layui-m-layer-"+c.skin+" ":"")+(c.className?c.className:"")+" "+(c.anim?"layui-m-anim-"+c.anim:"")+'" '+(c.style?'style="'+c.style+'"':"")+">"+g+'<div class="layui-m-layercont">'+c.content+"</div>"+j+"</div></div></div>",!c.type||2===c.type){var k=b[d](i[0]+c.type),l=k.length;l>=1&&layer.close(k[0].getAttribute("index"))}document.body.appendChild(f);var m=a.elem=e("#"+a.id)[0];c.success&&c.success(m),a.index=h++,a.action(c,m)},j.prototype.action=function(a,b){var c=this;a.time&&(g.timer[c.index]=setTimeout(function(){layer.close(c.index)},1e3*a.time));var e=function(){var b=this.getAttribute("type");0==b?(a.no&&a.no(),layer.close(c.index)):a.yes?a.yes(c.index):layer.close(c.index)};if(a.btn)for(var f=b[d]("layui-m-layerbtn")[0].children,h=f.length,i=0;h>i;i++)g.touch(f[i],e);if(a.shade&&a.shadeClose){var j=b[d]("layui-m-layershade")[0];g.touch(j,function(){layer.close(c.index,a.end)})}a.end&&(g.end[c.index]=a.end)},a.layer={v:"2.0",index:h,open:function(a){var b=new j(a||{});return b.index},close:function(a){var c=e("#"+i[0]+a)[0];c&&(c.innerHTML="",b.body.removeChild(c),clearTimeout(g.timer[a]),delete g.timer[a],"function"==typeof g.end[a]&&g.end[a](),delete g.end[a])},closeAll:function(){for(var a=b[d](i[0]),c=0,e=a.length;e>c;c++)layer.close(0|a[0].getAttribute("index"))}},"function"==typeof define?define(function(){return layer}):function(){var a=document.scripts,c=a[a.length-1],d=c.src,e=d.substring(0,d.lastIndexOf("/")+1);c.getAttribute("merge")||document.head.appendChild(function(){var a=b.createElement("link");return a.href=e+"need/layer.css?2.0",a.type="text/css",a.rel="styleSheet",a.id="layermcss",a}())}()}(window);
|
1
view/mew/common/js/linkedme.js
Normal file
1
view/mew/common/js/linkedme.js
Normal file
File diff suppressed because one or more lines are too long
14
view/mew/common/js/mescroll.min.js
vendored
Normal file
14
view/mew/common/js/mescroll.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
view/mew/common/js/need/layer.css
Normal file
1
view/mew/common/js/need/layer.css
Normal file
File diff suppressed because one or more lines are too long
2
view/mew/common/js/pingpp.js
Normal file
2
view/mew/common/js/pingpp.js
Normal file
File diff suppressed because one or more lines are too long
27
view/mew/common/js/route-constant.js
Normal file
27
view/mew/common/js/route-constant.js
Normal file
@@ -0,0 +1,27 @@
|
||||
// 设置客户端跳转方法参数
|
||||
var routeTypeConstant = {
|
||||
ROOM_PAGE: 1, //跳转房间页 传参(routerType): uid
|
||||
H5_PAGE: 2, // 跳转h5
|
||||
PURSE_PAGE: 3, //跳转钱包页
|
||||
RED_PAGE: 4, //xcRedColor
|
||||
RECHARGE_PAGE: 5, //跳转充值页
|
||||
PERSON_PAGE: 6, //跳转个人页 传参(routerType) : uid
|
||||
CAR_PAGE: 7, //跳转座驾 传参(routerType) : 0 (装扮商城) 或者 1 (车库)
|
||||
HEADWEAR_PAGE: 8, //跳转到头饰 传参(routerType) : 0 (装扮商城) 或者 1 (头饰库)
|
||||
SYSTEMMESSAGE_PAGE: 9, //系统消息
|
||||
FAMILY_PAGE: 10, //跳转到家族页面
|
||||
GROUP_PAGE: 11, //跳转到群组
|
||||
BACKGROUND_PAGE: 12, //跳转到背景设置 传参(routerType): 0 (装扮商城) 或者 1 (背景库)
|
||||
NEW_USER_PAGE: 13, //新秀玩友
|
||||
INVITE_FRIEND_PAGE: 14, //邀请好友
|
||||
PUBLICCHAT_PAGE: 15, //公聊大厅
|
||||
XCZ_ACCOUNT_PAGE: 16, //绑定 xcz 账号
|
||||
PHONE_NUM_PAGE: 17, //绑定手机号
|
||||
PAY_PWD_PAGE: 18, //设置支付密码
|
||||
WITHDRAW_RECORD_PAGE: 19, //提现记录页面
|
||||
RECOMMEND_CARD_PAGE: 20, //跳转到推荐卡仓库
|
||||
TEACHER_PUPIL_PAGE: 28, //跳转到师徒页面入口
|
||||
WORLD_GROUND_PAGE: 47, //跳转小世界广场
|
||||
VOICE_PAGE: 42, //声音瓶子
|
||||
DONG_TAI: 75 //声音瓶子
|
||||
}
|
1
view/mew/common/js/svga.min.js
vendored
Normal file
1
view/mew/common/js/svga.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
view/mew/common/js/swiper.animate1.0.3.min.js
vendored
Normal file
3
view/mew/common/js/swiper.animate1.0.3.min.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
//本插件由www.swiper.com.cn提供
|
||||
//版本1.03
|
||||
function swiperAnimateCache(a){for(j=0;j<a.slides.length;j++)for(allBoxes=a.slides[j].querySelectorAll(".ani"),i=0;i<allBoxes.length;i++)allBoxes[i].attributes["style"]?allBoxes[i].setAttribute("swiper-animate-style-cache",allBoxes[i].attributes["style"].value):allBoxes[i].setAttribute("swiper-animate-style-cache"," "),allBoxes[i].style.visibility="hidden"}function swiperAnimate(a){clearSwiperAnimate(a);var b=a.slides[a.activeIndex].querySelectorAll(".ani");for(i=0;i<b.length;i++)b[i].style.visibility="visible",effect=b[i].attributes["swiper-animate-effect"]?b[i].attributes["swiper-animate-effect"].value:"",b[i].className=b[i].className+" "+effect+" "+"animated",style=b[i].attributes["style"].value,duration=b[i].attributes["swiper-animate-duration"]?b[i].attributes["swiper-animate-duration"].value:"",duration&&(style=style+"animation-duration:"+duration+";-webkit-animation-duration:"+duration+";"),delay=b[i].attributes["swiper-animate-delay"]?b[i].attributes["swiper-animate-delay"].value:"",delay&&(style=style+"animation-delay:"+delay+";-webkit-animation-delay:"+delay+";"),b[i].setAttribute("style",style)}function clearSwiperAnimate(a){for(j=0;j<a.slides.length;j++)for(allBoxes=a.slides[j].querySelectorAll(".ani"),i=0;i<allBoxes.length;i++)allBoxes[i].attributes["swiper-animate-style-cache"]&&allBoxes[i].setAttribute("style",allBoxes[i].attributes["swiper-animate-style-cache"].value),allBoxes[i].style.visibility="hidden",allBoxes[i].className=allBoxes[i].className.replace("animated"," "),allBoxes[i].attributes["swiper-animate-effect"]&&(effect=allBoxes[i].attributes["swiper-animate-effect"].value,allBoxes[i].className=allBoxes[i].className.replace(effect," "))}
|
19
view/mew/common/js/swiper.min.js
vendored
Normal file
19
view/mew/common/js/swiper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
3
view/mew/common/js/template-web.js
Normal file
3
view/mew/common/js/template-web.js
Normal file
File diff suppressed because one or more lines are too long
12
view/mew/common/js/vconsole.min.js
vendored
Normal file
12
view/mew/common/js/vconsole.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user