视频任务管理更新
This commit is contained in:
@@ -2501,6 +2501,15 @@ export function getTaskSkipPriceAsinsPaginated(
|
||||
);
|
||||
}
|
||||
|
||||
export function markPriceTrackDispatchFailed(taskId: number, errorMessage: string) {
|
||||
return unwrapJavaResponse(
|
||||
post<JavaApiResponse<null>, { errorMessage: string }>(
|
||||
`${JAVA_API_PREFIX}/price-track/tasks/${taskId}/dispatch-failed?user_id=${encodeURIComponent(String(getCurrentUserId()))}`,
|
||||
{ errorMessage },
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
export function checkTaskSkipPriceAsin(taskId: number, country: string, asin: string) {
|
||||
return unwrapJavaResponse(
|
||||
get<JavaApiResponse<SkipPriceAsinCheckVo>>(
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
<template>
|
||||
<section class="ziniao-version-setting">
|
||||
<div class="setting-title">紫鸟版本</div>
|
||||
<div class="version-options" role="radiogroup" aria-label="紫鸟版本">
|
||||
<label v-for="option in options" :key="option.value" class="version-option"
|
||||
:class="{ active: modelValue === option.value }">
|
||||
<input :checked="modelValue === option.value" type="radio" :name="radioName" :value="option.value"
|
||||
@change="emit('update:modelValue', option.value)" />
|
||||
<span>{{ option.label }}</span>
|
||||
</label>
|
||||
</div>
|
||||
</section>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { ZiniaoVersion } from '@/shared/utils/ziniao-version'
|
||||
|
||||
defineProps<{ modelValue: ZiniaoVersion }>()
|
||||
const emit = defineEmits<{ 'update:modelValue': [value: ZiniaoVersion] }>()
|
||||
const radioName = `ziniao-version-${Math.random().toString(36).slice(2)}`
|
||||
const options: Array<{ label: string; value: ZiniaoVersion }> = [
|
||||
{ label: '新版', value: 'new' },
|
||||
{ label: '旧版', value: 'old' },
|
||||
]
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.ziniao-version-setting { margin: 16px 0; }
|
||||
.setting-title { margin-bottom: 10px; color: #bbb; font-size: 13px; }
|
||||
.version-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; min-height: 40px; padding: 3px; border: 1px solid #3a3a3a; border-radius: 6px; background: #202020; }
|
||||
.version-option { display: flex; min-width: 0; align-items: center; justify-content: center; border-radius: 4px; color: #aaa; cursor: pointer; font-size: 13px; transition: background-color .15s ease, color .15s ease; }
|
||||
.version-option:hover { color: #eee; }
|
||||
.version-option.active { background: #409eff; color: #fff; }
|
||||
.version-option input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
|
||||
</style>
|
||||
@@ -0,0 +1,20 @@
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
export type ZiniaoVersion = 'new' | 'old'
|
||||
|
||||
const STORAGE_KEY = 'ziniao:version'
|
||||
|
||||
function loadZiniaoVersion(): ZiniaoVersion {
|
||||
if (typeof window === 'undefined') return 'new'
|
||||
return window.localStorage.getItem(STORAGE_KEY) === 'old' ? 'old' : 'new'
|
||||
}
|
||||
|
||||
export function useZiniaoVersion() {
|
||||
const ziniaoVersion = ref<ZiniaoVersion>(loadZiniaoVersion())
|
||||
|
||||
watch(ziniaoVersion, (value) => {
|
||||
if (typeof window !== 'undefined') window.localStorage.setItem(STORAGE_KEY, value)
|
||||
})
|
||||
|
||||
return ziniaoVersion
|
||||
}
|
||||
Reference in New Issue
Block a user