Authored by 张帅

同步逛文章到种草

@@ -86,5 +86,7 @@ module.exports=function(app) { @@ -86,5 +86,7 @@ module.exports=function(app) {
86 app.get("/guang/updateArticlePic/background/:page", "guang.info.Update"); 86 app.get("/guang/updateArticlePic/background/:page", "guang.info.Update");
87 87
88 app.post("/guang/updateArticlePic", "infoManager_updateArticlePic"); 88 app.post("/guang/updateArticlePic", "infoManager_updateArticlePic");
  89 +
  90 + app.post("/guang/syncArticleToGrass", "infoManager_syncArticleToGrass");
89 } 91 }
90 92
@@ -156,6 +156,13 @@ module.exports={ @@ -156,6 +156,13 @@ module.exports={
156 {name: "page", type:"Number"}, 156 {name: "page", type:"Number"},
157 {name: "size", type:"Number", default: 0} 157 {name: "size", type:"Number", default: 0}
158 ] 158 ]
  159 + },
  160 + syncArticleToGrass:{
  161 + title: "同步逛文章到种草频道",
  162 + url: "/guang/article/syncArticleToGrass",
  163 + params: [
  164 + {name: "id", type:"Number"}
  165 + ]
159 } 166 }
160 } 167 }
161 } 168 }
@@ -206,6 +206,8 @@ var g = new common.grid({ @@ -206,6 +206,8 @@ var g = new common.grid({
206 //} else { 206 //} else {
207 // HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-success btn-xs info-toHomePage">同步逛频道</a>'); 207 // HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-success btn-xs info-toHomePage">同步逛频道</a>');
208 //} 208 //}
  209 +
  210 + HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-success btn-xs info-syncToGrass"同步到种草></a>');
209 211
210 return HtmArr.join(''); 212 return HtmArr.join('');
211 } 213 }
@@ -344,12 +346,32 @@ $(document).on('click', '.info-sticky-cancel', function () { @@ -344,12 +346,32 @@ $(document).on('click', '.info-sticky-cancel', function () {
344 }); 346 });
345 }); 347 });
346 348
  349 +//同步到种草
  350 +$(document).on('click', '.info-syncToGrass', function () {
  351 + var item = g.rows[$(this).data("index")];
  352 +
  353 + common.util.__ajax({
  354 + url: '/guang/article/operation',
  355 + data: {
  356 + id: item.id
  357 + }
  358 + }, function (res) {
  359 +
  360 + if (res.code == 200) {
  361 + common.util.__tip('同步成功', 'success');
  362 + g.reload();
  363 + } else {
  364 + common.util.__tip(res.message);
  365 + }
  366 + });
  367 +});
  368 +
347 //同步到逛频道 369 //同步到逛频道
348 $(document).on('click', '.info-toHomePage', function () { 370 $(document).on('click', '.info-toHomePage', function () {
349 var item = g.rows[$(this).data("index")]; 371 var item = g.rows[$(this).data("index")];
350 372
351 common.util.__ajax({ 373 common.util.__ajax({
352 - url: '/guang/article/operation', 374 + url: '/guang/article/syncArticleToGrass',
353 data: { 375 data: {
354 id: item.id, 376 id: item.id,
355 isToHomePage: 1 377 isToHomePage: 1