6dfe3907 by Zelig

图片上传修改

1 parent cd43e20e
......@@ -379,14 +379,8 @@
</div>
<div class="form-group col-sm-3 col-md-2">
<label id="deadline">贷款期限</label>
<span class="form-control select-box">
<select class="select" size="1" name="applyOrderVO.deadline">
<?php for ($i = 1; $i <= 12; $i++): ?>
<option <?= $applyOrderVO && $applyOrderVO->deadline ? 'selected' : '' ?>
value="<?= $i ?>"><?= $i ?></option>
<?php endfor; ?>
</select>
</span>
<input type="number" class="form-control input-text" name="applyOrderVO.deadline" value="<?= $applyOrderVO ? $applyOrderVO->deadline : '' ?>">
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
</div>
<div class="form-group col-sm-3 col-md-2">
<label>还款方式</label>
......@@ -481,30 +475,35 @@
var loc = beva.locationutil.attach('province', 'city', 'county', 'address');
$('input[name="applyOrderVO.products"]').on('change', function () {
const limit = $(this).data('limit');
const deadline = $(this).data('deadline');
$('#applyMoney').html('申请金额(max: '+limit+')');
$('#deadline').html('贷款期限(max: '+deadline+')');
})
$('input[name="applyOrderVO.applyMoney"]').on('keyup', function () {
var product = $('input[name="applyOrderVO.products"]:checked');
var limit = product.data('limit')
if($(this).val() > limit) {
$(this).val(limit)
// $('input[name="applyOrderVO.products"]').on('change', function () {
// const limit = $(this).data('limit');
// const deadline = $(this).data('deadline');
//
// $('#applyMoney').html('申请金额(max: '+limit+')');
// $('#deadline').html('贷款期限(max: '+deadline+')');
// })
//
// $('input[name="applyOrderVO.applyMoney"]').on('keyup', function () {
// var product = $('input[name="applyOrderVO.products"]:checked');
// var limit = product.data('limit')
//
// if($(this).val() > limit) {
// $(this).val(limit)
// }
// });
$('input[name="applyOrderVO.deadline"]').on('change', function () {
// var product = $('input[name="applyOrderVO.products"]:checked');
// var deadline = product.data('deadline')
if($(this).val() % 6) {
layer.alert('期数只能是6的倍数');
$(this).val('');
}
});
$('select[name="applyOrderVO.deadline"]').on('change', function () {
var product = $('input[name="applyOrderVO.products"]:checked');
var deadline = product.data('deadline')
if($(this).val() > deadline) {
$(this).val(deadline)
}
// if($(this).val() > deadline) {
// $(this).val(deadline)
// }
});
$("form").validate({
......
......@@ -16,14 +16,19 @@ jQuery(function() {
// 选择文件的按钮。可选。
// 内部根据当前运行是创建,可能是input元素,也可能是flash.
pick: '.filePicker',
pick: {
id: '.filePicker',
multiple: true
},
// 只允许选择文件,可选。
accept: {
title: 'Images',
extensions: 'gif,jpg,jpeg,bmp,png',
mimeTypes: 'image/*'
}
},
fileVal: 'files',
});
// 当有文件添加进来的时候
......@@ -104,8 +109,7 @@ jQuery(function() {
// 文件上传成功,给item添加成功class, 用样式标记上传成功。
uploader.on('uploadSuccess', function(file, response) {
var img = $('#' + file.id);
img.data('id', response.data.id);
img.addClass('upload-state-done');
img.data('id', response.data[0].id);
});
// 文件上传失败,现实上传出错。
......@@ -183,6 +187,7 @@ window.uploadList = function () {
function removeFile( file ) {
var $li = $('#'+file.id);
var id = $('#'+file.id).data('id');
console.log();
var targetUrl = 'order/ordersource/delete/' + id;
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!