Authored by 张帅

同步逛文章到种草

... ... @@ -86,5 +86,7 @@ module.exports=function(app) {
app.get("/guang/updateArticlePic/background/:page", "guang.info.Update");
app.post("/guang/updateArticlePic", "infoManager_updateArticlePic");
app.post("/guang/syncArticleToGrass", "infoManager_syncArticleToGrass");
}
... ...
... ... @@ -156,6 +156,13 @@ module.exports={
{name: "page", type:"Number"},
{name: "size", type:"Number", default: 0}
]
},
syncArticleToGrass:{
title: "同步逛文章到种草频道",
url: "/guang/article/syncArticleToGrass",
params: [
{name: "id", type:"Number"}
]
}
}
}
\ No newline at end of file
... ...
... ... @@ -206,6 +206,8 @@ var g = new common.grid({
//} else {
// HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-success btn-xs info-toHomePage">同步逛频道</a>');
//}
HtmArr.push('<a data-index="' + items.__index + '" href="JavaScript:;" class="btn btn-success btn-xs info-syncToGrass"同步到种草></a>');
return HtmArr.join('');
}
... ... @@ -344,12 +346,32 @@ $(document).on('click', '.info-sticky-cancel', function () {
});
});
//同步到种草
$(document).on('click', '.info-syncToGrass', function () {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
url: '/guang/article/operation',
data: {
id: item.id
}
}, function (res) {
if (res.code == 200) {
common.util.__tip('同步成功', 'success');
g.reload();
} else {
common.util.__tip(res.message);
}
});
});
//同步到逛频道
$(document).on('click', '.info-toHomePage', function () {
var item = g.rows[$(this).data("index")];
common.util.__ajax({
url: '/guang/article/operation',
url: '/guang/article/syncArticleToGrass',
data: {
id: item.id,
isToHomePage: 1
... ...