Authored by 陶雨

限购码限定数字输入

... ... @@ -81,7 +81,12 @@ $(document).on("change", ".observe", function () {
});
editBean.limitDateFrom = $("#limitDateFrom").val();
editBean.limitDateTo = $("#limitDateTo").val();
console.log(editBean);
//console.log(editBean);
});
//输入限制
$(".number").on("keyup", function() {
$(this).val($(this).val().replace(/\D/g, ''));
});
$(document).on("click", ".limitProduct", function() {
... ...
... ... @@ -25,7 +25,7 @@
<div class="form-group">
<label class="col-sm-2 control-label">数量<i class="red">*</i></label>
<div class="col-sm-8">
<input type="text" placeholder="数量" class="form-control observe noEdit" data-field="limitTimes" required pattern="^[0-9]+$" value="[[limitTimes]]">
<input type="text" placeholder="数量" class="form-control observe noEdit number" data-field="limitTimes" required pattern="^[0-9]+$" value="[[limitTimes]]">
</div>
</div>
... ... @@ -124,14 +124,14 @@
</div>
<label class="col-sm-3 control-label">SKN值:</label>
<div class="col-sm-4">
<input id="limitSkn" type="text" maxlength="8" placeholder="SKN" class="form-control observe" data-field="limitSkn" value="[[limitSkn]]">
<input id="limitSkn" type="text" maxlength="8" placeholder="SKN" class="form-control observe number" data-field="limitSkn" value="[[limitSkn]]">
</div><br>
<div id="skus" class="col-sm-10" [[selected=="SKU"?"":"hidden"]]>
<table class="table table-bordered responsive dataTable no-footer">
[[each skusInfo as item index]]
<tr>
<td><input type="text" class="form-control observe skus" data-field="skusInfo.[[index]].sku" value="[[item.sku]]" required></td>
<td><input type="text" class="form-control observe" data-field="skusInfo.[[index]].skuTimes" value="[[item.skuTimes]]" required></td>
<td><input type="text" class="form-control observe skus number" placeholder="sku值" data-field="skusInfo.[[index]].sku" value="[[item.sku]]" required></td>
<td><input type="text" class="form-control observe number" placeholder="数量" data-field="skusInfo.[[index]].skuTimes" value="[[item.skuTimes]]" required></td>
<td><a href="javascript:;" class="btn btn-danger btn-xs delSku" data-index="[[index]]">删除</a></td>
</tr>
[[/each]]
... ...