6dfe3907 by Zelig

图片上传修改

1 parent cd43e20e
...@@ -379,14 +379,8 @@ ...@@ -379,14 +379,8 @@
379 </div> 379 </div>
380 <div class="form-group col-sm-3 col-md-2"> 380 <div class="form-group col-sm-3 col-md-2">
381 <label id="deadline">贷款期限</label> 381 <label id="deadline">贷款期限</label>
382 <span class="form-control select-box"> 382 <input type="number" class="form-control input-text" name="applyOrderVO.deadline" value="<?= $applyOrderVO ? $applyOrderVO->deadline : '' ?>">
383 <select class="select" size="1" name="applyOrderVO.deadline"> 383 <span class="glyphicon form-control-feedback" aria-hidden="true"></span>
384 <?php for ($i = 1; $i <= 12; $i++): ?>
385 <option <?= $applyOrderVO && $applyOrderVO->deadline ? 'selected' : '' ?>
386 value="<?= $i ?>"><?= $i ?></option>
387 <?php endfor; ?>
388 </select>
389 </span>
390 </div> 384 </div>
391 <div class="form-group col-sm-3 col-md-2"> 385 <div class="form-group col-sm-3 col-md-2">
392 <label>还款方式</label> 386 <label>还款方式</label>
...@@ -481,30 +475,35 @@ ...@@ -481,30 +475,35 @@
481 475
482 var loc = beva.locationutil.attach('province', 'city', 'county', 'address'); 476 var loc = beva.locationutil.attach('province', 'city', 'county', 'address');
483 477
484 $('input[name="applyOrderVO.products"]').on('change', function () { 478 // $('input[name="applyOrderVO.products"]').on('change', function () {
485 const limit = $(this).data('limit'); 479 // const limit = $(this).data('limit');
486 const deadline = $(this).data('deadline'); 480 // const deadline = $(this).data('deadline');
487 481 //
488 $('#applyMoney').html('申请金额(max: '+limit+')'); 482 // $('#applyMoney').html('申请金额(max: '+limit+')');
489 $('#deadline').html('贷款期限(max: '+deadline+')'); 483 // $('#deadline').html('贷款期限(max: '+deadline+')');
490 }) 484 // })
491 485 //
492 $('input[name="applyOrderVO.applyMoney"]').on('keyup', function () { 486 // $('input[name="applyOrderVO.applyMoney"]').on('keyup', function () {
493 var product = $('input[name="applyOrderVO.products"]:checked'); 487 // var product = $('input[name="applyOrderVO.products"]:checked');
494 var limit = product.data('limit') 488 // var limit = product.data('limit')
495 489 //
496 if($(this).val() > limit) { 490 // if($(this).val() > limit) {
497 $(this).val(limit) 491 // $(this).val(limit)
492 // }
493 // });
494
495 $('input[name="applyOrderVO.deadline"]').on('change', function () {
496 // var product = $('input[name="applyOrderVO.products"]:checked');
497 // var deadline = product.data('deadline')
498
499 if($(this).val() % 6) {
500 layer.alert('期数只能是6的倍数');
501 $(this).val('');
498 } 502 }
499 });
500 503
501 $('select[name="applyOrderVO.deadline"]').on('change', function () { 504 // if($(this).val() > deadline) {
502 var product = $('input[name="applyOrderVO.products"]:checked'); 505 // $(this).val(deadline)
503 var deadline = product.data('deadline') 506 // }
504
505 if($(this).val() > deadline) {
506 $(this).val(deadline)
507 }
508 }); 507 });
509 508
510 $("form").validate({ 509 $("form").validate({
......
...@@ -16,14 +16,19 @@ jQuery(function() { ...@@ -16,14 +16,19 @@ jQuery(function() {
16 16
17 // 选择文件的按钮。可选。 17 // 选择文件的按钮。可选。
18 // 内部根据当前运行是创建,可能是input元素,也可能是flash. 18 // 内部根据当前运行是创建,可能是input元素,也可能是flash.
19 pick: '.filePicker', 19 pick: {
20 id: '.filePicker',
21 multiple: true
22 },
20 23
21 // 只允许选择文件,可选。 24 // 只允许选择文件,可选。
22 accept: { 25 accept: {
23 title: 'Images', 26 title: 'Images',
24 extensions: 'gif,jpg,jpeg,bmp,png', 27 extensions: 'gif,jpg,jpeg,bmp,png',
25 mimeTypes: 'image/*' 28 mimeTypes: 'image/*'
26 } 29 },
30
31 fileVal: 'files',
27 }); 32 });
28 33
29 // 当有文件添加进来的时候 34 // 当有文件添加进来的时候
...@@ -104,8 +109,7 @@ jQuery(function() { ...@@ -104,8 +109,7 @@ jQuery(function() {
104 // 文件上传成功,给item添加成功class, 用样式标记上传成功。 109 // 文件上传成功,给item添加成功class, 用样式标记上传成功。
105 uploader.on('uploadSuccess', function(file, response) { 110 uploader.on('uploadSuccess', function(file, response) {
106 var img = $('#' + file.id); 111 var img = $('#' + file.id);
107 img.data('id', response.data.id); 112 img.data('id', response.data[0].id);
108 img.addClass('upload-state-done');
109 }); 113 });
110 114
111 // 文件上传失败,现实上传出错。 115 // 文件上传失败,现实上传出错。
...@@ -183,6 +187,7 @@ window.uploadList = function () { ...@@ -183,6 +187,7 @@ window.uploadList = function () {
183 function removeFile( file ) { 187 function removeFile( file ) {
184 var $li = $('#'+file.id); 188 var $li = $('#'+file.id);
185 var id = $('#'+file.id).data('id'); 189 var id = $('#'+file.id).data('id');
190 console.log();
186 191
187 var targetUrl = 'order/ordersource/delete/' + id; 192 var targetUrl = 'order/ordersource/delete/' + id;
188 193
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!