mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 13:09:19 +08:00
feat: 完成多日读取支持
This commit is contained in:
@@ -7,6 +7,12 @@ import {
|
||||
} from '@/shared/messages';
|
||||
import type { AdvertisingCostBatch } from '@/types/advertisingCost';
|
||||
|
||||
import {
|
||||
isFloatingVisible,
|
||||
setFloatingVisible,
|
||||
toggleFloatingPanel,
|
||||
} from './floating/mount';
|
||||
|
||||
async function handleMessage(message: ExtensionMessage): Promise<ExtensionResponse> {
|
||||
const adapter = resolveAdapter(location.href);
|
||||
|
||||
@@ -18,14 +24,24 @@ async function handleMessage(message: ExtensionMessage): Promise<ExtensionRespon
|
||||
return { ok: true, data };
|
||||
}
|
||||
case 'PARSE_ADVERTISING_COST': {
|
||||
const parsed = await adapter.parseAdvertisingCost(message.payload.feeDate);
|
||||
// channelShopId 由 Popup 选择后填入
|
||||
const parsed = await adapter.parseAdvertisingCost();
|
||||
const data: AdvertisingCostBatch = {
|
||||
...parsed,
|
||||
channelShopId: 0,
|
||||
};
|
||||
return { ok: true, data };
|
||||
}
|
||||
case 'TOGGLE_FLOATING_PANEL': {
|
||||
const visible = toggleFloatingPanel();
|
||||
return { ok: true, data: { visible } };
|
||||
}
|
||||
case 'SET_FLOATING_PANEL': {
|
||||
const visible = setFloatingVisible(message.payload.visible);
|
||||
return { ok: true, data: { visible } };
|
||||
}
|
||||
case 'GET_FLOATING_PANEL_STATE': {
|
||||
return { ok: true, data: { visible: isFloatingVisible() } };
|
||||
}
|
||||
default:
|
||||
return {
|
||||
ok: false,
|
||||
|
||||
Reference in New Issue
Block a user