Files
device-voice-h5/api/modules/order.js
luo 4f281da778
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 1m11s
feat: 7月迭代
2026-07-27 18:13:19 +08:00

52 lines
1.1 KiB
JavaScript

import request from '@/utils/request.js';
import { APP_TYPE } from '@/utils/env.js';
export const orderApi = {
getList(identifier, page, page_size, payment_status) {
const data = { identifier, page, page_size };
if (payment_status !== undefined && payment_status !== null) {
data.payment_status = payment_status;
}
return request({
url: '/api/c/v1/orders',
method: 'GET',
data
});
},
getDetail(id) {
return request({
url: `/api/c/v1/orders/${id}`,
method: 'GET'
});
},
create(identifier, package_ids, payment_method) {
const data = { identifier, package_ids, payment_method };
if (payment_method === 'wechat') {
data.app_type = APP_TYPE;
}
return request({
url: '/api/c/v1/orders/create',
method: 'POST',
data
});
},
pay(order_id, payment_method, password) {
const data = { payment_method };
if (payment_method === 'wechat') {
data.app_type = APP_TYPE;
}
if (password) {
data.password = password;
}
return request({
url: `/api/c/v1/orders/${order_id}/pay`,
method: 'POST',
data
});
}
};