// JavaScript Document
/**
* 常用工具栏
*/
$(function(){
// 显示个人信息
$("#pToolbar .hd").removeClass("hide");
// 隐藏收起按钮
$("#pToolbar .btn_switch").addClass("hide");
//$("#pToolbar .btn_switch").addClass("btn_switch_off");
$("#pToolbar .bd").siblings(".btn_set_bg").removeClass("hide");
});
/**
* 资产概览
*/
$(function(){
// 饼图折线图切换
$(".module_zcgl").Tabs();
// 资产和负债界面切换
$("#zfzPieWp .btn_switch").on("click",function(){
$(this).toggleClass("back").siblings().toggleClass("show");
$("#zzcPieWp").children().toggleClass("show");
if($(this).hasClass("back")){
$("#zfzPieWp").animate({left:170},"fast");
}else{
$("#zfzPieWp").animate({left:500},"fast");
}
});
// 隐藏显示金额
$(".module_zcgl .toggle_money").on("click",function(){
$(this).find("li").toggleClass("hide");
$(this).closest(".module_index").find(".data_money").toggleClass("hide");
});
});
/**
* 账户概览
*/
$(function(){
// 账户概览
$("#zhglFocus").slideBox({
arrow:true, //显示箭头
dots:false, //显示原点导航
autoplay:false, //开启自动播放
delay:2500, //自动播放时的滑动延迟
speed:300, //滑动速度
num:1 //相册显示图片的数量,不包含隐藏部分
});
// 隐藏显示所有金额
$(".module_zhgl .toggle_money li").on("click",function(){
$(this).addClass("hide").siblings("li").removeClass("hide");
$(this).closest(".module_zhgl").find(".pbd_card_mon").toggleClass("hide");
var text=$(this).text()
if(text=="显示所有金额"){
$("#zhglFocus .pbd_card_money span").addClass("hide").siblings("b").removeClass("hide");
}else if(text=="隐藏所有金额"){
$("#zhglFocus .pbd_card_money b").addClass("hide").siblings("span").removeClass("hide");
}
});
// 隐藏显示金额
$("#zhglFocus .pbd_card_money_switch").on("click",function(){
$(this).closest(".pbd_card").find(".pbd_card_mon").toggleClass("hide");
$(this).addClass("hide").siblings(".pbd_card_money_switch").removeClass("hide");
});
//可能感兴趣
$("#kngxqFocus").slideBox({
arrow:true, //显示箭头
dots:false, //显示原点导航
autoplay:false, //开启自动播放
delay:2500, //自动播放时的滑动延迟
speed:300, //滑动速度
num:1 //相册显示图片的数量,不包含隐藏部分
});
});
/**
* 定制首页导航
*/
$(function(){
//共用变量
var dataNnum="";
var timeNum=0;
// 进入定制模式
$("#btnSetIndex").on("click",function(){
// 滚动到合适位置
$("html").animate({scrollTop:407},200);
$("body").animate({scrollTop:407},200);
// 显示工具条和遮罩层
$("#setIndexBar").removeClass("hide");
$("body").append('
');
$(".index_psidebar_js").css({"z-index":1002});
$(".index_pbd_js").css({"z-index":1002});
// 模块界面遮罩层
var moduleMask = getModuleMask();
/*
var moduleMask = '';
if($.support.leadingWhitespace){
moduleMask+='
';
}else{
moduleMask+='
';
}
moduleMask +='
'
+''
+''
+''
+'
'
+'
';
*/
// 初始化操作按钮
//$("#pmain .module").append(moduleMask).each(function(index, element) {
$("#pmain .module").append(moduleMask);
$("#pmain .index_pbd_js .module").each(function(index, element) {
if($(this).attr("id").substring(0,2) == "AD"){
}else{
var posNum =$(this).index();
$(this).attr("data_old_pos",posNum+1);
$(this).attr("data_new_pos",posNum+1);
var position = $(this).attr("data_old_pos");
var len = $(".index_pbd_js .module").length;// content -> “-2” modify yangyj 20151125 可以感兴趣置底
if(position == (len + 1)){
$(this).find("i.icon_27_arrow_down").addClass("hide");
};
if(position == 2){
$(this).find("i.icon_27_arrow_up").addClass("hide");
};
};
/*switch(position){
case '1':
$(this).find("i.icon_27_arrow_up").addClass("hide");
break;
case '3':
$(this).find("i.icon_27_arrow_down").addClass("hide");
break;
default:
break;
};*/
});
$("#pmain .index_psidebar_js .module").each(function(index, element){
var len = $("#pmain .index_psidebar_js .module").length;
var posNum =$(this).index();
$(this).attr("index",posNum);
$(this).attr("data_old_pos",posNum+1);
$(this).attr("data_new_pos",posNum+1);
var position = $(this).attr("data_old_pos");
if(position == len){
$(this).find("i.icon_27_arrow_down").addClass("hide");
};
if(position == 1){
$(this).find("i.icon_27_arrow_up").addClass("hide");
};
});
// 上移模块
function up(){
//$(".module_mask .icon_27_arrow_up").on("click",function(){
$(".btn_group").delegate(".icon_27_arrow_up","click.a",function(){
var bef_div = $(this).parents(".module").prev(".module");
var isRight = $(this).parents(".index_pbd_js");
//console.log(isRight);
var bef_div = $(this).parents(".module").prev(".module");
var pre_div = $(this).parents(".module").prev(".module").prev(".module");
var pre_div2 = $(this).parents(".module").prev(".module");
if(isRight.length == 1){
$(this).parents(".module").prev(".module").insertBefore(pre_div);
}else{
$(this).parents(".module").prev(".module").insertBefore(pre_div2);
};
$(this).parents(".module").insertBefore(bef_div);
$("#pmain .index_pbd_js .module").removeAttr("data_new_pos").each(function() {
dataNnum=$(this).index();
$(this).attr("data_new_pos",dataNnum+1);
$(this).find("i.icon_27_arrow_up,i.icon_27_arrow_down").removeClass("hide")
var position = $(this).attr("data_new_pos");
var len = $(".index_pbd_js .module").length;// content -> “-2” modify yangyj 20151125 可以感兴趣置底
if(position == (len + 1)){
$(this).find("i.icon_27_arrow_down").addClass("hide");
};
if(position == 2){
$(this).find("i.icon_27_arrow_up").addClass("hide");
};
/*switch(position){
case '1':
$(this).find("i.icon_27_arrow_up").addClass("hide");
break;
case '3':
$(this).find("i.icon_27_arrow_down").addClass("hide");
break;
default:
break;
}*/
});
$("#pmain .index_psidebar_js .module").removeAttr("data_new_pos").each(function(index, element){
var len = $("#pmain .index_psidebar_js .module").length;
dataNnum=$(this).index();
$(this).attr("data_new_pos",dataNnum+1);
$(this).find("i.icon_27_arrow_up,i.icon_27_arrow_down").removeClass("hide")
var position = $(this).attr("data_new_pos");
if(position == len){
$(this).find("i.icon_27_arrow_down").addClass("hide");
};
if(position == 1){
$(this).find("i.icon_27_arrow_up").addClass("hide");
};
});
setOperateBtn();
});
setOperateBtn();
}
up();
// 下移模块
function down(){
//$(".module_mask .icon_27_arrow_down").on("click",function(){
$(".btn_group").delegate(".icon_27_arrow_down","click.c",function(){
//alert(1);
var isRight = $(this).parents(".index_pbd_js");
var bef_div = $(this).parents(".module").next(".module");
var pre_div = $(this).parents(".module").next(".module").next(".module");
var pre_div2 = $(this).parents(".module").next(".module");
if(isRight.length == 1){
$(this).parents(".module").next(".module").insertAfter(pre_div);
}else{
$(this).parents(".module").next(".module").insertAfter(pre_div2)
};
$(this).parents(".module").insertAfter(bef_div);
$("#pmain .index_pbd_js .module").removeAttr("data_new_pos").each(function() {
dataNnum=$(this).index();
$(this).attr("data_new_pos",dataNnum+1);
$(this).find("i.icon_27_arrow_up,i.icon_27_arrow_down").removeClass("hide")
var position = $(this).attr("data_new_pos");
var len = $(".index_pbd_js .module").length;// content -> “-2” modify yangyj 20151125 可以感兴趣置底
if(position == (len + 1)){
$(this).find("i.icon_27_arrow_down").addClass("hide");
};
if(position == 2){
$(this).find("i.icon_27_arrow_up").addClass("hide");
};
/*switch(position){
case '1':
$(this).find("i.icon_27_arrow_up").addClass("hide");
break;
case '3':
$(this).find("i.icon_27_arrow_down").addClass("hide");
break;
default:
break;
}*/
});
$("#pmain .index_psidebar_js .module").each(function(index, element){
var len = $("#pmain .index_psidebar_js .module").length;
dataNnum=$(this).index();
$(this).attr("data_new_pos",dataNnum+1);
$(this).find("i.icon_27_arrow_up,i.icon_27_arrow_down").removeClass("hide")
var position = $(this).attr("data_new_pos");
if(position == len){
$(this).find("i.icon_27_arrow_down").addClass("hide");
};
if(position == 1){
$(this).find("i.icon_27_arrow_up").addClass("hide");
};
});
setOperateBtn();
});
setOperateBtn();
}
down();
// 删除模块
/*$(".module_mask .icon_27_delete").on("click",function(){
//alert(1);
$(this).closest(".module").addClass("hide");
var txt =$(this).closest(".module").find("h2").attr("data-txt");
$("#setModelBox .setModelBut[data-txt='"+txt+"']").removeClass("on")
$("#pmain .module").removeAttr("data_new_pos").each(function() {
dataNnum=$(this).index();
$(this).attr("data_new_pos",dataNnum+1);
$(this).find("i.icon_27_arrow_up,i.icon_27_arrow_down").removeClass("hide")
var position = $(this).attr("data_new_pos");
switch(position){
case '1':
$(this).find("i.icon_27_arrow_up").addClass("hide");
break;
case '3':
$(this).find("i.icon_27_arrow_down").addClass("hide");
break;
default:
break;
}
});
});
*/
function dele(){
$(".btn_group").delegate(".icon_27_delete","click.b",function(){
//$(this).closest(".module").addClass("hide");
var Id = $(this).parents('.module').attr('id');
$("#setModelBox ul.clearfix li.setModelBut").filter(function(){
return $(this).attr('_id') == Id;
}).removeClass('on');
/*获取当前对象的id属性*/
/*20160219 midify yangyj start */
if($(this).closest(".module").next(".module_index").length){
if($(this).closest(".module").next(".module_index").attr("id").substring(0,2) == "AD"){
$(this).closest(".module").next(".module").addClass("hide");
};
}
/*
if($(this).closest(".module").prev(".module_index").length){
if($(this).closest(".module").prev(".module_index").attr("id").substring(0,2) == "AD"){
$(this).closest(".module").prev(".module").addClass("hide");
//$(this).closest(".module").prev(".module").remove();
};
}
*/
/*20160219 midify yangyj end*/
/*
else if($(this).closest(".module").attr("data_new_pos") == "2"){
//$(this).closest(".module").next(".module").remove();
$(this).closest(".module").next(".module").addClass("hide");
};
*/
//$(this).closest(".module").remove();
$(this).closest(".module").addClass("hide");
setOperateBtn();
});
setOperateBtn();
};
dele();
// 加载拖拽插件
$(".index_psidebar_js").attr("id","index_psidebar");
$(".index_pbd_js").attr("id","index_pbd");
if(timeNum==0){
//ie8不显示拖动鼠标20160224
// .index_pbd .module_index .module_mask .handle
//dragulaItem.find("dl.pnav_third").append('');
dragula([$$('index_psidebar')], {moves: function (el, container, handle) {return handle.className === 'handle';}, removeOnSpill: false }).on('drop', function (el) {
setTimeout(function () {
$("#pmain .index_pbd_js .module").removeAttr("data_new_pos").each(function() {
dataNnum=$(this).index();
$(this).attr("data_new_pos",dataNnum+1);
$(this).find("i.icon_27_arrow_up,i.icon_27_arrow_down").removeClass("hide")
var position = $(this).attr("data_new_pos");
var len = $(".index_pbd_js .module").length;
if(position == (len + 1)){
$(this).find("i.icon_27_arrow_down").addClass("hide");
};
if(position == 2){
$(this).find("i.icon_27_arrow_up").addClass("hide");
};
/*switch(position){
case '1':
$(this).find("i.icon_27_arrow_up").addClass("hide");
break;
case '3':
$(this).find("i.icon_27_arrow_down").addClass("hide");
break;
default:
break;
}*/
});
$("#pmain .index_psidebar_js .module").each(function(index, element){
var len = $("#pmain .index_psidebar_js .module").length;
dataNnum=$(this).index();
$(this).attr("data_new_pos",dataNnum+1);
$(this).find("i.icon_27_arrow_up,i.icon_27_arrow_down").removeClass("hide")
var position = $(this).attr("data_new_pos");
if(position == len){
$(this).find("i.icon_27_arrow_down").addClass("hide");
};
if(position == 1){
$(this).find("i.icon_27_arrow_up").addClass("hide");
};
});
$(".index_pbd_js").css({"z-index":1002});
}, 0);
}).on('drag', function (el) {
$(".index_pbd_js").css({"z-index":1});
}).on('cancel', function (el) {
$(".index_pbd_js").css({"z-index":1002});
});
var w_module = "";
function movesFun(el, container, handle) {
var a = el;
var b = container;
w_module = el.id;
//console.log(w_module);
return handle.className === 'handle';
}
dragula([$$('index_pbd')], {moves: movesFun, removeOnSpill: false }).on('drop', function (el) {
/*实现拖拽广告固定js开始*/
var preObj = "";
if($("#" + w_module).prev(".module")){
preObj = $("#" + w_module).prev(".module");
}else{
preObj = $("#" + w_module).next(".module");
}
$("#pmain .index_pbd_js .module").each(function(index,element){
if($(this).attr("id").substring(0,2) == "AD"){
$(this).remove();
};
});
/*实现拖拽广告固定js结束*/
setTimeout(function () {
/*if($("#" + w_module).prev(".module").attr("id").substring(0,2) != "AD"){
$("#" + w_module).next(".module").insertBefore("#" + w_module);
}else if($("#" + w_module).next(".module").attr("id").substring(0,2) != "AD"){
$("#" + w_module).prev(".module").insertAfter("#" + w_module);
};*/
/*循环先删除广告再插入*/
var count = 0;
$("#pmain .index_pbd_js .module").each(function(index,element){
count++;
/*console.log(count);
var avImg = showCntAdsById(count+10);
if(!avImg){
avImg = '';
}*/
var avstr = '';
//console.log($(this));
$(avstr).insertAfter($(this));
showCntAdsById(count+10);
});
/*把最后一个广告去除*/
if($("#pmain .index_pbd_js .module:last-child").attr("id").substring(0,2) == "AD"){
$("#pmain .index_pbd_js .module:last-child").remove();
}
$("#pmain .index_pbd_js .module").removeAttr("data_new_pos").each(function() {
dataNnum=$(this).index();
$(this).attr("data_new_pos",dataNnum+1);
$(this).find("i.icon_27_arrow_up,i.icon_27_arrow_down").removeClass("hide")
var position = $(this).attr("data_new_pos");
var len = $(".index_pbd_js .module").length;
if(position == (len + 1)){
$(this).find("i.icon_27_arrow_down").addClass("hide");
};
if(position == 2){
$(this).find("i.icon_27_arrow_up").addClass("hide");
};
/*switch(position){
case '1':
$(this).find("i.icon_27_arrow_up").addClass("hide");
break;
case '3':
$(this).find("i.icon_27_arrow_down").addClass("hide");
break;
default:
break;
}*/
});
$("#pmain .index_psidebar_js .module").each(function(index, element){
var len = $("#pmain .index_psidebar_js .module").length;
dataNnum=$(this).index();
$(this).attr("data_new_pos",dataNnum+1);
$(this).find("i.icon_27_arrow_up,i.icon_27_arrow_down").removeClass("hide")
var position = $(this).attr("data_new_pos");
if(position == len){
$(this).find("i.icon_27_arrow_down").addClass("hide");
};
if(position == 1){
$(this).find("i.icon_27_arrow_up").addClass("hide");
};
});
$(".index_psidebar_js").css({"z-index":1002});
}, 0);
}).on('drag', function (el) {
$(".index_psidebar_js").css({"z-index":2});
}).on('cancel', function (el) {
$(".index_psidebar_js").css({"z-index":1002});
});
timeNum=timeNum+1
}
});
// 取消定制模式
$("#customCancle").on("click",function(){
$(".index_psidebar_js").find(".module[data_old_pos='1']").insertBefore($(".index_psidebar_js").find(".module[data_new_pos='1']"));
for(var i=1; i<$(".index_psidebar_js .module").length; i++){
var v=i+1
if(i+1==$(".index_psidebar_js .module").length){
break;
}else{
$(".index_psidebar_js").find(".module[data_old_pos="+v+"]").insertAfter($(".index_psidebar_js").find(".module[data_old_pos='"+i+"']"));
}
};
$(".index_pbd_js").find(".module[data_old_pos='2']").insertBefore($(".index_pbd_js").find(".module[data_new_pos='2']"));
for(var i=2; i<($(".index_pbd_js .module").length + 1); i++){
var v=i+1
if(i+1==$(".index_pbd_js .module").length){
break;
}else{
$(".index_pbd_js").find(".module[data_old_pos="+v+"]").insertAfter($(".index_pbd_js").find(".module[data_old_pos='"+i+"']"));
}
};
hideSetIndexNav();
$("#setIndexBar").addClass("hide");
$("#setIndexMask").remove();
$(".module_mask").remove();
$(".index_psidebar_js").css({"z-index":2}).removeAttr("id");
$(".index_pbd_js").css({"z-index":1}).removeAttr("id");
});
// 保存定制设置
/*$("#customSave").on("click",function(){
hideSetIndexNav();
$("#setIndexBar").addClass("hide");
$("#setIndexMask").remove();
$(".module_mask").remove();
$(".index_psidebar_js").css({"z-index":1}).removeAttr("id");
$(".index_pbd_js").css({"z-index":1}).removeAttr("id");
}); */
$("#customSave").on("click",function(){
/*放开可能感兴趣*/
$('#btnSetIndex .module_index').css({display:''}).remove().appendTo(".index_pbd_js");
/*----点击保存按钮后,获取左边模块的id号js开始----*/
/*点击保存的时候查看最前面与最后面是不是广告位*/
if($("#pmain .index_pbd_js .module:last-child").attr("id").substring(0,2) == "AD"){
$("#pmain .index_pbd_js .module:last-child").remove();
};
/*if($("#pmain .index_pbd_js .module:first-child").attr("id").substring(0,2) == "AD"){
$("#pmain .index_pbd_js .module:first-child").remove();
}*/
var str1 = '';
var str2 ='';
$("#index_psidebar .module").each(function(index,element){
if($(this).attr('id').substring(0,1) == "n" && !$(this).hasClass('hide')){
str1 += $(this).attr('id').substring(1) + ',';
};
});
/*----点击保存按钮后,获取左边模块的id号js结束----*/
/*----点击保存按钮后,获取右边模块的id号js结束----*/
$("#index_pbd .module").each(function(index,element){
if($(this).attr('id').substring(0,1) == "w" && !$(this).hasClass('hide')){
str2 += $(this).attr('id').substring(1) + ',';
};
});
/*----点击保存按钮后,获取右边模块的id号js开始----*/
/*----保存获取左右布局js开始-----------*/
var str3 = '';
$("#setLayoutBox span").each(function(index,element){
if($(this).hasClass('on')){
if(index == '0'){
str3 = '1,3';
}else if(index == '1'){
str3 = '3,1';
};
};
});
//console.log(str3);
/*----保存获取左右布局js结束-----------*/
/*获取用户有关数据*/
var USERID = _DAT_USERBASE["USERID"];
var SKEY = _DAT_USERBASE["SKEY"];
//console.log(SKEY);
/*获取用户有关数据*/
/*---点击后ajax请求到服务器---*/
$.ajax({
type:"post",
dataType:"html",
data:"BLKTYPE=3,4,5&NARRBLKIDS=" + str1.substring(0,(str1.length - 1)) + "&xn&WIDEBLKIDS=" + str2.substring(0,(str2.length - 1)) + "&PAGESCALE=" + str3,
url:top.DAT_ENVBASE.P1ACTION+"&PT_LANGUAGE=CN&PT_STYLE=1&TXCODE=NCST03&USERID="+USERID+"&SKEY="+SKEY+"",
success:function(data){
var j = eval("("+data+")");
if(j.SUCCEED == 'TRUE' && j.BLK3 == 'TRUE' && j.BLK4 == 'TRUE' && j.BLK5 == 'TRUE'){
//alert('保存成功');
}else{
alert('保存失败!');
};
},
error:function(data){
}
});
/*---点击后ajax请求到服务器---*/
hideSetIndexNav();
$("#setIndexBar").addClass("hide");
$("#setIndexMask").remove();
$(".module_mask").remove();
$(".index_psidebar_js").css({"z-index":1}).removeAttr("id");
$(".index_pbd_js").css({"z-index":1}).removeAttr("id");
});
// 显示/隐藏定制菜单
$("#setIndexBar .right_btns>li.has_nav>a").on("click",function(){
$(this).parent().toggleClass("on").siblings(".has_nav").removeClass("on");
});
// 显示定制菜单
function showSetIndexNav(){
$("#setIndexBar .right_btns>li.has_nav").addClass("on");
}
// 隐藏定制菜单
function hideSetIndexNav(){
$("#setIndexBar .right_btns>li.has_nav").removeClass("on");
}
// 选择布局
$("#setLayoutBox span").on("click",function(){
$(this).addClass("on").siblings("span").removeClass("on");
if($(".layout_l").hasClass("on")){
$("#index_psidebar").css({"float":"left"});
$("#index_pbd").css({"float":"right"});
}else if($(".layout_2").hasClass("on")){
$("#index_psidebar").css({"float":"right"});
$("#index_pbd").css({"float":"left"});
}
$("#setLayoutBox").parents("li").removeClass("on");
});
//id选择器
function $$(id) {
return document.getElementById(id);
}
});
/**
* 登录账户判断
*/
$(function(){
//--20150513 R.K--
//获取url地址参数
function GetQueryString(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 indexType =GetQueryString("judge");
if(indexType=="1"){
$("#pnav_zzhk .pnav_second_box a").attr("href","javascript:void(0)").addClass("zzhk_linkJS_no");
}else{
//alert("正常");
};
//转账弹出框
$(document).on("click", ".zzhk_linkJS_no", function () {
$(".zzhk_tc_box,.layer_fixed").show();
$(".zzhk_tc_box .complete").click(function(){
$(".zzhk_tc_box,.layer_fixed").hide();
})
});
//建行转账收款名册弹出相关
$(".scroll_box_inp1").slimScroll({
width: '182px',
height: '124px',
size: '7px',
position: 'right',
color: '#C1C1C1',
alwaysVisible: true,
distance: '0px',
railVisible: false,
railColor: '#222',
railOpacity: 0.3,
wheelStep: 10,
allowPageScroll: true,
disableFadeOut: true
})
$(document).on("input",".input_name_zz",function(){
var _val = $(this).val();
if(_val=="李"){
$(this).next(".scroll_box_inp").removeClass("hide").siblings(".scroll_box_inp").addClass("hide");
$(".jhzz_tx_box").hide();
}else{
$(this).siblings(".scroll_box_inp").addClass("hide");
}
});
$(document).on("input",".input_manber_zz",function(){
var _val = $(this).val();
if(_val=="1"){
$(this).next(".scroll_box_inp").removeClass("hide").siblings(".scroll_box_inp").addClass("hide");
$(".jhzz_tx_box").hide();
}else{
$(this).siblings(".scroll_box_inp").addClass("hide");
}
});
$(document).on("click",".scroll_box_inp li",function(){
if($(this).hasClass("lion")){
}else{
$(this).addClass("lion").siblings("li").removeClass("lion");
}
$(".input_name_zz").val("李大明");
$(".input_manber_zz").val("6217254000*****9906");
$(this).parents(".scroll_box_inp").addClass("hide");
$(".jhzz_tx_box").hide();
});
$(".jhzz_scroll_box").slimScroll({
width: '258px',
height: '165px',
size: '7px',
position: 'right',
color: '#C1C1C1',
alwaysVisible: true,
distance: '0px',
railVisible: false,
railColor: '#222',
railOpacity: 0.3,
wheelStep: 10,
allowPageScroll: true,
disableFadeOut: true
});
$(document).on("click", ".pbd_input_btn", function () {
$(".jhzz_tx_box").show();
$(".scroll_box_inp").addClass("hide");
$("scroll_box_inp").addClass("hide");
$(".jhzz_tx_box .complete").click(function(){
$(".jhzz_tx_box").hide();
})
});
var MenberList = $(".jhzz_tx_box .jhzz_tx_txt li")
$(document).on("input", ".jhzz_tx_box .jhzz_tx_tit .pbd_input_new", function () {
var _val=$(this).val();
searchGo(_val)
});
$(document).on("click", ".jhzz_tx_box .jhzz_tx_txt li", function () {
if($(this).hasClass("lion")){
}else{
$(this).addClass("lion").siblings("li").removeClass("lion");
}
$(".input_name_zz").val("李大明");
$(".input_manber_zz").val("6217254000*****9906");
$(".jhzz_tx_box").hide();
$(".scroll_box_inp").addClass("hide");
});
function searchGo(str){
var val=str || "";
if(val===undefined || val==null || val==""){
MenberList.show();
}else{
MenberList.each(function(){
var li=$(this);
if(li.find("span").text().indexOf(val)>=0){
li.show();
}else{
li.hide();
}
});
}
}
});
/**
* 交易自主提交表单给server,处理结果页target到主框架交易iframe
* @date: 2015-08-27
* @author: liujz
**/
function submitTX(txCode, addPara, curPos){
if (txCode==null || txCode=="") {
return;
}
var vHiddens="";
if(arguments.length>1 && addPara!=null && addPara!=""){
var vParas = addPara.split("&");
for(var i=0; i";
}
}
$("#submitTxCstField").html(vHiddens);
$("#submitTxform").get(0).submit();
$(".index_psidebar_js").hide();
$(".index_pbd_js").hide();
$("#txfrmcontainer").show();
$("#psidebar").show();
$("#btnSetIndex").hide();
//设置导航条
if(arguments.length>2 && curPos!=null && curPos!=""){
setTxPos(curPos);
}
}
/**
* 设置导航条
* @date: 2015-10-22
* @author: liujz
**/
function setTxPos(curPos){
var vTxts = curPos.split(">");
var vPosTx="";
for(var i=0;i"+vTxts[i]+"";
}else{
vPosTx=vPosTx+">"+vTxts[i]+"";
}
}
$("#currentpos").html(vPosTx);
}
/**
* 打开各一级功能的功能介绍
* @date: 2015-09-22
* @author: liujz
**/
function openTXIntr(txcode, addPara, menuName) {
submitTX(txcode, addPara);
setTxPos(menuName+">功能介绍");
}
/**
可能感兴趣置底
step3:定制加载时处理操作按钮(上移、下移、关闭);
*/
function setOperateBtn(){
var doms = [] ;
$.each($(".index_pbd_js .module_index"),function (index){
if($(this).attr('mustshow') && !$(this).hasClass('hide')){
doms.push($(this));
}
});
$.each(doms,function(index){
$('.module_mask .btn_group .icon_27_arrow_up',$(this)).removeClass('hide');
$('.module_mask .btn_group .icon_27_arrow_down',$(this)).removeClass('hide');
$('.module_mask .btn_group .icon_27_delete',$(this)).removeClass('hide');
if(index==0){//first dom
$('.btn_group .icon_27_arrow_up',$(this)).addClass('hide');
}
if( index == (doms.length)-1){//last dom
$('.btn_group .icon_27_arrow_down',$(this)).addClass('hide');
}
if($(this).attr("mustshow")==1){// not delete dom
$('.btn_group .icon_27_delete',$(this)).addClass('hide');
}
});
}
/**定制首页时隐藏/显示所有广告 m_hide*/
function hide_AD_IDXFRMS(flag){
if(flag){
$("#index_pbd >div").filter(function (){
return $(this).attr('id').indexOf('AD_IDX') != -1;
}).addClass('m_hide');
}else{
$(".index_pbd_js .m_hide").each(function (){
$(this).removeClass('m_hide');
});
}
}
/**ie8及以下浏览器禁止拖动*/
function getModuleMask(){
var moduleMask = '';
if($.support.leadingWhitespace){
moduleMask+='
';
}else{
moduleMask+='
';
}
moduleMask +='
'
+''
+''
+''
+'
'
+'
';
return moduleMask;
}
//加载当前开发人员头像、姓名等信息
$(document).ready(function() {
if("1"==DAT_USERBASE.CAN_TXTU){
$("#ptubar").removeClass("hide");
}
if($("#txmainfrm").is(':hidden') && !(top.$("#ptubar").is(':hidden'))){//首页显示时
$.getJSON(DAT_ENVBASE.P1ACTION + "&USERID="+DAT_USERBASE.USERID+"&BRANCHID="+DAT_USERBASE.BRANCHID+"&SKEY="+DAT_USERBASE.SKEY+"&TXCODE=TU0003", {"FUNID":DAT_TXENV.TXCODE, "ts":(new Date()).getTime()}, function(json){
/**if(json && json.devid){
var vDevCache= "{\"devid\":\""+json.devid + "\",\"name\":\"" + json.name + "\",\"user_alias\":\"" + json.user_alias + "\",\"sex\":\"" + json.sex + "\",\"phone\":\"" + json.phone + "\",\"mobilephone\":\"" + json.mobilephone + "\",\"email\":\"" + json.email + "\",\"sef_intro\":\"" + json.sef_intro + "\"}";
top.$("body").attr("tucache", encodeURIComponent(vDevCache));
}else if(top.$("body").attr("tucache")){
try{
eval("json="+decodeURIComponent(top.$("body").attr("tucache")));
}catch(ex){}
}**/
if(json && json.devid!=undefined){
$("#ptubar_devname").text(json.name);
$("#ptubar_devPic").attr("src", "/CCBIS/ImageServlet?USERID="+DAT_USERBASE.USERID+","+json.devid+"&SKEY="+DAT_USERBASE.SKEY+"&SEX="+json.sex+"×tamp="+(new Date()).getTime());
}
});
}
$("#ptubar_stars>li").on("click",function(){
/*if($("#ptubar_stars").attr("hadDoTU")!=undefined){
//提示已点赞,明日再来
//console.log("//提示已点赞,明日再来");
$("#ptubar_tip1").hide();
$("#ptubar_tip2").hide();
$("#ptubar_tip3").show();
}else{*/
$("#ptubar_tip1").hide();
$("#ptubar_tip2").hide();
$("#ptubar_tip3").hide();
//$("#ptubar_stars").attr("hadDoTU", $(this).index());
//发记录点赞请求
var vFunId=null;
if($("#txmainfrm").is(':hidden')){
vFunId="N00001";
}else{
vFunId = (document.getElementById('txmainfrm').contentWindow&&document.getElementById('txmainfrm').contentWindow.UDC_SRVASSIST_TXDAT&&document.getElementById('txmainfrm').contentWindow.UDC_SRVASSIST_TXDAT.TXCODE)?document.getElementById('txmainfrm').contentWindow.UDC_SRVASSIST_TXDAT.TXCODE:'UNKONW';
}
$.getJSON(DAT_ENVBASE.P1ACTION + "&USERID="+DAT_USERBASE.USERID+"&BRANCHID="+DAT_USERBASE.BRANCHID+"&SKEY="+DAT_USERBASE.SKEY+"&TXCODE=TU0001", {"FUNID":vFunId, "COMMID":DAT_TXENV.USERID, "SCORE":($(this).index()+1)*2, "ts":(new Date()).getTime()}, function(json){
if(json.result=="1"){
alert("评分成功!谢谢您的宝贵评价~~");
}else{
if(json.result=="-1"){
alert("今天您对此功能已评过分啦,请明天再来吧~~");
}
if(json.result=="-6"){
alert("评分失败,您不是点赞邀请客户~~");
}
}
});
//}
}).on("mouseenter",function(){
var _this=$(this);
$("#ptubar_tip1").show();
$("#ptubar_tip2").hide();
$("#ptubar_tip3").hide();
if(_this.index()==0){
$("#ptubar_tip1").text("要加油哦~思密达~");
}else if(_this.index()==1){
$("#ptubar_tip1").text("想说爱你不容易~");
}else if(_this.index()==2){
$("#ptubar_tip1").text("向右发现更好的自己...");
}else if(_this.index()==3){
$("#ptubar_tip1").text("我开始喜欢你了^_@");
}else if(_this.index()==4){
$("#ptubar_tip1").text("你真是太棒了!么么哒~");
}
$("#ptubar_stars>li").each(function(idx){
if(idx<=_this.index()){
$(this).find("i").css('background-image', 'url(/P1StaRes/V6/STY1/CN/images/tu/tu_star16_hl.png)');
}else{
$(this).find("i").css('background-image', 'url(/P1StaRes/V6/STY1/CN/images/tu/tu_star16.png)');
}
});
}).on("mouseleave",function(){
/*
if($("#ptubar_stars").attr("hadDoTU")!=undefined){
$("#ptubar_stars>li").each(function(index){
if(index<=parseInt($("#ptubar_stars").attr("hadDoTU"))){
$(this).find("i").css('background-image', 'url(/P1StaRes/V6/STY1/CN/images/tu/tu_star16_hl.png)');
}else{
$(this).find("i").css('background-image', 'url(/P1StaRes/V6/STY1/CN/images/tu/tu_star16.png)');
}
});
}else{
*/
$("#ptubar_tip1").text("");
$("#ptubar_tip1").hide();
$("#ptubar_tip2").hide();
$("#ptubar_tip3").hide();
$("#ptubar_stars>li").each(function(index){
$(this).find("i").css('background-image', 'url(/P1StaRes/V6/STY1/CN/images/tu/tu_star16.png)');
});
//}
});
$("#tu_btn_comment").on("click",function(){
if($("#txmainfrm").is(':hidden')){
window.open($(this).attr("_baseUri")+"&FUNID=N00001");
}else{
var vFunId = (document.getElementById('txmainfrm').contentWindow&&document.getElementById('txmainfrm').contentWindow.UDC_SRVASSIST_TXDAT&&document.getElementById('txmainfrm').contentWindow.UDC_SRVASSIST_TXDAT.TXCODE)?document.getElementById('txmainfrm').contentWindow.UDC_SRVASSIST_TXDAT.TXCODE:'UNKONW';
window.open($(this).attr("_baseUri")+"&FUNID="+vFunId);
}
}).on("mouseenter",function(){
$(this).text(">评论<");
}).on("mouseleave",function(){
$(this).text("我要评论");
});
});
/**
* 游客在弹出框里登录,登录后刷新主框架页,加载登录前访问交易
* @date: 2018-02-23
* @author: liujz
* @param
* menuId菜单Id,格式MENUV6***,可为空
* txCode可为空,为空时,打开menuId对应菜单,addPara/curPos无效;txCode非空时,只标记menuId对应菜单为选中,不打开对应菜单,用txcode和addPara访问交易
* menuId、txCode都为空时,只登录不做登录后其他操作
* curPos导行条显示当前位置,txCode非空时有效
* callbackTxFun交易iframe加载完成后需执行的js函数及参数(js函数需定义在交易页面),示例cbTouristLogin('aa','bb'),可传空串。
**/
function touristLogin(menuId, txCode, addPara, curPos, callbackTxFun){
//MateX环境下,调用手机端的登录方法
try{
//console.log("准备尝试调用MateX手机端的登录方法");
if(window.CCBBridge){//&& typeof(CCBBridge[login] == "function")
//console.log("调用了MateX手机端的登录方法");
CCBBridge.login();
return;
}
}catch(e){
}
showTouristLoginDlg();
var vTrLgCookie = menuId+"|@|"+txCode+"|@|"+addPara+"|@|"+curPos+"|@|"+callbackTxFun;
Cookies.set("TL_AST", vTrLgCookie, {path:'/'});
/*
top.$("#pop_TrLogin").attr("CB_MENUID", menuId);
top.$("#pop_TrLogin").attr("CB_TXCODE", txCode);
top.$("#pop_TrLogin").attr("CB_ADDPARA", addPara);
top.$("#pop_TrLogin").attr("CB_CURPOS", curPos);
top.$("#pop_TrLogin").attr("CB_FUNCTION", callbackTxFun);
*/
}