支持按账号商品监控库存抢购

This commit is contained in:
yml2213
2026-08-09 18:46:39 +08:00
parent a9ad969b64
commit 02d38d9ede
6 changed files with 154 additions and 42 deletions
+9
View File
@@ -303,6 +303,14 @@ export function useAccounts() {
markSelectedStatus({ pending: true, message })
}
const markAccountNamesPending = (accountNames: string[], message = '抢购中,等待后端结果') => {
const next: Record<string, AccountStatus> = {}
accountNames.forEach(name => {
next[name] = { pending: true, message }
})
mergeStatuses(next)
}
const setAccountProduct = (accountName: string, productId: string) => {
if (productId) {
accountProductMap.value[accountName] = productId
@@ -377,6 +385,7 @@ export function useAccounts() {
setStatus,
markSelectedStatus,
markSelectedPending,
markAccountNamesPending,
setAccountProduct,
getAccountProduct,
selectedAccountNames,