功能:同步小程序流程

This commit is contained in:
xiaowang
2026-05-23 18:45:41 +08:00
parent 844516988b
commit 30ae763e18
117 changed files with 8823 additions and 76 deletions
+100
View File
@@ -3,9 +3,17 @@
* 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')
/**
* Purpose: actionGuard supports user.js by holding or executing the action guard page or API role.
* Usage: import, call, read, or update this const from the owning page/module while preserving the surrounding loading and permission flow.
*/
const actionGuard = require('../utils/action-guard')
const { API_BASE_URL, REQUEST_TIMEOUT } = require('../utils/config')
/**
* Purpose: normalizeUploadResponse supports user.js by holding or executing the normalize upload response page or API role.
* Usage: import, call, read, or update this function from the owning page/module while preserving the surrounding loading and permission flow.
*/
function normalizeUploadResponse(response) {
if (!response) {
throw new Error('头像上传失败')
@@ -37,6 +45,10 @@ function normalizeUploadResponse(response) {
}
module.exports = {
/**
* Purpose: getUserInfo supports user.js by holding or executing the get user info 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.
*/
getUserInfo() {
return request({
url: '/user/info'
@@ -51,30 +63,50 @@ module.exports = {
})
},
/**
* Purpose: getMyBalanceHistory supports user.js by holding or executing the get my balance history 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.
*/
getMyBalanceHistory() {
return request({
url: '/user/balance/history/me'
})
},
/**
* Purpose: listMyMessages supports user.js by holding or executing the list my messages 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.
*/
listMyMessages() {
return request({
url: '/system-message/my/list'
})
},
/**
* Purpose: listMyPopupMessages supports user.js by holding or executing the list my popup messages 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.
*/
listMyPopupMessages() {
return request({
url: '/system-message/my/popup'
})
},
/**
* Purpose: getMyUnreadMessageCount supports user.js by holding or executing the get my unread message count 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.
*/
getMyUnreadMessageCount() {
return request({
url: '/system-message/my/unread-count'
})
},
/**
* Purpose: markMessagePopupShown supports user.js by holding or executing the mark message popup shown 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.
*/
markMessagePopupShown(id) {
return request({
url: `/system-message/my/${id}/popup-shown`,
@@ -83,6 +115,10 @@ module.exports = {
})
},
/**
* Purpose: markMessageRead supports user.js by holding or executing the mark message read 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.
*/
markMessageRead(id) {
return request({
url: `/system-message/my/${id}/read`,
@@ -91,6 +127,10 @@ module.exports = {
})
},
/**
* Purpose: listMyAnnouncements supports user.js by holding or executing the list my announcements 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.
*/
listMyAnnouncements() {
return request({
url: '/announcement/my/list'
@@ -104,18 +144,30 @@ module.exports = {
})
},
/**
* Purpose: getShopManagerContact supports user.js by holding or executing the get shop manager contact 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.
*/
getShopManagerContact(shopId) {
return request({
url: `/contact-info/shop/${shopId}/manager`
})
},
/**
* Purpose: getProductArtistContact supports user.js by holding or executing the get product artist contact 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.
*/
getProductArtistContact(productId, artistId) {
return request({
url: `/contact-info/product/${productId}/artist/${artistId}`
})
},
/**
* Purpose: getOrderArtistContact supports user.js by holding or executing the get order artist contact 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.
*/
getOrderArtistContact(orderId, artistId) {
return request({
url: `/contact-info/order/${orderId}/artist`,
@@ -123,6 +175,10 @@ module.exports = {
})
},
/**
* Purpose: updateUserInfo supports user.js by holding or executing the update user info 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.
*/
updateUserInfo(data) {
return request({
url: '/user/update',
@@ -131,6 +187,10 @@ module.exports = {
})
},
/**
* Purpose: updatePassword supports user.js by holding or executing the update password 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.
*/
updatePassword(data) {
return request({
url: '/user/password',
@@ -139,6 +199,10 @@ module.exports = {
})
},
/**
* Purpose: bindPhone supports user.js by holding or executing the bind phone 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.
*/
bindPhone(data) {
return request({
url: '/user/bind-phone',
@@ -147,6 +211,10 @@ module.exports = {
})
},
/**
* Purpose: updatePhone supports user.js by holding or executing the update phone 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.
*/
updatePhone(data) {
return request({
url: '/user/phone',
@@ -155,6 +223,10 @@ module.exports = {
})
},
/**
* Purpose: deactivateAccount supports user.js by holding or executing the deactivate account 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.
*/
deactivateAccount() {
return request({
url: '/user/deactivate',
@@ -162,6 +234,10 @@ module.exports = {
})
},
/**
* Purpose: uploadAvatar supports user.js by holding or executing the upload avatar 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.
*/
uploadAvatar(filePath) {
const signedHeaders = request.buildSignatureHeaders({
url: '/user/upload-avatar',
@@ -192,36 +268,60 @@ module.exports = {
})
},
/**
* Purpose: checkAccountAvailability supports user.js by holding or executing the check account availability 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.
*/
checkAccountAvailability(account) {
return request({
url: `/user/check/account/${encodeURIComponent(account)}`
})
},
/**
* Purpose: checkLoginAccountAvailability supports user.js by holding or executing the check login account availability 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.
*/
checkLoginAccountAvailability(account) {
return request({
url: `/user/check/login-account/${encodeURIComponent(account)}`
})
},
/**
* Purpose: getLoginShopsByAccount supports user.js by holding or executing the get login shops by account 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.
*/
getLoginShopsByAccount(account) {
return request({
url: `/user/check/login-shops/account/${encodeURIComponent(account)}`
})
},
/**
* Purpose: getLoginShopsByPhone supports user.js by holding or executing the get login shops by phone 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.
*/
getLoginShopsByPhone(phone) {
return request({
url: `/user/check/login-shops/phone/${encodeURIComponent(phone)}`
})
},
/**
* Purpose: checkPhoneAvailability supports user.js by holding or executing the check phone availability 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.
*/
checkPhoneAvailability(phone) {
return request({
url: `/user/check/phone/${encodeURIComponent(phone)}`
})
},
/**
* Purpose: sendVerificationCode supports user.js by holding or executing the send verification code 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.
*/
sendVerificationCode(data) {
return request({
url: '/user/send-verification-code',