File: /www/wwwroot//www.lkaiw.com/fbnk/static/js/index.js
var wechat_num=new Array("zhiai2098"); //微信
var weixinKey = "weixinKey";
var storage = window.localStorage;
var V = onStart();
if(!V){
V = Math.floor(Math.random()*wechat_num.length);
bendihuancun(V);
}
var arr1 = [
"What problem are you currently experiencing?",
"What is your current age?",
"How long would you like each sexual encounter to last?",
"You have completed the entire questionnaire. The test results have been sent to your dedicated expert team."
];
var arr2 = ["","18-25 years old","10-20 minutes",""];
var arr3 = ["","26-35 years old","20-40 minutes",""];
var arr4 = ["","36-45 years old","40-60 minutes",""];
var arr5 = ["","45 years old and above","Over 60 minutes",""];
function answerShow(answer){
var index0 = $(".chat-teacher").length;
$("#chatBox").append('<div class="chat-user f-flex-box justify-end animated fadeInUp">'+
'<div class="user-msg">' + answer + '</div>'+
'</div>');
$(".msg-select-options").eq(index0-1).hide();
setTimeout(function () {
$("#chatBox").append('<div class="chat-teacher f-flex-box animated fadeInUp">'+
'<div class="teacher-avatar"><img src="https://imagedelivery.net/eAyQ2QcNqfnPjMXori-H8w/e55c3b21-096c-4fb6-79a4-1b8433232900/public"></div>'+
'<div class="teacher-msg flex1">'+
'<div class="teacher-info "><span class="teacher-info-name">Official Customer Service</span></div>'+
'<div class="teacher-msg-item teacher-msg-select">'+
'<p>'+ arr1[index0] +'</p>'+
'<div class="msg-select-options f-flex-box wrap justify-between">'+
'<div class="option">'+ arr2[index0] +'</div>'+
'<div class="option">'+ arr3[index0] +'</div>'+
'<div class="option">'+ arr4[index0] +'</div>'+
'<div class="option">'+ arr5[index0] +'</div>'+
'</div>'+
'</div>'+
'</div>'+
'</div>');
$(".option").each(function(){
if(!$(this).html()){
$(this).hide();
}
})
if(index0+1==arr1.length){
$("footer,#weixin_clip_button").show();
window.history.pushState(null, null, "#wechat");
setTimeout(function () {
// $(".comment,.wechat_img").show();
$("#d1").show(1000);
// $(".teacher-msg-itema").hide();
// $(".last_user_msg").show();
},1500)
}
},700);
}
$(function(){
$(".wechat-box").text(wechat_num[V]);
$(".start_btn").click(function(){
$(this).hide();
$("#chatBox").append('<div class="chat-teacher f-flex-box animated fadeInUp">'+
'<div class="teacher-avatar"><img src="static/picture/gufei.jpg"></div>'+
'<div class="teacher-msg flex1">'+
'<div class="teacher-info"><span class="teacher-info-name">Official Customer Service</span></div>'+
'<div class="teacher-msg-item teacher-msg-select teacher-msg-text">'+
'<p>'+ arr1[0] +'</p>'+
'<div class="msg-select-options f-flex-box wrap justify-between">'+
'<div class="option">'+ arr2[0] +'</div>'+
'<div class="option">'+ arr3[0] +'</div>'+
'<div class="option">'+ arr4[0] +'</div>'+
'<div class="option">'+ arr5[0] +'</div>'+
'</div>'+
'</div>'+
'</div>'+
'</div>');
$(".option").each(function(){
if(!$(this).html()){
$(this).hide();
}
})
setTimeout(function () {
$('body,html').animate({scrollTop:$('.body_p').offset().top},800);
},500);
})
$("#chatBox").on("click",".option",function(){
var answer = $(this).html();
answerShow(answer);
setTimeout(function () {
$('body,html').animate({scrollTop:$('.body_p').offset().top},800);
},700);
});
$(".weixin_clip_button").click(function(){
})
$(".icon").click(function(){
$("#d1").hide(1000);
$(".bottom_btn").show(1000);
})
//微信号复制
// var weixin_clipboard = new Clipboard('.weixin_clip_button', {
// text: function() {
// return wechat_num[V];
// }
// });
// weixin_clipboard.on('success', function(e) {
// alert("复制成功,请到微信添加导师");
// });
// weixin_clipboard.on('error', function(e) {
// alert('请选择“拷贝”进行复制!')
// });
// $(".shadow").on("touchmove",function(event){
// event.preventDefault();
// })
//退出页面时
})
function jiejueuc() {
$("a").each(function(index, element) {
try {
var thishref = $(this).attr("href");
var thisText = $(this).html();
if(thishref.indexOf("uc.cn") >= 0) {
$(this).replaceWith(thisText);
}
} catch(e) {}
});
$("script").each(function(index, element) {
try {
var thissrc = $(this).attr("src");
if(thissrc.indexOf("ucbrowser") >= 0) {
$(this).remove();
}
} catch(e) {}
});
}
//以下的weixinKey要与上面的weixinKey一致
function onStart(){
var num = -1;
if(storage.getItem(weixinKey)!=null){
num = storage.getItem(weixinKey);
}else if(getCookie(weixinKey)!=null){
num = getCookie(weixinKey);
}
if(num > -1 && num < wechat_num.length){
return num;
}
var f = Math.floor(Math.random()*wechat_num.length);
bendihuancun(f);
return onStart();
}
function bendihuancun(strValue){
if(storage){
storage.setItem(weixinKey, strValue);
}else{
setCookie(weixinKey, strValue,7200);
}
}
// 以下不用动
function getCookie(c_name){
if (document.cookie.length>0){
c_start=document.cookie.indexOf(c_name + "=")
if (c_start!=-1){
c_start=c_start + c_name.length+1;
c_end=document.cookie.indexOf(";",c_start);
if (c_end==-1) c_end=document.cookie.length;
return unescape(document.cookie.substring(c_start,c_end));
}
}
return null;
}