Files
vobao/public/scripts/Vobao/NewIndex2.js
toom1996 945b713344 update
2025-08-04 17:33:40 +08:00

202 lines
5.4 KiB
JavaScript

$('.add-select').show();
/* 开始测试 */
$("#TouBaoBtn").on("click", function () {
if (!IsSlideStOK) { alert("请先拖动滑块完成验证!"); return false; }
var linkNo = $("#txtLinkNo").val().trim();
var re = /^1\d{10}$/;
if (linkNo && !re.test(linkNo)) { alert("号码格式不正确!"); $("#txtLinkNo").val("").focus(); return false; }
var niName = $("#txtNiName").val().trim();
if (niName) niName = encodeURIComponent(niName);
window.location.href = '//toubao.vobao.com/?FromTp=17&MonTp=10055&tel=' + linkNo + '&niname=' + niName;
});
/* 刷新“保险专家” */
var IsToDoA2Event = true;
function loadSellerListFn(areaId1, areaId2) {
var areaId = (areaId2 === null || areaId2 === "" || areaId2 === "0") ? areaId1 : areaId2;
$(".expert-content").load("/Vobao/SellerList?areaID=" + areaId);
}
/* 切换保险专家上的地区 */
$('#areaid1').on("change", function () {
IsToDoA2Event = false;
var areaId1 = $(this).val();
loadSellerListFn(areaId1, '0');
changearea('//www.riotgrrl.com/Vobao/QueryAllAreaByID?areaID=' + this.value, 'areaid2');
IsToDoA2Event = true;
});
$('#areaid2').on("change", function () {
if (IsToDoA2Event) {
var areaId2 = $(this).val();
var areaId1 = $("#areaid1").val();
loadSellerListFn(areaId1, areaId2);
}
});
/* 去找代理人页搜索代理人根据姓名 */
$("#SearchMemberBtn").on("click", function () {
var keyword = $("#MemberKeyWord").val().trim();
if (!keyword) { return; }
var areaid1 = $("#areaid1").val();
areaid1 = areaid1 == "0" ? "-100" : areaid1;
var areaid2 = $("#areaid2").val();
if (areaid1 != "-100" && ",2,25,27,32,".indexOf(',' + areaid1 + ',') < 0 && areaid2 == "0") {
alert("只选省份或特区是无法进行此操作的!但只写关键字可以!");
return;
}
var memberUrl = "//member.vobao.com";
if (areaid1 != "-100" || areaid2 != "0" || keyword.length != 0) {
memberUrl += "/0_" + areaid1 + "-" + areaid2 + "-0_0_0/";
memberUrl += "?Search.KeyWord=" + keyword + "&Search.SearchTp=1";
}
window.open(memberUrl);
});
/* 预约我的面板 */
function ShowNewAppointment(monTp, fromTp, fromUserId, regFrom, sex, linkRName) {
document.domain = "vobao.com";
if (!fromTp) {
fromTp = 0;
}
if (!fromUserId) {
fromUserId = 0;
}
if (!monTp) {
monTp = 0;
}
if (!linkRName) {
linkRName = '';
}
if (!sex) {
sex = 0;
}
var url = '//p.vobao.com/Common/NewAppointment';
url += '?FromTp=' + fromTp;
url += '&FromUserId=' + fromUserId;
url += '&monTp=' + monTp;
url += '&RegFrom=' + regFrom;
url += '&Sex=' + sex;
url += '&OP.DName=' + encodeURI(linkRName);
dialogCSForm = $.dialog({ title: '', content: 'url:' + url, lock: true, width: '636px', height: '648px' });
}
var swiper1 = new Swiper("#swiper1", {
autoplay: {
delay: 10000,
stopOnLastSlide: !1,
disableOnInteraction: false
}
});
var swiper2 = new Swiper("#swiper2", {
autoplay: {
delay: 5000,
stopOnLastSlide: !1,
disableOnInteraction: !0
}
});
$('.add-select').on('click', function () {
$('.city-bg').removeClass('none');
});
$(".city-close").on("click", function (b) {
$("#citySeachKey").val("");
$("#citypop-tip-no").hide();
$(".city-bg").addClass("none");
});
/**
* 看攻略
*/
var bxcpData = "";
var nmDataTitles = ["公司新闻", "监管动态", "最新问答", "热门测评", "社保资讯", "业界要闻"];
$('.nav-item').on('click', function () {
// if (!$(this).hasClass('active')) {
// var $a = $('.active-nav');
// var oldName = $a.find(".nav-item-name").html();
// if (oldName === "公司新闻") { bxcpData = $('.news-box-box').html(); }
// $a.removeClass('active-nav');
// $(this).addClass('active-nav');
// var newName = $(this).find(".nav-item-name").html();
// var index = nmDataTitles.indexOf(newName);
// if (index === 0) {
// $('.news-box-box').html(bxcpData);
// } else {
// $.ajax({
// url: '/Vobao/GetOtherDataOnFP?rm=' + Math.random(),
// cache: false,
// dataType: 'html',
// data: { tp: index },
// type: 'POST',
// timeout: 30000,
// success: function (d) {
// $('.news-box-box').html(d);
// },
// error: function (e) {
// }
// });
// }
// }
});
// 公共头部js
$('.spc-dh').hover(function () {
$('.hover-item-box').show();
}, function () {
$('.hover-item-box').hide();
});
$('.hover-item-bxo').hover(function () {
$('.hover-item-box').show();
}, function () {
$('.hover-item-box').hide();
});
// 合作媒体
$('.links-tab-item').hover(function () {
var tab = $(this).data('tab');
$('.active-links').removeClass('active-links');
$(this).addClass('active-links');
$('.show').removeClass('show');
$('.' + tab).addClass('show');
});
// // 头部数据
// $.post("/NewQbar/Partial_AskHeader/?rm=" + Math.random(), {}, function(d){
// $("#VoBaoHead").html(d);
// });
// 医疗险栏目的滚动
var swiperT1 = new Swiper("#swiper2", {
autoplay: {
delay: 1E4,
stopOnLastSlide: !1,
disableOnInteraction: !0
},
pagination: {
el: "#swiper-p2",
clickable: !0
}
})
var swiperT2 = new Swiper("#swiper3", {
autoplay: {
delay: 1E4,
stopOnLastSlide: !1,
disableOnInteraction: !0
},
pagination: {
el: "#swiper-p3",
clickable: !0
}
})
var swiperT3 = new Swiper("#swiper4", {
autoplay: {
delay: 1E4,
stopOnLastSlide: !1,
disableOnInteraction: !0
},
pagination: {
el: "#swiper-p4",
clickable: !0
}
})