Authored by tanling

晒单的列表中增加[同步到逛/取消同步到逛]按钮

... ... @@ -23,4 +23,7 @@ module.exports = function (app){
//同步
app.post("/shareOrder/syn","shareOrderAudit_syn");
//同步
app.post("/shareOrder/synGuang","shareOrderAudit_synGuang");
}
\ No newline at end of file
... ...
... ... @@ -66,6 +66,15 @@ module.exports={
{name: 'commentId', type: 'Number'},
{name: 'result', type: 'String'}
]
},
synGuang:{
title:"同步",
url:"/shareOrder/guangSyncYesOrNo",
params:[
{name: 'commentId', type: 'Number'},
{name: 'result', type: 'String'}
]
}
}
}
\ No newline at end of file
... ...
... ... @@ -39,7 +39,7 @@
<div class="clearfix"></div>
<div class="panel-col">
<select id="socialSyncFlag" class="form-control">
<option value="">同步状态</option>
<option value="">社区同步状态</option>
<option value="1">已同步</option>
<option value="0">未同步</option>
</select>
... ...
... ... @@ -192,6 +192,12 @@ var g = new common.grid({
}else if(items.socialSyncFlag == 1){
HtmArr.push('<a data-index="' + items.__index + '" data-type="noSync" href="JavaScript:;" class="btn btn-danger btn-xs synFlag">取消同步</a>');
}
if(items.guangSyncFlag == 0 ){
HtmArr.push('<a data-index="' + items.__index + '" data-type="sync" href="JavaScript:;" class="btn btn-primary btn-xs guangSynFlag">同步到逛</a>');
}else if(items.guangSyncFlag == 1){
HtmArr.push('<a data-index="' + items.__index + '" data-type="noSync" href="JavaScript:;" class="btn btn-danger btn-xs guangSynFlag">取消同步到逛</a>');
}
return HtmArr.join('');
}
}
... ... @@ -279,6 +285,29 @@ $(document).on('click', '.synFlag', function () {
});
// 同步
$(document).on('click', '.guangSynFlag', function () {
var item = g.rows[$(this).data("index")];
var type = $(this).data('type');
common.util.__ajax({
url: '/shareOrder/synGuang',
data: {
commentId: item.id,
result : type
}
}, function (res) {
g.reload();
/* if (res.code == 200) {
common.util.__tip('操作成功', 'success');
} else {
common.util.__tip(res.message,'danger');
}*/
}, false);
});
$(document).on('click', '#filter', function () {
g.reload();
});
... ... @@ -361,6 +390,7 @@ $('#batch-audit-fail').on('click', function () {
function encodeHtml(str, reg) {
return str ? str.replace(reg || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g, function(a, b) {
if (b) {
return a;
} else {
return {
... ...