锘?/181228澧炲姞鏀逛环鍘熷洜鏄剧ず
//181227_zhu鏂板璐墿杞︽€昏锛屾洿鏀逛负鏍规嵁椤甸潰鍍忕礌鎵цtop楂樺害
//20170427 淇敼浠锋牸闄愬埗
//20190118
function setTab(m, n) {
var tli = document.getElementById("menu" + m).getElementsByTagName("li");
var mli = document.getElementById("main" + m).getElementsByTagName("ul");
for (i = 0; i < tli.length; i++) {
tli[i].className = i == n ? "hover" : "";
mli[i].style.display = i == n ? "block" : "none";
}
}
$(document).ready(function () {
$('.one').click(function () {
$('.box2').show();
});
$('.two').click(function () {
$('.box2_show').show();
});
$('.login5 .close').click(function () {
$('.box2').hide();
});
});
var get = function (id) {
return document.getElementById(id);
};
window.onload = function () {
get("one").onclick = function () {
get("close").disabled = true;
setInterval(
function () {
get("close").disabled = false;
}, 5000);
};
};
$(function () {
$('.one').click(function () {
var count = 5;
var countdown = setInterval(CountDown, 1000);
function CountDown() {
$(".close").attr("disabled", true);
$(".cancel").attr("disabled", true);
$(".btn-time").attr("disabled", true);
//$("#coun").val("Please wait " + count + " seconds!");
$("#second_show").html('' + count + '绉?);
if (count == 0) {
$(".close").removeAttr("disabled");
$(".cancel").removeAttr("disabled");
$(".btn-time").removeAttr("disabled");
clearInterval(countdown);
}
count--;
}
})
});
$(document).ready(function () {
jQuery.fn.extend({
center: function (width, height) {
return $(this).css("left", ($(window).width() - width) / 2 + $(window).scrollLeft()).
css("top", ($(window).height() - height) / 2 + $(window).scrollTop()).
css("width", width).
css("height", height);
}
});
});
/* payfor */
/** jQuery Calculation Plug-in**/
(function ($) {
var defaults = {
reNumbers: /(-|-\$)?(\d+(,\d{3})*(\.\d{1,})?|\.\d{1,})/g, cleanseNumber: function (v) {
return v.replace(/[^0-9.\-]/g, "");
}, useFieldPlugin: (!!$.fn.getValue), onParseError: null, onParseClear: null
};
$.Calculation = {
version: "0.4.07", setDefaults: function (options) {
$.extend(defaults, options);
}
};
$.fn.parseNumber = function (options) {
var aValues = [];
options = $.extend(options, defaults);
this.each(function () {
var $el = $(this), sMethod = ($el.is(":input") ? (defaults.useFieldPlugin ? "getValue" : "val") : "text"), v = $.trim($el[sMethod]()).match(defaults.reNumbers, "");
if (v == null) {
v = 0;
if (jQuery.isFunction(options.onParseError)) options.onParseError.apply($el, [sMethod]);
$.data($el[0], "calcParseError", true);
} else {
v = options.cleanseNumber.apply(this, [v[0]]);
if ($.data($el[0], "calcParseError") && jQuery.isFunction(options.onParseClear)) {
options.onParseClear.apply($el, [sMethod]);
$.data($el[0], "calcParseError", false);
}
}
aValues.push(parseFloat(v, 10));
});
return aValues;
};
$.fn.calc = function (expr, vars, cbFormat, cbDone) {
var $this = this, exprValue = "", precision = 0, $el, parsedVars = {}, tmp, sMethod, _, bIsError = false;
for (var k in vars) {
expr = expr.replace((new RegExp("(" + k + ")", "g")), "_.$1");
if (!!vars[k] && !!vars[k].jquery) {
parsedVars[k] = vars[k].parseNumber();
} else {
parsedVars[k] = vars[k];
}
}
this.each(function (i, el) {
var p, len;
$el = $(this);
sMethod = ($el.is(":input") ? (defaults.useFieldPlugin ? "setValue" : "val") : "text");
_ = {};
for (var k in parsedVars) {
if (typeof parsedVars[k] == "number") {
_[k] = parsedVars[k];
} else if (typeof parsedVars[k] == "string") {
_[k] = parseFloat(parsedVars[k], 10);
} else if (!!parsedVars[k] && (parsedVars[k] instanceof Array)) {
tmp = (parsedVars[k].length == $this.length) ? i : 0;
_[k] = parsedVars[k][tmp];
}
if (isNaN(_[k])) _[k] = 0;
p = _[k].toString().match(/\.\d+$/gi);
len = (p) ? p[0].length - 1 : 0;
if (len > precision) precision = len;
}
try {
exprValue = eval(expr);
if (precision) exprValue = Number(exprValue.toFixed(Math.max(precision, 4)));
if (jQuery.isFunction(cbFormat)) {
var tmp = cbFormat.apply(this, [exprValue]);
if (!!tmp) exprValue = tmp;
}
} catch (e) {
exprValue = e;
bIsError = true;
}
$el[sMethod](exprValue.toString());
});
if (jQuery.isFunction(cbDone)) cbDone.apply(this, [this]);
return this;
};
$.each(["sum", "avg", "min", "max"], function (i, method) {
$.fn[method] = function (bind, selector) {
if (arguments.length == 0) return math[method](this.parseNumber());
var bSelOpt = selector && (selector.constructor == Object) && !(selector instanceof jQuery);
var opt = bind && bind.constructor == Object ? bind : { bind: bind || "keyup", selector: (!bSelOpt) ? selector : null, oncalc: null };
if (bSelOpt) opt = jQuery.extend(opt, selector);
if (!!opt.selector) opt.selector = $(opt.selector);
var self = this, sMethod, doCalc = function () {
var value = math[method](self.parseNumber(opt));
if (!!opt.selector) {
sMethod = (opt.selector.is(":input") ? (defaults.useFieldPlugin ? "setValue" : "val") : "text");
opt.selector[sMethod](value.toString());
}
if (jQuery.isFunction(opt.oncalc)) opt.oncalc.apply(self, [value, opt]);
};
doCalc();
return self.bind(opt.bind, doCalc);
}
});
var math = {
sum: function (a) {
var total = 0, precision = 0;
$.each(a, function (i, v) {
var p = v.toString().match(/\.\d+$/gi), len = (p) ? p[0].length - 1 : 0;
if (len > precision) precision = len;
total += v;
});
if (precision) total = Number(total.toFixed(precision));
return total;
}, avg: function (a) {
return math.sum(a) / a.length;
}, min: function (a) {
return Math.min.apply(Math, a);
}, max: function (a) {
return Math.max.apply(Math, a);
}
};
})(jQuery);
/** ------------- choose -------------------- **/
/* reduce_add */
var setAmount = {
min: 1,
max: 999,
reg: function (x) {
return new RegExp("^[1-9]\\d*$").test(x);
},
amount: function (obj, mode) {
var x = $(obj).val();
if (this.reg(x)) {
if (mode) {
x++;
} else {
x--;
}
} else {
// alert("璇疯緭鍏ユ纭殑鏁伴噺锛?);
$(obj).val(1);
$(obj).focus();
}
return x;
},
reduce: function (obj) {
var x = this.amount(obj, false);
if (x >= this.min) {
$(obj).val(x);
recalc();
} else {
alert("鍟嗗搧鏁伴噺鏈€灏戜负" + this.min);
$(obj).val(1);
$(obj).focus();
}
},
add: function (obj) {
var x = this.amount(obj, true);
if (x <= this.max) {
$(obj).val(x);
recalc();
} else {
alert("鍟嗗搧鏁伴噺鏈€澶氫负" + this.max);
$(obj).val(999);
$(obj).focus();
}
},
modify: function (obj) {
var x = $(obj).val();
if (x < this.min || x > this.max || !this.reg(x)) {
// alert("璇疯緭鍏ユ纭殑鏁伴噺锛?);
$(obj).val(1);
$(obj).focus();
}
}
}
function BuyUrl(wid) {
var pcounts = $("input[id^=qty_item_]").val();
var patrn = /^[0-9]{1,4}$/;
if (!patrn.exec(pcounts)) {
pcounts = 1;
}
else {
if (pcounts <= 0)
pcounts = 1;
if (pcounts >= 1000)
pcounts = 999;
}
};
function showHideCode(cla) {
$(cla).toggle();
};
function anotherHide(cla1) {
$(cla1).hide();
}
$(function () {
$(".btna1").click(function () {
$(".box2_show").hide();
$(".box2_hide").show();
});
$(".btna2").click(function () {
$(".box2_show").show();
$(".box2_hide").hide();
});
});
document.onkeydown = function () {
if (event.keyCode == 13) {
document.getElementById("ensub").click();
return false;
}
}
$(document).ready(function () {
$("#back").hide() //闅愯棌 back 鎸夐挳
$(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 200) { //褰搘indow鐨剆crolltop璺濈澶т簬1鏃讹紝go to top鎸夐挳娣″嚭锛屽弽涔嬫贰鍏
$("#back").fadeIn();
} else {
$("#back").fadeOut();
}
});
});
// 缁 back 鎸夐挳涓€涓偣鍑讳簨浠
$("#back a").click(function () {
$("html,body").animate({
scrollTop: 0
}, 300); //鐐瑰嚮back鎸夐挳鏃讹紝浠?00鐨勯€熷害鍥炲埌椤堕儴锛岃繖閲岀殑300鍙互鏍规嵁浣犵殑闇€姹備慨鏀
return false;
});
//181227_zhu鏂板璐墿杞︽€昏锛屾洿鏀逛负鏍规嵁椤甸潰鍍忕礌鎵цtop楂樺害
var ksqy=$(window).height()-45;
$("#zongji").css("top",""+ksqy+"px");
$(window).scroll(function() {
var top = $(this).scrollTop();
$("#zongji").css("top", ksqy + top + "px");
});
});
$(function () {
$(".opener").click(function () {
$("#dialogLog_ty")
.dialog("option", "title", "澧炲姞渚涘簲鍟?)
.dialog("option", "height", 500)
.dialog("option", "width", 600)
.dialog("option", "modal", true)
.dialog("open");
$(".d2")
.dialog("option", "title", "鏂板")
.dialog("open");
$(".d3")
.dialog("option", "title", "淇敼鍗曟嵁")
.dialog("option", "height", 500)
.dialog("option", "width", 850)
.dialog("open");
$(".d4")
.dialog("option", "title", "璇锋偍閫夋嫨璇鹃鍗″彿")
.dialog("option", "height", 420)
.dialog("open");
$(".d5")
.dialog("option", "height", 600)
.dialog("option", "width", 1000)
.dialog("open");
});
$(".cancel").click(function () {
$(".d5").dialog("close");
});
$(".datepicker").datepicker({
changeMonth: true,
changeYear: true,
showWeek: true,
firstDay: 1
});
$(".datepicker").datepicker("option", "dateFormat", "yy-mm-dd");
});
//鍟嗗搧璇︽儏鍒囨崲鏍囩
function changeTab(v) {
$("div[id^='tab']").each(function () {
$(this).addClass("none")
});
$("#" + v).removeClass("none");
var v1 = v.replace("tab", "a");
$("a[id^='a']").each(function () {
$(this).removeClass("fontwb")
});
$("#" + v1).addClass("fontwb");
}
//涓婁紶js
function up(v) {
$("#" + v + "_file").trigger("click");
}
function fileSelected(v) {
var file = document.getElementById(v + "_file").files[0];
if (file) {
var fileSize = 0;
if (file.size > 1024 * 1024)
fileSize = (Math.round(file.size * 100 / (1024 * 1024)) / 100).toString() + 'MB';
else
fileSize = (Math.round(file.size * 100 / 1024) / 100).toString() + 'KB';
$("#" + v + "_name").html(file.name);
$("#" + v + "_size").html("鎬诲ぇ灏忥細" + fileSize);
}
$("#" + v + "_sub").trigger("click");
// $("#" + v + "_form").submit();
}
//浠锋牸淇敼
function ghs_change_price(vid, vprice, v) {
$("#" + vid).removeAttr("readonly");
$("#" + vid).css("border-bottom", "2px ridge");
var t = $("#" + vid).val();
$("#" + vid).val("").focus().val(t);
$("#a" + v + "_change").addClass("none");
$("#a" + v + "_confirm").removeClass("none");
//181228澧炲姞鏀逛环鍘熷洜鏄剧ず
$("#yy" + v).css("display", "block");
}
//181228澧炲姞鏀逛环鍘熷洜鏄剧ず
function ghs_confirm_price(vid, vprice, v) {
if (isNaN($("#" + vid).val())) {
alert("璇疯緭鍏ユ纭环鏍?);
var t = $("#" + vid).val();
$("#" + vid).val("").focus().val(t);
}
else {
if (parseFloat($("#" + vid).val()) > parseFloat(vprice)) {
// alert("淇敼浠锋牸澶т簬鍗曚环锛岃閲嶆柊杈撳叆");
// var t = $("#" + vid).val();
// $("#" + vid).val("").focus().val(t);
//181225淇敼_zhu锛堢洰鐨勪负瓒呭嚭褰撳墠浠锋牸鍚庤繘鍏ュ鎵规祦绋嬶級
if($("#yy" + v).val()=="" || $("#yy" + v).val()==null)
{
alert("淇敼浠锋牸澶т簬鍗曚环锛岃杈撳叆鏀逛环鍘熷洜");
}
else
{
if(confirm("璇锋偍纭鎮ㄥ凡涓庤喘涔颁汉鍗忓晢涓€鑷达紝鏄惁缁х画锛?))
{
$("#" + vid).attr("readonly", "readonly");
$("#" + vid).css("border-bottom", "0px ridge");
$("#a" + v + "_confirm").addClass("none");
$("#a" + v + "_change").removeClass("none");
$("#alt_id").val(v);
$("#alt_price").val($("#" + vid).val());
$("#alt_gjyy").val($("#yy" + v).val());
$("#alt_price_sub").trigger("click");
}
else
{
var t = $("#" + vid).val();
$("#" + vid).val("").focus().val(t);
}
}
}
else {
$("#" + vid).attr("readonly", "readonly");
$("#" + vid).css("border-bottom", "0px ridge");
$("#a" + v + "_confirm").addClass("none");
$("#a" + v + "_change").removeClass("none");
$("#alt_id").val(v);
$("#alt_price").val($("#" + vid).val());
$("#alt_price_sub").trigger("click");
}
}
}
//20190118
function ghs_confirm_qxdd(vid) {
if ($("#qxyy" + vid).val()=="" || $("#qxyy" + vid).val()==null) {
alert("璇疯緭鍏ュ彇娑堣鍗曞師鍥?);
var t = $("#qxyy" + vid).val();
$("#qxyy" + vid).val("").focus().val(t);
}
else {
$("#quxiao_id").val(vid);
$("#alt_qxyy").val($("#qxyy" + vid).val());
$("#alt_quxiao_sub").trigger("click");
}
}
//璋冨墏鍏变韩
function tjgx_publish(vid, vtype, vname) {
if (confirm("纭畾瑕 " + vtype + " " + vname)) {
if (isNaN($("#鏁伴噺" + vid).val()))
alert("璇峰~鍐欐纭暟閲?);
else if (parseFloat($("#鏁伴噺" + vid).val()) < 0)
alert("璇峰~鍐欐纭暟閲?);
else if (parseFloat($("#鏁伴噺" + vid).val()) > parseFloat($("#鍓╀綑閲? + vid).text()))
alert("鍙戝竷鏁伴噺涓嶈兘瓒呰繃瀹為獙瀹ゅ瓨閲忥紝璇烽噸鏂拌緭鍏?);
else {
if (vtype == "鍙戝竷璋冨墏")
$("#tjgx_type").val("璋冨墏");
if (vtype == "鍙戝竷鍏变韩")
$("#tjgx_type").val("鍏变韩");
$("#tjgx_num").val($("#鏁伴噺" + vid).val());
$("#tjgx_id").val(vid);
$("#tjgx_sub").trigger("click");
}
} else return;
}
function tjgx_cancel(vid, vname) {
if (confirm("纭畾瑕佹挙閿€ " + vname)) {
$("#tjgx_type").val("鎾ら攢");
$("#tjgx_id").val(vid);
$("#tjgx_sub").trigger("click");
}
}
function tjgx_detail(v) {
if ($("#spn" + v).text() == "鈭?) {
$("span[id^='spn']").each(function () { $(this).text("鈭?); });
$("table[id^='tbl']").each(function () { $(this).html("");});
$("table[id^='tbl']").each(function () { $(this).addClass("none"); });
$("#spn" + v).text("鈭?);
title = $("#title").html().replace("