修改图片上传异常问题
This commit is contained in:
@@ -100,28 +100,32 @@
|
|||||||
<input type="text" class="form-control validate[required]" name="name" id="tr_modal_name" placeholder="请输入气泡名称">
|
<input type="text" class="form-control validate[required]" name="name" id="tr_modal_name" placeholder="请输入气泡名称">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<form class="form-horizontal" id="addForm1">
|
||||||
<label class="col-sm-4 control-label">安卓图片:</label>
|
<div class="form-group">
|
||||||
<div class="col-sm-6">
|
<label class="col-sm-4 control-label">安卓图片:</label>
|
||||||
<img src="" id="addAndroidIconPicUrl" style="height:44px;" alt="">
|
<div class="col-sm-6">
|
||||||
<input type="file" id="add_android_UploadIconPic" name="uploadFile"
|
<img src="" id="addAndroidIconPicUrl" style="height:44px;" alt="">
|
||||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
<input type="file" id="add_android_UploadIconPic" name="uploadFile"
|
||||||
<button class="btn btn-success" type="button" name="uploadBtn"
|
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||||
id="addAndroidIconPicUrl_androidUrl">上传</button>
|
<button class="btn btn-success" type="button" name="uploadBtn"
|
||||||
<input type="hidden" id="androidUrl" name="androidUrl" class="form-control" />
|
id="addAndroidIconPicUrl_androidUrl">上传</button>
|
||||||
|
<input type="hidden" id="androidUrl" name="androidUrl" class="form-control" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
<div class="form-group">
|
<form class="form-horizontal" id="addForm2">
|
||||||
<label class="col-sm-4 control-label">IOS图片:</label>
|
<div class="form-group" >
|
||||||
<div class="col-sm-6">
|
<label class="col-sm-4 control-label">IOS图片:</label>
|
||||||
<img src="" id="addIosIconPicUrl" style="height:44px;" alt="">
|
<div class="col-sm-6">
|
||||||
<input type="file" id="add_ios_UploadIconPic" name="uploadFile"
|
<img src="" id="addIosIconPicUrl" style="height:44px;" alt="">
|
||||||
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
<input type="file" id="add_ios_UploadIconPic" name="uploadFile"
|
||||||
<button class="btn btn-success" type="button" name="uploadBtn"
|
accept="image/gif,image/jpeg,image/jpg,image/png,image/svg">
|
||||||
id="addIosIconPicUrl_iosUrl">上传</button>
|
<button class="btn btn-success" type="button" name="uploadBtn"
|
||||||
<input type="hidden" id="iosUrl" name="iosUrl" class="form-control" />
|
id="addIosIconPicUrl_iosUrl">上传</button>
|
||||||
|
<input type="hidden" id="iosUrl" name="iosUrl" class="form-control" />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</form>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="status" class="col-sm-4 control-label">装扮状态:</label>
|
<label for="status" class="col-sm-4 control-label">装扮状态:</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
@@ -422,28 +426,39 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
$("[name='uploadBtn']").on('click', function () {
|
$("#addAndroidIconPicUrl_androidUrl").on('click', function () {
|
||||||
let id = $(this).attr('id');
|
|
||||||
let b = id.split("_");
|
|
||||||
let imageId = b[0];
|
|
||||||
let inputId = b[1];
|
|
||||||
console.log(imageId)
|
|
||||||
console.log(inputId)
|
|
||||||
var options = {
|
var options = {
|
||||||
type: 'post',
|
type: 'post',
|
||||||
url: '/admin/upload/img',
|
url: '/admin/upload/img',
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (json) {
|
success: function (json) {
|
||||||
if (json.path) {
|
if (json.path) {
|
||||||
$("#" + inputId).val(json.path);
|
$("#addAndroidIconPicUrl").val(json.path);
|
||||||
$("#" + imageId).attr("src", json.path);
|
$("#addAndroidIconPicUrl").attr("src", json.path);
|
||||||
} else {
|
} else {
|
||||||
$("#tipMsg").text(json.msg);
|
$("#tipMsg").text(json.msg);
|
||||||
$("#tipModal").modal('show');
|
$("#tipModal").modal('show');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
$("#addForm").ajaxSubmit(options);
|
$("#addForm1").ajaxSubmit(options);
|
||||||
|
});
|
||||||
|
$("#addIosIconPicUrl_iosUrl").on('click', function () {
|
||||||
|
var options = {
|
||||||
|
type: 'post',
|
||||||
|
url: '/admin/upload/img',
|
||||||
|
dataType: 'json',
|
||||||
|
success: function (json) {
|
||||||
|
if (json.path) {
|
||||||
|
$("#addIosIconPicUrl").val(json.path);
|
||||||
|
$("#addIosIconPicUrl").attr("src", json.path);
|
||||||
|
} else {
|
||||||
|
$("#tipMsg").text(json.msg);
|
||||||
|
$("#tipModal").modal('show');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
$("#addForm2").ajaxSubmit(options);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@@ -484,6 +499,8 @@ export default {
|
|||||||
partitionFlag |= partitionFlagArray[i].value;
|
partitionFlag |= partitionFlagArray[i].value;
|
||||||
}
|
}
|
||||||
formData.partitionFlag = partitionFlag;
|
formData.partitionFlag = partitionFlag;
|
||||||
|
formData.androidUrl = $('#addAndroidIconPicUrl').attr('src');
|
||||||
|
formData.iosUrl = $('#addIosIconPicUrl').attr('src');
|
||||||
// 将修改后的对象转换回序列化字符串
|
// 将修改后的对象转换回序列化字符串
|
||||||
let newSerializeStr = $.param(formData);
|
let newSerializeStr = $.param(formData);
|
||||||
//做下数据校验
|
//做下数据校验
|
||||||
|
@@ -448,7 +448,7 @@ export default {
|
|||||||
{ field: 'originalPrice', title: '原价(钻石)', align: 'center', width: '5%' },
|
{ field: 'originalPrice', title: '原价(钻石)', align: 'center', width: '5%' },
|
||||||
{ field: 'price', title: '购买价格(钻石)', align: 'center', width: '5%' },
|
{ field: 'price', title: '购买价格(钻石)', align: 'center', width: '5%' },
|
||||||
{ field: 'renewPrice', title: '续费价格(钻石)', align: 'center', width: '5%' },
|
{ field: 'renewPrice', title: '续费价格(钻石)', align: 'center', width: '5%' },
|
||||||
{ field: 'radishOriginalPrice', title: '原价(萝卜)', align: 'center', width: '5%' },
|
{ field: 'radishOriginalPrice', title: '原价(萝卜1)', align: 'center', width: '5%' },
|
||||||
{ field: 'radishPrice', title: '购买价格(萝卜)', align: 'center', width: '5%' },
|
{ field: 'radishPrice', title: '购买价格(萝卜)', align: 'center', width: '5%' },
|
||||||
{ field: 'radishRenewPrice', title: '续费价格(萝卜)', align: 'center', width: '5%' },
|
{ field: 'radishRenewPrice', title: '续费价格(萝卜)', align: 'center', width: '5%' },
|
||||||
{ field: 'days', title: '有效期', align: 'center', width: '5%' },
|
{ field: 'days', title: '有效期', align: 'center', width: '5%' },
|
||||||
|
Reference in New Issue
Block a user