// 引入 request 文件
import request from '../common/request.js'

//订单列表
export const orserlist = (data) => {
    return request({
        url: '/order/user/list'+data,
        method: 'get',
		header:{
			"Mall-Token": uni.getStorageSync('tokenId')
		},
    })
}
//删除订单
export const orserdelete = (data) => {
    return request({
        url: '/order/user/delete/'+data,
        method: 'delete',
		header:{
			"Mall-Token": uni.getStorageSync('tokenId')
		},
    })
}
//取消订单
export const orserclear = (data) => {
    return request({
        url: '/order/user/cancel/'+data,
        method: 'put',
		header:{
			"Mall-Token": uni.getStorageSync('tokenId')
		},
    })
}
//确认收货
export const shouhuo = (data) => {
    return request({
        url: '/order/user/receipt/'+data,
        method: 'put',
		header:{
			"Mall-Token": uni.getStorageSync('tokenId')
		},
    })
}
//订单详情
export const orderinfo = (data) => {
    return request({
        url: '/order/user/info/'+data,
        method: 'get',
		header:{
			"Mall-Token": uni.getStorageSync('tokenId')
		},
    })
}
//提交评价
export const comment = (data) => {
    return request({
        url: '/goodsComment/user/save',
        method: 'post',
		header:{
			"Mall-Token": uni.getStorageSync('tokenId')
		},
		data:data
    })
}
//根据订单id查物流信息
export const orderexpress = (data) => {
    return request({
        url: '/orderExpress/open/order/'+data,
        method: 'get',
		header:{
			"Mall-Token": uni.getStorageSync('tokenId')
		},
    })
}
//只有代发货状态才能申请退款
export const refund = (data) => {
    return request({
        url: '/order/user/apply/refund/'+data,
        method: 'put',
		header:{
			"Mall-Token": uni.getStorageSync('tokenId')
		},
    })
}