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

export const vipApi = {
  // 获取会员状态
  getStatus(userId) {
    return request({
      url: '/vip/status',
      method: 'GET',
      data: { userId },
      headers: {
        'Authorization': `Bearer ${uni.getStorageSync('token')}`
      }
    })
  },
  
  // 购买会员
  purchase(order) {
    return request({
      url: '/vip/purchase',
      method: 'POST',
      data: order,
      headers: {
        'Content-Type': 'application/json',
        'Authorization': `Bearer ${uni.getStorageSync('token')}`
      }
    })
  },
  
  // 获取会员权益列表
  getPrivileges() {
    return request({
      url: '/vip/privileges',
      method: 'GET'
    })
  }
}