Authored by shuaiguo

兑券删除

... ... @@ -2,7 +2,8 @@
* Created by ty on 2016/6/23.
* 发券管理
*/
var request = require('request');
var apiDomain = global.Register.domain;
module.exports={
namespace:"exchangeCoupon",
apis:{
... ... @@ -35,12 +36,23 @@ module.exports={
{name: 'exchangeYohoCoinNum', type: 'Number'} // 使用有货币数量
]
},
update:{
title: "删除",
url: '/activity/couponExchangeActivity/delete',
params: [
{name: 'id', type: 'Number'} // 兑券纪录Id
]
delete: function(req, callback) {
const params = []
for(let key in req.body) {
params.push(key+'='+encodeURI(req.body[key]))
}
const url = apiDomain + "/activity/couponExchangeActivity/delete?"+ params.join('&')
request.get(url,function(err,res,body){
if(err) {
return callback(null, err)
}
try{
body = JSON.parse(body)
}catch{
return callback(null, {message: '删除失败'})
}
return callback(null, body);
});
},
}
}
\ No newline at end of file
... ...
... ... @@ -216,10 +216,9 @@ $(document).on('click', '.delete', function () {
"确认删除?",
function () {
common.util.__ajax({
url: '/couponSendManager/addOrUpdate',
url: '/exchangeCouponManager/delete',
data: {
id: item.id,
status: 0
}
}, function () {
g.reload();
... ...