码迷,mamicode.com
首页 > Web开发 > 详细

框架-Jquerychange事件数值计算

时间:2015-11-27 10:30:56      阅读:149      评论:0      收藏:0      [点我收藏+]

标签:

//优惠率计算优惠价
            $("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);
            });

框架-Jquerychange事件数值计算

标签:

原文地址:http://www.cnblogs.com/howie/p/4999657.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!