[PROMOTE] dev → demo:APK 機台風味欄位自由輸入

1. [FEAT] APK 版本建立頁「機台風味」欄位改為自由輸入 (text input + datalist 建議值),新增必填驗證、檔名解析填入調整,並同步 zh_TW / en / ja 三語系。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
sky121113 2026-06-10 14:12:06 +08:00
commit cfa824f905
4 changed files with 22 additions and 19 deletions

View File

@ -1519,6 +1519,7 @@
"Please enter Webhook URL first.": "Please enter Webhook URL first.",
"Please enter address first": "Please enter address first",
"Please enter configuration name": "Please enter configuration name",
"Please enter machine flavor": "Please enter machine flavor",
"Please enter version name": "Please enter version name",
"Please make sure to enable \"Background graphics\" in your browser print settings to print product images and styled components correctly.": "Please make sure to enable \"Background graphics\" in your browser print settings to print product images and styled components correctly.",
"Please provide a download URL": "Please provide a download URL",

View File

@ -1519,6 +1519,7 @@
"Please enter Webhook URL first.": "最初にWebhook URLを入力してください。",
"Please enter address first": "先に住所を入力してください",
"Please enter configuration name": "設定名を入力してください",
"Please enter machine flavor": "機台フレーバーを入力してください",
"Please enter version name": "Please enter version name",
"Please make sure to enable \"Background graphics\" in your browser print settings to print product images and styled components correctly.": "商品の画像やスタイル付きコンポーネントを正しく印刷するために、ブラウザの印刷設定で『背景のグラフィック』を有効にしてください。",
"Please provide a download URL": "Please provide a download URL",

View File

@ -1519,6 +1519,7 @@
"Please enter Webhook URL first.": "請先輸入 Webhook 網址。",
"Please enter address first": "請先輸入地址",
"Please enter configuration name": "請輸入設定名稱",
"Please enter machine flavor": "請輸入機台風味",
"Please enter version name": "請輸入版本名稱",
"Please make sure to enable \"Background graphics\" in your browser print settings to print product images and styled components correctly.": "請確保在瀏覽器列印設定中啟用「背景圖形」,以便正確列印商品圖片和樣式元件。",
"Please provide a download URL": "請提供下載連結",

View File

@ -75,16 +75,16 @@
{{-- 機台風味 --}}
<div>
<label class="block text-[11px] font-black text-slate-400 uppercase tracking-[0.2em] mb-2">{{ __('Machine Flavor') }} <span class="text-rose-500">*</span></label>
<x-searchable-select name="flavor" id="apk-flavor-select"
:placeholder="__('Select flavor...')"
:selected="old('flavor')"
:hasSearch="true"
required>
{{-- S號 / Android 12 / XY主板 × 客戶專案 --}}
<option value="S_12_XY_U_Chengwai" data-title="S_12_XY_U_Chengwai 晟崴客製 / S12 / XY主板">S_12_XY_U_Chengwai (晟崴客製 / S12 / XY主板</option>
<option value="S_12_XY_U_General" data-title="S_12_XY_U_General 通用主幹 / S12 / XY主板">S_12_XY_U_General  (通用主幹 / S12 / XY主板</option>
<option value="S_9_XY_U_Cmuh" data-title="S_9_XY_U_Cmuh 中國醫客製 / S9 / XY主板">S_9_XY_U_Cmuh   (中國醫客製 / S9 / XY主板</option>
</x-searchable-select>
<input type="text" name="flavor" x-model="flavor" required
list="apk-flavor-options"
class="luxury-input w-full"
placeholder="{{ __('e.g., S_12_XY_U_General') }}">
{{-- 常用建議值(非強制,可自由輸入任意 flavor --}}
<datalist id="apk-flavor-options">
<option value="S_12_XY_U_Chengwai">S_12_XY_U_Chengwai(晟崴客製 / S12 / XY主板</option>
<option value="S_12_XY_U_General">S_12_XY_U_General(通用主幹 / S12 / XY主板</option>
<option value="S_9_XY_U_Cmuh">S_9_XY_U_Cmuh(中國醫客製 / S9 / XY主板</option>
</datalist>
<p class="mt-1.5 text-[10px] font-bold text-slate-400/70 dark:text-slate-500/70 tracking-wide">{{ __('Target hardware flavor for this APK') }}</p>
</div>
@ -198,6 +198,7 @@
isDragging: false,
versionName: '{{ old('version_name', '') }}',
versionCode: '{{ old('version_code', '') }}',
flavor: '{{ old('flavor', '') }}',
adjustVersionCode(delta) {
const current = parseInt(this.versionCode) || 0;
@ -222,6 +223,12 @@
}));
return;
}
if (!this.flavor.trim()) {
window.dispatchEvent(new CustomEvent('toast', {
detail: { message: '{{ __('Please enter machine flavor') }}', type: 'error' }
}));
return;
}
if (this.uploadMode === 'file') {
const fileInput = form.querySelector('[name=apk_file]');
@ -267,15 +274,8 @@
this.versionCode = (major * 10000 + minor * 100 + patch).toString();
}
// 3. Select Flavor (Preline HSSelect integration)
const selectEl = document.getElementById('apk-flavor-select');
if (selectEl) {
selectEl.value = flavor;
const instance = window.HSSelect?.getInstance(selectEl);
if (instance) {
instance.setValue(flavor);
}
}
// 3. Fill Flavor (free-text input — 任意 flavor 皆可填入)
this.flavor = flavor;
window.dispatchEvent(new CustomEvent('toast', {
detail: { message: '{{ __('已自動解析 APK 檔名並填入欄位!') }}', type: 'success' }