
import RequestManager from '../request';
import common from '../common';
import { platform } from '@/common/platform/PlatformFactory'

/**
 * 获取钻石商品列表
 * @returns {Promise}
 */
export const getDiamondList = async () => {
    const res = await RequestManager.get('/get_diamond_list');
    if (res.status == 1) {
        return res.data;
    } else {

        return null;
    }
}
/**
 * 创建钻石订单
 * @param {String} productId 
 * @returns 
 */
export const createOrderProducts = async (productId) => {
    // platform.
    let postData = platform.getPayData('createOrderProducts', { product_id: productId });
    const res = await RequestManager.get('/createOrderProducts', postData);
    if (res.status == 1) {
        return res.data;
    } else {
        return null;
    }
}

/**
 * 获取订单状态
 * @returns 
 */
export const getDiamondOrderLog = async (order_num) => {
    const res = await RequestManager.get('/get_diamond_order_log', { order_num });
    return res;
}
