/**
 * Web-zdx
 * moduleName: 我的数权
 */

import { request } from '../index'

// 我的数权
const mallWarrants = (data) => {
  return request({
    url: 'mall/warrants',
    method: 'GET',
    data: data
  })
}

// 我的数权Id获取数权详情
const mallWarrantsList = (symbol) => {
  return request({
    url: 'mall/warrants/exchange',
    method: 'GET',
    data: {
		symbol:symbol
	}
  })
 }
 
// 确认提货
const mallWarrantsSure = (data) => {
  return request({
    url: 'mall/warrants/exchange',
    method: 'POST',
    data: data
  })
}

// 我的邮寄订单，我的提货单
const mallShipmentsPostShop = (apiUrl,data) => {
  return request({
    url: apiUrl,
    method: 'GET',
    data: data
  })
}

// 根据提货单的no 获取提货单的详情
const mallShipmentsInfo = (no) => {
  return request({
    url: 'mall/shipments/'+no,
    method: 'GET'
  })
}

// 取消提货单
const mallShipmentsCancel = (shipmentNo) => {
  return request({
    url: 'mall/shipments/'+ shipmentNo+'/cancel',
    method: 'POST'
  })
}

// 签收提货单
const mallShipmentsSign = (shipmentNo) => {
  return request({
    url: 'mall/shipments/'+ shipmentNo+'/sign',
    method: 'POST'
  })
}

// 退货单申请退货
const mallShipmentsRefund = (data) => {
  return request({
    url: 'mall/shipments/'+ data.shipment_no+'/refund',
    method: 'POST',
	data:data
  })
}

// 退货单申请退货前置条件
const mallShipmentsRefundInfo = (shipmentNo) => {
  return request({
    url: 'mall/shipments/'+ shipmentNo+'/refund',
    method: 'GET'
  })
}

// 查看物流接口
const mallShipmentsLogistic = (shipmentNo) => {
  return request({
    url: 'mall/shipments/'+ shipmentNo+'/logistic',
    method: 'GET'
  })
}

// 我的退货单 mall/refunds
const mallRefunds = (data) => {
  return request({
    url: 'mall/refunds',
    method: 'GET',
    data: data
  })
}

//退货单详情页 
const mallRefundsInfo = (no) => {
  return request({
    url: 'mall/refunds/'+no,
    method: 'GET'
  })
}

// 确认退货mall/refunds/{refund}/deliver
const mallRefundsDeliver = (data) => {
  return request({
    url: 'mall/refunds/'+data.refund+'/deliver',
    method: 'POST',
	data:data
  })
}

// 提货单或者服务单生成提货二维码
const mallWarrantsQrcode = (data) => {
  return request({
    url: 'mall/warrants/qrcode',
    method: 'GET',
	data:data
  })
}


export {
  mallWarrants,
  mallWarrantsList,
  mallWarrantsSure,
  mallShipmentsPostShop,
  mallShipmentsInfo,
  mallShipmentsCancel,
  mallShipmentsSign,
  mallShipmentsRefund,
  mallShipmentsRefundInfo,
  mallShipmentsLogistic,
  mallRefunds,
  mallRefundsInfo,
  mallRefundsDeliver,
  mallWarrantsQrcode
}
