coupon.js 6.27 KB
exports.domain = require('../config/common.js').domain;


//路由配置
exports.res = [
    {
        route: '/coupon/index',
        method: 'GET',
        view: 'pages/coupon/index',
        src: '/coupon/index',
        noApi: true,
        data: {
            pageTitle: '优惠码列表',
            createUrl: '/coupon/add',
            bottons:'{"look":true, "couponDes": true}',
            gridurl:'/getPromotion',
            tabUrl: '/getCodeCount',
            sendUrl: '/sendPromotion',
            auditUrl: '/auditPromotion'
        }
        
    },
    {
        route: '/getPromotionCode',
        method: 'POST',
        url: '/promotioncode/getPromotionCode',
        isJsonRaw: true,
        params: [{
            name: 'id',
            type: 'String'
        }]
    },
    {
        route: '/getPromotion',
        method: 'POST',
        url: '/promotioncode/getPromotionCodeList',
        isJsonRaw: true,
        params: [{
             name: 'status',
             type: 'Number'
         }, {
             name: 'curPage',
             type: 'Number'
         }, {
             name: 'pageSize',
             type: 'Number'
         }, {
             name: 'batchNo',
             type: 'Number'
         }, {
             name: 'name',
             type: 'String'
         }, {
             name: 'reqDepartment',
             type: 'String'
         }]
    },{
        route: '/auditPromotion',
        method: 'POST',
        url: '/promotioncode/auditPromotionCode',
        isJsonRaw: true,
        params: [{
            name: 'id',
            type: 'Number'
        }, {
            name: 'status',
            type: 'Number'
        }, {
            name: 'reason',
            type: 'String'
        }]
    }, {
        route: '/sendPromotion',
        method: 'POST',
        url: '/promotioncode/getPromotionCodeSendList',
        isJsonRaw: true,
        params: [
            {
                name: 'auditTime',
                type: 'String'
            }
        ]
    },
    {
         route: '/auditPromotion',
         method: 'POST',
         url: '/promotioncode/auditPromotionCode',
         isJsonRaw: true,
         params: [{
             name: 'id',
             type: 'Number'
         }, {
             name: 'status',
             type: 'Number'
         }, {
             name: 'reason',
             type: 'String'
         }]
     }, {
         route: '/sendPromotion',
         method: 'POST',
         url: '/promotioncode/getPromotionCodeSendList',
         isJsonRaw: true,
         params: [
             {
                 name: 'auditTime',
                 type: 'String'
             }
                      ]
     }, {
         route: '/getCodeCount',
         method: 'POST',
         url: '/promotioncode/getPromotionCodeCountByStatus',
         isJsonRaw: true,
         params: [
             {
                 name: 'reqDepartment',
                 type: 'String'
             },
             {
                 name: 'name',
                 type: 'String'
             },
             {
                 name: 'batchNo',
                 type: 'Number'
             }
        ]
     },
     {//添加优惠卷页面
        route: '/coupon/add',
        method: 'GET',
        view: 'pages/coupon/edit',
        data: {
            action:"/coupon/action/add",
            type:"add",            
            data:{
                limitTimes: "0",
                reqDepartment: "零售运营部/平台运营",
                userSourceLimit: "1",
                userTypeLimit: "1",
                staff: "admin",
                status: "0"
            }
        },
        src:'/coupon/edit'
    },
    {//编辑优惠卷页面
        route: '/coupon/update/:id',
        method: 'GET',
        view: 'pages/coupon/edit',
        url: '/promotioncode/getPromotionCode',
        isJsonRaw:true,
        data:{
            action:"/coupon/action/update",
            type:"update"
        },
        src:'/coupon/edit',
        params:[
            {name:"id",type:"String"}
        ]
    },
    {//展示优惠卷详情
        route: '/coupon/info/:id',
        method: 'GET',
        view: 'pages/coupon/edit',
        url: '/promotioncode/getPromotionCode',
        isJsonRaw:true,
        src:'/coupon/edit',
        data:{
            type:"info"
        },
        params: [
            {name:"id",type:"String"}
        ]
    },
    {
        route: '/checkPromotionCode',
        method: 'POST',
        url: '/promotioncode/checkPromotionCode',
        isJsonRaw: true,
        params: [
            {
                name: 'code',
                type: 'String'
            }
        ]
    },
    {
        route: '/coupon/action/add',
        method: 'POST',
        url: '/promotioncode/addPromotionCode',
        isJsonRaw: true,
        params: [
            {name: 'name',type: 'String'},
            {name: 'limitTimes',type: 'String'},
            {name: 'code',type: 'String'},
            {name: 'describe',type: 'String'},
            {name: 'promotionInfo',type: 'String'},
            {name: 'userSourceLimit',type: 'String'},
            {name: 'userTypeLimit',type: 'String'},
            {name: 'creatorId',type: 'String'},
            {name: 'limitDateFrom',type: 'String'},
            {name: 'limitDateTo',type: 'String'},
            {name: 'createTime',type: 'String'},
            {name: 'reqDepartment',type: 'String'},
            {name: 'status',type: 'String'},
            {name: 'staff',type: 'String'}
        ]
    },
    {
        route: '/coupon/action/update',
        method: 'POST',
        url: '/promotioncode/updatePromotionCode',
        isJsonRaw: true,
        params: [
             {name: 'id',type: 'String'},
             {name: 'name',type: 'String'},
             {name: 'limitTimes',type: 'String'},
             {name: 'code',type: 'String'},
             {name: 'describe',type: 'String'},
             {name: 'promotionInfo',type: 'String'},
             {name: 'userSourceLimit',type: 'String'},
             {name: 'userTypeLimit',type: 'String'},
             {name: 'creatorId',type: 'String'},
             {name: 'limitDateFrom',type: 'String'},
             {name: 'limitDateTo',type: 'String'},
             {name: 'createTime',type: 'String'},
             {name: 'reqDepartment',type: 'String'},
             {name: 'status',type: 'String'}
         ]
    }
 ]