/* version v8
** up:2018.03.08*/
var zanpian = {
//浏览器信息
'browser': {
'url': document.url,
'domain': document.domain,
'title': document.title,
'language': function () {
try {
var ua = (navigator.language || navigator.browserlanguage).tolowercase();//zh-tw|zh-hk|zh-cn
return ua;
} catch (e) {
}
}(),
'canvas': function () {
return !!document.createelement('canvas').getcontext;
}(),
'useragent': function () {
var ua = navigator.useragent;//navigator.appversion
return {
'mobile': !!ua.match(/applewebkit.*mobile.*/), //是否为移动终端
'ios': !!ua.match(/\(i[^;]+;( u;)? cpu.+mac os x/), //ios终端
'android': ua.indexof('android') > -1 || ua.indexof('linux') > -1, //android终端或者uc浏览器
'iphone': ua.indexof('iphone') > -1 || ua.indexof('mac') > -1, //是否为iphone或者qqhd浏览器
'ipad': ua.indexof('ipad') > -1, //是否ipad
'trident': ua.indexof('trident') > -1, //ie内核
'presto': ua.indexof('presto') > -1, //opera内核
'webkit': ua.indexof('applewebkit') > -1, //苹果、谷歌内核
'gecko': ua.indexof('gecko') > -1 && ua.indexof('khtml') == -1, //火狐内核
'weixin': ua.indexof('micromessenger') > -1 //是否微信 ua.match(/micromessenger/i) == "micromessenger",
};
}()
},
//系统公共
'cms': {
//提示窗口
'floatdiv': function () {
},
//选项卡切换
'tab': function () {
$("#mytab li a").click(function (e) {
$(this).tab('show');
//$($(this).attr('href')).find('a').lazyload({effect: "fadein"});
});
},
//内容详情折叠
'collapse': function () {
var w = document.documentelement ? document.documentelement.clientwidth : document.body.clientwidth;
if (w > 640) {
$(".list_type").addclass("in");
}
},
'scrolltop': function () {
var a = $(window);
$scrolltoplink = $("a.backtop");
a.scroll(function () {
500 < $(this).scrolltop() ? $scrolltoplink.css("display", "block") : $scrolltoplink.css("display", "none")
});
$scrolltoplink.on("click", function () {
$("html, body").animate({
scrolltop: 0
}, 400);
return !1
})
},
//ajax模态弹窗加载
'modal': function (url) {
},
//公共
'all': function (url) {
}
},
'list': {
//列表ajax响应
'more': function () {
},
'ajax': function () {
},
'url': function (url) {
},
},
'detail': {
'collapse': function () { //内容详情折叠
},
//播放列表折叠
'playlist': function () {
},
//下载地址处理
'download': function () {
},
'juqing': function () {
}
},
'player': {
//播放页面播放列表
'playerlist': function () {
},
//播放权限回调
'vip_callback': function ($vod_id, $vod_sid, $vod_pid, $status, $trysee, $tips) {
},
},
'updown': { //顶踩与送花
'load': function () {
},
},
'barrage': { //弹幕
'index': function () {
},
'get': function (t) {
}
},
'love': {//订阅与收藏
'load': function () {
},
},
//评分
'score': {
'load': function () {
},
'loading': function () {
},
//加载评分与订阅收藏
'ajax': function (url) {
},
'stars': function (r) {
},
},
//播放记录
'playlog': {
'load': function () {
},
'get': function () {
},
'set': function () {
},
},
//评论
'cm': {
//按类型加载评论
'load': function () {
},
'forum': function () {
},
'uyan': function () {
},
'changyan': function () {
},
//评论表情
'emo': function () {
},
'ajax': function (url) {
},
},
'user': {
'index': function () {
},
//会员充值窗口
'payment': function () {
},
//检查vip播放页面并刷新页面
'iframe': function () {
},
//检查登录状态
'islogin': function () {
},
//弹出登录窗口
'loginform': function () {
return false;
},
//登录
'login': function () {
},
//注册
'reg': function () {
},
//注册
'userinfo': function () {
},
'home': function () {
},
//会员中心
'center': function () {
},
'hot': function (url) {
},
'setuplabel': function () {
},
'editor': function () {
}
},
'gbook': {
//留言
'load': function () {
},
},
'search': { //搜索
'autocomplete': function () {
},
},
//图片处理
'image': {
//幻灯与滑块
'swiper': function () {
$.ajaxsetup({
cache: true
});
$.getscript("/template/default27/static/js/swiper.min.js", function () {
var swiper = new swiper('.box-slide', {
pagination: '.swiper-pagination',
lazyloading: true,
preventclicks: true,
paginationclickable: true,
autoplaydisableoninteraction: false,
autoplay: 3000,
loop: true,
nextbutton: '.swiper-button-next',
prevbutton: '.swiper-button-prev',
});
var swiper = new swiper('.details-slide', {
pagination: '.swiper-pagination',
autoheight: true,
loop: true,
nextbutton: '.details-slide-next',
prevbutton: '.details-slide-pre',
paginationtype: 'fraction',
keyboardcontrol: true,
lazyloading: true,
lazyloadinginprevnext: true,
lazyloadinginprevnextamount: 1,
lazyloadingontransitionstart: true,
});
var swiper = new swiper('.news-switch-3', {
lazyloading: true,
slidesperview: 3,
spacebetween: 0,
nextbutton: '.swiper-button-next',
prevbutton: '.swiper-button-prev',
breakpoints: {
1200: {slidesperview: 3, spacebetween: 0},
992: {slidesperview: 2, spacebetween: 0},
767: {slidesperview: 1, spacebetween: 0}
}
});
var swiper = new swiper('.news-switch-4', {
lazyloading: true,
slidesperview: 4,
spacebetween: 0,
nextbutton: '.swiper-button-next',
prevbutton: '.swiper-button-prev',
breakpoints: {
1200: {slidesperview: 4, spacebetween: 0},
992: {slidesperview: 3, spacebetween: 0},
767: {slidesperview: 2, spacebetween: 0}
}
});
var swiper = new swiper('.news-switch-5', {
lazyloading: true,
slidesperview: 5,
spacebetween: 0,
nextbutton: '.swiper-button-next',
prevbutton: '.swiper-button-prev',
breakpoints: {
1200: {slidesperview: 4, spacebetween: 0},
992: {slidesperview: 3, spacebetween: 0},
767: {slidesperview: 2, spacebetween: 0}
}
});
var swiper = new swiper('.vod-swiper-4', {
lazyloading: true,
slidesperview: 4,
spacebetween: 0,
nextbutton: '.swiper-button-next',
prevbutton: '.swiper-button-prev',
breakpoints: {1200: {slidesperview: 4, spacebetween: 0}, 767: {slidesperview: 3, spacebetween: 0}}
});
var swiper = new swiper('.vod-swiper-5', {
lazyloading: true,
slidesperview: 5,
spacebetween: 0,
nextbutton: '.swiper-button-next',
prevbutton: '.swiper-button-prev',
breakpoints: {1200: {slidesperview: 4, spacebetween: 0}, 767: {slidesperview: 3, spacebetween: 0}}
});
var swiper = new swiper('.vod-swiper-6', {
lazyloading: true,
slidesperview: 6,
spacebetween: 0,
nextbutton: '.swiper-button-next',
prevbutton: '.swiper-button-prev',
breakpoints: {
1200: {slidesperview: 5, spacebetween: 0},
992: {slidesperview: 4, spacebetween: 0},
768: {slidesperview: 3, spacebetween: 0}
}
});
});
},
//延迟加载
'lazyload': function () {
$.ajaxsetup({
cache: true
});
$.getscript("/template/default27/static/js/jquery.lazyload.min.js", function (response, status) {
$(".loading").lazyload({
effect: "fadein",
failurelimit: 15
});
});
},
//生成二维码
'qrcode': function () {
murl = cms.murl;
if (murl == '' || murl === 'undefined') {
murl = zanpian.browser.url;
}
if ($(".qrcode")) {
$(".qrcode").append('');
}
$("#qrcode").popover({
html: true
});
$("#qrcode").on('show.bs.popover', function () {
$("#qrcode").attr('data-content', '');
})
},
//生成验证码图片
'validate': function () {
},
//生成验证码图片
'validateurl': function () {
},
},
//验证码相关
'validate': {
'load': function () {
},
'focus': function () {//验证码框焦点
},
'click': function () {//点击刷新
}
},
'language': {//简繁转换
's2t': function () {
},
't2s': function () {
}
},
//人气处理
'hits': {
'load': function () {
}
},
'mobile': {//移动端专用
},
'loadjs': {
},
};
$(document).ready(function () {
zanpian.image.swiper();//幻灯片
zanpian.cms.floatdiv();//窗口提示信息
zanpian.cms.all();//主要加载
zanpian.cms.tab();//切换
zanpian.cms.collapse();
zanpian.cms.scrolltop();
zanpian.image.lazyload();//图片延迟加载
// zanpian.search.autocomplete();//联系搜索
zanpian.image.qrcode();//二维码
// zanpian.list.ajax();//列表ajax
});