修复卖家发布页样式和全天时间选择
This commit is contained in:
@@ -187,6 +187,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
const draft = readPublishDraft(options.draftKey)
|
||||
if (!draft) return
|
||||
Object.assign(form, draft.form)
|
||||
normalizeOnlineTime()
|
||||
clearRecord(quantityValues)
|
||||
clearRecord(quantityModes)
|
||||
clearRecord(screenshotFiles)
|
||||
@@ -212,6 +213,13 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
}
|
||||
}
|
||||
|
||||
function normalizeOnlineTime() {
|
||||
if (form.online_start === '全天' || form.online_end === '全天') {
|
||||
form.online_start = '00:00'
|
||||
form.online_end = '23:59'
|
||||
}
|
||||
}
|
||||
|
||||
async function handleResetDraft() {
|
||||
try {
|
||||
await options.confirmReset?.()
|
||||
@@ -370,6 +378,7 @@ export function usePublishForm(options: UsePublishFormOptions) {
|
||||
}
|
||||
|
||||
async function handleSubmit() {
|
||||
normalizeOnlineTime()
|
||||
const error = validateForm()
|
||||
if (error) {
|
||||
options.notifyWarning(error)
|
||||
|
||||
Reference in New Issue
Block a user