import {http} from '@/utils/http'
import type {
    CollectGoods, CollectStore, CreditCard, MemberPackage,
    RechargeDetail,
    RefundedOrder, RefundOrderDetail,
} from '@/pages-user/service/index.data'

/**
 * 用户信息
 */

// 修改用户信息
export const editUserInfo = (data: Record<string, any>) => http.post('/app/user/editUserInfo', data)
// 设置支付密码
export const setPayPwd = (data: Record<string, any>) => http.post('/app/user/setPayPwd', data)

// 修改支付密码
export const editPayPwd = (data: Record<string, any>) => http.post('/app/user/editPayPwd', data)

// 忘记支付密码
export const forgetPayPwd = (data: Record<string, any>) => http.post('/app/user/forgetPayPwd', data)

// 用户邀请列表
export const getUserInviteList = (data: Record<string, any>, query: PageQuery) => http.post('/app/user/my/userInviteList', data, query)


// 常见问题解答列表
export const getFaqsList = (data: Record<string, any>, query: PageQuery) => http.post('/app/user/my/faqsList', data, query)



// 余额明细类型
export const getAllBalanceDetailTypeApi = (userPort: any, data: Record<string, any>) => http.post(
    `/app/user/userBalanceDetail/allBalanceDetailType?userPort=${userPort}`,
    {}
)
// 获取州列表
export const getStateListApi = () => http.post<Record<string, any>>('/app/continent/list')

// 充值余额
export const rechargeBalanceApi = (data: Record<string, any>) => http.post('/app/userRechargeOrder/recharge', data)

// 查询首页未领取的非兑换码类型的商家优惠券
export const getCouponReceiveListApi = () => http.post('/app/coupon/couponReceiveList')
//  一键领取所有优惠券
export const receiveAllCouponApi = () => http.post('/app/coupon/receiveAll')
// 查询指定商家已领取和未领取的非对话吗优惠券
export const getMerchantCouponReceiveListApi = (merchantId: string) => http.post(`/app/coupon/merchantCouponReceiveList/${merchantId}`)
//  领取优惠券
export const receiveCouponApi = (id: string) => http.post(`/app/coupon/receiveCoupon/${id}`)
