import {req} from "../request" //用户信息 const index = () => req({url: "user"}) //切换用户登录 const mobiles = () => req({url: "user/mobiles"}) //卡券 const coupon = (status) => req({url: "coupons?status=" + status}) //卡券分组 const couponArr = (activityId, status, page) => req({url: "coupons/list", data:{activityId : activityId, status : status, page : page}}) //卡券详情 const couponinfo = (coupon_id, user_lng, user_lat) => req({url: "coupons/show", data:{coupon_id : coupon_id, user_lng : user_lng, user_lat : user_lat}}) //卡券二维码 const qrcode = (coupon_id) => req({url: "coupons/qrcode", data:{coupon_id : coupon_id}}) //卡券二维码 const barcode = (coupon_id) => req({url: "coupons/" + coupon_id + '/barcode'}) //门店列表 const stores = (coupon_id, province_id, city_id, district_id, title, user_lng, user_lat, page) => req({url: "coupons/new_stores", method: "POST", data:{coupon_id : coupon_id, province_id : province_id || '', city_id : city_id || '', district_id : district_id || '', title : title || '', user_lng : user_lng, user_lat : user_lat, page : page}}) //门店详情 const storesShow = (store_id, user_lng, user_lat) => req({url: "coupons/store/show", data:{store_id : store_id, user_lng : user_lng, user_lat : user_lat}}) //省市区 const areas = (psn) => req({url: "areas/children?psn=" + psn}) // 加入微信卡包 const jssdk = (coupon_id) => req({url: "coupons/jssdk?coupon_id=" + coupon_id}) // 积分卡激活 const cards = (code, pass) => req({url: "user/cards/activate", method: "POST", data:{code : code, pass : pass}}) // 积分账变记录 const logs = (type, channel, page) => req({url: "account/logs", data:{type : type, channel: channel, page : page}}) // 冻结列表 const ungrants = (type,) => req({url: "account/newungrants", data:{type : type}}) // 发送短信 const send = (mobile, channel, type) => req({url: "sms/send", method: "POST", data:{mobile : mobile, channel : channel, type : type}}) // 领取红包 const unicom = (mobile, channel, code) => req({url: "unicom/get", method: "POST", data:{mobile : mobile, channel : channel, code : code}}) // 获取商家券信息 const merchant_card = (coupon_id) => req({url: "coupons/merchant_card", method: "GET", data:{coupon_id : coupon_id}}) // 获取商家券信息 const washcarBuy = (welfare_id, right_id, qty, address_id, is_deliver) => req({url: "washcar/create", data:{welfare_id : welfare_id, right_id : right_id, qty : qty, address_id : address_id || '', is_deliver : is_deliver}}) // 收银台提交 const washcarCreate = (welfare_id, right_id, qty, address_id, is_deliver) => req({url: "washcar/create", method: "POST", data:{welfare_id : welfare_id, right_id : right_id, qty : qty, address_id : address_id || '', is_deliver : is_deliver}}) export default({ index, mobiles, coupon, couponArr, couponinfo, qrcode, barcode, stores, storesShow, areas, jssdk, cards, logs, ungrants, send, unicom, merchant_card, washcarBuy, washcarCreate })