From 6ce040fbd6804f8e2ce377c63927796c22dfc46c Mon Sep 17 00:00:00 2001
From: YunaiV <>
Date: Sat, 16 Mar 2019 22:15:36 +0800
Subject: [PATCH] =?UTF-8?q?=E5=89=8D=E7=AB=AF=EF=BC=9A=E5=95=86=E5=93=81?=
=?UTF-8?q?=E6=B7=BB=E5=8A=A0=E3=80=82=E5=AE=8C=E6=88=90=E5=BA=A6=2010%=20?=
=?UTF-8?q?=EF=BC=8C=E5=85=88=E6=90=AD=E5=BB=BA=E5=A5=BD=E6=A1=86=E6=A1=86?=
=?UTF-8?q?~?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
admin-web/config/router.config.js | 10 ++
admin-web/src/pages/Home/Home.js | 6 +-
.../pages/Product/ProductSpuAddOrUpdate.js | 143 ++++++++++++++++++
.../pages/Product/ProductSpuAddOrUpdate.less | 15 ++
4 files changed, 171 insertions(+), 3 deletions(-)
create mode 100644 admin-web/src/pages/Product/ProductSpuAddOrUpdate.js
create mode 100644 admin-web/src/pages/Product/ProductSpuAddOrUpdate.less
diff --git a/admin-web/config/router.config.js b/admin-web/config/router.config.js
index 99875d14e..5fc60174d 100644
--- a/admin-web/config/router.config.js
+++ b/admin-web/config/router.config.js
@@ -69,6 +69,16 @@ export default [
name: 'product-spu-list',
component: './Product/ProductSpuList',
},
+ {
+ path: '/product/product-spu-add',
+ name: 'product-spu-add',
+ component: './Product/ProductSpuAddOrUpdate',
+ },
+ {
+ path: '/product/product-category-list',
+ name: 'product-category-list',
+ component: './Product/ProductCategoryList',
+ },
{
path: '/product/product-category-list',
name: 'product-category-list',
diff --git a/admin-web/src/pages/Home/Home.js b/admin-web/src/pages/Home/Home.js
index ac3848812..42651f51b 100644
--- a/admin-web/src/pages/Home/Home.js
+++ b/admin-web/src/pages/Home/Home.js
@@ -10,9 +10,9 @@ export default class Home extends Component {
render() {
return (
-
-
-
+ {/*
*/}
+ {/**/}
+ {/**/}
home...
diff --git a/admin-web/src/pages/Product/ProductSpuAddOrUpdate.js b/admin-web/src/pages/Product/ProductSpuAddOrUpdate.js
new file mode 100644
index 000000000..4a3f26a02
--- /dev/null
+++ b/admin-web/src/pages/Product/ProductSpuAddOrUpdate.js
@@ -0,0 +1,143 @@
+/* eslint-disable */
+
+import React, { PureComponent, Fragment } from 'react';
+import { connect } from 'dva';
+import moment from 'moment';
+import {Card, Form, Input, Radio, Button, Table, Divider} from 'antd';
+import PageHeaderWrapper from '@/components/PageHeaderWrapper';
+
+import styles from './ProductSpuAddOrUpdate.less';
+
+const FormItem = Form.Item;
+const RadioGroup = Radio.Group;
+
+// roleList
+@connect(({ productSpuList, loading }) => ({
+ productSpuList,
+ list: productSpuList.list.spus,
+ loading: loading.models.productSpuList,
+}))
+
+@Form.create()
+class ProductSpuAddOrUpdate extends PureComponent {
+ state = {
+ modalVisible: false,
+ modalType: 'add', //add update
+ initValues: {},
+ roleAssignVisible: false,
+ roleAssignRecord: {},
+ };
+
+ componentDidMount() {
+ const { dispatch } = this.props;
+ dispatch({
+ type: 'productSpuList/page',
+ payload: {
+ name: '',
+ pageNo: 0,
+ pageSize: 10,
+ },
+ });
+ }
+
+ handleSubmit = e => {
+ const { dispatch, form } = this.props;
+ e.preventDefault();
+ form.validateFieldsAndScroll((err, values) => {
+ if (!err) {
+ dispatch({
+ type: 'form/submitRegularForm',
+ payload: values,
+ });
+ }
+ });
+ }
+
+ render() {
+ // debugger;
+ const { form, data } = this.props;
+
+ // 规格明细
+ const columns = [
+ {
+ title: '颜色',
+ dataIndex: 'price'
+ },
+ {
+ title: '价格',
+ dataIndex: 'price',
+ render(val) {
+ return
{status[val]};
+ },
+ },
+ {
+ title: '库存',
+ dataIndex: 'quantity',
+ }
+ ];
+
+ return (
+
+
+
+
+
+ );
+ }
+}
+
+export default ProductSpuAddOrUpdate;
diff --git a/admin-web/src/pages/Product/ProductSpuAddOrUpdate.less b/admin-web/src/pages/Product/ProductSpuAddOrUpdate.less
new file mode 100644
index 000000000..ebb45c292
--- /dev/null
+++ b/admin-web/src/pages/Product/ProductSpuAddOrUpdate.less
@@ -0,0 +1,15 @@
+@import '~antd/lib/style/themes/default.less';
+@import '~@/utils/utils.less';
+
+.tableList {
+ .tableListOperator {
+ margin-bottom: 16px;
+ button {
+ margin-right: 8px;
+ }
+ }
+}
+
+.tableDelete {
+ color: red;
+}