|
@@ -14,6 +14,8 @@ var phoneReg = /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/; |
|
@@ -14,6 +14,8 @@ var phoneReg = /^(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/; |
14
|
|
14
|
|
15
|
var validate = require('./order/validation');
|
15
|
var validate = require('./order/validation');
|
16
|
|
16
|
|
|
|
17
|
+var imgBoxTpl = require('../../tpl/me/thumbnail.hbs');
|
|
|
18
|
+
|
17
|
var validateMap = {
|
19
|
var validateMap = {
|
18
|
user: {
|
20
|
user: {
|
19
|
sl: '#user',
|
21
|
sl: '#user',
|
|
@@ -400,6 +402,17 @@ function initAddr(areaCode) { |
|
@@ -400,6 +402,17 @@ function initAddr(areaCode) { |
400
|
}
|
402
|
}
|
401
|
}
|
403
|
}
|
402
|
|
404
|
|
|
|
405
|
+function bindImgDeleteEvent() {
|
|
|
406
|
+ $('.operation-box .delete').off('click').on('click', function() {
|
|
|
407
|
+ var $thumb = $(this).closest('.thumb-box');
|
|
|
408
|
+ var $t = $thumb.siblings('.img-up-tip');
|
|
|
409
|
+ var number = $('.thumb-box').length - 1;
|
|
|
410
|
+
|
|
|
411
|
+ $t.text(number + '/4');
|
|
|
412
|
+ $thumb.remove();
|
|
|
413
|
+ });
|
|
|
414
|
+}
|
|
|
415
|
+
|
403
|
function bindUploadEvent() {
|
416
|
function bindUploadEvent() {
|
404
|
var $tip = $('.img-up-tip');
|
417
|
var $tip = $('.img-up-tip');
|
405
|
|
418
|
|
|
@@ -419,12 +432,13 @@ function bindUploadEvent() { |
|
@@ -419,12 +432,13 @@ function bindUploadEvent() { |
419
|
var $t;
|
432
|
var $t;
|
420
|
|
433
|
|
421
|
if (result.code === 200) {
|
434
|
if (result.code === 200) {
|
422
|
- img = '<img class="envidence" src="' + result.data + '" alt="凭证图片">';
|
435
|
+ img = imgBoxTpl({src: result.data});
|
423
|
$t = $(that).next('.img-up-tip');
|
436
|
$t = $(that).next('.img-up-tip');
|
424
|
|
437
|
|
425
|
$(that).before(img);
|
438
|
$(that).before(img);
|
426
|
number += 1;
|
439
|
number += 1;
|
427
|
$t.text(number + '/4');
|
440
|
$t.text(number + '/4');
|
|
|
441
|
+ bindImgDeleteEvent();
|
428
|
} else {
|
442
|
} else {
|
429
|
new _alert(result.message).show();
|
443
|
new _alert(result.message).show();
|
430
|
}
|
444
|
}
|