Authored by tanling

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

@@ -23,4 +23,7 @@ module.exports = function (app){ @@ -23,4 +23,7 @@ module.exports = function (app){
23 23
24 //同步 24 //同步
25 app.post("/shareOrder/syn","shareOrderAudit_syn"); 25 app.post("/shareOrder/syn","shareOrderAudit_syn");
  26 +
  27 + //同步
  28 + app.post("/shareOrder/synGuang","shareOrderAudit_synGuang");
26 } 29 }
@@ -66,6 +66,15 @@ module.exports={ @@ -66,6 +66,15 @@ module.exports={
66 {name: 'commentId', type: 'Number'}, 66 {name: 'commentId', type: 'Number'},
67 {name: 'result', type: 'String'} 67 {name: 'result', type: 'String'}
68 ] 68 ]
  69 + },
  70 +
  71 + synGuang:{
  72 + title:"同步",
  73 + url:"/shareOrder/guangSyncYesOrNo",
  74 + params:[
  75 + {name: 'commentId', type: 'Number'},
  76 + {name: 'result', type: 'String'}
  77 + ]
69 } 78 }
70 } 79 }
71 } 80 }
@@ -39,7 +39,7 @@ @@ -39,7 +39,7 @@
39 <div class="clearfix"></div> 39 <div class="clearfix"></div>
40 <div class="panel-col"> 40 <div class="panel-col">
41 <select id="socialSyncFlag" class="form-control"> 41 <select id="socialSyncFlag" class="form-control">
42 - <option value="">同步状态</option> 42 + <option value="">社区同步状态</option>
43 <option value="1">已同步</option> 43 <option value="1">已同步</option>
44 <option value="0">未同步</option> 44 <option value="0">未同步</option>
45 </select> 45 </select>
@@ -192,6 +192,12 @@ var g = new common.grid({ @@ -192,6 +192,12 @@ var g = new common.grid({
192 }else if(items.socialSyncFlag == 1){ 192 }else if(items.socialSyncFlag == 1){
193 HtmArr.push('<a data-index="' + items.__index + '" data-type="noSync" href="JavaScript:;" class="btn btn-danger btn-xs synFlag">取消同步</a>'); 193 HtmArr.push('<a data-index="' + items.__index + '" data-type="noSync" href="JavaScript:;" class="btn btn-danger btn-xs synFlag">取消同步</a>');
194 } 194 }
  195 +
  196 + if(items.guangSyncFlag == 0 ){
  197 + HtmArr.push('<a data-index="' + items.__index + '" data-type="sync" href="JavaScript:;" class="btn btn-primary btn-xs guangSynFlag">同步到逛</a>');
  198 + }else if(items.guangSyncFlag == 1){
  199 + HtmArr.push('<a data-index="' + items.__index + '" data-type="noSync" href="JavaScript:;" class="btn btn-danger btn-xs guangSynFlag">取消同步到逛</a>');
  200 + }
195 return HtmArr.join(''); 201 return HtmArr.join('');
196 } 202 }
197 } 203 }
@@ -279,6 +285,29 @@ $(document).on('click', '.synFlag', function () { @@ -279,6 +285,29 @@ $(document).on('click', '.synFlag', function () {
279 285
280 }); 286 });
281 287
  288 +// 同步
  289 +$(document).on('click', '.guangSynFlag', function () {
  290 + var item = g.rows[$(this).data("index")];
  291 +
  292 + var type = $(this).data('type');
  293 + common.util.__ajax({
  294 + url: '/shareOrder/synGuang',
  295 + data: {
  296 + commentId: item.id,
  297 + result : type
  298 + }
  299 + }, function (res) {
  300 + g.reload();
  301 + /* if (res.code == 200) {
  302 + common.util.__tip('操作成功', 'success');
  303 +
  304 + } else {
  305 + common.util.__tip(res.message,'danger');
  306 + }*/
  307 + }, false);
  308 +
  309 +});
  310 +
282 $(document).on('click', '#filter', function () { 311 $(document).on('click', '#filter', function () {
283 g.reload(); 312 g.reload();
284 }); 313 });
@@ -361,6 +390,7 @@ $('#batch-audit-fail').on('click', function () { @@ -361,6 +390,7 @@ $('#batch-audit-fail').on('click', function () {
361 function encodeHtml(str, reg) { 390 function encodeHtml(str, reg) {
362 return str ? str.replace(reg || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g, function(a, b) { 391 return str ? str.replace(reg || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g, function(a, b) {
363 if (b) { 392 if (b) {
  393 +
364 return a; 394 return a;
365 } else { 395 } else {
366 return { 396 return {