import {
  request
} from '../_utils/request';


/** 获取收货地址详情 */
export function fetchDeliveryAddress(id) {
  return new Promise((resolve, reject) => {
    request({
      url: `CustomerAddressApi/getCustomerAddressDetails?CustomerAddressId=` + id,
      method: 'GET',
      success: function (res) {
        let detail = res.data;
    
        resolve(detail);
      },
      fail: function (error) {
        reject(error);
      }
    });
  });
}



/** 获取收货地址列表 */
export function fetchDeliveryAddressList() {
  return new Promise((resolve, reject) => {
    request({
      url: `CustomerAddressApi/getCustomerAddressList`,
      method: 'GET',
      success: function (res) {
        let list = res.data;
    
        resolve(list);
      },
      fail: function (error) {
        reject(error);
      }
    });
  });
}