...
|
...
|
@@ -39,7 +39,7 @@ |
|
|
<tr style="height: 60px">
|
|
|
<td >
|
|
|
<span style="color:red">*</span><label>选择用户</label> <br>
|
|
|
<input id="articleUid" name="articleUid" style="width:60% " class="easyui-textbox" />
|
|
|
<input id="articleUid" name="articleUid" style="width:60% " class="easyui-combobox" />
|
|
|
</td>
|
|
|
</tr>
|
|
|
|
...
|
...
|
@@ -84,8 +84,8 @@ |
|
|
</td>
|
|
|
</tr>
|
|
|
<tr>
|
|
|
<td height="50" valign="bottom">
|
|
|
<input class="btn-primary" type="submit" value="保存"/>
|
|
|
<td valign="bottom">
|
|
|
<input id="subBotton" class="btn-primary" type="button" style="font-size: 20px; margin-top: 0px;margin-bottom: 0px;" value="保存"/>
|
|
|
</td>
|
|
|
</tr>
|
|
|
</table>
|
...
|
...
|
@@ -105,91 +105,80 @@ |
|
|
var checkedItemsObj = {};
|
|
|
$(function () {
|
|
|
|
|
|
$("#articleUid").textbox({
|
|
|
$("#articleUid").combobox({
|
|
|
required: true,
|
|
|
missingMessage: "发布用户不能为空",
|
|
|
prompt: "请输入发布用户"
|
|
|
prompt: "请输入发布用户",
|
|
|
selectOnNavigation : true,
|
|
|
valueField: 'text',
|
|
|
textField: 'value',
|
|
|
url : contextPath + "/grassArticle/platPublishUser",
|
|
|
loadFilter: function (data) {
|
|
|
var list = [];
|
|
|
var obj = {};
|
|
|
debugger;
|
|
|
for (var i = 0; i < data.data.length; i++) {
|
|
|
obj['text'] = data.data[i];
|
|
|
obj['value'] = data.data[i];
|
|
|
list.push(obj);
|
|
|
}
|
|
|
return list;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$("#topic").combobox({
|
|
|
prompt: "请选择话题"
|
|
|
});
|
|
|
|
|
|
// $("#imageUpload1").imageUpload({
|
|
|
// width: 171,
|
|
|
// height: 120,
|
|
|
// realInputName: "url",
|
|
|
// url: contextPath + '/fileupload/uploadFile',
|
|
|
// queryParams: {
|
|
|
// bucket: "activity"
|
|
|
// },
|
|
|
// 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.url;
|
|
|
// },
|
|
|
// onLoadSuccess: function (data) {
|
|
|
// debugger
|
|
|
// $.messager.progress("close");
|
|
|
// return false;
|
|
|
// }
|
|
|
// });
|
|
|
|
|
|
initimg();
|
|
|
|
|
|
$("#subBotton").linkbutton({
|
|
|
iconCls: "icon-save",
|
|
|
onClick: function () {
|
|
|
$("#publishArticleForm").form("submit",{
|
|
|
url : serverContextPath+"/grassArticle/publishArticle",
|
|
|
onSubmit : function(param) {
|
|
|
debugger;
|
|
|
if (!$("#publishArticleForm").form("validate")) {
|
|
|
return false;
|
|
|
|
|
|
});
|
|
|
|
|
|
$("#publishArticleForm").form("submit",{
|
|
|
url : serverContextPath+"/grassArticle/publishArticle",
|
|
|
onSubmit : function(param) {
|
|
|
debugger
|
|
|
if (!$("#publishArticleForm").form("validate")) {
|
|
|
return false;
|
|
|
}
|
|
|
if($("#articleUid").combobox("getValue") == ''){
|
|
|
return false;
|
|
|
}
|
|
|
var imgs = '';
|
|
|
$("input[name='url']").each(function(j,item){
|
|
|
debugger
|
|
|
var url = item.value;
|
|
|
if(imgs == ''){
|
|
|
imgs = url;
|
|
|
}else{
|
|
|
imgs = imgs + ","+url;
|
|
|
}
|
|
|
});
|
|
|
$("#imgs").val(imgs);
|
|
|
return true;
|
|
|
},
|
|
|
success : function(data) {
|
|
|
if (data) {
|
|
|
data = $.parseJSON(data);
|
|
|
if (data.code == 200) {
|
|
|
$.messager.alert("保存成功");
|
|
|
} else {
|
|
|
$.messager.alert("保存失败", data.message, "error");
|
|
|
}
|
|
|
} else {
|
|
|
$.messager.alert("保存失败", data.message, "error");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
}
|
|
|
if($("#articleUid").val() == ''){
|
|
|
return false;
|
|
|
}
|
|
|
var imgs = '';
|
|
|
$("input[name='url']").each(function(j,item){
|
|
|
var url = item.val();
|
|
|
if(imgs == ''){
|
|
|
imgs = url;
|
|
|
}else{
|
|
|
imgs = imgs + ","+url;
|
|
|
}
|
|
|
});
|
|
|
$("#imgs").val(imgs);
|
|
|
return true;
|
|
|
},
|
|
|
success : function(data) {
|
|
|
if (data) {
|
|
|
data = $.parseJSON(data);
|
|
|
if (data.code == 200) {
|
|
|
$.messager.alert("保存成功");
|
|
|
} else {
|
|
|
$.messager.alert("保存失败", data.message, "error");
|
|
|
}
|
|
|
} else {
|
|
|
$.messager.alert("保存失败", data.message, "error");
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 编辑分组
|
|
|
function getEditDialog(data){
|
|
|
var labelGroupList = $("<div id='labelGroupList'>").appendTo($(document.body));
|
...
|
...
|
@@ -208,16 +197,13 @@ |
|
|
text:textVar,
|
|
|
iconCls : "icon-save",
|
|
|
handler:function(){
|
|
|
debugger
|
|
|
// $("input[type='checkbox'][name='id']:checked").each(function (index,$this) {
|
|
|
// buildgood(index,$this)
|
|
|
// });
|
|
|
debugger;
|
|
|
$("#goodstd").html("<div id=\"good0\" style=\"float: left;\">\n" +
|
|
|
" </div>")
|
|
|
" </div>");
|
|
|
var skns = '';
|
|
|
for (var i = 0; i < checkedItems.length; i++) {
|
|
|
buildgood(i,checkedItems[i])
|
|
|
if( i == checkedItems.length){
|
|
|
buildgood(i,checkedItems[i]);
|
|
|
if( i == checkedItems.length -1){
|
|
|
skns = skns+ checkedItems[i]
|
|
|
}else{
|
|
|
skns = skns+ checkedItems[i] +","
|
...
|
...
|
@@ -243,7 +229,7 @@ |
|
|
}
|
|
|
|
|
|
function oo(num){
|
|
|
debugger
|
|
|
// debugger
|
|
|
if(num >9){
|
|
|
return
|
|
|
}
|
...
|
...
|
@@ -273,7 +259,7 @@ |
|
|
return data.data.url;
|
|
|
},
|
|
|
onLoadSuccess: function (data) {
|
|
|
debugger
|
|
|
debugger;
|
|
|
$.messager.progress("close");
|
|
|
return false;
|
|
|
}
|
...
|
...
|
@@ -289,7 +275,7 @@ |
|
|
}
|
|
|
|
|
|
function buildgood(index,obj) {
|
|
|
debugger
|
|
|
debugger;
|
|
|
var data = checkedItemsObj[obj];
|
|
|
$("#good"+index).html(gooddiv(data));
|
|
|
$div = $("#good"+(index+1));
|
...
|
...
|
@@ -299,8 +285,8 @@ |
|
|
|
|
|
return " <span>商品图:<img width=\"120\" height=\"60\" src="+getImageUrl()+
|
|
|
" </span>" +
|
|
|
"<h5 style=\"margin-top: 0px;margin-bottom: 0px>商品名:"+ data.product_name +"</h5>\n" +
|
|
|
"<h5 style=\"margin-top: 0px;margin-bottom: 0px>价格:"+data.sales_price+"</h5>"
|
|
|
"<h5 style=\"margin-top: 0px;margin-bottom: 0px>\"商品名:"+ data.product_name +"</h5>\n" +
|
|
|
"<h5 style=\"margin-top: 0px;margin-bottom: 0px>\"价格:"+data.sales_price+"</h5>"
|
|
|
}
|
|
|
|
|
|
function getImageUrl(image) {
|
...
|
...
|
|