// JavaScript Document
var BROWSER = {};
var USERAGENT = navigator.userAgent.toLowerCase();
browserVersion({'ie':'msie','firefox':'','chrome':'','opera':'','safari':'','mozilla':'','webkit':'','maxthon':'','qq':'qqbrowser'});
if(BROWSER.safari) {
BROWSER.firefox = true;
}
BROWSER.opera = BROWSER.opera ? opera.version() : 0;
HTMLNODE = document.getElementsByTagName('head')[0].parentNode;
if(BROWSER.ie) {
BROWSER.iemode = parseInt(typeof document.documentMode != 'undefined' ? document.documentMode : BROWSER.ie);
HTMLNODE.className = 'ie_all ie' + BROWSER.iemode;
}
var lang1='请输入商家或商品关键词';
var lang2='抱歉,你的浏览器不支持此操作。\n请使用按键 Ctrl+D 收藏拉手。';
function browserVersion(types) {
var other = 1;
for(i in types) {
var v = types[i] ? types[i] : i;
if(USERAGENT.indexOf(v) != -1) {
var re = new RegExp(v + '(\\/|\\s)([\\d\\.]+)', 'ig');
var matches = re.exec(USERAGENT);
var ver = matches != null ? matches[2] : 0;
other = ver !== 0 && v != 'mozilla' ? 0 : other;
}else {
var ver = 0;
}
eval('BROWSER.' + i + '= ver');
}
BROWSER.other = other;
}
function check_all(obj,id,n)
{
for(var i=0;i请选择二级地区');
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&it618_area_id="+it618_area_id+""+"&formhash=b1b1ea03", {ac:"getbrandarea"},function (data, textStatus){
IT618_BRAND("#it618_area_id1").html(data);
}, "html");
}
function getbrandclass(it618_class_id){
IT618_BRAND("#it618_class_id1").html('');
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&it618_class_id="+it618_class_id+"&formhash=b1b1ea03", {ac:"getbrandclass"},function (data, textStatus){
IT618_BRAND("#it618_class_id1").html(data);
}, "html");
}
function showshare(sharetype,shareid,tuicount){
var title='分享';
var content='plugin.php?id=it618_brand:share&sharetype='+sharetype+"&tuicount="+tuicount+"&shareid="+shareid;
showlayer('share',2,title,content,430,530);
}
function showlayer(it618type,type,title,content,width,height){
if(type==1){
content=''+content+'
';
}
layer.open({
type: type,
title: ""+title+"
",
shadeClose: true,
scrollbar: false,
shade: [0.5, "#393D49"],
maxmin: false,
area: [width+"px",height+"px"],
content: content,
cancel: function(index, layero){
}
});
}
var layerclose = {};
function showlayerwin(it618type,type,title,content,width,height,wintype){
if(type==1){
content=''+content+'
';
}
if(wintype==0){
var maxmin=false;
var shade=0.3;
}else{
var maxmin=true;
var shade=false;
}
if(height>IT618_BRAND(window).height()*0.8){
height=IT618_BRAND(window).height()*0.8;
}
layerclose[it618type]=layer.open({
type: type,
title: ""+title+"
",
shadeClose: false,
scrollbar: false,
shade: shade,
maxmin: maxmin,
area: [width+"px",height+"px"],
content: content,
cancel: function(index, layero){
if(it618type=='myaddr'){
if(addrtype=='gwc')getgwclist();
}
if(it618type=='codepay'){
clearInterval(tmptime);
}
}
});
}
IT618_BRAND.ajaxSetup({cache:false});
var saleaddkmid,saleaddconid,addrtype;
$(document).ready(function() {
//28d7ebfec183a96b7e8f8b84a1b04011
$(".renzheng").click(function(){
it618_members_login();return;
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:showrenzheng", {ac:"add"},function (data, textStatus){
var tmparr=data.split("it618_split");
showlayerwin('renzheng',1,tmparr[0],tmparr[1],1100,550,0);
}, "html");
});
//ead2869c78b0f4e1f33af349d91dc50d
$("#tmpaddrbtn").click(function(){
showlayerwin('myaddr',1,'收货地址管理','',880,580,0);
$("#layer_myaddr").html('
');
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:showaddr&type="+addrtype+"&formhash=b1b1ea03", {ac:"add"},function (data, textStatus){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax&formhash=b1b1ea03", {ac:"addr_get"},function (data1, textStatus){
$("#layer_myaddr").html(''+data1+'
'+data+'');
}, "html");
}, "html");
});
//2611a0ef5afd983e61c13668d1447d98
$("#mysale").click(function(){
showlayerwin('mysale',1,'我的线上交易','',1200,610,1);
$("#layer_mysale").html('
');
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:mysale", {ac:"add"},function (data, textStatus){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&formhash=b1b1ea03", {ac:"mysalelist_get",ac1:"pcmysale"},function (data1, textStatus){
var tmparr1=data1.split("it618_split");
var bodytmp=data;
bodytmp=bodytmp.replace("it618mysalesum",tmparr1[0]);
bodytmp=bodytmp.replace("it618mysalelist",tmparr1[1]);
bodytmp=bodytmp.replace("it618mysalepage",tmparr1[2]);
$("#layer_mysale").html(bodytmp);
laydate.render({trigger: "click",
elem: '#it618_time1'
});
laydate.render({trigger: "click",
elem: '#it618_time2'
});
if(saleaddkmid>0)setsalekm(saleaddkmid);
if(saleaddconid>0)setsalecontend(saleaddconid);
saleaddkmid=0;
saleaddconid=0;
}, "html");
}, "html");
});
//80d805a44a4bae0a19594402cb3cca80
$("#myorder").click(function(){
showlayerwin('myorder',1,'我的订购','',1200,610,1);
$("#layer_myorder").html('
');
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:myorder", {ac:"add"},function (data, textStatus){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&formhash=b1b1ea03", {ac:"orderlist_get",ac1:"pcmyorder"},function (data1, textStatus){
var tmparr1=data1.split("it618_split");
var bodytmp=data;
bodytmp=bodytmp.replace("it618myordersum",tmparr1[0]);
bodytmp=bodytmp.replace("it618myorderlist",tmparr1[1]);
bodytmp=bodytmp.replace("it618myorderpage",tmparr1[2]);
bodytmp=bodytmp.replace("it618myjfcount",tmparr1[3]);
$("#layer_myorder").html(bodytmp);
laydate.render({trigger: "click",
elem: '#it618_time1'
});
laydate.render({trigger: "click",
elem: '#it618_time2'
});
}, "html");
}, "html");
});
//15a9dab1dcc13aacccd24fed3c75b11a
$("#mycard").click(function(){
showlayerwin('mycard',1,'我的会员卡','',1200,610,1);
$("#layer_mycard").html('
');
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:mycard", {ac:"it618"},function (data, textStatus){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&formhash=b1b1ea03", {ac:"mycardmoney_get"},function (data1, textStatus){
var tmparr1=data1.split("it618_split");
var bodytmp=data;
bodytmp=bodytmp.replace("it618_mysalesum",tmparr1[0]);
bodytmp=bodytmp.replace("it618_mysalelist",tmparr1[1]);
bodytmp=bodytmp.replace("it618_mysalepage",tmparr1[2]);
$("#layer_mycard").html(bodytmp);
}, "html");
}, "html");
});
//4c076554b680d4b0f2e63a606dc65a76
$("#mysale1").click(function(){
showlayerwin('mysale1',1,'我的线下交易','',1200,610,1);
$("#layer_mysale1").html('
');
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:mysale1", {ac:"it618"},function (data, textStatus){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&formhash=b1b1ea03", {ac:"moneylist_get"},function (data1, textStatus){
var tmparr1=data1.split("it618_split");
var bodytmp=data;
bodytmp=bodytmp.replace("it618_mysalesum",tmparr1[0]);
bodytmp=bodytmp.replace("it618_mysalelist",tmparr1[1]);
bodytmp=bodytmp.replace("it618_mysalepage",tmparr1[2]);
$("#layer_mysale1").html(bodytmp);
laydate.render({trigger: "click",
elem: '#it618_time1'
});
laydate.render({trigger: "click",
elem: '#it618_time2'
});
}, "html");
}, "html");
});
//ac91cdf2bb51de0623c6b625064479e7
$("#mycollect").click(function(){
showlayerwin('mycollect',1,'我的收藏','',1005,698,1);
$("#layer_mycollect").html('
');
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:mycollect", {ac:"it618"},function (data, textStatus){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&formhash=b1b1ea03", {ac:"collectlist_get",ac1:"pcmycollect"},function (data1, textStatus){
var tmparr1=data1.split("it618_split");
var bodytmp=data;
bodytmp=bodytmp.replace("it618mycollectsum",tmparr1[0]);
bodytmp=bodytmp.replace("it618mycollectlist",tmparr1[1]);
$("#layer_mycollect").html(bodytmp);
}, "html");
}, "html");
});
//da5bf826c02a5e3ec7313825262e2ddd
$(".brandmap,.tmpbrandmap").click(function(){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:showmap"+"&sid="+this.name, {ac:"it618"},function (data, textStatus){
var tmparr=data.split("it618_split");
showlayerwin('brandmap',1,tmparr[0],tmparr[1],991,613,0);
}, "html");
});
});
function addmycard(){
var it618_name=document.getElementById("it618_name").value;
var it618_tel=document.getElementById("it618_tel").value;
if(it618_tel==''){
alert("抱歉,请输入手机号!");
document.getElementById("it618_tel").focus();
return;
}
var reg=/^[1][3,4,5,6,7,8,9][0-9]{9}$/;
if (!reg.test(it618_tel)) {
alert("抱歉,您的手机号码不是有效的!");
document.getElementById("it618_tel").focus();
return;
}
if(confirm("确定要提交申请?请确定您的手机号正确!")){
IT618_BRAND.post("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&it618_name="+it618_name+"&it618_tel="+it618_tel+"&formhash=b1b1ea03", {ac:"addmycard"},function (data, textStatus){
var tmparr=data.split("it618_split");
if(tmparr[0]=="ok"){
alert(tmparr[1]);
dialog_mycard.remove();
document.getElementById('mycard').click();
}else{
alert(data);
}
}, "html");
}
}
function editcardname(cid){
var it618_name=document.getElementById("it618_name").value;
IT618_BRAND.post("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&cid="+cid+"&it618_name="+it618_name+"&formhash=b1b1ea03", {ac:"editcardname"},function (data, textStatus){
var tmparr=data.split("it618_split");
if(tmparr[0]=="ok"){
alert(tmparr[1]);
dialog_mycard.remove();
document.getElementById('mycard').click();
}else{
alert(data);
}
}, "html");
}
var sqlurl="";sqlurl1="";sqlurl2="";
function getmysale1list(url){
document.getElementById("img_loading").style.display="";
document.getElementById("mysalelist").style.display="none";
IT618_BRAND.get(url+sqlurl1+"&formhash=b1b1ea03", {ac:"moneylist_get"},function (data, textStatus){
var tmparr=data.split("it618_split");
IT618_BRAND("#mysalesum").html(tmparr[0]);
IT618_BRAND("#mysalelist").html(tmparr[1]);
IT618_BRAND("#mysalepage").html(tmparr[2]);
document.getElementById("mysaleurl").value=url;
document.getElementById("img_loading").style.display="none";
document.getElementById("mysalelist").style.display="";
}, "html");
}
function searchmysale1(){
if(parseInt(document.getElementById("it618_time1").value.replace(/-/g,""))>parseInt(document.getElementById("it618_time2").value.replace(/-/g,""))){
alert("开始日期不能大于截止日期!");
return false;
}
var it618_shopid=document.getElementById("it618_shopid").value;
var it618_time1=document.getElementById("it618_time1").value;
var it618_time2=document.getElementById("it618_time2").value;
url="https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax";
sqlurl1="&it618_shopid="+it618_shopid+"&it618_time1="+it618_time1+"&it618_time2="+it618_time2;
getmysale1list(url);
document.getElementById("mysaleurl").value=url;
}
function getmycradlist(url){
IT618_BRAND.get(url+"&formhash=b1b1ea03", {ac:"mycardmoney_get"},function (data, textStatus){
var tmparr=data.split("it618_split");
IT618_BRAND("#mysalesum").html(tmparr[0]);
IT618_BRAND("#mysalelist").html(tmparr[1]);
IT618_BRAND("#mysalepage").html(tmparr[2]);
}, "html");
}
function getmycollectlist(url){
IT618_BRAND.get(url+"&formhash=b1b1ea03", {ac:"collectlist_get",ac1:"pcmycollect"},function (data, textStatus){
var tmparr=data.split("it618_split");
IT618_BRAND("#mycollectsum").html(tmparr[0]);
IT618_BRAND("#mycollectlist").html(tmparr[1]);
document.getElementById("mycollecurl").value=url;
}, "html");
}
function delcollect(){
IT618_BRAND.post("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&ac=delcollect"+"&formhash=b1b1ea03",IT618_BRAND("#mycollectids").serialize(),function (data, textStatus){
var tmparr=data.split("it618_split");
if(tmparr[0]=="ok"){
alert(tmparr[1]);
getmycollectlist(document.getElementById("mycollecurl").value);
}else{
alert(data);
}
}, "html");
}
function getmyorderlist(url){
document.getElementById("img_loading").style.display="";
document.getElementById("mysalelist").style.display="none";
IT618_BRAND.get(url+sqlurl2+"&formhash=b1b1ea03", {ac:"orderlist_get",ac1:"pcmyorder"},function (data, textStatus){
var tmparr=data.split("it618_split");
IT618_BRAND("#mysalesum").html(tmparr[0]);
IT618_BRAND("#mysalelist").html(tmparr[1]);
IT618_BRAND("#mysalepage").html(tmparr[2]);
IT618_BRAND("#myjfcount").html(tmparr[3]);
document.getElementById("myorderurl").value=url;
document.getElementById("img_loading").style.display="none";
document.getElementById("mysalelist").style.display="";
}, "html");
}
function searchmyorder(){
if(parseInt(document.getElementById("it618_time1").value.replace(/-/g,""))>parseInt(document.getElementById("it618_time2").value.replace(/-/g,""))){
alert("开始日期不能大于截止日期!");
return false;
}
var mysalepname=document.getElementById("mysalepname").value;
var mysalestate=document.getElementById("mysalestate").value;
var it618_time1=document.getElementById("it618_time1").value;
var it618_time2=document.getElementById("it618_time2").value;
sqlurl2="&pname="+mysalepname+"&state="+mysalestate+"&it618_time1="+it618_time1+"&it618_time2="+it618_time2;
url="https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax";
getmyorderlist(url);
document.getElementById("myorderurl").value=url;
}
function getmysalelist(url){
document.getElementById("img_loading").style.display="";
document.getElementById("mysalelist").style.display="none";
IT618_BRAND.get(url+sqlurl+"&formhash=b1b1ea03", {ac:"mysalelist_get",ac1:"pcmysale"},function (data, textStatus){
var tmparr=data.split("it618_split");
IT618_BRAND("#mysalesum").html(tmparr[0]);
IT618_BRAND("#mysalelist").html(tmparr[1]);
IT618_BRAND("#mysalepage").html(tmparr[2]);
document.getElementById("mysaleurl").value=url;
document.getElementById("img_loading").style.display="none";
document.getElementById("mysalelist").style.display="";
}, "html");
}
function searchmysale(){
if(parseInt(document.getElementById("it618_time1").value.replace(/-/g,""))>parseInt(document.getElementById("it618_time2").value.replace(/-/g,""))){
alert("开始日期不能大于截止日期!");
return false;
}
var mysalepname=document.getElementById("mysalepname").value;
var mysalestate=document.getElementById("mysalestate").value;
var it618_time1=document.getElementById("it618_time1").value;
var it618_time2=document.getElementById("it618_time2").value;
url="https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax";
sqlurl="&pname="+mysalepname+"&state="+mysalestate+"&it618_time1="+it618_time1+"&it618_time2="+it618_time2;
getmysalelist(url);
document.getElementById("mysaleurl").value=url;
}
function delorder(orderid){
if(confirm("确定要取消订单?此操作不可逆!")){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&orderid="+orderid+"&formhash=b1b1ea03", {ac:"delorder"},function (data, textStatus){
var tmparr=data.split("it618_split");
if(tmparr[0]=="ok"){
alert(tmparr[1]);
getmyorderlist(document.getElementById("myorderurl").value);
}else{
alert(data);
}
}, "html");
}
}
function tuikuan(saleid){
if(confirm("确定要申请退款?此操作不可逆。")){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&saleid="+saleid+"&formhash=b1b1ea03", {ac:"tuikuan"},function (data, textStatus){
var tmparr=data.split("it618_split");
if(tmparr[0]=="ok"){
alert(tmparr[1]);
getmysalelist(document.getElementById("mysaleurl").value);
}else{
alert(data);
}
}, "html");
}
}
function shouhuo(saleid){
if(confirm("确定要确认收货?此操作不可逆。")){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&saleid="+saleid+"&formhash=b1b1ea03", {ac:"shouhuo"},function (data, textStatus){
var tmparr=data.split("it618_split");
if(tmparr[0]=="ok"){
alert(tmparr[1]);
getmysalelist(document.getElementById("mysaleurl").value);
}else{
alert(data);
}
}, "html");
}
}
function setsaletui(saleid){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:saletui"+"&saleid="+saleid, {ac:"it618"},function (data, textStatus){
var tmparr=data.split("it618_split");
showlayerwin('getsaletui',1,tmparr[0],tmparr[1],551,385,0);
IT618_BRAND('.ns-sub-a').click(function(){
if(document.getElementById("tuivalue").value==''){
alert("抱歉,请输入申请退款原因!");
document.getElementById("tuivalue").focus();
return;
}
if(confirm("确定要申请退款?")){
IT618_BRAND.post("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&ac=saletui"+"&saleid="+saleid+"&formhash=b1b1ea03",IT618_BRAND("#it618_saletui").serialize(),function (data, textStatus){
var tmparr=data.split("it618_split");
if(tmparr[0]=="ok"){
alert(tmparr[1]);
layer.close(layerclose['getsaletui']);
getmysalelist(document.getElementById("mysaleurl").value);
}else{
alert(data);
}
}, "html");
}
})
IT618_BRAND('.ns-sub-b').click(function(){
layer.close(layerclose['getsaletui']);
})
}, "html");
}
function setsalekm(saleid){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:salekm"+"&saleid="+saleid, {ac:"it618"},function (data, textStatus){
var tmparr=data.split("it618_split");
showlayerwin('getsalekm',1,tmparr[0],tmparr[1],620,390,0);
}, "html");
}
function setsalecontend(saleid){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:salecontend"+"&saleid="+saleid, {ac:"it618"},function (data, textStatus){
var tmparr=data.split("it618_split");
showlayerwin('getsalecontend',1,tmparr[0],tmparr[1],800,580,0);
}, "html");
}
function it618_getkd(kdid){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_members:getkd"+"&kdid="+kdid, {ac:"it618"},function (data, textStatus){
var tmparr=data.split("it618_split");
showlayerwin('getsalekd',1,tmparr[0],tmparr[1],760,480,0);
}, "html");
}
var K;
KindEditor.ready(function(ktmp) {
K=ktmp;
});
var ispjpicdel=0;
var ish5oss=0;
function setsalepj(saleid){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:salepj"+"&saleid="+saleid, {ac:"it618"},function (data, textStatus){
var tmparr=data.split("it618_split");
showlayerwin('getsalepj',1,tmparr[0],tmparr[1],535,385,0);
if(tmparr[4]==1){
var editor = K.editor({
uploadJson : 'source/plugin/it618_brand/kindeditor/php/upload_json.php?uid='+tmparr[3]+'&imgwidth=880&oss',
fileManagerJson : 'source/plugin/it618_brand/kindeditor/php/file_manager_json.php?uid='+tmparr[3],
allowFileManager : true
});
K('#pjpic_addbtn').click(function() {
if(document.getElementById("pjpiccount").value>=5){
return;
}
if(ish5oss==1){
getimagejs('salepj',saleid);
}else{
editor.loadPlugin('image', function() {
editor.plugin.imageDialog({
showRemote : false,
clickFn : function(url, title, width, height, border, align) {
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&ac=salepj&saleid="+saleid+"&picurl="+url+"&formhash=b1b1ea03",{ac1:"addpjpic"},function (data, textStatus){
getpjpic(saleid);
}, "html");
editor.hideDialog();
}
});
});
}
var dlgh=K(".ke-dialog-default").height;
var dlgw=K(".ke-dialog-default").width;
var ntop=(window.innerHeight-dlgh)/2;
var nleft=(window.innerWidth-dlgw)/2;
K(".ke-dialog-default").css({"top":ntop,"left":nleft});
});
getpjpic(saleid);
}
IT618_BRAND('.ns-sub-a').click(function(){
if(getstrlen1(document.getElementById("pjvalue").value)<5){
alert("评价内容字数不能少于5个!");
return;
}
document.getElementById("pjvalue").value=document.getElementById("pjvalue").value.replace(/\n/g,"[br]");
if(confirm(tmparr[2])){
IT618_BRAND.post("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&ac=salepj"+"&saleid="+saleid+"&formhash=b1b1ea03",IT618_BRAND("#it618_salepj").serialize(),function (data, textStatus){
var tmparr=data.split("it618_split");
if(tmparr[0]=="ok"){
alert(tmparr[1]);
layer.close(layerclose['getsalepj']);
getmysalelist(document.getElementById("mysaleurl").value);
}else if(tmparr[0]=="editok"){
alert(tmparr[1]);
layer.close(layerclose['getsalepj']);
getpjlist(pjurl);
}else{
alert(data);
}
}, "html");
}
})
IT618_BRAND('.ns-sub-b').click(function(){
layer.close(layerclose['getsalepj']);
})
}, "html");
}
function getbigpjpic(saleid,bigpjpic){
IT618_BRAND("#bigpjpic"+saleid).html("
");
IT618_BRAND("#bigpjpic"+saleid).show();
}
function hidebigpjpic(obj){
obj.style.display='none';
}
function delpjpic(saleid,pjpicid){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&ac=salepj&saleid="+saleid+"&pjpicid="+pjpicid+"&formhash=b1b1ea03",{ac1:"delpjpic"},function (data, textStatus){
getpjpic(saleid);
}, "html");
}
function getpjpic(saleid){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax"+"&saleid="+saleid+"&formhash=b1b1ea03", {ac:"getpjpic"},function (data, textStatus){
IT618_BRAND("#divpjpic").html(data);
}, "html");
}
function getstrlen1(str) {
///获得字符串实际长度,中文2,英文1
///要获得长度的字符串
var realLength = 0, len = str.length, charCode = -1;
for (var i = 0; i < len; i++) {
charCode = str.charCodeAt(i);
if (charCode >= 0 && charCode <= 128) realLength += 1;
else realLength += 2;
}
return realLength;
}
function setpjcolor1(id){
document.getElementById("lab1").style.color="#000";
document.getElementById("lab2").style.color="#000";
document.getElementById("lab3").style.color="#000";
document.getElementById("lab"+id).style.color="#FF6600";
}
function gethotbtn(sid){
IT618_BRAND(".tmpbrandmap").attr("name",sid);
IT618_BRAND(".tmpbrandmap").click();
}
function savaaddr(action,aid){
if(action=='add'){
tmptips='addrtips';
}else{
tmptips='list_addrtips';
}
if(document.getElementById("it618_name"+aid).value==""){
sendmsg(tmptips,"请输入姓名!");
return false;
}
if(document.getElementById("it618_tel"+aid).value==""){
sendmsg(tmptips,"请输入手机号码!");
return false;
}
var it618_name=document.getElementById("it618_name"+aid).value;
var it618_addr=document.getElementById("it618_addr"+aid).value;
var it618_tel=document.getElementById("it618_tel"+aid).value;
IT618_BRAND.post("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax&ac=addr_"+action+"&aid="+aid+"&formhash=b1b1ea03","it618_name="+it618_name+"&it618_addr="+it618_addr+"&it618_tel="+it618_tel,function (data, textStatus){
sendmsg(tmptips,data);
getaddr();
}, "html");
}
function getaddr(){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax&formhash=b1b1ea03", {ac:"addr_get"},function (data, textStatus){
IT618_BRAND("#addrlist").html(data);
}, "html");
}
function defaultaddr(aid){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax&aid="+aid+"&formhash=b1b1ea03", {ac:"addr_default"},function (data, textStatus){
getaddr();
sendmsg('list_addrtips',data);
}, "html");
}
function deladdr(aid){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax&aid="+aid+"&formhash=b1b1ea03", {ac:"addr_del"},function (data, textStatus){
getaddr();
sendmsg('list_addrtips',data);
}, "html");
}
function _attachEvent(obj, evt, func, eventobj) {
eventobj = !eventobj ? obj : eventobj;
if(obj.addEventListener) {
obj.addEventListener(evt, func, false);
} else if(eventobj.attachEvent) {
obj.attachEvent('on' + evt, func);
}
}
function showTopLink() {
if(document.getElementById('body_wrap')){
var viewPortHeight = parseInt(document.documentElement.clientHeight);
var scrollHeight = parseInt(document.body.getBoundingClientRect().top);
var basew = parseInt(document.getElementById('body_wrap').clientWidth);
var sw = document.getElementById('scrolltop').clientWidth;
if (basew < 1000) {
var left = parseInt(fetchOffset(document.getElementById('body_wrap'))['left']);
left = left < sw ? left * 2 - sw : left;
document.getElementById('scrolltop').style.left = ( basew + left ) + 'px';
} else {
document.getElementById('scrolltop').style.left = 'auto';
document.getElementById('scrolltop').style.right = 0;
}
if (BROWSER.ie && BROWSER.ie < 7) {
document.getElementById('scrolltop').style.top = viewPortHeight - scrollHeight - 150 + 'px';
}
if (scrollHeight < -100) {
document.getElementById('scrolltop').style.visibility = 'visible';
} else {
document.getElementById('scrolltop').style.visibility = 'hidden';
}
}
}
function fetchOffset(obj, mode) {
var left_offset = 0, top_offset = 0, mode = !mode ? 0 : mode;
if(obj.getBoundingClientRect && !mode) {
var rect = obj.getBoundingClientRect();
var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);
var scrollLeft = Math.max(document.documentElement.scrollLeft, document.body.scrollLeft);
if(document.documentElement.dir == 'rtl') {
scrollLeft = scrollLeft + document.documentElement.clientWidth - document.documentElement.scrollWidth;
}
left_offset = rect.left + scrollLeft - document.documentElement.clientLeft;
top_offset = rect.top + scrollTop - document.documentElement.clientTop;
}
if(left_offset <= 0 || top_offset <= 0) {
left_offset = obj.offsetLeft;
top_offset = obj.offsetTop;
while((obj = obj.offsetParent) != null) {
position = getCurrentStyle(obj, 'position', 'position');
if(position == 'relative') {
continue;
}
left_offset += obj.offsetLeft;
top_offset += obj.offsetTop;
}
}
return {'left' : left_offset, 'top' : top_offset};
}
function brandmode(){
IT618_BRAND.get("https://www.xiaoyanren.com/plugin.php?id=it618_brand:ajax&formhash=b1b1ea03", {ac:"brandmode"},function (data, textStatus){
if(data=="ok"){
location.reload();
}
}, "html");
}