Files
JayuCloud/WeChatProgram/api/order.js
T

132 lines
4.6 KiB
JavaScript

/**
* Mini program API wrapper for this module.
* Call guide: require this module in a page, then invoke the matching method from page event handlers or lifecycle hooks.
*/
const request = require('../utils/request')
module.exports = {
/**
* Purpose: createOrder supports order.js by holding or executing the create order page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
createOrder(data) {
return request({
url: '/order/create',
method: 'POST',
data
})
},
/**
* Purpose: getOrderList supports order.js by holding or executing the get order list page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
getOrderList() {
return request({
url: '/order/list'
})
},
/**
* Purpose: listMyPendingReviews supports order.js by holding or executing the list my pending reviews page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
listMyPendingReviews() {
return request({
url: '/order/review/my-pending'
})
},
/**
* Purpose: listOrderReviews supports order.js by holding or executing the list order reviews page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
listOrderReviews(orderId) {
return request({
url: `/order/${orderId}/reviews`
})
},
/**
* Purpose: submitArtistReview supports order.js by holding or executing the submit artist review page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
submitArtistReview(reviewId, data) {
return request({
url: `/order/review/${reviewId}/submit`,
method: 'POST',
data
})
},
/**
* Purpose: getArtistChangeOptions supports order.js by holding or executing the get artist change options page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
getArtistChangeOptions(orderId, orderItemId) {
return request({
url: `/order/${orderId}/artist-change/options`,
params: {
orderItemId
}
})
},
/**
* Purpose: requestArtistChange supports order.js by holding or executing the request artist change page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
requestArtistChange(data) {
return request({
url: '/order/artist-change/request',
method: 'POST',
data
})
},
/**
* Purpose: listMyPendingArtistChangeRequests supports order.js by holding or executing the list my pending artist change requests page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
listMyPendingArtistChangeRequests() {
return request({
url: '/order/artist-change/my-pending'
})
},
/**
* Purpose: approveArtistChange supports order.js by holding or executing the approve artist change page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
approveArtistChange(requestId) {
return request({
url: `/order/artist-change/${requestId}/approve`,
method: 'PUT',
data: {}
})
},
/**
* Purpose: rejectArtistChange supports order.js by holding or executing the reject artist change page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
rejectArtistChange(requestId, data) {
return request({
url: `/order/artist-change/${requestId}/reject`,
method: 'PUT',
data: data || {}
})
},
/**
* Purpose: cancelOrder supports order.js by holding or executing the cancel order page or API role.
* Usage: import, call, read, or update this method from the owning page/module while preserving the surrounding loading and permission flow.
*/
cancelOrder(orderId) {
return request({
url: `/order/cancel/${orderId}`,
method: 'PUT'
})
}
}