PromotionCode.js 2.43 KB
/**
 * Created by yoho on 2016/6/20.
 */
module.exports = function (app) {

    /*************************************优惠码管理*************************************/
    //列表页
    app.get("/marketing/promotionCode", "marketing.PromotionCode.Index", function () {
        this.$extend = {
            moduleName: '营销管理',
            pageName: '优惠码码列表',
            filter: true,
            createUrl: '/market/coupon/add',
            gridurl: '/market/coupon/getPromotion'
        }
    });

    //优惠码码列表
    app.post("/marketing/getPromotionCodeList", "PromotionCode_getPromotionCodeList");

    //添加页
    app.get("/marketing/promotionCode/add", "marketing.PromotionCode.Edit", function () {
        this.$extend = {
            moduleName: '营销管理',
            pageName: '添加优惠码',
            action: "/marketing/addPromotionCode",
            type: "add",
            data: {
                limitTimes: "0",
                reqDepartment: "零售部/营销策划",
                userSourceLimit: "1",
                userTypeLimit: "1",
                userUseLimit: "1",
                staff: "admin",
                status: "0"
            }
        }
    });
    //添加限购码
    app.post("/marketing/addPromotionCode", "PromotionCode_AddPromotionCode");

    //编辑限购码页面渲染
    app.get("/marketing/promotionCode/update/:id", "marketing.PromotionCode.Edit", function () {
        this.$extend = {
            moduleName: '营销管理',
            pageName: '编辑优惠码',
            action: "/marketing/updateLimitCode",
            type: "update"
        }
    });
    //编辑限购码
    app.post("/marketing/updatePromotionCode", "PromotionCode_updatePromotionCode");

    //通过、驳回、作废限购码接口
    app.post("/marketing/auditPromotion", "PromotionCode_auditPromotion");

    //发放
    app.post("/marketing/getPromotionCodeSendList", "PromotionCode_getPromotionCodeSendList");

    //tab卡数据
    app.post("/marketing/getPromotionCodeCountByStatus", "PromotionCode_getPromotionCodeCountByStatus");

    //查看限购码页面渲染
    app.get("/marketing/promotionCode/info/:id", "marketing.PromotionCode.Edit", function () {
        this.$extend = {
            moduleName: '营销管理',
            pageName: '优惠码详情'
        }
    });
//验证优惠码
    app.post("/marketing/checkPromotionCode", "PromotionCode_checkPromotionCode");


};