|
@@ -39,7 +39,7 @@ |
|
@@ -39,7 +39,7 @@ |
39
|
<tr style="height: 60px">
|
39
|
<tr style="height: 60px">
|
40
|
<td >
|
40
|
<td >
|
41
|
<span style="color:red">*</span><label>选择用户</label> <br>
|
41
|
<span style="color:red">*</span><label>选择用户</label> <br>
|
42
|
- <input id="articleUid" name="articleUid" style="width:60% " class="easyui-textbox" />
|
42
|
+ <input id="articleUid" name="articleUid" style="width:60% " class="easyui-combobox" />
|
43
|
</td>
|
43
|
</td>
|
44
|
</tr>
|
44
|
</tr>
|
45
|
|
45
|
|
|
@@ -84,8 +84,8 @@ |
|
@@ -84,8 +84,8 @@ |
84
|
</td>
|
84
|
</td>
|
85
|
</tr>
|
85
|
</tr>
|
86
|
<tr>
|
86
|
<tr>
|
87
|
- <td height="50" valign="bottom">
|
|
|
88
|
- <input class="btn-primary" type="submit" value="保存"/>
|
87
|
+ <td valign="bottom">
|
|
|
88
|
+ <input id="subBotton" class="btn-primary" type="button" style="font-size: 20px; margin-top: 0px;margin-bottom: 0px;" value="保存"/>
|
89
|
</td>
|
89
|
</td>
|
90
|
</tr>
|
90
|
</tr>
|
91
|
</table>
|
91
|
</table>
|
|
@@ -105,91 +105,80 @@ |
|
@@ -105,91 +105,80 @@ |
105
|
var checkedItemsObj = {};
|
105
|
var checkedItemsObj = {};
|
106
|
$(function () {
|
106
|
$(function () {
|
107
|
|
107
|
|
108
|
- $("#articleUid").textbox({
|
108
|
+ $("#articleUid").combobox({
|
109
|
required: true,
|
109
|
required: true,
|
110
|
missingMessage: "发布用户不能为空",
|
110
|
missingMessage: "发布用户不能为空",
|
111
|
- prompt: "请输入发布用户"
|
111
|
+ prompt: "请输入发布用户",
|
|
|
112
|
+ selectOnNavigation : true,
|
|
|
113
|
+ valueField: 'text',
|
|
|
114
|
+ textField: 'value',
|
|
|
115
|
+ url : contextPath + "/grassArticle/platPublishUser",
|
|
|
116
|
+ loadFilter: function (data) {
|
|
|
117
|
+ var list = [];
|
|
|
118
|
+ var obj = {};
|
|
|
119
|
+ debugger;
|
|
|
120
|
+ for (var i = 0; i < data.data.length; i++) {
|
|
|
121
|
+ obj['text'] = data.data[i];
|
|
|
122
|
+ obj['value'] = data.data[i];
|
|
|
123
|
+ list.push(obj);
|
|
|
124
|
+ }
|
|
|
125
|
+ return list;
|
|
|
126
|
+ }
|
112
|
});
|
127
|
});
|
113
|
|
128
|
|
114
|
$("#topic").combobox({
|
129
|
$("#topic").combobox({
|
115
|
prompt: "请选择话题"
|
130
|
prompt: "请选择话题"
|
116
|
});
|
131
|
});
|
117
|
-
|
|
|
118
|
- // $("#imageUpload1").imageUpload({
|
|
|
119
|
- // width: 171,
|
|
|
120
|
- // height: 120,
|
|
|
121
|
- // realInputName: "url",
|
|
|
122
|
- // url: contextPath + '/fileupload/uploadFile',
|
|
|
123
|
- // queryParams: {
|
|
|
124
|
- // bucket: "activity"
|
|
|
125
|
- // },
|
|
|
126
|
- // onBeforeSubmit: function () {
|
|
|
127
|
- // $.messager.progress({
|
|
|
128
|
- // title: "正在执行",
|
|
|
129
|
- // msg: "正在执行,请稍后...",
|
|
|
130
|
- // interval: 500,
|
|
|
131
|
- // text: ""
|
|
|
132
|
- // });
|
|
|
133
|
- // },
|
|
|
134
|
- // filterFileName: function (data) {
|
|
|
135
|
- // debugger;
|
|
|
136
|
- // if (!data || data.code != 200) {
|
|
|
137
|
- // $.messager.progress("close");
|
|
|
138
|
- // $.messager.alert("错误",data.message);
|
|
|
139
|
- // return "";
|
|
|
140
|
- // }
|
|
|
141
|
- //
|
|
|
142
|
- // return data.data.url;
|
|
|
143
|
- // },
|
|
|
144
|
- // onLoadSuccess: function (data) {
|
|
|
145
|
- // debugger
|
|
|
146
|
- // $.messager.progress("close");
|
|
|
147
|
- // return false;
|
|
|
148
|
- // }
|
|
|
149
|
- // });
|
|
|
150
|
-
|
|
|
151
|
initimg();
|
132
|
initimg();
|
152
|
|
133
|
|
|
|
134
|
+ $("#subBotton").linkbutton({
|
|
|
135
|
+ iconCls: "icon-save",
|
|
|
136
|
+ onClick: function () {
|
|
|
137
|
+ $("#publishArticleForm").form("submit",{
|
|
|
138
|
+ url : serverContextPath+"/grassArticle/publishArticle",
|
|
|
139
|
+ onSubmit : function(param) {
|
|
|
140
|
+ debugger;
|
|
|
141
|
+ if (!$("#publishArticleForm").form("validate")) {
|
|
|
142
|
+ return false;
|
153
|
|
143
|
|
154
|
- });
|
|
|
155
|
-
|
|
|
156
|
- $("#publishArticleForm").form("submit",{
|
|
|
157
|
- url : serverContextPath+"/grassArticle/publishArticle",
|
|
|
158
|
- onSubmit : function(param) {
|
|
|
159
|
- debugger
|
|
|
160
|
- if (!$("#publishArticleForm").form("validate")) {
|
|
|
161
|
- return false;
|
144
|
+ }
|
|
|
145
|
+ if($("#articleUid").combobox("getValue") == ''){
|
|
|
146
|
+ return false;
|
|
|
147
|
+ }
|
|
|
148
|
+ var imgs = '';
|
|
|
149
|
+ $("input[name='url']").each(function(j,item){
|
|
|
150
|
+ debugger
|
|
|
151
|
+ var url = item.value;
|
|
|
152
|
+ if(imgs == ''){
|
|
|
153
|
+ imgs = url;
|
|
|
154
|
+ }else{
|
|
|
155
|
+ imgs = imgs + ","+url;
|
|
|
156
|
+ }
|
|
|
157
|
+ });
|
|
|
158
|
+ $("#imgs").val(imgs);
|
|
|
159
|
+ return true;
|
|
|
160
|
+ },
|
|
|
161
|
+ success : function(data) {
|
|
|
162
|
+ if (data) {
|
|
|
163
|
+ data = $.parseJSON(data);
|
|
|
164
|
+ if (data.code == 200) {
|
|
|
165
|
+ $.messager.alert("保存成功");
|
|
|
166
|
+ } else {
|
|
|
167
|
+ $.messager.alert("保存失败", data.message, "error");
|
|
|
168
|
+ }
|
|
|
169
|
+ } else {
|
|
|
170
|
+ $.messager.alert("保存失败", data.message, "error");
|
|
|
171
|
+ }
|
|
|
172
|
+ }
|
|
|
173
|
+ });
|
162
|
|
174
|
|
163
|
}
|
175
|
}
|
164
|
- if($("#articleUid").val() == ''){
|
|
|
165
|
- return false;
|
|
|
166
|
- }
|
|
|
167
|
- var imgs = '';
|
|
|
168
|
- $("input[name='url']").each(function(j,item){
|
|
|
169
|
- var url = item.val();
|
|
|
170
|
- if(imgs == ''){
|
|
|
171
|
- imgs = url;
|
|
|
172
|
- }else{
|
|
|
173
|
- imgs = imgs + ","+url;
|
|
|
174
|
- }
|
|
|
175
|
- });
|
|
|
176
|
- $("#imgs").val(imgs);
|
|
|
177
|
- return true;
|
|
|
178
|
- },
|
|
|
179
|
- success : function(data) {
|
|
|
180
|
- if (data) {
|
|
|
181
|
- data = $.parseJSON(data);
|
|
|
182
|
- if (data.code == 200) {
|
|
|
183
|
- $.messager.alert("保存成功");
|
|
|
184
|
- } else {
|
|
|
185
|
- $.messager.alert("保存失败", data.message, "error");
|
|
|
186
|
- }
|
|
|
187
|
- } else {
|
|
|
188
|
- $.messager.alert("保存失败", data.message, "error");
|
|
|
189
|
- }
|
|
|
190
|
- }
|
176
|
+ });
|
191
|
});
|
177
|
});
|
192
|
|
178
|
|
|
|
179
|
+
|
|
|
180
|
+
|
|
|
181
|
+
|
193
|
// 编辑分组
|
182
|
// 编辑分组
|
194
|
function getEditDialog(data){
|
183
|
function getEditDialog(data){
|
195
|
var labelGroupList = $("<div id='labelGroupList'>").appendTo($(document.body));
|
184
|
var labelGroupList = $("<div id='labelGroupList'>").appendTo($(document.body));
|
|
@@ -208,16 +197,13 @@ |
|
@@ -208,16 +197,13 @@ |
208
|
text:textVar,
|
197
|
text:textVar,
|
209
|
iconCls : "icon-save",
|
198
|
iconCls : "icon-save",
|
210
|
handler:function(){
|
199
|
handler:function(){
|
211
|
- debugger
|
|
|
212
|
- // $("input[type='checkbox'][name='id']:checked").each(function (index,$this) {
|
|
|
213
|
- // buildgood(index,$this)
|
|
|
214
|
- // });
|
200
|
+ debugger;
|
215
|
$("#goodstd").html("<div id=\"good0\" style=\"float: left;\">\n" +
|
201
|
$("#goodstd").html("<div id=\"good0\" style=\"float: left;\">\n" +
|
216
|
- " </div>")
|
202
|
+ " </div>");
|
217
|
var skns = '';
|
203
|
var skns = '';
|
218
|
for (var i = 0; i < checkedItems.length; i++) {
|
204
|
for (var i = 0; i < checkedItems.length; i++) {
|
219
|
- buildgood(i,checkedItems[i])
|
|
|
220
|
- if( i == checkedItems.length){
|
205
|
+ buildgood(i,checkedItems[i]);
|
|
|
206
|
+ if( i == checkedItems.length -1){
|
221
|
skns = skns+ checkedItems[i]
|
207
|
skns = skns+ checkedItems[i]
|
222
|
}else{
|
208
|
}else{
|
223
|
skns = skns+ checkedItems[i] +","
|
209
|
skns = skns+ checkedItems[i] +","
|
|
@@ -243,7 +229,7 @@ |
|
@@ -243,7 +229,7 @@ |
243
|
}
|
229
|
}
|
244
|
|
230
|
|
245
|
function oo(num){
|
231
|
function oo(num){
|
246
|
- debugger
|
232
|
+ // debugger
|
247
|
if(num >9){
|
233
|
if(num >9){
|
248
|
return
|
234
|
return
|
249
|
}
|
235
|
}
|
|
@@ -273,7 +259,7 @@ |
|
@@ -273,7 +259,7 @@ |
273
|
return data.data.url;
|
259
|
return data.data.url;
|
274
|
},
|
260
|
},
|
275
|
onLoadSuccess: function (data) {
|
261
|
onLoadSuccess: function (data) {
|
276
|
- debugger
|
262
|
+ debugger;
|
277
|
$.messager.progress("close");
|
263
|
$.messager.progress("close");
|
278
|
return false;
|
264
|
return false;
|
279
|
}
|
265
|
}
|
|
@@ -289,7 +275,7 @@ |
|
@@ -289,7 +275,7 @@ |
289
|
}
|
275
|
}
|
290
|
|
276
|
|
291
|
function buildgood(index,obj) {
|
277
|
function buildgood(index,obj) {
|
292
|
- debugger
|
278
|
+ debugger;
|
293
|
var data = checkedItemsObj[obj];
|
279
|
var data = checkedItemsObj[obj];
|
294
|
$("#good"+index).html(gooddiv(data));
|
280
|
$("#good"+index).html(gooddiv(data));
|
295
|
$div = $("#good"+(index+1));
|
281
|
$div = $("#good"+(index+1));
|
|
@@ -299,8 +285,8 @@ |
|
@@ -299,8 +285,8 @@ |
299
|
|
285
|
|
300
|
return " <span>商品图:<img width=\"120\" height=\"60\" src="+getImageUrl()+
|
286
|
return " <span>商品图:<img width=\"120\" height=\"60\" src="+getImageUrl()+
|
301
|
" </span>" +
|
287
|
" </span>" +
|
302
|
- "<h5 style=\"margin-top: 0px;margin-bottom: 0px>商品名:"+ data.product_name +"</h5>\n" +
|
|
|
303
|
- "<h5 style=\"margin-top: 0px;margin-bottom: 0px>价格:"+data.sales_price+"</h5>"
|
288
|
+ "<h5 style=\"margin-top: 0px;margin-bottom: 0px>\"商品名:"+ data.product_name +"</h5>\n" +
|
|
|
289
|
+ "<h5 style=\"margin-top: 0px;margin-bottom: 0px>\"价格:"+data.sales_price+"</h5>"
|
304
|
}
|
290
|
}
|
305
|
|
291
|
|
306
|
function getImageUrl(image) {
|
292
|
function getImageUrl(image) {
|