Files
uni-fans-score/config/api/coupon.js
T
2026-03-09 09:07:58 +08:00

42 lines
861 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import request from '../http'
// 按场地查询可用优惠券
export const getCouponsByPosition = (positionId) => {
return request({
url: `/device/coupon/app/position/${positionId}`,
method: 'get'
})
}
// 创建优惠券支付订单
export const createCouponPayment = (couponId, paymentPlatform) => {
return request({
url: '/app/coupon/pay',
method: 'post',
data: {
couponId,
// 支付平台类型:WECHAT / ALIPAY / ANTOM(不传则后端默认 WECHAT
...(paymentPlatform ? { paymentPlatform } : {})
}
})
}
// 查询用户优惠券
export const getUserCoupons = (status) => {
return request({
url: '/device/userPurchase/app/my',
method: 'get',
data: {
status
}
})
}
export const cancelCouponPayment = (orderNo) => {
return request({
url: `/device/userPurchase/app/cancel/${orderNo}`,
method: 'post'
})
}