...
|
...
|
@@ -5,6 +5,7 @@ |
|
|
<title>Yoho!Buy运营平台</title>
|
|
|
<script src="/pfcms/js/include.js"></script>
|
|
|
<script src="/pfcms/js/ajaxfileupload.js"></script>
|
|
|
<script src="/pfcms/js/jquery.imageUpload.js"></script>
|
|
|
<style>
|
|
|
.btn-long {
|
|
|
width: 120px;
|
...
|
...
|
@@ -155,7 +156,7 @@ |
|
|
return defaultLoadFilter(data);
|
|
|
}
|
|
|
});
|
|
|
initimg();
|
|
|
|
|
|
|
|
|
$("#subBotton").linkbutton({
|
|
|
iconCls: "icon-save",
|
...
|
...
|
@@ -173,6 +174,7 @@ |
|
|
return false;
|
|
|
}
|
|
|
var imgs = '';
|
|
|
var imageCount = 0;
|
|
|
$("input[name='url']").each(function(j,item){
|
|
|
debugger
|
|
|
var url = item.value;
|
...
|
...
|
@@ -181,8 +183,13 @@ |
|
|
}else{
|
|
|
imgs = imgs + ","+url;
|
|
|
}
|
|
|
imageCount++;
|
|
|
});
|
|
|
$("#imgs").val(imgs);
|
|
|
if(imageCount > 9){
|
|
|
$.messager.alert("保存失败", "最多只能选择9张图片", "error");
|
|
|
return false;
|
|
|
}
|
|
|
var labels = '';
|
|
|
$("input[name='labelId']").each(function(j,item){
|
|
|
debugger
|
...
|
...
|
@@ -200,9 +207,9 @@ |
|
|
if (data) {
|
|
|
data = $.parseJSON(data);
|
|
|
if (data.code == 200) {
|
|
|
// $.messager.alert("保存成功","保存成功", "success");
|
|
|
alert("保存成功");
|
|
|
window.location.reload();
|
|
|
$.messager.alert("提示","保存成功", "info", function(){window.location.reload()});
|
|
|
// alert("保存成功");
|
|
|
|
|
|
|
|
|
} else {
|
|
|
$.messager.alert("保存失败", data.message, "error");
|
...
|
...
|
@@ -215,6 +222,47 @@ |
|
|
|
|
|
}
|
|
|
});
|
|
|
|
|
|
|
|
|
$("#imageUpload1").imageUpload({
|
|
|
width: 171,
|
|
|
height: 120,
|
|
|
realInputName: "url",
|
|
|
uploadInputName: "files",
|
|
|
url: serverContextPath + '/fileupload/uploads',
|
|
|
queryParams: {
|
|
|
bucket: "grassImg"
|
|
|
},
|
|
|
onBeforeSubmit: function () {
|
|
|
$.messager.progress({
|
|
|
title: "正在执行",
|
|
|
msg: "正在执行,请稍后...",
|
|
|
interval: 500,
|
|
|
text: ""
|
|
|
});
|
|
|
},
|
|
|
filterFileName: function (data) {
|
|
|
debugger;
|
|
|
if (!data || data.code != 200) {
|
|
|
$.messager.progress("close");
|
|
|
$.messager.alert("错误",data.message);
|
|
|
return "";
|
|
|
}
|
|
|
return data.data[0];
|
|
|
},
|
|
|
onLoadSuccess: function (data) {
|
|
|
debugger;
|
|
|
initimg(1,data.data.length);
|
|
|
for (var i= 1; i<= data.data.length; i++){
|
|
|
$("#imageUpload"+i).imageUpload("setValue",data.data[i-1])
|
|
|
}
|
|
|
$.messager.progress("close");
|
|
|
return false;
|
|
|
},
|
|
|
onClose:function(data){
|
|
|
$("#imageUpload1").remove();
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
...
|
...
|
@@ -272,14 +320,29 @@ |
|
|
|
|
|
function oo(num){
|
|
|
// debugger
|
|
|
if(num >9){
|
|
|
return
|
|
|
// if(num >9){
|
|
|
// return
|
|
|
// }
|
|
|
var imageCount = 0;
|
|
|
$("input[name='url']").each(function(j,item){
|
|
|
debugger
|
|
|
var url = item.value;
|
|
|
if(imgs == ''){
|
|
|
imgs = url;
|
|
|
}else{
|
|
|
imgs = imgs + ","+url;
|
|
|
}
|
|
|
imageCount++;
|
|
|
});
|
|
|
if(imageCount > 9 ){
|
|
|
return;
|
|
|
}
|
|
|
$("#imageUpload"+num).imageUpload({
|
|
|
width: 171,
|
|
|
height: 120,
|
|
|
realInputName: "url",
|
|
|
url: serverContextPath + '/fileupload/uploadFile',
|
|
|
uploadInputName: "files",
|
|
|
url: serverContextPath + '/fileupload/uploads',
|
|
|
queryParams: {
|
|
|
bucket: "grassImg"
|
|
|
},
|
...
|
...
|
@@ -298,21 +361,35 @@ |
|
|
$.messager.alert("错误",data.message);
|
|
|
return "";
|
|
|
}
|
|
|
return data.data.url;
|
|
|
return data.data[0];
|
|
|
},
|
|
|
onLoadSuccess: function (data) {
|
|
|
debugger;
|
|
|
initimg(num,data.data.length);
|
|
|
var c =0;
|
|
|
for (var i= 0; i<= data.data.length; i++){
|
|
|
nnum = num +i;
|
|
|
$("#imageUpload"+nnum).imageUpload("setValue",data.data[c]);
|
|
|
c++;
|
|
|
}
|
|
|
$.messager.progress("close");
|
|
|
return false;
|
|
|
},
|
|
|
onClose:function(data){
|
|
|
$("#imageUpload"+num).remove();
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
function initimg() {
|
|
|
for (var i =1 ; i<=9; i++){
|
|
|
var nnum = i+1;
|
|
|
$("#imageUpload"+i).after('<div id="imageUpload'+nnum+'"> </div>');
|
|
|
|
|
|
|
|
|
|
|
|
function initimg(m,n) {
|
|
|
for (var i =1 ; i<=n; i++){
|
|
|
debugger
|
|
|
var nnum = m+i;
|
|
|
$("#imageUpload"+(nnum-1)).after('<div id="imageUpload'+nnum+'"> </div>');
|
|
|
count = count+1;
|
|
|
oo(i);
|
|
|
oo(nnum);
|
|
|
}
|
|
|
}
|
|
|
|
...
|
...
|
|