购物车js代码

window.w_$7;
window.w_$doc;
window.w_$7doc;
window.w_$html;
window.w_myapp;
function jayfunction($,IScroll,Framework7) {
//就在这里执行jay.js的方法吧
console.log("start");
//console.log(IScroll)
//console.log($7)
var $7 = Dom7;
var $doc=$(document);
var $7doc=$7(document);
var $html = $("html")
w_$7 = $7;
w_$doc = $doc;
w_$7doc = $7doc;
w_$html = $html;
var myApp = new Framework7({
pushState:true
});
w_myapp = myApp;
var myPlugin = {};
    var compiledTemplate = {};
    
    //编译模板
    myPlugin.compileTemp=function (tempId,data) {  
        if(!compiledTemplate[tempId]){
            var template = $('script#'+tempId).html();
            compiledTemplate[tempId] = Template7.compile(template);
        }
        return compiledTemplate[tempId](data);
    };
    w_myapp.myPlugin = myPlugin; 
var appView = myApp.addView('.view-main', {
 // Because we want to use dynamic navbar, we need to enable it for this view:
dynamicNavbar: true,
domCache: true
 // options
});
w_myapp.mainView = appView; 


var iscrollOptions = {
//tap: true,
click:true,
    probeType:2,
scrollbars: false,
bindToWrapper:true
//,
//fadeScrollbars:true,
//disableMouse: true,
//disablePointer: true
}

var iscrollOptions2 = {
//tap: true,
    //probeType:2,
click:true,
useTransform: false,
scrollbars: false,
bindToWrapper:true
//,
//fadeScrollbars:true
//,
//disableMouse: true,
//disablePointer: true
}






/*$.stellar.positionProperty.sticky = {
setPosition: function($element, newLeft, originalLeft, newTop, originalTop) {
if (newTop < 0 ) {return;}
$element.css('transform', 'translate3d(' +
(newLeft - originalLeft) + 'px, ' +
(newTop) + 'px, ' +
'0)');
}
}*/


/*$("#sticky_title").stellar({
scrollProperty: 'transform',
positionProperty: 'sticky'
});*/

function hideSearchbar() {
if ( wrapperScroll.directionY === 1 ) {
var $searchbar = $(".searchbar");
$searchbar.addClass("hide");
$html.removeClass("showSearchbar");
$searchbar.find("input").trigger("blur");
wrapperScroll.off("scroll", hideSearchbar);
}
}


var scrolldefine = 0;


function detectionJump(obj,wrapSilder,Num) {
$(obj.scroller).on("touchend", function() {
var _this = obj;
var scalcheight = 50;
var scalcheight2 = _this.scrollerHeight - _this.wrapperHeight + Num;
if (Math.floor(_this.y) <= -scalcheight2) {
wrapSilder.slideNext();
} else if (Math.floor(_this.y) >= Num) {
wrapSilder.slidePrev();
}
})
}


function scrollendfn() {
// if (scrolldefine%2 === 0) {
var _this = wrapperScroll;
// var scalcheight =Number(_this.scrollerHeight)-Number(_this.wrapperHeight) + 30;
if ( Math.floor(_this.y) >= 44 ) {
$(".searchbar").removeClass("hide");
$html.addClass("showSearchbar")
_this.on("scroll", hideSearchbar);
}
/*if (Math.floor(_this.y) <= -scalcheight ) {
console.log(scalcheight)
mySliderIndex.slideNext();
}*/
// }
// scrolldefine = scrolldefine+1
}


function scrollStart() {
scrolldefine = 0;
console.log("start")
}






//console.log(eachscrollArry)

//mySliderIndex.slideTo(5,100)

var wrapperScroll;
var $eachscroll;
var eachscrollArry = [];
var $iscroll_wrap = $(".iscroll-wrap");
var $iscrollinner_parallax = $(".iscrollinner-parallax");
var $APP_CLS_BTN = $("#APP_CLS_BTN");


function getAndroidVersion(ua) {
ua = (ua || navigator.userAgent).toLowerCase(); 
var match = ua.match(/android\s([0-9\.]*)/);
return match ? match[1] : false;
};


var GetQueryString = function(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!==null)return  unescape(r[2]); return null;
};
var getstr1 = GetQueryString('jumpURL');
var getstr2 = GetQueryString('backto'); 
var getstr3 = GetQueryString('jpf');




// Returns a function which adds a vendor prefix to any CSS property name
vendorPrefix = (function() {
var prefixes = /^(Moz|Webkit|Khtml|O|ms|Icab)(?=[A-Z])/,
style = $('script')[0].style,
prefix = '',
prop;


for (prop in style) {
if (prefixes.test(prop)) {
prefix = prop.match(prefixes)[0];
break;
}
}


if ('WebkitOpacity' in style) { prefix = 'Webkit'; }
if ('KhtmlOpacity' in style) { prefix = 'Khtml'; }


return function(property) {
return prefix + (prefix.length > 0 ? property.charAt(0).toUpperCase() + property.slice(1) : property);
};
}()),


prefixedTransform = vendorPrefix('transform'),

$.stellar.scrollProperty.myappstellar = {
getLeft: function($elem) {
var $insideElement=$elem.find("#banner_1_hor");
if ($insideElement.length) {
var computedTransform = getComputedStyle($insideElement[0])[prefixedTransform];
return (computedTransform !== 'none' ? parseInt(computedTransform.match(/(-?[0-9]+)/g)[4], 10) * -1 : 0);
} else {
var computedTransform = getComputedStyle($elem[0])[prefixedTransform];
return (computedTransform !== 'none' ? parseInt(computedTransform.match(/(-?[0-9]+)/g)[4], 10) * -1 : 0);
}
},
getTop: function($elem) {
var computedTransform = getComputedStyle($elem[0])[prefixedTransform];
return (computedTransform !== 'none' ? parseInt(computedTransform.match(/(-?[0-9]+)/g)[5], 10) * -1 : 0);
}

}
$.stellar.positionProperty.myappstellar = {
setPosition: function($elem, left, startingLeft, top, startingTop) {
if ($elem.data("stellar-horizontal") === true) {
$elem[0].style[prefixedTransform] = 'translate3d(' + (left - startingLeft) + 'px, ' + (top - startingTop) + 'px, 0)';
} else {
$elem[0].style[prefixedTransform] = 'translate3d(' + '0px, ' + (top - startingTop) + 'px, 0)';
}

}



window.index_fn = {
init:function() {
$iscroll_wrap = $(".iscroll-wrap");
$iscrollinner_parallax = $(".iscrollinner-parallax");
$iscrollinner_parallax_horizontal = $("#banner_1_hor");
$APP_CLS_BTN = $("#APP_CLS_BTN");

var mySliderIndex = myApp.slider('#homeSlider', {
speed: 400,
direction: 'vertical',
onlyExternal:true,
spaceBetween: 100,
onTransitionEnd:function(slider) {
if (slider.activeSlideIndex == "0") {
$iscrollinner_parallax.stellar("_reset");
//console.log($iscrollinner_parallax)
}
}
//onlyExternal:true
});
//mySliderIndex.onTransitionEnd("")


if (myApp.device.os != "android" ) {
var tarstates = false;
$iscroll_wrap.on("touchstart.iswa1", "a",function(e) {
tarstates=true;
}).on("touchmove.iswa2", "a", function(e) {
tarstates=false;
}).on("touchend.iswa3", "a", function(e) {
if (tarstates===false) {
return false;
}
})
}


$iscroll_wrap.on("touchmove.isw",function(e) {
e.stopPropagation();
});


wrapperScroll = new IScroll("#page_iscroll_1",iscrollOptions);


$iscrollinner_parallax.stellar({
/*horizontalScrolling: false,*/
scrollProperty: 'myappstellar',
positionProperty: 'myappstellar',
hideDistantElements: false
});




wrapperScroll.on("beforeScrollStart", scrollStart);
wrapperScroll.on("beforeScrollStart", function() {
this.refresh();
});
detectionJump(wrapperScroll,mySliderIndex,40)
/*$(wrapperScroll.scroller).on("touchend", function() {
scrollendfn();
});*/
//wrapperScroll.on("scroll", scrollendfn)

$APP_CLS_BTN.on("click.demotest", function() {
myApp.alert("你触发了一次主窗口关闭事件","");
});
//each scroll
$eachscroll = $(".eachscroll");
$eachscroll.each(function(index,element) {
eachscrollArry[index] = new IScroll(element, iscrollOptions2);
detectionJump(eachscrollArry[index],mySliderIndex,40);
eachscrollArry[index].on("beforeScrollStart", function(e) {
this.refresh();
});
})
            
            
            
            
            
},
destory:function() {
$iscrollinner_parallax.stellar("destroy");
$iscrollinner_parallax.stellar("refresh");
// wrapperScroll.destroy();
// wrapperScroll = null;
// $.each(eachscrollArry, function(i,d) {
// d.destroy();
// });
$iscroll_wrap.off(".isw");
$APP_CLS_BTN.off(".demotest");
}

}


function touzi_list(style) {
//监听toolbar swiper 的高度等级
$doc.on("toolbar_event", function(e) {
//console.log(e);
console.log("swipername:"+e.swipername+",levelval:"+e.levelval);
var categoryName = e.swipername;
var categoryValue = e.levelval;
var money = "";
var filter = "";
if(categoryValue){
if(categoryName != "qigoujine"){
if("all" == categoryValue){//获取所有的tag
var val = "";
$("#"+categoryName+" .databox div").each(function(){
var $this = $(this);
var v = $this.attr("value");
if(v && v != "all"){
if(val != ""){
val += "|" + v;
}else{
val = v;
}
}
});
filter = val;
}else{
filter = categoryValue;
}
if(categoryName == "shouyileixing"){
$("#shouyileixingFilter").val(filter);
}else if(categoryName == "fengxian"){
$("#fengxianFilter").val(filter);
}
var tempFilter = $("#shouyileixingFilter").val();
if("" == tempFilter){
tempFilter += $("#fengxianFilter").val();
}else{
var fenxianFilter = $("#fengxianFilter").val();
if(fenxianFilter != ""){
tempFilter += "|" + fenxianFilter;
}
}
$("#filter").val(tempFilter);
filter = tempFilter;
money = $("#money").val();
}else if(categoryName == "qigoujine"){
if("all" == categoryValue){//获取所有的tag
var val = "";
$("#"+categoryName+" .databox div").each(function(){
var $this = $(this);
var v = $this.attr("value");
if(v && v != "all"){
if(val != ""){
val += "|" + v;
}else{
val = v;
}
}
});
money = val;
}else{
money = categoryValue;
}
$("#money").val(money);
filter = $("#filter").val();
}
}else{
return;
}
var types = $("#types").val();
var baseUrlName = $("#baseUrlName").val();
var baseSubUrlName = $("#baseSubUrlName").val();
if(!baseSubUrlName){
baseSubUrlName = baseUrlName;
}
var bgc = $("#bgc").val();
var sort = $("#sort").val();
var pageSize = $("#pageSize").val();
var pageNum = parseInt($("#pageNum").val());
$.ajax({
url : '../queryProductByCondition.do',
timeout : 20000,
type : 'GET',
cache : false,
data : {
sort : sort,
pageNum : pageNum,
types : types,
filter : filter,
money : money,
pageSize:pageSize
},
success : function(data) {
var html = '';
var noData = '<a class="list-item" href="#">'+
'<div class="list-info">'+
'<div class="ubox">'+
'<div class="ub-f1">&nbsp;</div>'+
'<span></span>'+
'</div>'+
'<div class="no-data">暂无数据</div>'+
'<div class="ubox">'+
'<div class="ub-f1">&nbsp;</div>'+
'<span></span>'+
'</div>'+
'</div>'+
'</a>';
$.each(data.prodList,function(key, value) {
var procuctId = value.id;
var productName = value.productName;
var productIconUrl = value.productIconUrl;
var productSlogan = value.productSlogan;
var investDto = value.productInvestDto;
var incomeRate = "";
var startAmount = "";
var timeLimit = "";
if(investDto){
incomeRate = investDto.incomeRate;
startAmount = investDto.startAmount;
timeLimit = investDto.timeLimit;
}
if(style=='lfexStyle'){
html += '<a class="list-item" href="'+baseSubUrlName+'/'+procuctId+'.shtml?bgc='+bgc+'">'+
'<div class="list-info">'+
'<div class="ubox">'+
'<div class="ub-f1 pre-name">'+productName+'</div>'+
'<span></span>'+
'</div>'+
'<div class="pre-income">'+incomeRate+'</div>'+
'<div class="ubox ub-ae">'+
'<span>预期收益</span>'+
'<div class="ub-f1 pre-num">'+startAmount+'万<i>起</i></div>'+
'<span>'+timeLimit+'</span>'+
'</div>'+
'</div>'+
'</a>';
}else if(style=='trustStyle'){
html += '<a class="list-item" href="'+baseSubUrlName+'/'+procuctId+'.shtml?bgc='+bgc+'">'+
'<div class="ub-f1 ubox-v product-info">'+
'<div class="title-name">'+productName+'</div>'+
'<div class="ubox title-value ub-ae">'+
'<span class="ub-f3">'+incomeRate.replace(/%/g, "<i>%</i>")+'</span>'+
'<span class="ub-f2">'+startAmount+'万</span>'+
'<span class="ub-f2">'+timeLimit+'</span>'+
'</div>'+
'<div class="ubox">'+
'<div class="ub-f3 overflow-elli">预期收益率</div>'+
'<div class="ub-f2">起购金额</div>'+
'<div class="ub-f2">产品期限</div>'+
'</div>'+
'</div>'+
'</a>';
}
});
if(''!= html){
$("#liebiao").html("").append(html);
}else{
$("#liebiao").html(noData);
}
},
       error : function(info) {
        window.location.href="../pages/error.jsp";
       }
});

});
}

function licai_list(style) {
//监听toolbar swiper 的高度等级
$doc.on("toolbar_event", function(e) {
console.log("swipername:"+e.swipername+",levelval:"+e.levelval);
var categoryName = e.swipername;
var categoryValue = e.levelval;
var yuqishouyi = "";
var rengouqidian = "";
var shouyileixing = "";
if(categoryValue){
if(categoryName == "yuqishouyi"){
if("all" == categoryValue){
$("#yuqishouyiFilter").val("");
}else{
$("#yuqishouyiFilter").val(categoryValue);
}
}
yuqishouyi = $("#yuqishouyiFilter").val();
if(categoryName == "rengouqidian"){
if("all" == categoryValue){
$("#rengouqidianFilter").val("");
}else{
$("#rengouqidianFilter").val(categoryValue);
}
}
qigoujine = $("#rengouqidianFilter").val();
if(categoryName == "shouyileixing"){
if("all" == categoryValue){
$("#shouyileixingFilter").val("");
}else{
$("#shouyileixingFilter").val(categoryValue);
}
}
shouyileixing = $("#shouyileixingFilter").val();
}else{
return;
}
var types = $("#types").val();
var baseUrlName = $("#baseUrlName").val();
var baseSubUrlName = $("#baseSubUrlName").val();
if(!baseSubUrlName){
baseSubUrlName = baseUrlName;
}
var bgc = $("#bgc").val();
var sort = $("#sort").val();
var pageSize = $("#pageSize").val();
var pageNum = parseInt($("#pageNum").val());
$.ajax({
url : '../queryProductByCondition.do',
timeout : 20000,
type : 'GET',
cache : false,
data : {
sort : sort,
pageNum : pageNum,
pageSize : pageSize,
types : types,
           qigou : rengouqidian,
           shouyi : yuqishouyi,
           shouyiType : shouyileixing
},
success : function(data) {
var html = '';
var noData = '<a class="list-item" href="#">'+
'<div class="list-info">'+
'<div class="ubox">'+
'<div class="ub-f1">&nbsp;</div>'+
'<span></span>'+
'</div>'+
'<div class="no-data">暂无数据</div>'+
'<div class="ubox">'+
'<div class="ub-f1">&nbsp;</div>'+
'<span></span>'+
'</div>'+
'</div>'+
'</a>';
$.each(data.licaiList, function(key, value) {
var productNameStr = value.productName;
var procuctId = value.productId;
var pDateName = value.pDateName;
var productYield = value.productYield;
var pMoney = value.pMoney;
var timeUnit = value.timeUnit;
var isMonthTimeUnit = timeUnit==30;
var isYearTimeUnit = timeUnit==365;
var unitYearStr = "";
if(isMonthTimeUnit){
unitYearStr = "月";
}else if(isYearTimeUnit){
unitYearStr = "月";
}else{
unitYearStr = "日";
}
var unit = value.unit;
var unitJRStr = "";
if(unit == '1000'){
unitJRStr = "千";
}else if(unit == '10000'){
unitJRStr = "万";
}else if(unit == '1'){
unitJRStr = "";
}
var curr = value.currency;
var currStr = "";
if(curr == 'USD'){
currStr = "美元";
}else if(curr == 'RMB'){
currStr = "元";
}else if(curr == "HKD"){
currStr = "港元";
}
var productNames = productNameStr.split("-");
var p1 = "";
var p2 = "";
if(productNames.length > 0){
p1 = productNames[0];
}
if(productNames.length > 1){
p2 = productNames[1];
}
if(style=='licaiStyle'){
html += '<a class="list-item" href="'+baseSubUrlName+'/'+procuctId+'.shtml?bgc='+bgc+'">'+
'<div class="ub-f1 ubox-v product-info">'+
'<div class="title-name">'+p1+'</div>'+
'<div class="title-number">'+p2+'</div>'+
'<div class="ubox title-value ub-ae">'+
'<span class="ub-f3">'+productYield.replace(/%/g, "<i>%</i>")+'</span>'+
'<span class="ub-f2">'+pMoney+unitJRStr+currStr+'</span>'+
'<span class="ub-f2">'+pDateName+unitYearStr+'</span>'+
'</div>'+
'<div class="ubox">'+
'<div class="ub-f3 overflow-elli">预期收益率</div>'+
'<div class="ub-f2">起购金额</div>'+
'<div class="ub-f2">产品期限</div>'+
'</div>'+
'</div>'+
'</a>';
}
});
if(''!= html){
$("#liebiao").html("").append(html);
}else{
$("#liebiao").html(noData);
}
},
       error : function(info) {
        window.location.href="../pages/error.jsp";
       }
});

});
}

function index_list() {

//监听toolbar swiper 的高度等级
$doc.on("toolbar_event", function(e) {
//console.log(e);
});
}


function index_lufex() {
var lufex_slider = myApp.slider("#lufex_slider",{
//options
direction:"horizontal",
loop:true,
paginationHide:false,
pagination:".lfex-banner-slider .slider-pagination"
});
}


//index_fn.init();
if(getstr3){

}else{
if (getstr1) {
var target;
if (getstr2) {
target = getstr1 + "?" + "backto=" + getstr2
} else {
target = getstr1+ "?" + "backto=home.shtml"
}
appView.router.load({
url:target
})
} else {
appView.router.load({
url:"home.shtml"
})
}
}



var oldClientY;
var oldHeight;
var $element;
var $element_navbar;
/* 2015年01月28日 add*/
var $showSwiperGhost;
//$(".toolbar").on("touchmove", ".toolbar-swiper", function(e) {
$doc.on("touchmove", ".toolbar-swiper", function(e) {
var _this = this;
var _clientHeight =_this.clientHeight;
_this.style.height = oldHeight +  (oldClientY - e.originalEvent.touches[0].clientY ) + "px";
if (_clientHeight >= 160 && _clientHeight < 193) {
$element.removeClass("level-2 level-3 level-4 level-5 level-6");
$element.addClass("level-1");
$element.attr("state","1");

$showSwiperGhost.removeClass("level-2 level-3 level-4 level-5 level-6");
$showSwiperGhost.addClass("level-1");
$showSwiperGhost.attr("state","1");

} else if (_clientHeight >= 193 && _clientHeight < 226) {
$element.removeClass("level-1 level-3 level-4 level-5 level-6");
$element.addClass("level-2");
$element.attr("state","2");

$showSwiperGhost.removeClass("level-1 level-3 level-4 level-5 level-6");
$showSwiperGhost.addClass("level-2");
$showSwiperGhost.attr("state","2");


} else if (_clientHeight >= 226 && _clientHeight < 259) {
$element.removeClass("level-1 level-2 level-4 level-5 level-6");
$element.addClass("level-3");
$element.attr("state","3");

$showSwiperGhost.removeClass("level-1 level-2 level-4 level-5 level-6");
$showSwiperGhost.addClass("level-3");
$showSwiperGhost.attr("state","3");

} else if (_clientHeight >= 259 && _clientHeight < 292) {
$element.removeClass("level-1 level-2 level-3 level-5 level-6");
$element.addClass("level-4");
$element.attr("state","4");

$showSwiperGhost.removeClass("level-1 level-2 level-3 level-5 level-6");
$showSwiperGhost.addClass("level-4");
$showSwiperGhost.attr("state","4");

} else if ( _clientHeight >= 292 && _clientHeight < 325 ) {
$element.removeClass("level-1 level-2 level-3 level-4 level-6");
$element.addClass("level-5");
$element.attr("state","5");

$showSwiperGhost.removeClass("level-1 level-2 level-3 level-4 level-6");
$showSwiperGhost.addClass("level-5");
$showSwiperGhost.attr("state","5");

} else if ( _clientHeight >= 325 ) {
$element.removeClass("level-1 level-2 level-3 level-4 level-5");
$element.addClass("level-6");
$element.attr("state","6");

$showSwiperGhost.removeClass("level-1 level-2 level-3 level-4 level-5");
$showSwiperGhost.addClass("level-6");
$showSwiperGhost.attr("state","6");

} else {
$element.removeClass("level-1 level-2 level-3 level-4 level-5 level-6");

$showSwiperGhost.removeClass("level-1 level-2 level-3 level-4 level-5 level-6");
}
e.stopPropagation();
e.preventDefault();
}).on("touchstart", ".toolbar-swiper", function(e) {
$element = $(this);
var _this = this;
$element.attr("state","");
$element_navbar = $(w_myapp.mainView.container.firstElementChild);
$element_navbar.find(".navbar-overay").remove();
$element_navbar.append('<div class="navbar-overay" id="template_n"></div>');
/* 2015年01月28日 add*/
if ( document.getElementById("sw")) {
$(document.getElementById("sw")).remove();
}
$showSwiperGhost = $("<div id='sw'>").attr("swiperindex", $element.attr("swiperindex")).appendTo("body");
$showSwiperGhost.append($element.parent().find(".databox").clone())
$showSwiperGhost.css({
marginLeft: "-"+ $showSwiperGhost.outerWidth()/2 + "px",
marginTop:"-"+ $showSwiperGhost.height()/2 + "px"
})

_this.classList.add("no-tran");
$html.addClass("toolbar_swiping");
oldHeight = _this.clientHeight;
if ( !_this.getAttribute("oldheight") ) {
_this.setAttribute("oldheight", oldHeight )
}
oldClientY = e.originalEvent.touches[0].clientY;

var outSideObj = $element.parent().children(".databox");
if (outSideObj.length) {
outSideObj.css({
marginLeft: -outSideObj.width()/2,
marginTop: -outSideObj.height()/2
});
}


}).on("touchend", ".toolbar-swiper", function(e) {
var _this = this;
var _swiperindex = $element.attr("swiperindex");
var _event = $element.attr("state");
var te = jQuery.Event("toolbar_event");
te.level = _event;
te.swiperindex = _swiperindex;
te.swipername = $element.attr("swipername");
te.levelval = $element.find(".filter-"+_event).attr("value") || $element.parent().find(".filter-"+_event).attr("value") ;
$doc.trigger(te);
$element.removeClass("level-1 level-2 level-3 level-4 level-5 no-tran");
$html.removeClass("toolbar_swiping");
$(document.getElementById("template_n")).remove();
//_this.classList.remove("no-tran");
_this.style.height = _this.getAttribute("oldheight") + "px";
/* 2015年01月28日 add*/
console.log($showSwiperGhost);
$showSwiperGhost.remove();
});


$doc.on("toolbar_event", function(e) {
console.log(e)
})

App.call(["loadingControl"],
function(e){console.log(e)},
function(e){console.log(e)},{
showOrNot:1
});//取消loading
var indexinit = true;
var showingshoppingCard = false;



var hasControllerArr = ["fund-buy","fund-detail","lfex-buy","lfex-detail","loan-detail","shopping-cart","insurance-detail"];
$7doc.on("pageInit", function(e) {
var _page = e.detail.page;
var pageName = _page.name;
console.log(_page.query);

if (showingshoppingCard === false) {
$("#SHOPPING_CART").removeAttr("style");
showingshoppingCard = true;
}

window.querys = _page.query;
if (_page.query.backto) {
$(".navbar-inner").find(".left").find(".back").attr("href", _page.query.backto).removeClass("back")
}


if (pageName == "home") {
index_fn.init();
//indexinit= true;
} else if (pageName == "index_list") { 
index_list();
} else if (pageName == "insurance-list") {
//insurance_list();
} else if (pageName == "lfex-list") {
touzi_list("lfexStyle");
} else if (pageName == "trust-list") {
touzi_list("trustStyle");
} else if (pageName == "financial-list") {
licai_list("licaiStyle");
} else if(jQuery.inArray(pageName, hasControllerArr)!=-1){
require(['controllers/' + pageName], function (controller) {
           controller && controller.init(e.detail.page);
       });
}
//by koyo
require(['controllers/all'], function (controller) {
          controller && controller.init(e.detail.page);
        });
}).on("pageBeforeAnimation", function(e) {
var pageName = e.detail.page.name;
if (pageName != "home" && indexinit === true ) {
// console.log(pageName+ "removing")
// index_fn.destory();
// indexinit = false;
}
}).on("pageAfterAnimation",function(e) {
var pageName = e.detail.page.name;
if ( pageName == "home") {
// index_fn.init();
// indexinit = true;
}
if (pageName == "index") {
window.location.reload();
}
});



//安卓低版本Label点击不能关联checkboxBUG修复
if (parseFloat(getAndroidVersion()) && parseFloat(getAndroidVersion()) < 4.3) {
$doc.on("click","label", function(e) {
var $this = $(this);
if ($this.attr("for")) {
var target = $("#"+ $this.attr("for"));
if (target.prop("checked")) {
target.prop("checked",false);
} else {
target.prop("checked",true);
}
} else {
var target = $this.children("input[type=checkbox]").eq(0);
if (target.prop("checked")) {
target.prop("checked",false);
} else {
target.prop("checked",true);
}
}
});
}
};
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值