style(project): 统一模式切换快照写法

This commit is contained in:
2026-02-20 10:41:07 +08:00
parent ddc9df38e0
commit df31135940
2 changed files with 19 additions and 23 deletions

View File

@@ -247,15 +247,13 @@ export function useStoreFeesPage() {
if (selectedStoreId.value === currentStoreId) {
isConfigured.value = true;
loadedStoreId.value = currentStoreId;
if (snapshot.value) {
snapshot.value = {
...snapshot.value,
packagingFeeMode: form.packagingFeeMode,
orderPackagingFeeMode: form.orderPackagingFeeMode,
};
} else {
snapshot.value = createSettingsSnapshot(form);
}
snapshot.value = snapshot.value
? {
...snapshot.value,
packagingFeeMode: form.packagingFeeMode,
orderPackagingFeeMode: form.orderPackagingFeeMode,
}
: createSettingsSnapshot(form);
message.success('包装费收取方式已切换');
}
} catch (error) {

View File

@@ -277,20 +277,18 @@ export function useStorePickupPage() {
if (selectedStoreId.value === currentStoreId) {
isConfigured.value = true;
loadedStoreId.value = currentStoreId;
if (snapshot.value) {
snapshot.value = {
...snapshot.value,
mode: value,
};
} else {
snapshot.value = createSettingsSnapshot({
mode: value,
basicSettings,
bigSlots: bigSlots.value,
fineRule,
previewDays: previewDays.value,
});
}
snapshot.value = snapshot.value
? {
...snapshot.value,
mode: value,
}
: createSettingsSnapshot({
mode: value,
basicSettings,
bigSlots: bigSlots.value,
fineRule,
previewDays: previewDays.value,
});
message.success('自提预约模式已切换');
}
} catch (error) {