import request from '@/utils/request'
import { sellerShopHeaders } from '@/utils/sellerShop'

// 页签角标
export function getSellerShipBadges() {
  return request({
    url: '/agri/seller/ship/badges',
    method: 'get',
    headers: sellerShopHeaders()
  })
}

// 履约订单列表（仅待发货/已发货/已完成）
export function listSellerShip(query) {
  return request({
    url: '/agri/seller/ship/list',
    method: 'get',
    params: query,
    headers: sellerShopHeaders()
  })
}

// 履约订单详情
export function getSellerShip(orderId) {
  return request({
    url: '/agri/seller/ship/' + orderId,
    method: 'get',
    headers: sellerShopHeaders()
  })
}

// 整单发货
export function shipSellerShip(orderId, data) {
  return request({
    url: '/agri/seller/ship/' + orderId + '/ship',
    method: 'post',
    data: data,
    headers: sellerShopHeaders()
  })
}

// 更新物流
export function logisticsSellerShip(orderId, data) {
  return request({
    url: '/agri/seller/ship/' + orderId + '/logistics',
    method: 'post',
    data: data,
    headers: sellerShopHeaders()
  })
}

// 登记送达
export function deliveredSellerShip(orderId, data) {
  return request({
    url: '/agri/seller/ship/' + orderId + '/delivered',
    method: 'post',
    data: data,
    headers: sellerShopHeaders()
  })
}
