//优惠率计算优惠价
$("body").on("change", "#Rate", function() {
var ratePrice = 0;
var rate=$("#Rate").val();
var sUrl = "/manage/BaseDoMove/GetJsonProduct?ProductCode=" + $("#ProductCodes").val();
var retInfo = eval("(" + $.asAjaxPost(sUrl, {}) + ")");
var lessonCostPrice = "";
$.each(retInfo, function(n, value) {
lessonCostPrice += value.LessonCostPrice;
});
ratePrice = (rate / 100) * lessonCostPrice;
$("#RatePrice").val(ratePrice);
});
//优惠价计算优惠率
$("body").on("change", "#RatePrice", function() {
var rate = 0;
var ratePrice=$("#RatePrice").val();
var sUrl = "/manage/BaseDoMove/GetJsonProduct?ProductCode=" + $("#ProductCodes").val();
var retInfo = eval("(" + $.asAjaxPost(sUrl, {}) + ")");
var lessonCostPrice = "";
$.each(retInfo, function(n, value) {
lessonCostPrice += value.LessonCostPrice;
});
rate = (ratePrice / lessonCostPrice) * 100;
$("#Rate").val(rate);
});
转载于:https://www.cnblogs.com/howie/p/4999657.html