2026-05-18 09:46:11 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-04-01 15:18:35 +08:00
|
|
|
const request = require('../utils/request')
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-04-01 15:18:35 +08:00
|
|
|
createOrder(data) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/order/create',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 21:56:52 +08:00
|
|
|
checkoutPreview(data) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/order/checkout-preview',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-04-01 15:18:35 +08:00
|
|
|
getOrderList() {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/order/list'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
listMyPendingReviews() {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/order/review/my-pending'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
listOrderReviews(orderId) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/order/${orderId}/reviews`
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 21:56:52 +08:00
|
|
|
/**
|
|
|
|
|
* Purpose: listOrderArtistChangeRequests loads every change request attached to one order for timeline display.
|
|
|
|
|
* Usage: call it from the order page after loading the order list; callers may fall back to an empty list.
|
|
|
|
|
*/
|
|
|
|
|
listOrderArtistChangeRequests(orderId) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/order/${orderId}/artist-change/requests`
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
submitArtistReview(reviewId, data) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/order/review/${reviewId}/submit`,
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
getArtistChangeOptions(orderId, orderItemId) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/order/${orderId}/artist-change/options`,
|
|
|
|
|
params: {
|
|
|
|
|
orderItemId
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
requestArtistChange(data) {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/order/artist-change/request',
|
|
|
|
|
method: 'POST',
|
|
|
|
|
data
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
listMyPendingArtistChangeRequests() {
|
|
|
|
|
return request({
|
|
|
|
|
url: '/order/artist-change/my-pending'
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
approveArtistChange(requestId) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/order/artist-change/${requestId}/approve`,
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
data: {}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-05-23 15:16:40 +08:00
|
|
|
rejectArtistChange(requestId, data) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/order/artist-change/${requestId}/reject`,
|
|
|
|
|
method: 'PUT',
|
|
|
|
|
data: data || {}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
2026-05-23 18:45:41 +08:00
|
|
|
/**
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
2026-04-01 15:18:35 +08:00
|
|
|
cancelOrder(orderId) {
|
|
|
|
|
return request({
|
|
|
|
|
url: `/order/cancel/${orderId}`,
|
|
|
|
|
method: 'PUT'
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|