...
|
...
|
@@ -37,6 +37,7 @@ var pageType = 0, // 0-换货 1-退货 |
|
|
timer;
|
|
|
|
|
|
require('../plugins/jquery.qupload');
|
|
|
require('../common/ajaxfileupload');
|
|
|
|
|
|
if (defaultPhone) {
|
|
|
$hidePhone.remove();
|
...
|
...
|
@@ -86,6 +87,13 @@ function setBackInput(type) { |
|
|
}
|
|
|
}
|
|
|
|
|
|
var resetImg = function($p) {
|
|
|
$p.removeClass('selected');
|
|
|
$p.find('input[name=imgs]').val('');
|
|
|
$p.find('img').attr('src', '');
|
|
|
};
|
|
|
|
|
|
|
|
|
if ($refundInfo.length) {
|
|
|
pageType = 1;
|
|
|
|
...
|
...
|
@@ -148,8 +156,11 @@ $goodsTable.on('change', '.exchange-color', function() { |
|
|
$warp.find('.exchange-size').html(_html).val(0);
|
|
|
});
|
|
|
|
|
|
$goodsTable.on('click', '.btn-del', function() {
|
|
|
$(this).parent().empty();
|
|
|
$goodsTable.on('click', '.btn-del', function(e) {
|
|
|
var $p = $(this).closest('li');
|
|
|
|
|
|
e.stopPropagation();
|
|
|
resetImg($p);
|
|
|
});
|
|
|
|
|
|
$file.each(function(e) {
|
...
|
...
|
@@ -159,37 +170,88 @@ $file.each(function(e) { |
|
|
if (!window.location.origin) {
|
|
|
window.location.origin = window.location.protocol + '//' + window.location.hostname + (window.location.port ? ':' + window.location.port : '');
|
|
|
}
|
|
|
$this.qupload({
|
|
|
button_image_url: '',
|
|
|
upload_url: window.location.origin + '/home/returns/imgUpload',
|
|
|
file_post_name: 'fileData',
|
|
|
button_text: '<span class="btn_upload_text">上传图片</span>',
|
|
|
button_text_style: '.btn_upload_text{color: #ffffff;}',
|
|
|
button_width: 116,
|
|
|
button_height: 33,
|
|
|
button_text_left_padding: 32,
|
|
|
button_text_top_padding: 8,
|
|
|
button_action: window.SWFUpload.BUTTON_ACTION.SELECT_FILE,
|
|
|
file_size_limit: '10240',
|
|
|
file_types: '*.jpg;*.jpeg;*.png;*.bmp',
|
|
|
uploadSuccessed: function(data) {
|
|
|
var $imgList = $par.find('li'),
|
|
|
isShow = false,
|
|
|
img, _html;
|
|
|
|
|
|
img = JSON.parse(data).imgList[0];
|
|
|
_html = '<span class="btn-del" title="删除"></span>' +
|
|
|
'<img src="' + img[0] + '" width="126" height="126">' +
|
|
|
'<input type="hidden" name="imgs" value="' + img.imgRelUrl + '">';
|
|
|
$imgList.each(function() {
|
|
|
if (!isShow && !$(this).find('img').length) {
|
|
|
isShow = true;
|
|
|
$(this).html(_html);
|
|
|
|
|
|
fileChangeEvent($this)//
|
|
|
|
|
|
// $this.qupload({
|
|
|
// button_image_url: '',
|
|
|
// upload_url: window.location.origin + '/home/returns/imgUpload',
|
|
|
// file_post_name: 'fileData',
|
|
|
// button_text: '<span class="btn_upload_text">上传图片</span>',
|
|
|
// button_text_style: '.btn_upload_text{color: #ffffff;}',
|
|
|
// button_width: 116,
|
|
|
// button_height: 33,
|
|
|
// button_text_left_padding: 32,
|
|
|
// button_text_top_padding: 8,
|
|
|
// button_action: window.SWFUpload.BUTTON_ACTION.SELECT_FILE,
|
|
|
// file_size_limit: '10240',
|
|
|
// file_types: '*.jpg;*.jpeg;*.png;*.bmp',
|
|
|
// uploadSuccessed: function(data) {
|
|
|
// var $imgList = $par.find('li'),
|
|
|
// isShow = false,
|
|
|
// img, _html;
|
|
|
//
|
|
|
// img = JSON.parse(data).imgList[0];
|
|
|
// _html = '<span class="btn-del" title="删除"></span>' +
|
|
|
// '<img src="' + img[0] + '" width="126" height="126">' +
|
|
|
// '<input type="hidden" name="imgs" value="' + img.imgRelUrl + '">';
|
|
|
// $imgList.each(function() {
|
|
|
// if (!isShow && !$(this).find('img').length) {
|
|
|
// isShow = true;
|
|
|
// $(this).html(_html);
|
|
|
// }
|
|
|
// });
|
|
|
// }
|
|
|
// });
|
|
|
});
|
|
|
|
|
|
function fileChangeEvent($file) {
|
|
|
console.log('111111111111111');
|
|
|
|
|
|
// 图片上传
|
|
|
$goodsTable.on('change', 'input[type=file]', function() {
|
|
|
|
|
|
var $f = $(this);
|
|
|
var $p = $f.siblings('.up-image-list');
|
|
|
|
|
|
var $lis = $p.find('li:not(.selected)');
|
|
|
var $li = $($lis[0]);
|
|
|
console.log('===========================');
|
|
|
|
|
|
if ($f.val()) {
|
|
|
$.ajaxFileUpload({
|
|
|
url: '/common/upload/image',
|
|
|
secureuri: false,
|
|
|
fileElementId: $f,
|
|
|
data: {
|
|
|
bucket: 'evidenceImages'
|
|
|
},
|
|
|
dataType: 'json',
|
|
|
success: function(data /* , status */) {
|
|
|
var url, relaUrl;
|
|
|
|
|
|
if (data && data.code === 200 && data.data && data.data.images && data.data.images[0]) {
|
|
|
url = data.data.images[0];
|
|
|
relaUrl = data.data.imagesList[0];
|
|
|
$li.find('img').attr('src', url).attr('source-url', url);
|
|
|
$li.find('input[name=imgs]').val(relaUrl);
|
|
|
$li.addClass('selected');
|
|
|
|
|
|
} else if (data && data.message) {
|
|
|
alert(data.message);
|
|
|
}
|
|
|
},
|
|
|
error: function() { /** data, status, e **/
|
|
|
alert('上传失败,请稍后再试!');
|
|
|
},
|
|
|
complete: function() {
|
|
|
$f.clone().replaceAll($f);
|
|
|
// fileChangeEvent($f);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
}
|
|
|
|
|
|
$exchange.on('change', '#area', function() {
|
|
|
var code = $(this).val() * 1;
|
...
|
...
|
|