// (function() { // var bp = document.createElement('script'); // var curProtocol = window.location.protocol.split(':')[0]; // if (curProtocol === 'https') { // bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; // } else { // bp.src = 'http://push.zhanzhang.baidu.com/push.js'; // } // var s = document.getElementsByTagName("script")[0]; // s.parentNode.insertBefore(bp, s); // })(); let titleAlt = document.title let pinpai = "" var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?583ee22dd97d57ccd5f3eeefe1b7eff4"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); // var _hmt = _hmt || []; // (function() { // var hm = document.createElement("script"); // hm.src = "https://hm.baidu.com/hm.js?a9e5192f706841629c92eec6d806af5b"; // var s = document.getElementsByTagName("script")[0]; // s.parentNode.insertBefore(hm, s); // })(); //详询需求 var staticprice; var name; var qq; var fileName = window.location.href; var obj = fileName.lastIndexOf("/"); var gpls = "2-" + fileName.substr(obj + 1).substring(0, 12) + ".do"; var aaaa=fileName.substr(obj + 1).substring(0, 12); function returnqq(hydm, name) { if (hydm == '0001609' && name == '贾长铎') { return '357736667'; } if (hydm == '0001609' && name == '朱晓林') { return '3529958968'; } if (hydm == '0001609' && name == '李昀茜') { return '2285546320'; } if (hydm == '0001609' && name == '郎艳') { return '1422551469'; } if (hydm == '0001609' && name == '王卓') { return '1602301564'; } if (hydm == '0001609' && name == '王秋月') { return '2443873679'; } if (hydm == '0001609' && name == '李艳艳') { return '467729810'; } if (hydm == '0001609' && name == '王兴华') { return '467452263'; } if (hydm == '0001609' && name == '臧霞') { return '2714181403'; } if (hydm == '0001609' && name == '姚秋池') { return '1849437684'; } } var shopid //详询需求 end $(document).ready(function() { // var myprovince = returnCitySN['cname']; // var mys = myprovince.split("省"); // var '' = '辽宁' shopid = getParameter("shopid").substring(0,7); if(shopid == null || shopid == "" ){ $.ajax({ type: "post", url: "http://www.mrobay.com/xianhuo/pick/show/1-" + aaaa + ".do?jsoncallback=?", async: true, dataType: "jsonp", data: { 'htmlflag': 'true' }, success: function (ob) { shopid =ob[0].zyinfo.hydm indexxx(shopid) } }); } $.ajax({ type: "post", url: "http://www.mrobay.com/bsplatform/shop/" + shopid + "/" + gpls + "?jsoncallback=?", async: false, dataType: "jsonp", data: { 'htmlflag': 'true' }, success: function(ob) { if(ob[0].user.mbname == '青岛恒信动力科技有限公司'){ ob[0].user.mbname='高品智机床工具一站式解决方案供应链' } msfp(ob[0].user.hydm, ''); $("#fzr").html(ob[0].shopBean.fuser); $("#fzrdh").html(ob[0].shopBean.ftel); $("#fzrqq").html(ob[0].shopBean.im1); $("#gsdh").html(ob[0].user.coptel); // showmbscoreType("http://www.mrobay.com/scplatform", ob[0].user.hydm, "mbscore", "1", "1", ob[0].user.mbname); // $.ajax({ // type: "post", // url: "http://47.105.148.55/spxiangqing?gpls=" + gpls + "&shopid=" + shopid + "&jsoncallback=?", // dataType: "jsonp", // success: function (ob4) { // console.log(ob4) // } // }); //评价 $.ajax({ type: "POST", url: "http://www.mrobay.com/forbaidu", dateType: "json", data: { 'spu_hydm': ob[0].user.hydm, 'li': ob[0].user.hydm }, success: function(data) { var JsonObjs = eval("(" + data + ")"); pinpai = JsonObjs[0].cd + "轴承" $(".carousel5 img").each(function(){ $(this).attr('alt', pinpai); }); $(".carousel6 img").each(function(){ $(this).attr('alt', pinpai); }); $("#ljpj2").html("累计评价(" + JsonObjs.length + ")") var plHtml = ""; for (var i = 0; i < JsonObjs.length; i++) { /*图片 */ var tp = JsonObjs[i]['hf']; var strs = new Array(); //定义一数组 if (tp.length > 0) { strs = tp.split("```"); //字符分割 for (j = 0; j < strs.length - 1; j++) { var path = "http://www.mrobay.com/webresource" + strs[j]; } } /*追加图片 */ var tp1 = JsonObjs[i]['zjimg']; var strs1 = new Array(); //定义一数组 if (tp1.length > 0) { strs1 = tp1.split("```"); //字符分割 for (j = 0; j < strs1.length - 1; j++) { var path = "http://www.mrobay.com/webresource" + strs1[j]; //gAlert(path); } } var sj = JsonObjs[i]['pfrq']; var sj2 = sjFormat(sj); var hydm = JsonObjs[i]['hydm']; var first = hydm.substr(0, 1); var last = hydm.substr(hydm.length - 1, 1); var hzname = first + "****" + last + "(匿名)"; var img = ""; var sd = ""; if (strs.length > 0) { img += "
【追加评价】:" + JsonObjs[i]['zjpl'] + "
"; } var mjhf = ""; if (JsonObjs[i]['mjhf'] != "") { var hjy = JsonObjs[i]['mjhf'] == '评价方未及时做出评价,系统默认好评!' ? '好评' : JsonObjs[i]['mjhf'] mjhf += "卖家回复:" + hjy + "
"; } var hpghp = JsonObjs[i]['remark'] == '请输入您对商品的评价' ? '好评' : JsonObjs[i]['remark']; hpghp = hpghp == '评价方未及时做出评价,系统默认好评!' ? '好评' : hpghp; if (hpghp == '好评') { switch (Math.floor(Math.random() * 10)) { case 0: hpghp = '物流很快,发票到的也快,商家服务态度非常好,非常耐心'; break; case 1: hpghp = '服务不错 发货很快 是正品'; break; case 2: hpghp = '发货及时,货新'; break; case 3: hpghp = '正品,价格很好'; break; case 4: hpghp = '有华夏银行担保,买的很放心,卖家服务也很好,期待下次采购'; break; case 5: hpghp = '轴承很好,发货及时,好评~~'; break; case 6: hpghp = '卖家发货速度快,物流也快,希望长期合作'; break; case 7: hpghp = '服务很周到,发票开的也及时,货到付款,很放心'; break; case 8: hpghp = '正品轴承,质量没问题,客服也很专业'; break; case 9: hpghp = '质量很好,信得过,操作也很方便'; break; } } plHtml += "![" +ob[0].source.cd + " " + ob[0].source.pm+"](http://www.mrobay.com/webresource/htmlpage/images/sp3/huiyuantu1.png)
" + "
");
}else if(ob22[0].wzpzList.ref0.indexOf("调心球轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("圆柱滚子轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("调心滚子轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("滚针轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("角接触球轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("圆锥滚子轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("推力球轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("推力调心滚子轴承") != -1){
$("#showbox").html("
");
}
}
} else {
//$("#dlname").html(source.dlname == '' ? '暂无数据' : source.dlname).attr("title", source.dlname);
if ($("#dlname").html() == '') {
$("#dlname").html(source.dlname == '' ? '暂无数据' : source.dlname).attr("title", source.dlname);
}
$("#wzstr01").html(source.wzstr01 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr01 + "mm");
$("#wzstr02").html(source.wzstr02 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr02 + "mm");
$("#wzstr03").html(source.wzstr03 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr03 + "mm");
$("#wznum01").html(source.wznum01 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wznum01 + "kg");
}
}
});
// $("#stockAccuracy").html(getKcjzd(source.price18))
//面包屑
$("#mbx_xh").html(source.cd + "_" + source.pm).attr("title", source.cd + source.pm);
$("#mbx_gs").html(ob[0].user.mbname + " >").attr("title", ob[0].user.mbname).attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
if (ob[0].user.mbname == '陌贝自营') {
$("#mbx_gs").html("陌贝自营" + " >").attr("title", ob[0].user.mbname).attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
$("#sjlb").html("陌贝自营");
$("#sjlb2").html("陌贝自营");
}
if (source.longData != null && source.longData != "") {
$("#beizhu").html("【" + source.longData + "】");
} else if (source.opt1 == '嘉瑞') {
$("#beizhu").html("【满500接单】");
}
if (source.isxg == '1') {
//$("#ljgm").attr("style","display:none");
}
if (ob[0].user2 == null) {
$("#ljgm").attr("onclick", "tologin()");
$("#gwc").attr("onclick", "tologin()");
$("#gwc2").attr("onclick", "tologin()");
} else if (ob[0].user2.menber.qxgid == 'M00000' || ob[0].user2.menber.qxgid == 'M00001') {
$("#ljgm").attr("onclick", "toRZ()");
$("#gwc").attr("onclick", "toRZ()");
$("#gwc2").attr("onclick", "toRZ()");
} else {
$("#gwc").attr("onclick", "do_shopping('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "')");
$("#gwc2").attr("onclick", "do_shopping('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "')");
$("#ljgm").attr("onclick", "gwc('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "','" + source.cd + "')");
}
if (source.blogoimg == "" && source.mlogoimg == "" && source.slogoimg == "" && source.logoimg1 == "" && source.logoimg2 == "") {
if($("#dlname").html() != '' && $("#dlname").html() != '暂无数据'){
if($("#dlname").html().indexOf("深沟球轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("调心球轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("圆柱滚子轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("调心滚子轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("滚针轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("角接触球轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("圆锥滚子轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("推力球轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("推力调心滚子轴承") != -1){
$("#showbox").html("
");
}
}else{
$("#showbox").html("
");
}
} else {
$("#showbox").html("");
if (source.blogoimg != "") {
$("#showbox").html($("#showbox").html() + "【追加评价】:" + JsonObjs[i]['zjpl'] + "
"; } var mjhf = ""; if (JsonObjs[i]['mjhf'] != "") { var hjy = JsonObjs[i]['mjhf'] == '评价方未及时做出评价,系统默认好评!' ? '好评' : JsonObjs[i]['mjhf'] mjhf += "卖家回复:" + hjy + "
"; } var hpghp = JsonObjs[i]['remark'] == '请输入您对商品的评价' ? '好评' : JsonObjs[i]['remark']; hpghp = hpghp == '评价方未及时做出评价,系统默认好评!' ? '好评' : hpghp; if (hpghp == '好评') { switch (Math.floor(Math.random() * 10)) { case 0: hpghp = '物流很快,发票到的也快,商家服务态度非常好,非常耐心'; break; case 1: hpghp = '服务不错 发货很快 是正品'; break; case 2: hpghp = '发货及时,货新'; break; case 3: hpghp = '正品,价格很好'; break; case 4: hpghp = '有华夏银行担保,买的很放心,卖家服务也很好,期待下次采购'; break; case 5: hpghp = '轴承很好,发货及时,好评~~'; break; case 6: hpghp = '卖家发货速度快,物流也快,希望长期合作'; break; case 7: hpghp = '服务很周到,发票开的也及时,货到付款,很放心'; break; case 8: hpghp = '正品轴承,质量没问题,客服也很专业'; break; case 9: hpghp = '质量很好,信得过,操作也很方便'; break; } } plHtml += "!["+ob[0].source.cd + " " + ob[0].source.pm +"](http://www.mrobay.com/webresource/htmlpage/images/sp3/huiyuantu1.png)
" + "
");
}else if(ob22[0].wzpzList.ref0.indexOf("调心球轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("圆柱滚子轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("调心滚子轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("滚针轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("角接触球轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("圆锥滚子轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("推力球轴承") != -1){
$("#showbox").html("
");
}else if(ob22[0].wzpzList.ref0.indexOf("推力调心滚子轴承") != -1){
$("#showbox").html("
");
}
}
} else {
//$("#dlname").html(source.dlname == '' ? '暂无数据' : source.dlname).attr("title", source.dlname);
if ($("#dlname").html() == '') {
$("#dlname").html(source.dlname == '' ? '暂无数据' : source.dlname).attr("title", source.dlname);
}
$("#wzstr01").html(source.wzstr01 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr01 + "mm");
$("#wzstr02").html(source.wzstr02 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr02 + "mm");
$("#wzstr03").html(source.wzstr03 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wzstr03 + "mm");
$("#wznum01").html(source.wznum01 == '' || source.wzstr01 == 0 ? '暂无数据' : source.wznum01 + "kg");
}
}
});
//$("#stockAccuracy").html(getKcjzd(source.price18))
//面包屑
$("#mbx_xh").html(source.cd + "_" + source.pm).attr("title", source.cd + source.pm);
$("#mbx_gs").html(ob[0].user.mbname + " >").attr("title", ob[0].user.mbname).attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
if (ob[0].user.mbname == '陌贝自营') {
$("#mbx_gs").html("陌贝自营" + " >").attr("title", ob[0].user.mbname).attr("href", "http://www.mrobay.com/shangcheng/" + shopid+"/spxhd.html");
$("#sjlb").html("陌贝自营");
$("#sjlb2").html("陌贝自营");
}
if (source.longData != null && source.longData != "") {
$("#beizhu").html("【" + source.longData + "】");
} else if (source.opt1 == '嘉瑞') {
$("#beizhu").html("【满1200接单】");
}
if (source.isxg == '1') {
//$("#ljgm").attr("style","display:none");
}
if (ob[0].user2 == null) {
$("#ljgm").attr("onclick", "tologin()");
$("#gwc").attr("onclick", "tologin()");
$("#gwc2").attr("onclick", "tologin()");
} else if (ob[0].user2.menber.qxgid == 'M00000' || ob[0].user2.menber.qxgid == 'M00001') {
$("#ljgm").attr("onclick", "toRZ()");
$("#gwc").attr("onclick", "toRZ()");
$("#gwc2").attr("onclick", "toRZ()");
} else {
$("#gwc").attr("onclick", "do_shopping('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "')");
$("#gwc2").attr("onclick", "do_shopping('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "')");
$("#ljgm").attr("onclick", "gwc('" + source.gpls + "','" + source.sl00 + "','" + source.sl2 + "','" + ob[0].user2.hydm + "','" + 2 + "','" + source.hydm + "','" + source.cd + "')");
}
if("0020361" == source.hydm){
$("#showbox").html("");
// if (source.blogoimg != "") {
$("#showbox").html($("#showbox").html() + "
");
// }
// if (source.mlogoimg != "") {
$("#showbox").html($("#showbox").html() + "
");
// }
// if (source.slogoimg != "") {
$("#showbox").html($("#showbox").html() + "
");
// }
// if (source.logoimg1 != "") {
$("#showbox").html($("#showbox").html() + "
");
// }
// if (source.logoimg2 != "") {
$("#showbox").html($("#showbox").html() + "
");
// }
}else if (source.blogoimg == "" && source.mlogoimg == "" && source.slogoimg == "" && source.logoimg1 == "" && source.logoimg2 == "") {
if($("#dlname").html() != '' && $("#dlname").html() != '暂无数据'){
if($("#dlname").html().indexOf("深沟球轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("调心球轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("圆柱滚子轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("调心滚子轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("滚针轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("角接触球轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("圆锥滚子轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("推力球轴承") != -1){
$("#showbox").html("
");
}else if($("#dlname").html().indexOf("推力调心滚子轴承") != -1){
$("#showbox").html("
");
}
}else{
$("#showbox").html("
");
}
} else {
$("#showbox").html("");
if (source.blogoimg != "") {
$("#showbox").html($("#showbox").html() + "
";
$("#" + id).html(html);
$("#" + id + "2").html(html);
} else {
var docpath = "http://www.mrobay.com/webresource/images/integral";
var url = "";
if (typ == null || typ == undefined || typ == "") {
typ = "1";
}
if (typ == "1") {
url = scpath + "/scp/score/mbscore.do?jsoncallback=?";
} else if (typ == "2") {
url = scpath + "/scm/score/mbscore.do?jsoncallback=?";
}
$.post(url, { "hydm": mbcode, "docpath": docpath, "flag": flag }, function(result) {
try {
var msg = result[0];
$("#" + id).html(msg);
$("#" + id + "2").html(msg);
} catch (e) {
}
}, "json");
}
}
function gwc(gpls, zdcgl, kc, sessionid, flag01, hydm, qq) {
if (staticprice == "详询") {
//alert("请与在线客服咨询商品信息,再进行采购!");
var r = confirm("请与在线客服咨询商品信息,再进行采购!")
if (r == true) {
qqjt('1', $("#fzrqq").html());
} else {
return;
}
return;
}
var cando = sessionid == hydm ? '0' : '1';
if (cando == "0") {
gAlert("该商品为您本公司发布的商品,不能进行采购");
return;
}
if (!checksl(zdcgl, kc)) {
return false;
}
var jsons = new Array();
var json = {};
json.gpls = gpls;
json.sl = jQuery("#cgs").val();
json.flag01 = '2';
jsons[jsons.length] = json;
gConfirm1('该商品价格供参考,建议您先进行议价后再采购!', function doYes() {
layer_close();
validateLogin("http://www.mrobay.com/pages/htmlpage/app/hangsource/buy/picksource/pickInput.html?jsonstring=" + JSON.stringify(jsons), true);
}, function doNo() {
layer_close();
qqTz(hydm, qq);
});
}
function checksl(zdcgl, kc) {
//购买数量
var sl = jQuery("#cgs").val();
if (zdcgl == null || zdcgl == "" || zdcgl == undefined) {
gAlert("最少起订量为空!");
return false;
}
if (kc == null || kc == "" || kc == undefined) {
gAlert("库存为空!");
return false;
}
var r = /^[0-9]*[1-9][0-9]*$/ //正整数
if (!r.test(sl)) {
gAlert("采购数必须为正整数!");
return false;
} else {
if (parseFloat(sl) < parseFloat(zdcgl)) {
gAlert("采购数不能小于最低购买量!");
return false;
}
if (parseFloat(sl) > parseFloat(kc)) {
gAlert("采购数不能大于库存!");
return false;
}
return true;
}
}
function buy(gpls, flag01) {
var jsons = new Array();
var json = {};
json.gpls = gpls;
json.sl = jQuery("#cgs").val();
json.flag01 = '2';
jsons[jsons.length] = json;
validateLogin("http://www.mrobay.com/pages/htmlpage/app/hangsource/buy/picksource/pickInput.html?jsonstring=" + JSON.stringify(jsons), true);
}
function tologin() {
validateLogin("http://www.mrobay.com/bsplatform/pages/htmlpage/app/login/market/login.html", true);
}
function do_shopping(gpls, zdcgl, kc, sessionid, flag01, hydm) {
//详询
if (staticprice == "详询") {
var r = confirm("请与在线客服咨询商品信息,再进行采购!")
if (r == true) {
qqjt('1', $("#fzrqq").html());
} else {
return;
}
return;
}
//详询 end
var sl01 = $("#cgs").val();
var cando = sessionid == hydm ? '0' : '1';
if (cando == "0") {
gAlert("该商品为您本公司发布的商品,不能加入购物车。");
return;
}
if (!checksl(zdcgl, kc)) {
return false;
}
currentAjax = $.ajax({
type: "POST",
url: "http://www.mrobay.com/exp/hangsource/buy/shopping/save.do",
data: { "gpls": gpls, "flag01": flag01, "sl01": sl01, 'htmlflag': 'true' },
dataType: "text",
statusCode: {
302: function() { gAlert("您无权限操作该功能模块!若要开通,请联系管理员。"); }
},
success: function(result2) {
try {
var msg2 = result2;
if ("1" == msg2) {
gAlert("已加入购物车");
return false;
} else if ("0" == msg2) {
gAlert("该商品已经被他人选购或卖方已经撤牌");
return false;
} else {
gAlert("您无权限操作该功能模块!若要开通,请联系管理员。");
return false;
}
} catch (e1) {}
},
error: function(a, b, c) {
gAlert("您无权限操作该功能模块!若要开通,请联系管理员。");
}
});
}
function getContractInfo(hydm, mbname) {
if (hydm == '0001609') {
var currentTime = Date.now();
console.log(new Date().getDate());
var targetTime = (new Date(2018, 9, 9, 0, 0, 0)).getTime();
var offsetTime = targetTime - currentTime;
offsetTime = Math.abs(offsetTime);
var offsetDays = Math.floor(offsetTime / (3600 * 24 * 1e3));
$("#cjbs").html(mrobayNum() + "套");
//$("#cj_price").html((mrobayPrice()).toFixed(2) + "元");
$("#cj_price").html(( mrobayPrice()-1000000000).toFixed(2) + "元");
} else {
$.post("http://www.mrobay.com/exp/contract/sell/manage/getContractInfo.do?jsoncallback=?", { "hzdm": hydm }, function(data) {
try {
var amt = parseFloat(data[0].htamt).toFixed(2);
$("#cjbs").html(parseInt(data[0].spsl) + "套");
$("#cj_price").html(amt + "元");
if (mbname == '陌贝自营') {
var currentTime = Date.now();
console.log(new Date().getDate());
var targetTime = (new Date(2018, 9, 9, 0, 0, 0)).getTime();
var offsetTime = targetTime - currentTime;
offsetTime = Math.abs(offsetTime);
var offsetDays = Math.floor(offsetTime / (3600 * 24 * 1e3));
$("#cjbs").html(parseInt(data[0].spsl) + mrobayNum() + "套");
$("#cj_price").html((parseFloat(amt) + mrobayPrice()).toFixed(2) + "元");
}
} catch (e) {
}
}, "json");
}
}
qqTz = function(hydm, flag) {
$.ajax({
type: "post",
url: "http://www.mrobay.com/exp/hangsource/buy/picksource/getShopInfo.do?jsoncallback=?",
cache: false,
async: false,
dataType: "jsonp",
data: { "hydm": hydm, "brand": flag },
success: function(result) {
window.open("tencent://message/?uin=" + result.im1 + "&Site=陌贝网&Menu=yes");
}
});
}
function getParameter(param) {
var query = window.location.search;
var iLen = param.length;
var iStart = query.indexOf(param);
if (iStart == -1)
return "";
iStart += iLen + 1;
var iEnd = query.indexOf("&", iStart);
if (iEnd == -1)
return query.substring(iStart);
return query.substring(iStart, iEnd);
}
function sjFormat(data) {
var hh = data['hours'];
var mm = data['minutes'];
var ss = data['seconds'];
hh = buwei(hh);
mm = buwei(mm);
ss = buwei(ss);
var day = data['date'];
var month = data['month'] + 1;
var year = data['year'] - 100 + 2000;
return year + "-" + month + "-" + day + " " + hh + ":" + mm + ":" + ss;
}
function buwei(value) {
if (value < 10) {
value = "0" + value;
}
return value;
}
//底部切换、评价切换
function scrollIdx() {
var h1 = $(".tab_wrap .t_wrap:eq(0)").position().top - 40;
var h2 = $("#foot").position().top;
$(".spxxnav ul li").bind("click", function() {
var idx = $(".spxxnav ul li").index($(this));
$(this).addClass("li1").siblings().removeClass("li1");
if (idx == 3) {
//商铺商品详情评价
$("html, body").animate({ scrollTop: $("#ljpj").position().top }, 120);
} else {
$("html, body").animate({ scrollTop: $(".tab_wrap .t_wrap:eq(" + idx + ")").position().top }, 120);
}
});
$(".gongsidi a").bind("click", function() {
var idx = $(".gongsidi a").index($(this));
switch (idx) {
case 1:
$(".spxxnav ul li").eq(0).trigger("click");
break;
case 2:
$(".spxxnav ul li").eq(1).trigger("click");
break;
case 3:
$(".spxxnav ul li").eq(2).trigger("click");
break;
}
});
$(window).scroll(function() {
var h = $(window).scrollTop();
//console.log(h+" "h2);
if (h > h1) {
$(".gongsidi").fadeIn();
} else {
$(".gongsidi").hide();
}
});
//评价切换
$(".pjnr1 li").bind("click", function() {
var idx = $(".pjnr1 li").index($(this));
$(this).addClass("on").siblings().removeClass("on");
//处理评价切换
});
}
function toPickList() {
window.location.href = "http://www.mrobay.com/pages/htmlpage/app/hangsource/buy/picksource/pickList.html?keyword=" + $("#yid").val();
}
function toPickList2() {
validateLogin("http://www.mrobay.com/shop/spxhd.html?shopid=" + getParameter('shopid') + "&select=" + $('#yid').val(), false);
}
function carouselN(d, n, a) {
var dom1 = '.' + d
var num = $(dom1).children("li").length
if (num > 1) {
var i = 0
setInterval(function showHide() {
if (i < num - 1) {
i++
} else if (i = num - 1) {
i = 0
}
console.log(i)
$(dom1).children("li").eq(i).fadeIn(n)
$(dom1).children("li").eq(i).siblings('li').fadeOut(n)
}, 3000);
}
}
carouselN('carousel5', 700, 0)
carouselN('carousel6', 700, 0)
$(function() {
var obj = new commentMove('.tm-m-photos', '.tm-m-photo-viewer');
obj.init()
})
var levelstar = GetQueryString('levelstar');
function GetQueryString(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
// 库存准确度
function getKcjzd(price18) {
var listHtml = '';
if (price18 == 5) {
listHtml += '