//个人中心
import request from '@/utils/request'

// 完善用户信息
export function updateCustomer(data) {
    return request({
        url: '/h5/personal/updateCustomer',
        method: 'post',
        data: data
    })
}

// 查询客户积分记录列表
export function getCustomerIntegralRecord(params) {
    return request({
        url: '/h5/personal/getCustomerIntegralRecord',
        method: 'get',
        params: params
    })
}

// 获取用户订单信息
export function getOrderList(params) {
    return request({
        url: '/h5/personal/getOrderList',
        method: 'get',
        params: params
    })
}

// 积分转让
export function customerIntegralTurnOut(params) {
    return request({
        url: '/h5/personal/customerIntegralTurnOut?phone='+params.phone+'&integral='+params.integral,
        method: 'post',
    })
}

// 查询客户分销记录列表
export function customerDistributionList(params) {
    return request({
        url: '/h5/personal/customerDistributionList',
        method: 'get',
        params: params
    })
}

// 查询客户优惠券信息列表
export function customerCouponList(params) {
    return request({
        url: '/h5/personal/customerCouponList',
        method: 'get',
        params: params
    })
}

//查询客户足迹或收藏信息列表
export function collectionOrFootprintList(params) {
    return request({
        url: '/h5/personal/collectionOrFootprintList',
        method: 'get',
        params: params
    })
}

// 删除客户足迹或收藏信息
export function delCollectionOrFootprint(id) {
    return request({
        url: '/h5/personal/delCollectionOrFootprint/' + id,
        method: 'delete',
    })
}

// 增加订单信息评价
export function addOrderEvalute(data) {
    return request({
        url: '/h5/order/addOrderEvalute',
        method: 'post',
        data: data
    })
}

// 删除客户订单(目前仅支持待支付订单删除)
export function delOrder(id) {
    return request({
        url: '/h5/personal/delOrder/' + id,
        method: 'delete',
    })
}

//客户订单退款
export function returnPay(id) {
    return request({
        url: '/h5/personal/returnPay/'+ id,
        method: 'get',
    })
}