12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- 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}&writeOffStatus=${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}&writeOffStatus=${writeOffStatus}&discussStatus=1`)
- 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
- }
- }
- export default order
|