From 2eb5d32cbcbe59e84d3fb2ef8562e3ccff34b27a Mon Sep 17 00:00:00 2001 From: YunaiV <> Date: Tue, 16 Apr 2019 23:26:56 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=90=8E=E5=8F=B0=EF=BC=9A?= =?UTF-8?q?=E5=95=86=E5=93=81=E5=88=97=E8=A1=A8=E6=8A=A5=E9=94=99=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=EF=BC=8C=E8=A7=A3=E5=86=B3=E5=95=86=E5=93=81?= =?UTF-8?q?=E6=8A=A5=E4=BB=B7=20*=20100?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-web/config/proxy/proxy.dev.js | 4 +- .../src/models/product/productSpuList.js | 4 +- .../pages/Product/ProductSpuAddOrUpdate.js | 15 +------ admin-web/src/pages/Product/ProductSpuList.js | 44 ++----------------- admin-web/src/services/product.js | 3 +- 5 files changed, 10 insertions(+), 60 deletions(-) diff --git a/admin-web/config/proxy/proxy.dev.js b/admin-web/config/proxy/proxy.dev.js index bb5b0c986..958c70da5 100644 --- a/admin-web/config/proxy/proxy.dev.js +++ b/admin-web/config/proxy/proxy.dev.js @@ -8,8 +8,8 @@ export default { pathRewrite: {}, }, '/product-api/': { - target: 'http://180.167.213.26:18083/', - // target: 'http://127.0.0.1:18081/', + // target: 'http://180.167.213.26:18083/', + target: 'http://127.0.0.1:18081/', changeOrigin: true, pathRewrite: {}, }, diff --git a/admin-web/src/models/product/productSpuList.js b/admin-web/src/models/product/productSpuList.js index cc9ad9607..e816bf087 100644 --- a/admin-web/src/models/product/productSpuList.js +++ b/admin-web/src/models/product/productSpuList.js @@ -56,8 +56,8 @@ export default { yield put(routerRedux.replace('/product/product-spu-add')); }, *page({ payload }, { call, put }) { - const { queryParams } = payload; - const response = yield call(productSpuPage, queryParams); + // const { queryParams } = payload; + const response = yield call(productSpuPage, payload); message.info('查询成功!'); yield put({ type: 'treeSuccess', diff --git a/admin-web/src/pages/Product/ProductSpuAddOrUpdate.js b/admin-web/src/pages/Product/ProductSpuAddOrUpdate.js index 2aa0d6660..f0910898a 100644 --- a/admin-web/src/pages/Product/ProductSpuAddOrUpdate.js +++ b/admin-web/src/pages/Product/ProductSpuAddOrUpdate.js @@ -47,19 +47,6 @@ class ProductSpuAddOrUpdate extends Component { }); } - // handleSubmit = e => { - // const { dispatch, form } = this.props; - // e.preventDefault(); - // form.validateFieldsAndScroll((err, values) => { - // if (!err) { - // dispatch({ - // type: 'form/submitRegularForm', - // payload: values, - // }); - // } - // }); - // } - handleAddAttr = e => { // alert('你猜'); const { dispatch } = this.props; @@ -83,7 +70,7 @@ class ProductSpuAddOrUpdate extends Component { } let newAttr = { attrs: [], - price: sku.price, + price: sku.price * 100, quantity: sku.quantity, } for (let j in sku.attrs) { diff --git a/admin-web/src/pages/Product/ProductSpuList.js b/admin-web/src/pages/Product/ProductSpuList.js index 6abb3de4a..5dcedfcc8 100644 --- a/admin-web/src/pages/Product/ProductSpuList.js +++ b/admin-web/src/pages/Product/ProductSpuList.js @@ -11,44 +11,7 @@ import styles from './ProductSpuList.less'; const FormItem = Form.Item; const { TreeNode } = Tree; -// 添加 form 表单 -const CreateForm = Form.create()(props => { - const { modalVisible, form, handleAdd, handleModalVisible, modalType, initValues } = props; - - const okHandle = () => { - form.validateFields((err, fieldsValue) => { - if (err) return; - form.resetFields(); - handleAdd({ - fields: fieldsValue, - modalType, - initValues, - }); - }); - }; - - const title = modalType === 'add' ? '添加一个 Role' : '更新一个 Role'; - const okText = modalType === 'add' ? '添加' : '更新'; - return ( - handleModalVisible()} - > - - {form.getFieldDecorator('name', { - rules: [{ required: true, message: '请输入角色名!', min: 2 }], - initialValue: initValues.name, - })()} - - - ); -}); - -// roleList +// productSpuList @connect(({ productSpuList, loading }) => ({ productSpuList, list: productSpuList.list.spus, @@ -71,8 +34,8 @@ class ProductSpuList extends PureComponent { type: 'productSpuList/page', payload: { name: '', - pageNo: 0, - pageSize: 10, + pageNo: 1, + pageSize: 20, }, }); } @@ -168,7 +131,6 @@ class ProductSpuList extends PureComponent { - ); } diff --git a/admin-web/src/services/product.js b/admin-web/src/services/product.js index f8181bf02..624c1b8c3 100644 --- a/admin-web/src/services/product.js +++ b/admin-web/src/services/product.js @@ -39,6 +39,7 @@ export async function productCategoryDelete(params) { // product spu + sku export async function productSpuPage(params) { + debugger; return request(`/product-api/admins/spu/page?${stringify(params)}`, { method: 'GET', }); @@ -57,4 +58,4 @@ export async function productAttrTree(params) { return request(`/product-api/admins/attr/tree?${stringify(params)}`, { method: 'GET', }); -} \ No newline at end of file +}