diff --git a/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js b/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js index e8f6a8d8185ca16bf32e823b9c38341b82646f6f..741879f0995e15fcd640a324d055c726dbbd7361 100644 --- a/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js +++ b/shop/src/main/resources/template/js/keepFitOrder/keepFitOrderAdd.js @@ -36,6 +36,7 @@ layui.config({ } }); + var carHasMealList = []; // 车辆信息变化 form.on('select(memberCar)', function(data) { var val = data.value; @@ -45,6 +46,7 @@ layui.config({ // 获取车辆用于的套餐信息 AjaxPostUtil.request({url: shopBasePath + "queryMealMationByCarId", params: {carId: val}, type: 'json', method: "GET", callback: function(json){ if(json.returnCode == 0){ + carHasMealList = [].concat(json.rows); $("#mealId").html(getDataUseHandlebars(selOption, json)); form.render('select'); }else{ @@ -54,6 +56,19 @@ layui.config({ } }); + // 套餐变化 + form.on('select(mealId)', function(data) { + var val = data.value; + if(isNull(val)){ + $("#mealExplain").html(""); + $("#mealConsume").html(""); + }else{ + var item = getInPoingArr(carHasMealList, "id", val, null); + $("#mealExplain").html(item.mealExplain); + $("#mealConsume").html(item.mealConsume); + } + }); + textool.init({ eleId: 'remark', maxlength: 400, diff --git a/shop/src/main/resources/template/tpl/keepFitOrder/keepFitOrderAdd.html b/shop/src/main/resources/template/tpl/keepFitOrder/keepFitOrderAdd.html index dc44e18d6ce4a0e62d0b3d4e5b68f46372777f43..b62a20ac76a9fbaf218a29412b018ef7794824e8 100644 --- a/shop/src/main/resources/template/tpl/keepFitOrder/keepFitOrderAdd.html +++ b/shop/src/main/resources/template/tpl/keepFitOrder/keepFitOrderAdd.html @@ -31,7 +31,7 @@