// 引入 request 文件
import request from '@/common/api/request.js'
const url = '/order'

let platformType = '';
let payType='';
// #ifdef MP-WEIXIN
platformType = 'wechat'
payType='WECHAT'
// #endif
// #ifdef MP-ALIPAY
platformType = 'alipay'
payType='ALIPAY'
// #endif

export const pointGoodsPage = (data) => {
    return request({
        url: url + '/user/pointGoods/page',
        method: 'get',
        data: data
    })
}
export const pointsGoods = (data) => {
    return request({
        url: url + '/user/pointGoods/'+data.id,
        method: 'get',
    })
}


export const exchange = (data) => {
    return request({
        url: url + '/user/pointGoods/exchange',
        method: 'post',
        data: {...data,payType}
    })
}


export const applyRefund = (data) => {
    return request({
        url: url + '/user/pointGoods/applyRefund',
        method: 'post',
        data: data
    })
}


export const cancelRefund = (data) => {
    return request({
        url: url + '/user/pointGoods/cancelRefund',
        method: 'post',
        data: data
    })
}


export const recordPage = (data) => {
    return request({
        url: url + '/user/pointGoods/record/page',
        method: 'get',
        data: data
    })
}

export const recordOne = (data) => {
    return request({
        url: url + '/user/pointGoods/record/one',
        method: 'get',
        data: data
    })
}