作者 耿培杰

修改后台添加商品

... ... @@ -8,13 +8,13 @@
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Category_two_id')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="col-xs-12 col-sm-8 category_two">
<input id="c-category_two_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_two_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Category_three_id')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="col-xs-12 col-sm-8 category_three">
<input id="c-category_three_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_three_id]" type="text" value="">
</div>
</div>
... ...
... ... @@ -8,14 +8,14 @@
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Category_two_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-category_two_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_two_id]" type="text" value="{$row.category_two_id|htmlentities}">
<div class="col-xs-12 col-sm-8 category_two">
<input id="c-category_two_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_two_id]" type="text" value="{$row.category_two_id}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Category_three_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-category_three_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_three_id]" type="text" value="{$row.category_three_id|htmlentities}">
<div class="col-xs-12 col-sm-8 category_three">
<input id="c-category_three_id" data-source="category/selectpage" data-multiple="true" class="form-control selectpage" name="row[category_three_id]" type="text" value="{$row.category_three_id}">
</div>
</div>
<div class="form-group">
... ...
... ... @@ -102,24 +102,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
$('.vip_price').hide();
}
});
$("#c-category_two_id").data("params", function (obj) {
var id = $("#c-category_one_id").val()?$("#c-category_one_id").val():-1;
return {wherein: {pid: id}};
});
$("#c-category_one_id").on('change',function(){
$("#c-category_two_id").val('');
$("#c-category_two_id_text").val('');
$("#c-category_three_id").val('');
$("#c-category_three_id_text").val('');
});
$("#c-category_three_id").data("params", function (obj) {
var id = $("#c-category_two_id").val()?$("#c-category_two_id").val():-1;
return {wherein: {pid: id}};
});
$("#c-category_two_id").on('change',function(){
$("#c-category_three_id").val('');
$("#c-category_three_id_text").val('');
});
},
edit: function () {
Controller.api.bindevent();
... ... @@ -139,38 +121,44 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
$('.group').hide();
}
});
$('#c-is_vip_price').change(function () {
var val = $('#c-is_vip_price').val();
if(val == 1){
$('.vip_price').show();
}else {
$('.vip_price').hide();
}
});
$("#c-category_two_id").data("params", function (obj) {
var id = $("#c-category_one_id").val()?$("#c-category_one_id").val():-1;
return {wherein: {pid: id}};
});
$("#c-category_one_id").on('change',function(){
$("#c-category_two_id").val('');
$("#c-category_two_id_text").val('');
$("#c-category_three_id").val('');
$("#c-category_three_id_text").val('');
});
$("#c-category_three_id").data("params", function (obj) {
var id = $("#c-category_two_id").val()?$("#c-category_two_id").val():-1;
return {wherein: {pid: id}};
});
$("#c-category_two_id").on('change',function(){
$("#c-category_three_id").val('');
$("#c-category_three_id_text").val('');
});
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
$('#c-is_vip_price').change(function () {
var val = $('#c-is_vip_price').val();
if(val == 1){
$('.vip_price').show();
}else {
$('.vip_price').hide();
}
});
$("#c-category_two_id").data("params", function (obj) {
var id = $("#c-category_one_id").val()?$("#c-category_one_id").val():-1;
return {wherein: {pid: id}};
});
$("#c-category_one_id").change(function () {
$("#c-category_two_id").val('');
$("#c-category_two_id_text").val('');
$("#c-category_three_id").val('');
$("#c-category_three_id_text").val('');
$(".category_two .selected_tag").remove();
$(".category_three .selected_tag").remove();
})
// $("#c-category_one_id").on('change',function(){
//
// });
$("#c-category_three_id").data("params", function (obj) {
var id = $("#c-category_two_id").val()?$("#c-category_two_id").val():-1;
return {wherein: {pid: id}};
});
$("#c-category_two_id").on('change',function(){
$("#c-category_three_id").val('');
$("#c-category_three_id_text").val('');
$(".category_three .selected_tag").remove();
console.log(123);
});
}
}
};
... ...