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

/**
 * 获取订单状态
 * @param {String} order_num 订单号
 * @returns {Boolean} 订单状态
 */
export const getOrderStatus = async (order_num) => {
	const res = await RequestManager.get('/get_order_status', {
		order_num
	}, true);
	return res;
}

/**
 * 获取订单列表
 * @param {Object} data 请求参数
 * @returns {Promise} 订单列表
 */
export const getOrderList = async (data) => {
	const res = await RequestManager.get('/get_order_list', data, true);
	return res;
}

/**
 * 创建网页支付订单
 * @param {Object} data 请求参数
 * @returns {Promise} 订单列表
 */
export const createWebPayOrder = async (data) => {
	const res = await RequestManager.post('/create_web_pay_order', data, true);
	return res;
}

/**
 * 获取订单链接
 * @param {String} order_num 订单号
 * @returns {Promise} 订单链接
 */
export const getOrderUrlLink = async (order_num) => {
	const res = await RequestManager.post('/get_order_url_link', {
		order_num: order_num
	}, true);
	return res;
}
//get_user_test
/**
 * 获取账号token
 * @param {*} user_id 
 * @returns 
 */
export const getUserTest = async (user_id) => {
	const res = await RequestManager.post('/get_user_test', { user_id: user_id }, true);
	return res;
}

