// JavaScript Document //閫氳繃device.js鍒ゆ柇鐧诲綍璁惧锛屽綋鏄Щ鍔ㄧ鏃惰烦杞埌鎵嬫満鐗堥〉闈 //if(device.mobile() || device.ipad()){ // window.location.href="/mobile"; //window.location="url"; //瑕佽烦杞埌鐨刄RL鍦板潃 // } $(function(){ setTimeout(function(){ $("html").css("opacity",1); },500); $('#indexReTop').click(function(){ $('body,html').animate({scrollTop:0},500); }); var widthS=$(window).width()/7.5; $('html').css("font-size",widthS.toFixed(2)+"px"); setTimeout(function(){ $(".inheader").css("opacity",1); $(".useNav").css("opacity",1); },100); $(".webMeuc").css('height', $(window).height()); $("body").click(function(e){ $(".webMeuc").removeClass("on"); $(".webMeuc").addClass("nostart"); $(".meuc-btn").removeClass("on"); // $(".download-btn").css("display","none"); $(".meuc-btn").html(""); }) $(".webMeuc").click(function(e){ stopPropagation(); }) }); //寰俊jssdk鑾峰緱鏉冩牴骞惰缃彍鍗曟爮 function wxMenu(){ shareurl=location.href.split('#')[0]; $.ajax({ url: "/index/index/wxqianming", data: {'url':shareurl}, type: "GET", dataType: "json", success: function(res) { //寰俊鍒嗕韩---- //res.webconfig.nowurl=window.location.href; //console.log(res); wxconfig=res.wxconfig; //鑷畾涔夊垎浜唴瀹?------------ //console.log(wxconfig); wx.config({ debug:false,// 鏄惁寮€鍚皟璇曟ā寮 appId:wxconfig.appId,// 蹇呭~锛屽井淇″彿AppID timestamp:wxconfig.timestamp,// 蹇呭~锛岀敓鎴愮鍚嶇殑鏃堕棿鎴 nonceStr:wxconfig.nonceStr,// 蹇呭~锛岀敓鎴愮鍚嶇殑闅忔満涓 signature:wxconfig.signature,// 蹇呭~锛岀鍚嶏紝瑙侀檮褰? jsApiList: [ 'checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'hideOptionMenu',//鐣岄潰鎿嶄綔鎺ュ彛1 'showOptionMenu',//鐣岄潰鎿嶄綔鎺ュ彛2 'closeWindow'聽,聽聽////鐣岄潰鎿嶄綔鎺ュ彛3 'hideMenuItems',////鐣岄潰鎿嶄綔鎺ュ彛4 'showMenuItems',////鐣岄潰鎿嶄綔鎺ュ彛5 'hideAllNonBaseMenuItem',////鐣岄潰鎿嶄綔鎺ュ彛6 'showAllNonBaseMenuItem',////鐣岄潰鎿嶄綔鎺ュ彛7 'openAddress', 'openLocation', 'getLocation', 'scanQRCode' ] }); wx.ready(function(){ wx.hideMenuItems({ menuList: [ //"menuItem:share:appMessage", //"menuItem:share:timeline", //"menuItem:share:qq", //"menuItem:share:weiboApp", //"menuItem:share:facebook", //"menuItem:share:QZone", "menuItem:editTag", "menuItem:delete", "menuItem:originPage", "menuItem:readMode", "menuItem:openWithQQBrowser", "menuItem:openWithSafari", "menuItem:share:email", "menuItem:share:brand", "menuItem:copyUrl" ] // 瑕佹樉绀虹殑鑿滃崟椤癸紝鎵€鏈塵enu椤硅闄勫綍3 }); }); }, error: function(data) { //layer.msg('缃戠粶鎷ュ牭,璇烽噸鏂板皾璇?,{shade:.5,icon: 2,time:3000}); } }); } //寰俊杞彂鍒嗕韩璁剧疆 function wxshareconf(wxtitle,wxlink,wximgurl,wxdesc){ wx.ready(function(){ var shareData ={ title:wxtitle,// 鍒嗕韩鏍囬 link:wxlink,// 鍒嗕韩閾炬帴锛岃寰椾娇鐢ㄧ粷瀵硅矾寰 imgUrl:wximgurl,// 鍒嗕韩鍥炬爣锛岃寰椾娇鐢ㄧ粷瀵硅矾寰 desc:wxdesc,// 鍒嗕韩鎻忚堪 type: 'link', success:function(){ //console.info('鍒嗕韩鎴愬姛锛?); }, cancel:function(){ console.info('鍙栨秷鍒嗕韩锛?); // 鐢ㄦ埛鍙栨秷鍒嗕韩鍚庢墽琛岀殑鍥炶皟鍑芥暟 } } wx.onMenuShareAppMessage(shareData); wx.onMenuShareTimeline(shareData); wx.onMenuShareQQ(shareData); wx.onMenuShareWeibo(shareData); }); } //鎵撳紑缇や簩缁寸爜銆佸璐簩缁寸爜 function openQr(img,name){ stopPropagation(); $(".bigbox img").attr('src',img); $(".bigbox p").text(name); $(".bigbox").fadeIn(300); } //鍏抽棴缇や簩缁寸爜銆佸璐簩缁寸爜 function closeQr(that){ $(that).fadeOut(300); } //闃绘鍐掓场浜嬩欢 function stopPropagation(e) { e = e || window.event; if(e.stopPropagation) { //W3C闃绘鍐掓场鏂规硶 e.stopPropagation(); } else { e.cancelBubble = true; //IE闃绘鍐掓场鏂规硶 } } //鍏抽棴娴獥 function closeContact(e){ if($(".my-righticon .main .box1").hasClass("on")){ $(".my-righticon").fadeOut(200); $(".my-righticon .main .box1").removeClass("on"); } else{ $(".my-righticon").fadeIn(200); $(".my-righticon .main .box1").addClass("on"); } } //杩斿洖涓婁竴椤 function reback(url) { document.referrer === '' ?window.location.href = url :window.history.go(-1); } //鍒囨崲鑿滃崟 function jumpMeuc(pos,target,target1){ stopPropagation(); if($(target).hasClass("on")){ $(target).removeClass("on"); $(target).addClass("nostart"); $(pos).removeClass("on"); // $(".download-btn").css("display","none"); $(pos).html(""); } else{ $(target).addClass("on"); $(target).removeClass("nostart"); setTimeout(function(){ // $(".download-btn").css("display","flex"); $(pos).addClass("on"); $(pos).html(""); },700); } //$(target1).slideUp(200); // $(pos).siblings('i').removeClass("open"); // if ($(pos).hasClass("open")) { // $(pos).removeClass('open'); // $(target).slideToggle(300); // } // else{ // $(pos).addClass('open'); // $(target).slideToggle(300); // } } //鍔犵洘琛ㄥ崟鎻愪氦妫€楠 function joincheck(){ var uname=$("input[name='uname']").val(); var city=$("input[name='city']").val(); var umobile=$("input[name='umobile']").val(); var type=$("input[name='type']").val(); if(uname.length<1){ layer.msg('璇峰~鍐欐偍鐨勫鍚?,{shade:.5,icon: 0,time:2000}); } else if(city.length<1){ layer.msg('璇峰~鍐欐偍鎵€鍦ㄥ煄甯?,{shade:.5,icon: 0,time:2000}); } else if(umobile.length<5 || umobile.length !=11){ layer.msg('璇锋纭~鍐欐偍鐨勬墜鏈哄彿',{shade:.5,icon: 0,time:2000}); } else{ var loading1 = layer.load(); $.ajax({ url: "/index/index/app", data: {'uname':uname,'city':city,'umobile':umobile,'type':type}, type: "POST", dataType: "json", success: function(data) { console.log(data); layer.close(loading1); if(data.status==1){ layer.msg(data.info,{shade:.5,icon: 6,time:5000}); $("input[name='uname']").val(""); $("input[name='city']").val(""); $("input[name='umobile']").val(""); } else{ layer.msg(data.info,{shade:.5,icon: 0,time:2000}); } }, error: function(data) { layer.close(loading1); } }); } } //瑙嗛寮傞儴璇诲彇鏂规硶-------------- function changeVideo(sid){ if(runsta==true){ runsta=false; itData={id:sid}; $.ajax({ type:"POST", url:ajaxurl, data:itData, success: function(data,st){ $("#video-tit").html(data['data']['title']); $("#video-area").html(data['data']['outdata']); var dheight=$(window).width()*0.7; var mt=($(window).height()-dheight)/4; $(".modal-dialog").css('height',dheight+'px'); $(".modal-dialog iframe").attr('height',dheight); $(".modal-dialog").css('top',mt+'px'); $("#modal-demo").modal("show"); runsta=true; }, }); } } //杩樺師瑙嗛寮瑰嚭妗嗗唴瀹 function resetVideo(){ $("#video-tit").html("瑙嗛鏍囬"); $("#video-area").html("
聽聽瑙嗛姝e湪鍔犺浇涓?..
');
}
function clearform(pos){
$(pos).val('');
}
$(document).ready(function(e) {
//鍥剧墖鍒囨崲鍔熻兘
$("#prop img").click(
function(e){
yuan=$(this).attr('src');
mubiao=$(this).attr('rel');
(mubiao == "" || mubiao == undefined || mubiao == null) ? mubiao=yuan : mubiao;
$(this).attr('src',mubiao);
$(this).attr('rel',yuan);
}
);
});
function returnTop(){
$("html,body").animate({scrollTop: 0},300);
}
//鏀跺睍鍒嗙被鑿滃崟
function showclass(pos){
if($(pos).children('i').hasClass("Hui-iconfont-arrow3-bottom")){
$(pos).children('i').removeClass("Hui-iconfont-arrow3-bottom");
$(pos).children('i').addClass("Hui-iconfont-arrow3-top");
}
else{
$(pos).children('i').removeClass("Hui-iconfont-arrow3-top");
$(pos).children('i').addClass("Hui-iconfont-arrow3-bottom");
}
$(pos).next().slideToggle(300);
}
//閫夋嫨鐪佷唤---------------------------
function changeProvince(shenfen){
$('#province_wrap .pro').removeClass('ball-on');
var loading1 = layer.load();
var father=$("select[name='province'] option:selected").attr("data-father");
province=$("select[name='province'] option:selected").val();
$(".storelist .tit").text(province+"闂ㄥ簵");
$.ajax({
url: "store",
data: {'father':father},
type: "POST",
dataType: "json",
success: function(data) {
console.log(data)
layer.close(loading1);
if(data.status==1){
var city_arr=data.data;
var html="";
city_arr.forEach((item,index,array)=>{
html+="";
});
$("select[name='city']").html(html);
ajaxStore(province,"",ajaxurl);
}
},
error: function(data) {
layer.close(loading1);
}
});
}
//閫夋嫨鍩庡競---------------------------
function changeCity(){
var province=$("select[name='province'] option:selected").val();
var city=$("select[name='city'] option:selected").val();
ajaxStore(province,city,ajaxurl);
}
// 鏍规嵁鎵€閫夋潯浠跺姞杞介棬搴
function ajaxStore(province,city,url){
if(runsta==true){
runsta=false;
itData={province:province,city:city};
$.ajax({
type:"POST",
url:url,
data:itData,
success: function(data,st){
console.log(data);
var html=""
if(data.status==1){
html=''+el.brandshop+'
鍦板潃锛?+el.province+el.city+el.area+'
鐢佃瘽锛?+el.mobile+'