|
@@ -0,0 +1,79 @@
|
|
|
|
+import { useState } from 'react';
|
|
|
|
+import './shop-list.css';
|
|
|
|
+
|
|
|
|
+const initialProducts = [
|
|
|
|
+ {
|
|
|
|
+ category: 'Sporting Goods',
|
|
|
|
+ price: '$49.99',
|
|
|
|
+ stocked: true,
|
|
|
|
+ name: 'Football',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ category: 'Sporting Goods',
|
|
|
|
+ price: '$9.99',
|
|
|
|
+ stocked: true,
|
|
|
|
+ name: 'Baseball',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ category: 'Sporting Goods',
|
|
|
|
+ price: '$29.99',
|
|
|
|
+ stocked: false,
|
|
|
|
+ name: 'Basketball',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ category: 'Electronics',
|
|
|
|
+ price: '$99.99',
|
|
|
|
+ stocked: true,
|
|
|
|
+ name: 'iPod Touch',
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ category: 'Electronics',
|
|
|
|
+ price: '$399.99',
|
|
|
|
+ stocked: false,
|
|
|
|
+ name: 'iPhone 5',
|
|
|
|
+ },
|
|
|
|
+ { category: 'Electronics', price: '$199.99', stocked: true, name: 'Nexus 7' },
|
|
|
|
+];
|
|
|
|
+
|
|
|
|
+export default function ShopList() {
|
|
|
|
+ let [products] = useState(() => initialProducts);
|
|
|
|
+
|
|
|
|
+ return (
|
|
|
|
+ <div className="shop-list">
|
|
|
|
+ <h3 style={{ marginTop: '0' }}>商品列表</h3>
|
|
|
|
+ <div className="list-header">
|
|
|
|
+ <input type="text" placeholder="Search..." />
|
|
|
|
+ <label>
|
|
|
|
+ <input type="checkbox" />
|
|
|
|
+ 仅显示在库商品
|
|
|
|
+ </label>
|
|
|
|
+ </div>
|
|
|
|
+ <div className="list-content">
|
|
|
|
+ <table>
|
|
|
|
+ <thead>
|
|
|
|
+ <tr>
|
|
|
|
+ <th>商品名称</th>
|
|
|
|
+ <th>商品价格</th>
|
|
|
|
+ </tr>
|
|
|
|
+ </thead>
|
|
|
|
+ <tbody>
|
|
|
|
+ <tr>
|
|
|
|
+ <th colSpan={2}>运动商品</th>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>篮球</td>
|
|
|
|
+ <td>$19.9</td>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <th colSpan={2}>电子商品</th>
|
|
|
|
+ </tr>
|
|
|
|
+ <tr>
|
|
|
|
+ <td>Iphone 14 pm</td>
|
|
|
|
+ <td>$1399.9</td>
|
|
|
|
+ </tr>
|
|
|
|
+ </tbody>
|
|
|
|
+ </table>
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+ );
|
|
|
|
+}
|