1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- import request from '../utils/request.js'
- class order extends request {
- static async getOrderList(page = 1, pageSize = 10, orderStatus, writeOffStatus,foodOrder=2) {
- const res = await this.getRequest(`${this.BASE_URL}Order/index?page=${page}&pageSize=${pageSize}&orderStatus=${orderStatus}&pay=${writeOffStatus}&foodOrder=${foodOrder}`)
- return res.data
- }
- static async getDiscussOffOrderList(page = 1, pageSize = 10, orderStatus, writeOffStatus) {
- const res = await this.getRequest(`${this.BASE_URL}Order/index?page=${page}&pageSize=${pageSize}&orderStatus=${orderStatus}&pay=${writeOffStatus}`)
- return res.data
- }
- static async getAllOrderList(page = 1, pageSize = 10) {
- const res = await this.getRequest(`${this.BASE_URL}Order/index?page=${page}&pageSize=${pageSize}`)
- return res.data
- }
- static async getOrderById(id) {
- const res = await this.getRequest(`${this.BASE_URL}Order/read?id=${id}`)
- return res.data
- }
- static async payOrderAgain(data) {
- const res = await this.postRequest(`${this.BASE_URL}Order/payOrderAgain`,data)
- return res.data
- }
- static async refreshCode(data) {
- const res = await this.postRequest(`${this.BASE_URL}Order/changeCode`,data)
- return res.data
- }
-
- static async createOrder(data) {
- const res = await this.postRequest(`${this.BASE_URL}Order/createOrder`,data)
- return res.data
- }
- static async deleteOrder(id) {
- const res = await this.postRequest(`${this.BASE_URL}Order/deleteOrder?orderId=${id}`)
- return res.data
- }
- static async closeOrder(id) {
- const res = await this.postRequest(`${this.BASE_URL}Order/closeOrder?orderId=${id}`)
- return res
- }
- static async createFoodOrder(data) {
- const res = await this.postRequest(`${this.BASE_URL}Order/createFoodOrder`,data)
- return res.data
- }
- static async startServer(orderId) {
- const res = await this.postRequest(`${this.BASE_URL}Order/serverStart`,{orderId:orderId})
- return res.data
- }
- static async endServer(orderId) {
- const res = await this.postRequest(`${this.BASE_URL}Order/serverComplete`,{orderId:orderId})
- return res.data
- }
- }
- export default order
|