提审官网
This commit is contained in:
321
view/peko/homeCheck/js/common.js
Normal file
321
view/peko/homeCheck/js/common.js
Normal file
@@ -0,0 +1,321 @@
|
||||
const productUrl = 'https://api.nnbc123.cn'; // 正式环境
|
||||
const testUrl = 'http://apidev.yinmeng.zhongjialx.com'; // 测试环境
|
||||
|
||||
function render (templateId, templateData, target) {
|
||||
var html = template(templateId, templateData);
|
||||
target.innerHTML += html;
|
||||
}
|
||||
|
||||
// 根据域名判断 正式环境(含www)/测试环境(含beta), 并返回所需url前缀
|
||||
// written by zxfxiong
|
||||
function getUrlPrefix () {
|
||||
if (!EnvCheck()) return undefined;
|
||||
return EnvCheck() === 'live' ? productUrl : testUrl;
|
||||
}
|
||||
|
||||
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 = 'http://www.erbanyy.com/modules/bonus/fight.html';
|
||||
// var res = EnvCheck();
|
||||
// if (res == 'test'){
|
||||
// _url = 'http://beta.erbanyy.com/modules/bonus/fight.html';
|
||||
// }
|
||||
// var info = {
|
||||
// title: '耳伴与你一起红',
|
||||
// imgUrl: 'http://www.erbanyy.com/home/images/logo.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/)
|
||||
if (res || res1 || res2 || res3 || res4) {
|
||||
return 'test';
|
||||
} else {
|
||||
return 'live';
|
||||
}
|
||||
}
|
||||
}
|
||||
// 根据域名判断是本地打开还是服务器打开
|
||||
function locateJudge() {
|
||||
if(window.location.href){
|
||||
var _url = window.location.href;
|
||||
var res = _url.match(/test/);
|
||||
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
|
||||
app: u.match('mengshengApp') == 'mengshengApp' //是否在app内
|
||||
};
|
||||
}
|
||||
|
||||
// 图片预加载
|
||||
function preloadImage(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 msMask(channel,tags,params) {
|
||||
//此函数用于一般的耳伴底层面罩
|
||||
var browser = checkVersion();
|
||||
var env = EnvCheck();
|
||||
// params = params? params:0;
|
||||
var bol = $.isEmptyObject(params);
|
||||
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
|
||||
// '{"uid":"' + params + '"}'
|
||||
};
|
||||
|
||||
linkedme.init("414571f0698afaa1c194f345f0dcc328", {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{
|
||||
$('#share-mask').css('display','flex');
|
||||
}
|
||||
}
|
||||
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: data.data.appId, // 必填,公众号的唯一标识
|
||||
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;
|
||||
// }
|
||||
|
||||
|
||||
$('#share-mask .shareBtn').on('click',function () {
|
||||
var browser = checkVersion();
|
||||
if (browser.app) {
|
||||
if (browser.android) {
|
||||
window.androidJsObj.openSharePage();
|
||||
} else if (browser.ios) {
|
||||
window.webkit.messageHandlers.openSharePage.postMessage(null);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* 渲染列表组件
|
||||
* @param templateId 组件的id
|
||||
* @param $target 渲染目标dom
|
||||
* @param attrParam 属性名,格式 {'.class':['dataAttr',type]}
|
||||
* @param data 渲染数据的数组
|
||||
*/
|
||||
|
||||
function templateList(templateId,$target,attrParam,data){
|
||||
var $template = $(templateId);
|
||||
var str = $template.html();
|
||||
|
||||
for(var i = 0;i < data.length;i++){
|
||||
var $list = $(str);
|
||||
$target.append($list);
|
||||
for(var j in attrParam){
|
||||
if(attrParam[j][1] == 1){
|
||||
$list.find(j + ' img').attr('src',data[i][attrParam[j][0]]);
|
||||
}else if(attrParam[j][1] == 2){
|
||||
$list.find(j).html(data[i][attrParam[j][0]]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function initNav(obj) {
|
||||
if($.isEmptyObject(obj)){
|
||||
return;
|
||||
}
|
||||
var browser = checkVersion();
|
||||
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 tranUrl = 'https://h5.nnbc123.cn';
|
||||
|
||||
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) {
|
||||
// 获取cookie参数
|
||||
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) { //删除cookie方法
|
||||
var date = new Date(); //获取当前时间
|
||||
date.setTime(date.getTime() - 10000); //将date设置为过去的时间
|
||||
document.cookie = key + '=v; expires =' + date.toGMTString(); //设置cookie
|
||||
}
|
||||
}
|
||||
}
|
109
view/peko/homeCheck/js/flexible.js
Normal file
109
view/peko/homeCheck/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 > 730) {
|
||||
width = 730 * 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'] = {}));
|
4
view/peko/homeCheck/js/html5shiv.min.js
vendored
Normal file
4
view/peko/homeCheck/js/html5shiv.min.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
/**
|
||||
* @preserve HTML5 Shiv 3.7.3 | @afarkas @jdalton @jon_neal @rem | MIT/GPL2 Licensed
|
||||
*/
|
||||
!function(a,b){function c(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function d(){var a=t.elements;return"string"==typeof a?a.split(" "):a}function e(a,b){var c=t.elements;"string"!=typeof c&&(c=c.join(" ")),"string"!=typeof a&&(a=a.join(" ")),t.elements=c+" "+a,j(b)}function f(a){var b=s[a[q]];return b||(b={},r++,a[q]=r,s[r]=b),b}function g(a,c,d){if(c||(c=b),l)return c.createElement(a);d||(d=f(c));var e;return e=d.cache[a]?d.cache[a].cloneNode():p.test(a)?(d.cache[a]=d.createElem(a)).cloneNode():d.createElem(a),!e.canHaveChildren||o.test(a)||e.tagUrn?e:d.frag.appendChild(e)}function h(a,c){if(a||(a=b),l)return a.createDocumentFragment();c=c||f(a);for(var e=c.frag.cloneNode(),g=0,h=d(),i=h.length;i>g;g++)e.createElement(h[g]);return e}function i(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return t.shivMethods?g(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+d().join().replace(/[\w\-:]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(t,b.frag)}function j(a){a||(a=b);var d=f(a);return!t.shivCSS||k||d.hasCSS||(d.hasCSS=!!c(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),l||i(a,d),a}var k,l,m="3.7.3-pre",n=a.html5||{},o=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,p=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,q="_html5shiv",r=0,s={};!function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",k="hidden"in a,l=1==a.childNodes.length||function(){b.createElement("a");var a=b.createDocumentFragment();return"undefined"==typeof a.cloneNode||"undefined"==typeof a.createDocumentFragment||"undefined"==typeof a.createElement}()}catch(c){k=!0,l=!0}}();var t={elements:n.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output picture progress section summary template time video",version:m,shivCSS:n.shivCSS!==!1,supportsUnknownElements:l,shivMethods:n.shivMethods!==!1,type:"default",shivDocument:j,createElement:g,createDocumentFragment:h,addElements:e};a.html5=t,j(b),"object"==typeof module&&module.exports&&(module.exports=t)}("undefined"!=typeof window?window:this,document);
|
133
view/peko/homeCheck/js/index.js
Normal file
133
view/peko/homeCheck/js/index.js
Normal file
@@ -0,0 +1,133 @@
|
||||
/* eslint-disable semi */
|
||||
/* eslint-disable no-undef */
|
||||
let version = checkVersion()
|
||||
let urlData = getQueryString()
|
||||
const urlPrefix = getUrlPrefix()
|
||||
//获取url参数
|
||||
let channelData = urlData.channel
|
||||
//定义官方渠道包
|
||||
const channelDict = {
|
||||
'peko0': 'https://image.lecheng163.com/peko_peko0.apk',
|
||||
'peko1': 'https://image.lecheng163.com/peko_peko1.apk',
|
||||
'peko2': 'https://image.lecheng163.com/peko_peko2.apk',
|
||||
'peko3': 'https://image.lecheng163.com/peko_peko3.apk',
|
||||
'peko4': 'https://image.lecheng163.com/peko_peko4.apk',
|
||||
'peko5': 'https://image.lecheng163.com/peko_peko5.apk',
|
||||
'peko6': 'https://image.lecheng163.com/peko_peko6.apk',
|
||||
'peko7': 'https://image.lecheng163.com/peko_peko7.apk',
|
||||
'peko8': 'https://image.lecheng163.com/peko_peko8.apk',
|
||||
'peko9': 'https://image.lecheng163.com/peko_peko9.apk',
|
||||
'peko10': 'https://image.lecheng163.com/peko_peko10.apk',
|
||||
'gongzhonghao': 'https://image.lecheng163.com/peko_gongzhonghao.apk',
|
||||
'zhaohui': 'https://image.lecheng163.com/zhaohui.apk'
|
||||
|
||||
// 'baomihua01': 'https://image.lecheng163.com/accompany_release_v_213_1_baomihua01_sign.apk'
|
||||
}
|
||||
|
||||
function swiperFun() {
|
||||
var swiper = new Swiper('.swiper', {
|
||||
direction: 'vertical',
|
||||
pagination: '.swiper-pagination',
|
||||
paginationClickable: true,
|
||||
loop: true,
|
||||
autoplay: 4000,
|
||||
// nextButton: ".swiper-button-next",
|
||||
// prevButton: ".swiper-button-prev",
|
||||
|
||||
});
|
||||
}
|
||||
function swiperFun2() {
|
||||
var swiper2 = new Swiper('.swiper2', {
|
||||
direction: 'horizontal',
|
||||
pagination: '.swiper-pagination',
|
||||
paginationClickable: true,
|
||||
loop: true,
|
||||
autoplay: 4000,
|
||||
// nextButton: ".swiper-button-next",
|
||||
// prevButton: ".swiper-button-prev",
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(function () {
|
||||
|
||||
//判断url参数是否是与渠道包名一致
|
||||
let androidUrl = null;
|
||||
channelDict.hasOwnProperty(channelData) ? androidUrl = channelDict[channelData] : androidUrl = 'https://play.google.com/store/apps/details?id=com.vele.peko';
|
||||
let iosUrl = 'http://doudouyue.com/8axv' //ios企业包
|
||||
// let iosUrl = 'https://apps.apple.com/cn/app/id1571083482' //ios商店包
|
||||
|
||||
if (version.ios) {
|
||||
$('.button-wrapper').on('click', function () {
|
||||
if (version.weixin) {
|
||||
$('.tips').show()
|
||||
return
|
||||
}
|
||||
window.location.href = iosUrl;
|
||||
})
|
||||
|
||||
} else if (version.android) {
|
||||
$('.button-wrapper').on('click', function () {
|
||||
if (version.weixin) {
|
||||
$('.tips').show()
|
||||
return
|
||||
}
|
||||
window.location.href = androidUrl;
|
||||
})
|
||||
} else {
|
||||
$('.button-wrapper').on('click', function () {
|
||||
window.location.href = androidUrl;
|
||||
})
|
||||
$('.button2-wrapper').on('click', function () {
|
||||
window.location.href = iosUrl;
|
||||
})
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
$(function () {
|
||||
$(document).ready(function () {
|
||||
var deviceWidth = document.documentElement.clientWidth;
|
||||
if (deviceWidth > 768) {
|
||||
document.documentElement.style.fontSize = deviceWidth / 19.20 + 'px';
|
||||
swiperFun();
|
||||
} else {
|
||||
document.documentElement.style.fontSize = deviceWidth / 7.50 + 'px';
|
||||
swiperFun2()
|
||||
}
|
||||
});
|
||||
window.onresize = function () {
|
||||
var deviceWidth = document.documentElement.clientWidth;
|
||||
// console.log('deviceWidth', deviceWidth);
|
||||
if (deviceWidth > 768) {
|
||||
document.documentElement.style.fontSize = deviceWidth / 19.20 + 'px';
|
||||
swiperFun();
|
||||
} else {
|
||||
document.documentElement.style.fontSize = deviceWidth / 7.50 + 'px';
|
||||
swiperFun2()
|
||||
}
|
||||
}
|
||||
//跳转pc端充值
|
||||
$('.homePc .charge').click(function () {
|
||||
window.location.href = urlPrefix + '/peko/modules/payPc/index.html?channelType=4';
|
||||
})
|
||||
// 跳转移动端h5充值
|
||||
$('.homeM .charge').click(function () {
|
||||
window.location.href = urlPrefix + '/peko/modules/pay/index.html?channelType=4';
|
||||
})
|
||||
// goglo跳转
|
||||
$('.googlePlay').click(function () {
|
||||
window.location.href = 'https://play.google.com/store/apps/details?id=com.vele.peko'
|
||||
})
|
||||
$('.appleStore').click(function () {
|
||||
// console.log(version, 'version');
|
||||
if (version.webKit && version.ios) {
|
||||
window.location.href = 'itms-services:///?action=download-manifest&url=https://img.pekolive.com/distribute.plist'
|
||||
} else {
|
||||
window.location.href = 'http://doudouyue.com/h958'
|
||||
}
|
||||
})
|
||||
$('.apk').click(function () {
|
||||
window.location.href = 'https://img.pekolive.com/peko_official.apk'
|
||||
})
|
||||
})
|
4
view/peko/homeCheck/js/jquery.min.js
vendored
Normal file
4
view/peko/homeCheck/js/jquery.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
69
view/peko/homeCheck/js/jquery.qrcode.js
Normal file
69
view/peko/homeCheck/js/jquery.qrcode.js
Normal file
File diff suppressed because one or more lines are too long
6
view/peko/homeCheck/js/respond.min.js
vendored
Normal file
6
view/peko/homeCheck/js/respond.min.js
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
/*! Respond.js v1.4.2: min/max-width media query polyfill
|
||||
* Copyright 2014 Scott Jehl
|
||||
* Licensed under MIT
|
||||
* http://j.mp/respondjs */
|
||||
|
||||
!function(a){"use strict";a.matchMedia=a.matchMedia||function(a){var b,c=a.documentElement,d=c.firstElementChild||c.firstChild,e=a.createElement("body"),f=a.createElement("div");return f.id="mq-test-1",f.style.cssText="position:absolute;top:-100em",e.style.background="none",e.appendChild(f),function(a){return f.innerHTML='­<style media="'+a+'"> #mq-test-1 { width: 42px; }</style>',c.insertBefore(e,d),b=42===f.offsetWidth,c.removeChild(e),{matches:b,media:a}}}(a.document)}(this),function(a){"use strict";function b(){v(!0)}var c={};a.respond=c,c.update=function(){};var d=[],e=function(){var b=!1;try{b=new a.XMLHttpRequest}catch(c){b=new a.ActiveXObject("Microsoft.XMLHTTP")}return function(){return b}}(),f=function(a,b){var c=e();c&&(c.open("GET",a,!0),c.onreadystatechange=function(){4!==c.readyState||200!==c.status&&304!==c.status||b(c.responseText)},4!==c.readyState&&c.send(null))},g=function(a){return a.replace(c.regex.minmaxwh,"").match(c.regex.other)};if(c.ajax=f,c.queue=d,c.unsupportedmq=g,c.regex={media:/@media[^\{]+\{([^\{\}]*\{[^\}\{]*\})+/gi,keyframes:/@(?:\-(?:o|moz|webkit)\-)?keyframes[^\{]+\{(?:[^\{\}]*\{[^\}\{]*\})+[^\}]*\}/gi,comments:/\/\*[^*]*\*+([^/][^*]*\*+)*\//gi,urls:/(url\()['"]?([^\/\)'"][^:\)'"]+)['"]?(\))/g,findStyles:/@media *([^\{]+)\{([\S\s]+?)$/,only:/(only\s+)?([a-zA-Z]+)\s?/,minw:/\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,maxw:/\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/,minmaxwh:/\(\s*m(in|ax)\-(height|width)\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)/gi,other:/\([^\)]*\)/g},c.mediaQueriesSupported=a.matchMedia&&null!==a.matchMedia("only all")&&a.matchMedia("only all").matches,!c.mediaQueriesSupported){var h,i,j,k=a.document,l=k.documentElement,m=[],n=[],o=[],p={},q=30,r=k.getElementsByTagName("head")[0]||l,s=k.getElementsByTagName("base")[0],t=r.getElementsByTagName("link"),u=function(){var a,b=k.createElement("div"),c=k.body,d=l.style.fontSize,e=c&&c.style.fontSize,f=!1;return b.style.cssText="position:absolute;font-size:1em;width:1em",c||(c=f=k.createElement("body"),c.style.background="none"),l.style.fontSize="100%",c.style.fontSize="100%",c.appendChild(b),f&&l.insertBefore(c,l.firstChild),a=b.offsetWidth,f?l.removeChild(c):c.removeChild(b),l.style.fontSize=d,e&&(c.style.fontSize=e),a=j=parseFloat(a)},v=function(b){var c="clientWidth",d=l[c],e="CSS1Compat"===k.compatMode&&d||k.body[c]||d,f={},g=t[t.length-1],p=(new Date).getTime();if(b&&h&&q>p-h)return a.clearTimeout(i),i=a.setTimeout(v,q),void 0;h=p;for(var s in m)if(m.hasOwnProperty(s)){var w=m[s],x=w.minw,y=w.maxw,z=null===x,A=null===y,B="em";x&&(x=parseFloat(x)*(x.indexOf(B)>-1?j||u():1)),y&&(y=parseFloat(y)*(y.indexOf(B)>-1?j||u():1)),w.hasquery&&(z&&A||!(z||e>=x)||!(A||y>=e))||(f[w.media]||(f[w.media]=[]),f[w.media].push(n[w.rules]))}for(var C in o)o.hasOwnProperty(C)&&o[C]&&o[C].parentNode===r&&r.removeChild(o[C]);o.length=0;for(var D in f)if(f.hasOwnProperty(D)){var E=k.createElement("style"),F=f[D].join("\n");E.type="text/css",E.media=D,r.insertBefore(E,g.nextSibling),E.styleSheet?E.styleSheet.cssText=F:E.appendChild(k.createTextNode(F)),o.push(E)}},w=function(a,b,d){var e=a.replace(c.regex.comments,"").replace(c.regex.keyframes,"").match(c.regex.media),f=e&&e.length||0;b=b.substring(0,b.lastIndexOf("/"));var h=function(a){return a.replace(c.regex.urls,"$1"+b+"$2$3")},i=!f&&d;b.length&&(b+="/"),i&&(f=1);for(var j=0;f>j;j++){var k,l,o,p;i?(k=d,n.push(h(a))):(k=e[j].match(c.regex.findStyles)&&RegExp.$1,n.push(RegExp.$2&&h(RegExp.$2))),o=k.split(","),p=o.length;for(var q=0;p>q;q++)l=o[q],g(l)||m.push({media:l.split("(")[0].match(c.regex.only)&&RegExp.$2||"all",rules:n.length-1,hasquery:l.indexOf("(")>-1,minw:l.match(c.regex.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),maxw:l.match(c.regex.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||"")})}v()},x=function(){if(d.length){var b=d.shift();f(b.href,function(c){w(c,b.href,b.media),p[b.href]=!0,a.setTimeout(function(){x()},0)})}},y=function(){for(var b=0;b<t.length;b++){var c=t[b],e=c.href,f=c.media,g=c.rel&&"stylesheet"===c.rel.toLowerCase();e&&g&&!p[e]&&(c.styleSheet&&c.styleSheet.rawCssText?(w(c.styleSheet.rawCssText,e,f),p[e]=!0):(!/^([a-zA-Z:]*\/\/)/.test(e)&&!s||e.replace(RegExp.$1,"").split("/")[0]===a.location.host)&&("//"===e.substring(0,2)&&(e=a.location.protocol+e),d.push({href:e,media:f})))}x()};y(),c.update=y,c.getEmValue=u,a.addEventListener?a.addEventListener("resize",b,!1):a.attachEvent&&a.attachEvent("onresize",b)}}(this);
|
19
view/peko/homeCheck/js/swiper.min.js
vendored
Normal file
19
view/peko/homeCheck/js/swiper.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
68
view/peko/homeCheck/js/utf.js
Normal file
68
view/peko/homeCheck/js/utf.js
Normal file
@@ -0,0 +1,68 @@
|
||||
/* utf.js - UTF-8 <=> UTF-16 convertion
|
||||
*
|
||||
* Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>
|
||||
* Version: 1.0
|
||||
* LastModified: Dec 25 1999
|
||||
* This library is free. You can redistribute it and/or modify it.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Interfaces:
|
||||
* utf8 = utf16to8(utf16);
|
||||
* utf16 = utf16to8(utf8);
|
||||
*/
|
||||
|
||||
function utf16to8(str) {
|
||||
var out, i, len, c;
|
||||
|
||||
out = "";
|
||||
len = str.length;
|
||||
for(i = 0; i < len; i++) {
|
||||
c = str.charCodeAt(i);
|
||||
if ((c >= 0x0001) && (c <= 0x007F)) {
|
||||
out += str.charAt(i);
|
||||
} else if (c > 0x07FF) {
|
||||
out += String.fromCharCode(0xE0 | ((c >> 12) & 0x0F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 6) & 0x3F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
} else {
|
||||
out += String.fromCharCode(0xC0 | ((c >> 6) & 0x1F));
|
||||
out += String.fromCharCode(0x80 | ((c >> 0) & 0x3F));
|
||||
}
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
function utf8to16(str) {
|
||||
var out, i, len, c;
|
||||
var char2, char3;
|
||||
|
||||
out = "";
|
||||
len = str.length;
|
||||
i = 0;
|
||||
while(i < len) {
|
||||
c = str.charCodeAt(i++);
|
||||
switch(c >> 4)
|
||||
{
|
||||
case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:
|
||||
// 0xxxxxxx
|
||||
out += str.charAt(i-1);
|
||||
break;
|
||||
case 12: case 13:
|
||||
// 110x xxxx 10xx xxxx
|
||||
char2 = str.charCodeAt(i++);
|
||||
out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));
|
||||
break;
|
||||
case 14:
|
||||
// 1110 xxxx 10xx xxxx 10xx xxxx
|
||||
char2 = str.charCodeAt(i++);
|
||||
char3 = str.charCodeAt(i++);
|
||||
out += String.fromCharCode(((c & 0x0F) << 12) |
|
||||
((char2 & 0x3F) << 6) |
|
||||
((char3 & 0x3F) << 0));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
Reference in New Issue
Block a user