import request from "@/utils/request.js";

// 设置默认地址
export function defaultAddr(data) {
    return request({
        method: 'post',
        url: '/tAddress/defaultAddress',
        data
    });
}

// 添加地址
export function netAddressAdd(data) {
    return request({
        method: 'post',
        url: '/tAddress/save',
        data
    });
}

// 修改地址
export function netAddressUpdate(data) {
    return request({
        method: 'post',
        url: '/tAddress/update',
        data
    });
}

// 删除地址
export function netAddressDel(data) {
    return request({
        method: 'delete',
        url: '/tAddress/delete',
        data,
        header: {
            'content-type': 'application/x-www-form-urlencoded'
        }
    });
}

// 地址列表
export function getAddrList(data) {
    return request({
        method: 'get',
        url: '/tAddress/getByOpenId',
        data
    });
}

// 地址详情
export function getAddrById(data) {
    return request({
        method: 'get',
        url: '/tAddress/getById',
        data
    });
}

// 查询技师的虚拟地址
export function getVirtualAddrByPhone(data) {
    return request({
        method: 'get',
        url: '/tAddress/wx/getVirtualAddressByPhone',
        data
    });
}

// 新增虚拟地址
export function netVirtualAddrAdd(data) {
    return request({
        method: 'post',
        url: '/tAddress/saveVirtualAddress',
        data
    });
}

// 删除虚拟地址
export function netVirtualAddrDel(data) {
    let str = uni.$u.queryParams(data);
    return request({
        method: 'delete',
        url: `/tAddress/deleteVirtualAddress${str}`,
        data
    });
}