" + "
");
};
$("#controler div").eq(0).addClass("onclick");
$("#controler div").each(function () {
$(this).click(function () {
autoPlayIndex = $(this).index();//为模拟点击索引值赋值
Change(this);
});
});
$(".nex_nav").click(function () {
currentIndex++;
if (currentIndex > imgtotal - 1) {
currentIndex = imgtotal - 1;
}
Change(currentIndex)
})
$(".pre_nav").click(function () {
currentIndex--;
if (currentIndex ' +
'' +
'';
$('#show-area').append(loadingHTML);
}
function LoadShow() {
// 第一个请求发送时展示loading
$(document).on('ajaxStart', function () {
$('.overlay').show();
});
}
function LoadHide() {
// 最后一个请求结束时隐藏loading
$(document).on('ajaxStop', function () {
$('.overlay').hide();
});
}
$(".start_consul").on("click", function () {
$(".modal_bg").addClass("bg_show");
document.documentElement.style.overflow = "hidden";
})
$(".modal_bg").on("click", function (event) {
var offmodal = $(".modal_t");
if (!offmodal.is(event.target) && offmodal.has(event.target).length === 0) {
$(".modal_bg").removeClass("bg_show");
document.documentElement.style.overflow = "auto";
}
})
$(".close_pop").on("click", function (event) {
$(".modal_bg").removeClass("bg_show");
document.documentElement.style.overflow = "auto";
})
// 图片上传预览
var form = new FormData();//通过HTML表单创建FormData对象
var url = '127.0.0.1:8080/'
$('.filechnage').change(function () {
var result = $(this).closest(".thumb-preview-uploaded").find(".inline")[0];
var files = this.files;
if (files.length == 0) {
return;
}
var file = files[0];
//把上传的图片显示出来
var reader = new FileReader();
// 将文件以Data URL形式进行读入页面
// console.log(reader);
reader.readAsBinaryString(file);
reader.onload = function (f) {
var src = "data:" + file.type + ";base64," + window.btoa(this.result);
result.innerHTML = '';
}
form.append('file', file);
});
// 获取select属性
$.ajax({
type: "post",
dataType: "json",
url: "https://custom.aporro.com/web/Home/AporroApi/advanced_custom_attribute",
cache: false,
success: function (data) {
$(".make_style").text(data.msg.attr_4.desc);
var obj = data.msg;
var values =[];
for(var key in obj){
// keys.push(key);
values.push(obj[key]);//取得value
// console.log(values)
}
var select = '';
$(".form_make").html(select);
$('.mySelect').find('option').eq(0).attr("selected","selected")
var p1 = $(".mySelect").children('option:selected').val();
$("#check_vid").val(p1);
$('.mySelect').change(function(){
p1=$(this).children('option:selected').val();//这就是selected的值
$("#check_vid").val(p1);
});
}
})
// form表单提交
$(".btn_submit").off('click').on("click", function (){
var formData = new FormData($( "#form_data" )[0]);
$.ajax({
type: "post",
dataType: "json",
url: "https://custom.aporro.com/web/Home/AporroApi/advanced_custom",
data: formData,
// async: false,
cache: false,
contentType: false,
processData: false,
beforeSend(){
var userEmail = $(".validate-email").val();
var phone = $(".validate-phoneStrict").val();
var nama = $(".name_on").val();
var content = $(".textarea_content").val();
// // 验证用户名输入是否合法:非空 不能包含特殊字符
var reg = /^([a-zA-Z0-9_-])+@/;
var reg1 = /^[0-9]+$/;
if (userEmail == "" ||phone == "" ||nama==""||content=="") {
return false;
}
},
success: function (data) {
if(data.bool=="success"){
$("#form_data")[0].reset();
$(".btn-toolb p").html(data.va_title)
.fadeIn(1000)
.delay(10000)
.fadeOut(3000);
$("html").css("overflow","auto");
$("body").css("overflow","auto");
}else{
$(".btn-toolb p")
.html(data.va_title)
.fadeIn(1000)
.delay(9000)
.fadeOut(3000);
setTimeout(() => {
$(„.modal_bg“).removeClass(„bg_show“);
$(„html“).css(„overflow“,“auto“);
$(„body“).css(„overflow“,“auto“);
}, 3000);
}
}
})
})
$.ajax({
type: „post“,
dataType: „json“,
url: „https://custom.aporro.com/web/Home/AporroApi/country_option“,
cache: false,
success: function (data) {
// console.log(data.msg);
$(„.form_country select“).html(data.msg);
$(„.form_country select“).val(„226“);
},
})
})
// ]]>