...
|
...
|
@@ -40,6 +40,8 @@ |
|
|
<div region="center" id="labelGroupList" style="margin-left: 20px">
|
|
|
<div id="tt" class="easyui-layout" fit="true" style="overflow-y: scroll">
|
|
|
<form name="publishArticleForm" id="publishArticleForm" method="post" >
|
|
|
<input id="draftType" name="draftType" hidden="hidden"/>
|
|
|
<input id="draftArticleId" name="articleId" hidden="hidden"/>
|
|
|
<div style="margin-top: 20px;margin-left: 30px">
|
|
|
<table border="0" style="width:100%;margin-top:5px;line-height:30px;" id="tab">
|
|
|
|
...
|
...
|
@@ -102,7 +104,7 @@ |
|
|
</tr>
|
|
|
<tr style="height: 60px">
|
|
|
<td id="goodstd">
|
|
|
<div id="good0" style="float: left;margin-left: 30px;width: 150px;">
|
|
|
<div id="good0" style="float: left;margin-left: 30px;width: 300px;">
|
|
|
|
|
|
</div>
|
|
|
</td>
|
...
|
...
|
@@ -154,7 +156,7 @@ |
|
|
//发送请求
|
|
|
$.ajax({
|
|
|
type: "POST",
|
|
|
url: contextPath + "/grassArticle/getUserInfo", //提交到后端的url
|
|
|
url: serverContextPath + "/grassArticle/getUserInfo", //提交到后端的url
|
|
|
dataType: 'json',
|
|
|
data:{
|
|
|
uid : $(this).textbox("getValue")
|
...
|
...
|
@@ -198,7 +200,7 @@ |
|
|
valueField: 'id',
|
|
|
textField: 'labelName',
|
|
|
multiple:true,
|
|
|
url : contextPath + "/grassLabelManage/getAllGrassLabelInfo",
|
|
|
url : serverContextPath + "/grassLabelManage/getAllGrassLabelInfo",
|
|
|
loadFilter: function (data) {
|
|
|
return defaultLoadFilter(data);
|
|
|
},
|
...
|
...
|
@@ -253,7 +255,6 @@ |
|
|
removeSingleItemById(product_skn);
|
|
|
var skns = '';
|
|
|
for (var i = 0; i < checkedItems.length; i++) {
|
|
|
buildgood(i,checkedItems[i]);
|
|
|
if( i == checkedItems.length -1){
|
|
|
skns = skns+ checkedItems[i]
|
|
|
}else{
|
...
|
...
|
@@ -270,13 +271,14 @@ |
|
|
width:200,
|
|
|
onClick: function () {
|
|
|
$("#publishArticleForm").form("submit",{
|
|
|
url : contextPath+"/grassArticle/publishArticle",
|
|
|
url : serverContextPath+"/grassArticle/updateArticleDraft",
|
|
|
onSubmit : function(param) {
|
|
|
debugger;
|
|
|
if (!$("#publishArticleForm").form("validate")) {
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
$("#draftType").val(2);
|
|
|
var imgs = '';
|
|
|
var imageCount = 0;
|
|
|
$("input[name='url']").each(function(j,item){
|
...
|
...
|
@@ -294,6 +296,10 @@ |
|
|
$.messager.alert("发布失败", "最多只能选择9张图片", "error");
|
|
|
return false;
|
|
|
}
|
|
|
if(imageCount < 1){
|
|
|
$.messager.alert("发布失败", "请选择至少一张图片", "error");
|
|
|
return false;
|
|
|
}
|
|
|
var labels = '';
|
|
|
$("input[name='labelId']").each(function(j,item){
|
|
|
debugger
|
...
|
...
|
@@ -332,14 +338,14 @@ |
|
|
width:200,
|
|
|
onClick: function () {
|
|
|
$("#publishArticleForm").form("submit",{
|
|
|
url : contextPath+"/grassArticle/saveArticleDraft",
|
|
|
url : serverContextPath+"/grassArticle/updateArticleDraft",
|
|
|
onSubmit : function(param) {
|
|
|
debugger;
|
|
|
if (!$("#publishArticleForm").form("validate")) {
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
$("#draftType").val(1);
|
|
|
var imgs = '';
|
|
|
var imageCount = 0;
|
|
|
$("input[name='url']").each(function(j,item){
|
...
|
...
|
@@ -357,6 +363,10 @@ |
|
|
$.messager.alert("保存失败", "最多只能选择9张图片", "error");
|
|
|
return false;
|
|
|
}
|
|
|
if(imageCount < 1){
|
|
|
$.messager.alert("发布失败", "请选择至少一张图片", "error");
|
|
|
return false;
|
|
|
}
|
|
|
var labels = '';
|
|
|
$("input[name='labelId']").each(function(j,item){
|
|
|
debugger
|
...
|
...
|
@@ -395,7 +405,7 @@ |
|
|
height: 120,
|
|
|
realInputName: "url",
|
|
|
uploadInputName: "files",
|
|
|
url: contextPath + '/fileupload/uploads',
|
|
|
url: serverContextPath + '/fileupload/uploads',
|
|
|
queryParams: {
|
|
|
bucket: "grassImg"
|
|
|
},
|
...
|
...
|
@@ -467,6 +477,7 @@ |
|
|
|
|
|
|
|
|
$("#articleUid").textbox("setValue", data.authorUid);
|
|
|
$("#draftArticleId").val(data.articleId);
|
|
|
|
|
|
//奖品数量不可修改
|
|
|
$("#content").val(data.articleContent);
|
...
|
...
|
@@ -484,8 +495,10 @@ |
|
|
$("#imageUpload"+j).imageUpload("setValue",data.imgList[j-1])
|
|
|
}
|
|
|
|
|
|
debugger
|
|
|
if(data.sknList!=null && data.sknList.length>0){
|
|
|
initGoods(data.sknList,data.sknType);
|
|
|
$("#sknType").val(data.sknType);
|
|
|
}
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -551,7 +564,7 @@ |
|
|
height: 120,
|
|
|
realInputName: "url",
|
|
|
uploadInputName: "files",
|
|
|
url: contextPath + '/fileupload/uploads',
|
|
|
url: serverContextPath + '/fileupload/uploads',
|
|
|
queryParams: {
|
|
|
bucket: "grassImg"
|
|
|
},
|
...
|
...
|
@@ -641,7 +654,7 @@ |
|
|
}
|
|
|
function gooddiv(data) {
|
|
|
|
|
|
return " <span>商品图:<img width=\"120\" height=\"60\" src="+getImageUrl(data.default_images)+
|
|
|
return " <span>商品图:<img width=\"100\" height=\"60\" src="+getImageUrl(data.default_images)+
|
|
|
" /> <a href=\"#\" class=\"goodTag\" data-index=\""+data.product_skn+"\">x</a></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>"
|
...
|
...
|
@@ -734,16 +747,17 @@ |
|
|
|
|
|
function initGoods(skns,type) {
|
|
|
debugger
|
|
|
// var url=serverContextPath+"/grassArticle/queryGoods ";
|
|
|
var url = contextPath+"/search/queryGoods";
|
|
|
var url=serverContextPath+"/grassArticle/queryGoods ";
|
|
|
// var url = contextPath+"/search/queryGoods";
|
|
|
var query ='';
|
|
|
var params ='';
|
|
|
for (var i=0;i<skns;i++){
|
|
|
for (var i=0;i<skns.length;i++){
|
|
|
if(query==''){
|
|
|
query = skns[i];
|
|
|
}else{
|
|
|
query = query+","+skns[i];
|
|
|
}
|
|
|
checkedItems.push(skns[i]);
|
|
|
}
|
|
|
if(type==1){
|
|
|
params = "?query="+query+"&status=1&stocknumber=1&attribute_not=2";
|
...
|
...
|
@@ -755,21 +769,20 @@ |
|
|
$.post(url+params, function (data) {
|
|
|
debugger
|
|
|
if(data.code == 200){
|
|
|
for (var i=0; i<data.list.length;i++){
|
|
|
var rowdata = data.list[i]
|
|
|
for (var i=0; i<data.data.list.length;i++){
|
|
|
var rowdata = data.data.list[i]
|
|
|
checkedItemsObj[rowdata.product_skn] = rowdata;
|
|
|
checkedItems.push(rowdata.product_skn);
|
|
|
}
|
|
|
var skns = '';
|
|
|
for (var i = 0; i < checkedItems.length; i++) {
|
|
|
buildgood(i,checkedItems[i]);
|
|
|
if( i == checkedItems.length -1){
|
|
|
skns = skns+ checkedItems[i]
|
|
|
var skns1 = '';
|
|
|
for (var j = 0; j < checkedItems.length; j++) {
|
|
|
buildgood(j,checkedItems[j]);
|
|
|
if( j == checkedItems.length -1){
|
|
|
skns1 = skns1+ checkedItems[j]
|
|
|
}else{
|
|
|
skns = skns+ checkedItems[i] +","
|
|
|
skns1 = skns1+ checkedItems[j] +","
|
|
|
}
|
|
|
}
|
|
|
$("#skns").val(skns);
|
|
|
$("#skns").val(skns1);
|
|
|
}
|
|
|
}, "json");
|
|
|
}
|
...
|
...
|
|