修改图片上传异常问题
This commit is contained in:
@@ -100,6 +100,7 @@
|
||||
<input type="text" class="form-control validate[required]" name="name" id="tr_modal_name" placeholder="请输入气泡名称">
|
||||
</div>
|
||||
</div>
|
||||
<form class="form-horizontal" id="addForm1">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-4 control-label">安卓图片:</label>
|
||||
<div class="col-sm-6">
|
||||
@@ -111,7 +112,9 @@
|
||||
<input type="hidden" id="androidUrl" name="androidUrl" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
</form>
|
||||
<form class="form-horizontal" id="addForm2">
|
||||
<div class="form-group" >
|
||||
<label class="col-sm-4 control-label">IOS图片:</label>
|
||||
<div class="col-sm-6">
|
||||
<img src="" id="addIosIconPicUrl" style="height:44px;" alt="">
|
||||
@@ -122,6 +125,7 @@
|
||||
<input type="hidden" id="iosUrl" name="iosUrl" class="form-control" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="form-group">
|
||||
<label for="status" class="col-sm-4 control-label">装扮状态:</label>
|
||||
<div class="col-sm-6">
|
||||
@@ -422,28 +426,39 @@ export default {
|
||||
});
|
||||
|
||||
|
||||
$("[name='uploadBtn']").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)
|
||||
$("#addAndroidIconPicUrl_androidUrl").on('click', function () {
|
||||
var options = {
|
||||
type: 'post',
|
||||
url: '/admin/upload/img',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
if (json.path) {
|
||||
$("#" + inputId).val(json.path);
|
||||
$("#" + imageId).attr("src", json.path);
|
||||
$("#addAndroidIconPicUrl").val(json.path);
|
||||
$("#addAndroidIconPicUrl").attr("src", json.path);
|
||||
} else {
|
||||
$("#tipMsg").text(json.msg);
|
||||
$("#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;
|
||||
}
|
||||
formData.partitionFlag = partitionFlag;
|
||||
formData.androidUrl = $('#addAndroidIconPicUrl').attr('src');
|
||||
formData.iosUrl = $('#addIosIconPicUrl').attr('src');
|
||||
// 将修改后的对象转换回序列化字符串
|
||||
let newSerializeStr = $.param(formData);
|
||||
//做下数据校验
|
||||
|
@@ -448,7 +448,7 @@ export default {
|
||||
{ field: 'originalPrice', title: '原价(钻石)', align: 'center', width: '5%' },
|
||||
{ field: 'price', 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: 'radishRenewPrice', title: '续费价格(萝卜)', align: 'center', width: '5%' },
|
||||
{ field: 'days', title: '有效期', align: 'center', width: '5%' },
|
||||
|
Reference in New Issue
Block a user