Add productId data for toy, and fix submit form issues
This commit is contained in:
parent
b2799cc6be
commit
99d63d4912
|
|
@ -16,6 +16,7 @@ interface FormValue {
|
||||||
sale: string;
|
sale: string;
|
||||||
type: number;
|
type: number;
|
||||||
desc: string;
|
desc: string;
|
||||||
|
productId: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const getInfo = async () => {
|
const getInfo = async () => {
|
||||||
|
|
@ -93,7 +94,7 @@ function Toy() {
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Form className={styles.form} onSubmit={onSubmit(submitForm)}>
|
<Form ref={formRef} className={styles.form} onSubmit={onSubmit(submitForm)}>
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="name">中文名</label>
|
<label htmlFor="name">中文名</label>
|
||||||
<input {...bindInput("name")} required placeholder="中文名" />
|
<input {...bindInput("name")} required placeholder="中文名" />
|
||||||
|
|
@ -122,6 +123,10 @@ function Toy() {
|
||||||
<option value={3}>想要但没钱</option>
|
<option value={3}>想要但没钱</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<label htmlFor="productId">B 站产品 ID</label>
|
||||||
|
<input {...bindInput("productId")} placeholder="B 站产品 ID" />
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<label htmlFor="desc">描述</label>
|
<label htmlFor="desc">描述</label>
|
||||||
<textarea {...bindInput("desc")} rows={5} placeholder="描述"></textarea>
|
<textarea {...bindInput("desc")} rows={5} placeholder="描述"></textarea>
|
||||||
|
|
|
||||||
|
|
@ -31,10 +31,11 @@ chrome.runtime.onMessage.addListener((req, sender, send) => {
|
||||||
|
|
||||||
send({
|
send({
|
||||||
name,
|
name,
|
||||||
project,
|
project: project.replace(":", ":"),
|
||||||
made: document.querySelector<HTMLDivElement>(".tagC-ip .tagC-ip-con-brand").innerText,
|
made: document.querySelector<HTMLDivElement>(".tagC-ip .tagC-ip-con-brand").innerText,
|
||||||
sale: document.querySelector<HTMLDivElement>(".item-complex:nth-child(4) .item-complex-value").innerText.replace("-", "/"),
|
sale: document.querySelector<HTMLDivElement>(".item-complex:nth-child(4) .item-complex-value").innerText.replace("-", "/"),
|
||||||
images,
|
images,
|
||||||
|
productId: new URLSearchParams(location.search).get("itemsId"),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue