add notice bar for HomeTab.vue

This commit is contained in:
Timi
2026-10-28 11:44:15 +08:00
parent e71c0e8a4e
commit bf901f4031
8 changed files with 213 additions and 96 deletions
+4 -1
View File
@@ -1,8 +1,9 @@
import { pendingNoticeEvents } from "@/utils/pendingNoticeEvents";
import { axios } from "timi-web-api";
import type { PageResult } from "timi-web-api";
import type { CustomerEventRankView, EventOptionStat, EventRecord, EventRecordPage, EventRecordPageResult, EventRecordRankPage } from "@/types/EventRecord";
import type { Customer } from "@/types/Customer.ts";
import { withCurrentStoreId } from "@/utils/store";
import { getCurrentStoreId, withCurrentStoreId } from "@/utils/store";
const BASE_URI = "/gao/event/record";
@@ -33,9 +34,11 @@ async function update(record: EventRecord): Promise<void> {
}
async function verify(id: string): Promise<void> {
const storeId = getCurrentStoreId();
await axios.post(`${BASE_URI}/verify`, undefined, {
params: { id }
});
pendingNoticeEvents.emit("changed", storeId);
}
async function remove(id: string): Promise<void> {
+10 -3
View File
@@ -1,5 +1,6 @@
import { pendingNoticeEvents } from "@/utils/pendingNoticeEvents";
import { axios } from "timi-web-api";
import { withCurrentStoreId } from "@/utils/store";
import { getCurrentStoreId, withCurrentStoreId } from "@/utils/store";
import type {
FulfillmentActionRequest,
FulfillmentPage,
@@ -37,10 +38,16 @@ async function quickCreate(request: QuickFulfillmentCreateRequest): Promise<Orde
return await axios.post(`${URI}/quick/create`, request);
}
async function prepareStock(request: FulfillmentPrepareStockRequest): Promise<OrderFulfillment> {
return await axios.post(`${URI}/prepare-stock`, request);
const storeId = getCurrentStoreId();
const result = await axios.post(`${URI}/prepare-stock`, request);
pendingNoticeEvents.emit("changed", storeId);
return result;
}
async function verify(request: FulfillmentActionRequest): Promise<OrderFulfillment> {
return await axios.post(`${URI}/verify`, request);
const storeId = getCurrentStoreId();
const result = await axios.post(`${URI}/verify`, request);
pendingNoticeEvents.emit("changed", storeId);
return result;
}
async function reject(request: FulfillmentActionRequest): Promise<OrderFulfillment> {
return await axios.post(`${URI}/reject`, request);
+6 -2
View File
@@ -1,5 +1,6 @@
import { pendingNoticeEvents } from "@/utils/pendingNoticeEvents";
import { axios } from "timi-web-api";
import { withCurrentStoreId } from "@/utils/store";
import { getCurrentStoreId, withCurrentStoreId } from "@/utils/store";
import type {
DirectProductOrderCreateRequest,
FundRecord,
@@ -45,7 +46,10 @@ async function receivePaymentAndVerify(request: OrderPaymentReceiveRequest): Pro
return await axios.post(`${ORDER_URI}/payment/receive-and-verify`, request);
}
async function verifyPayment(id: string): Promise<FundRecord> {
return await axios.post(`${ORDER_URI}/payment/verify`, undefined, { params: { id } });
const storeId = getCurrentStoreId();
const result = await axios.post(`${ORDER_URI}/payment/verify`, undefined, { params: { id } });
pendingNoticeEvents.emit("changed", storeId);
return result;
}
async function rejectPayment(request: OrderPaymentActionRequest): Promise<FundRecord> {
return await axios.post(`${ORDER_URI}/payment/reject`, request);