Add initial order details to selector

This commit is contained in:
Jacky Ser
2026-08-10 16:24:53 +08:00
parent 596493a686
commit 3f9202b315
2 changed files with 36 additions and 6 deletions

View File

@@ -158,6 +158,7 @@ select:focus, input:focus, textarea:focus { border-color: var(--blue); box-shado
.select-field select, .parameter-input { width: 100%; height: 43px; padding: 0 12px; }
.text-field { margin-top: 13px; }
.text-field input { height: 44px; padding: 0 13px; }
.project-notes textarea { min-height: 78px; padding: 11px 13px; resize: vertical; line-height: 1.55; }
.field-group { margin: 17px 0 13px; }
.pill-row { display: flex; gap: 7px; margin-top: 8px; }
.pill-row button { flex: 1; padding: 10px 7px; border: 1px solid #dce3ed; border-radius: 9px; background: white; cursor: pointer; font-size: 11px; }

View File

@@ -17,7 +17,9 @@ type Requirements = {
control: string;
gear: string;
annualVolume: string;
firstOrderQuantity: string;
currentModel: string;
otherRequirements: string;
painPoint: string;
};
@@ -168,7 +170,9 @@ const DEFAULT_REQUIREMENTS: Requirements = {
control: "不限",
gear: "不限",
annualVolume: "500050000件",
firstOrderQuantity: "",
currentModel: "",
otherRequirements: "",
painPoint: "交期",
};
@@ -285,6 +289,7 @@ export default function Home() {
const needsEngineer =
!top?.coreCompatible ||
requirements.annualVolume === "50000件以上" ||
Number(requirements.firstOrderQuantity) >= 1000 ||
requirements.application === "工业设备";
function update<K extends keyof Requirements>(key: K, value: Requirements[K]) {
@@ -559,6 +564,21 @@ export default function Home() {
<option>50000</option>
</select>
</label>
<label className="select-field">
<span></span>
<input
className="parameter-input"
type="number"
min="1"
step="1"
inputMode="numeric"
value={requirements.firstOrderQuantity}
onChange={(event) => update("firstOrderQuantity", event.target.value)}
placeholder="例如500"
/>
</label>
</div>
<div className="two-fields">
<label className="select-field">
<span></span>
<select
@@ -573,13 +593,22 @@ export default function Home() {
<option></option>
</select>
</label>
<label className="select-field">
<span>使</span>
<input
className="parameter-input"
value={requirements.currentModel}
onChange={(event) => update("currentModel", event.target.value)}
placeholder="例如SG90 / DS-E001"
/>
</label>
</div>
<label className="text-field">
<span>使</span>
<input
value={requirements.currentModel}
onChange={(event) => update("currentModel", event.target.value)}
placeholder="例如:SG90 / DS-E001 / 自定义型号"
<label className="text-field project-notes">
<span></span>
<textarea
value={requirements.otherRequirements}
onChange={(event) => update("otherRequirements", event.target.value)}
placeholder="例如:防水等级、噪音、寿命、认证、安装尺寸、线长或交期要求"
/>
</label>
</div>