coupon.js 3.76 KB
/**
 * 桩数据
 *  @author h1bomb
 */

module.exports = {
    '/promotioncode/getPromotionCodeList': function(req, res) {
        res.json({
            code: 200,
            data: [{
                batchNo: 'DFX100332SXX',
                code: 'DFX100332SXX',
                id: 1,
                name: '50元优惠券',
                limitTimes: 10,
                reqDepartment: '零售部/运营部',
                limitDateFrom: '2016-01-16 00:00:00',
                limitDateTo: '2016-01-20 00:00:00',
                describe: '新注册用户全场满200减50',
                staff: '李四',
                status: 0
            }, {
                batchNo: 'DFX100332SXX',
                code: 'DFX100333SXX',
                id: 2,
                name: '50元优惠券',
                limitTimes: 10,
                reqDepartment: '零售部/运营部',
                limitDateFrom: '2016-01-16 00:00:00',
                limitDateTo: '2016-01-20 00:00:00',
                describe: '新注册用户全场满200减50',
                staff: '李四',
                status: 1
            }, {
                batchNo: 'DFX100332SXX',
                code: 'DFX100334SXX',
                id: 3,
                name: '50元优惠券',
                limitTimes: 10,
                reqDepartment: '零售部/运营部',
                limitDateFrom: '2016-01-16 00:00:00',
                limitDateTo: '2016-01-20 00:00:00',
                describe: '新注册用户全场满200减50',
                staff: '李四',
                status: 2
            }, {
                batchNo: 'DFX100332SXX',
                code: 'DFX100335SXX',
                id: 4,
                name: '50元优惠券',
                limitTimes: 10,
                reqDepartment: '零售部/运营部',
                limitDateFrom: '2016-01-16 00:00:00',
                limitDateTo: '2016-01-20 00:00:00',
                describe: '新注册用户全场满200减50',
                staff: '李四',
                status: 3
            }, {
                batchNo: 'DFX100332SXX',
                code: 'DFX100332SXX',
                id: 5,
                name: '50元优惠券',
                limitTimes: 10,
                reqDepartment: '零售部/运营部',
                limitDateFrom: '2016-01-16 00:00:00',
                limitDateTo: '2016-01-20 00:00:00',
                describe: '新注册用户全场满200减50',
                staff: '李四',
                status: 4
            }]
        });
        return;
    },
    '/promotioncode/getPromotionCode':function(req,res){
            var result={
              "id": 1,
              "name": "全场8折",
              "limitTimes": 1000,
              "code": "DFX100332SXX",
              "reqDepartment": "零售运营部/类目运营",
              "describe": "全场8折",
              "promotionInfo":'{"type": "2", "condition": {"amount_at_least": "100", "count_at_least": "1"}, "action": {"discount": "0.88","discount_at_most": "100"}}',
              "userUseLimit": 2,
              "userSourceLimit": "2",
              "userTypeLimit": "2",
              "creatorId": 123456,
              "limitDateFrom": "2015-12-23 12:20:00",
              "limitDateTo": "2015-16-23 12:20:00",
              "createTime": "2016-01-09 12:20:00",
              "staff":"李四",
              "state":0
            }
            res.json({code:"200",data:result,message:"操作成功"});
    },
    '/cmd':function(req,res){
        res.json({
              "code": 200,
              "message": "修改成功!"
            });
    },
    '/promotioncode/checkPromotionCode':function(req,res){
        res.json({
          "code": 200,
          "data":[{code:"xxxxx",flag:"1"}],
          "message": "修改成功!"
        });
    }
}