Commit 342d712f by xuzhenghua

bug

parent 3f5950a3
......@@ -17,10 +17,10 @@
"MyEdit.js": "/static/js/MyEdit.085de024.chunk.js",
"MyEdit.js.map": "/static/js/MyEdit.085de024.chunk.js.map",
"Order.css": "/static/css/Order.061a2017.chunk.css",
"Order.js": "/static/js/Order.f6cc80c6.chunk.js",
"Order.js.map": "/static/js/Order.f6cc80c6.chunk.js.map",
"Orderinfo.js": "/static/js/Orderinfo.20a5f741.chunk.js",
"Orderinfo.js.map": "/static/js/Orderinfo.20a5f741.chunk.js.map",
"Order.js": "/static/js/Order.d9e85938.chunk.js",
"Order.js.map": "/static/js/Order.d9e85938.chunk.js.map",
"Orderinfo.js": "/static/js/Orderinfo.f574e640.chunk.js",
"Orderinfo.js.map": "/static/js/Orderinfo.f574e640.chunk.js.map",
"PayOrder.css": "/static/css/PayOrder.a9111f28.chunk.css",
"PayOrder.js": "/static/js/PayOrder.b19cb7bf.chunk.js",
"PayOrder.js.map": "/static/js/PayOrder.b19cb7bf.chunk.js.map",
......@@ -39,20 +39,20 @@
"coupons.css": "/static/css/coupons.f2c7a13b.chunk.css",
"coupons.js": "/static/js/coupons.1a550880.chunk.js",
"coupons.js.map": "/static/js/coupons.1a550880.chunk.js.map",
"detail.css": "/static/css/detail.bf05380d.chunk.css",
"detail.js": "/static/js/detail.f598b4a0.chunk.js",
"detail.js.map": "/static/js/detail.f598b4a0.chunk.js.map",
"main.css": "/static/css/main.a6bfbdfe.chunk.css",
"main.js": "/static/js/main.0199246b.chunk.js",
"main.js.map": "/static/js/main.0199246b.chunk.js.map",
"detail.css": "/static/css/detail.a70a1e9a.chunk.css",
"detail.js": "/static/js/detail.447a0b4c.chunk.js",
"detail.js.map": "/static/js/detail.447a0b4c.chunk.js.map",
"main.css": "/static/css/main.47a6e046.chunk.css",
"main.js": "/static/js/main.c9c9cdd6.chunk.js",
"main.js.map": "/static/js/main.c9c9cdd6.chunk.js.map",
"myorders.css": "/static/css/myorders.99c740b6.chunk.css",
"myorders.js": "/static/js/myorders.b8058807.chunk.js",
"myorders.js.map": "/static/js/myorders.b8058807.chunk.js.map",
"purchased.css": "/static/css/purchased.fb5cdbc2.chunk.css",
"purchased.js": "/static/js/purchased.249d4ca9.chunk.js",
"purchased.js.map": "/static/js/purchased.249d4ca9.chunk.js.map",
"runtime~main.js": "/static/js/runtime~main.efc52c9c.js",
"runtime~main.js.map": "/static/js/runtime~main.efc52c9c.js.map",
"runtime~main.js": "/static/js/runtime~main.a1c7156d.js",
"runtime~main.js.map": "/static/js/runtime~main.a1c7156d.js.map",
"search.css": "/static/css/search.ed8f7a59.chunk.css",
"search.js": "/static/js/search.8e8657cc.chunk.js",
"search.js.map": "/static/js/search.8e8657cc.chunk.js.map",
......@@ -89,7 +89,7 @@
"static/js/30.425f9e4f.chunk.js": "/static/js/30.425f9e4f.chunk.js",
"static/js/30.425f9e4f.chunk.js.map": "/static/js/30.425f9e4f.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.e0a24d3b6c51ca43cf1e3324c5d16514.js": "/precache-manifest.e0a24d3b6c51ca43cf1e3324c5d16514.js",
"precache-manifest.8162147460d132ab5748e450a1f942e7.js": "/precache-manifest.8162147460d132ab5748e450a1f942e7.js",
"service-worker.js": "/service-worker.js",
"static/css/24.e59d820f.chunk.css.map": "/static/css/24.e59d820f.chunk.css.map",
"static/css/25.73976871.chunk.css.map": "/static/css/25.73976871.chunk.css.map",
......@@ -109,8 +109,8 @@
"static/css/ShopCart.8f4c32db.chunk.css.map": "/static/css/ShopCart.8f4c32db.chunk.css.map",
"static/css/aist-share.a97e13d0.chunk.css.map": "/static/css/aist-share.a97e13d0.chunk.css.map",
"static/css/coupons.f2c7a13b.chunk.css.map": "/static/css/coupons.f2c7a13b.chunk.css.map",
"static/css/detail.bf05380d.chunk.css.map": "/static/css/detail.bf05380d.chunk.css.map",
"static/css/main.a6bfbdfe.chunk.css.map": "/static/css/main.a6bfbdfe.chunk.css.map",
"static/css/detail.a70a1e9a.chunk.css.map": "/static/css/detail.a70a1e9a.chunk.css.map",
"static/css/main.47a6e046.chunk.css.map": "/static/css/main.47a6e046.chunk.css.map",
"static/css/myorders.99c740b6.chunk.css.map": "/static/css/myorders.99c740b6.chunk.css.map",
"static/css/purchased.fb5cdbc2.chunk.css.map": "/static/css/purchased.fb5cdbc2.chunk.css.map",
"static/css/search.ed8f7a59.chunk.css.map": "/static/css/search.ed8f7a59.chunk.css.map",
......
......@@ -44,16 +44,16 @@ self.__precacheManifest = [
"url": "/static/js/MyEdit.085de024.chunk.js"
},
{
"revision": "6d493534410aef830e8c",
"revision": "61ec3d322746f0744a87",
"url": "/static/css/Order.061a2017.chunk.css"
},
{
"revision": "6d493534410aef830e8c",
"url": "/static/js/Order.f6cc80c6.chunk.js"
"revision": "61ec3d322746f0744a87",
"url": "/static/js/Order.d9e85938.chunk.js"
},
{
"revision": "cfad0e336606bee2e95b",
"url": "/static/js/Orderinfo.20a5f741.chunk.js"
"revision": "526eab489798cc841a52",
"url": "/static/js/Orderinfo.f574e640.chunk.js"
},
{
"revision": "89ebec2151665987e176",
......@@ -104,20 +104,20 @@ self.__precacheManifest = [
"url": "/static/js/coupons.1a550880.chunk.js"
},
{
"revision": "32632e74fc5521004320",
"url": "/static/css/detail.bf05380d.chunk.css"
"revision": "b5d87eaf5228c9435da5",
"url": "/static/css/detail.a70a1e9a.chunk.css"
},
{
"revision": "32632e74fc5521004320",
"url": "/static/js/detail.f598b4a0.chunk.js"
"revision": "b5d87eaf5228c9435da5",
"url": "/static/js/detail.447a0b4c.chunk.js"
},
{
"revision": "79260ad29fdf1a8af368",
"url": "/static/css/main.a6bfbdfe.chunk.css"
"revision": "3036ff004732b623125b",
"url": "/static/css/main.47a6e046.chunk.css"
},
{
"revision": "79260ad29fdf1a8af368",
"url": "/static/js/main.0199246b.chunk.js"
"revision": "3036ff004732b623125b",
"url": "/static/js/main.c9c9cdd6.chunk.js"
},
{
"revision": "cd0c976558b5469b64eb",
......@@ -136,8 +136,8 @@ self.__precacheManifest = [
"url": "/static/js/purchased.249d4ca9.chunk.js"
},
{
"revision": "9bd3a42b3a7ede478596",
"url": "/static/js/runtime~main.efc52c9c.js"
"revision": "7a6e6b8ccd566ca7aeac",
"url": "/static/js/runtime~main.a1c7156d.js"
},
{
"revision": "68309ce95ee8e6619fb2",
......@@ -256,7 +256,7 @@ self.__precacheManifest = [
"url": "/static/css/24.e59d820f.chunk.css"
},
{
"revision": "36429787ebb1b642398988406eef74f1",
"revision": "4e140845a2bc24a6183bbb9da0327356",
"url": "/index.html"
}
];
\ No newline at end of file
......@@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js");
importScripts(
"/precache-manifest.e0a24d3b6c51ca43cf1e3324c5d16514.js"
"/precache-manifest.8162147460d132ab5748e450a1f942e7.js"
);
workbox.clientsClaim();
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{813:function(e,n,a){"use strict";a.r(n);var o=a(7),r=a(8),t=a(10),l=a(9),i=a(11),c=(a(44),a(14)),s=a.n(c),p=a(24),u=(a(153),a(74)),d=a.n(u),f=(a(785),a(787)),h=a.n(f),m=(a(788),a(790)),v=a.n(m),b=a(0),g=a.n(b),q=a(18),E=a(33),y=a(4),j=Object(q.e)({mapPropsToValues:function(e){return Object(p.a)({},e.userInfo)},validate:function(e,n){return{}},handleSubmit:function(e,n){var a=e.real_name,o=e.cellphone,r=e.qq;if(a)if(0!=="".concat(a).replace(/\s+/g,"").length)if(o)if(/1\d{10}/g.test("".concat(o).replace(/\s+/g,"")))if(r)if(/\d{5,}/g.test(r)){var t=0;if(n.props.userInfo){var l=n.props.userInfo;l.real_name===a&&(t+=1),l.cellphone===o&&(t+=1),l.qq===r&&(t+=1)}var i="/order";n.props.userInfo.id&&(i=i+"?id="+n.props.userInfo.id),3!==t?y.c.post("".concat(API["base-api"],"/m/order/saveUserInfo"),{real_name:e.real_name,cellphone:"".concat(e.cellphone).replace(/\s+/g,""),qq:e.qq}).then(function(a){console.log(a),200===a.data.errno?(s.a.info("\u4fdd\u5b58\u6210\u529f\uff01",void 0,void 0,!1),n.props.history.replace(i,e)):s.a.info(a.data.msg,void 0,void 0,!1)}):n.props.history.replace(i,Object(p.a)({},e))}else s.a.info("\u8bf7\u8f93\u5165\u6b63\u786eQQ\u53f7\uff01",void 0,void 0,!1);else s.a.info("\u8bf7\u8f93\u5165QQ\u53f7\uff01",void 0,void 0,!1);else s.a.info("\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u624b\u673a\u53f7\uff01",void 0,void 0,!1);else s.a.info("\u8bf7\u8f93\u5165\u624b\u673a\u53f7\uff01",void 0,void 0,!1);else s.a.info("\u8bf7\u8f93\u5165\u59d3\u540d\uff01",void 0,void 0,!1);else s.a.info("\u8bf7\u8f93\u5165\u59d3\u540d\uff01",void 0,void 0,!1)}})(function(e){var n=e.values,a=(e.errors,e.touched,e.setFieldValue),o=(e.handleBlur,e.handleSubmit);e.isSubmitting;return g.a.createElement("form",null,g.a.createElement(v.a,{clear:!0,name:"real_name",onChange:function(e){return a("real_name",e)},placeholder:"\u8bf7\u8f93\u5165\u60a8\u7684\u771f\u5b9e\u59d3\u540d",value:n.real_name},"\u59d3\u540d"),g.a.createElement(v.a,{clear:!0,type:"phone",name:"cellphone",placeholder:"\u8bf7\u8f93\u5165\u60a8\u7684\u624b\u673a\u53f7\u7801",onChange:function(e){return a("cellphone",e)},value:n.cellphone},"\u7535\u8bdd"),g.a.createElement(v.a,{clear:!0,name:"qq",placeholder:"\u8bf7\u8f93\u5165\u60a8\u7684QQ\u53f7\u7801",maxLength:"15",onChange:function(e){return a("qq",e)},value:n.qq},"QQ"),g.a.createElement("div",{style:{marginTop:"21px"}},g.a.createElement(d.a,null,g.a.createElement(h.a,{type:"primary",onClick:o},"\u786e\u8ba4"))))}),I=function(e){function n(e){return Object(o.a)(this,n),Object(t.a)(this,Object(l.a)(n).call(this,e))}return Object(i.a)(n,e),Object(r.a)(n,[{key:"render",value:function(){return g.a.createElement("div",null,g.a.createElement(E.e,{title:"\u62a5\u540d\u4fe1\u606f",arrow:!0}),g.a.createElement(j,{history:this.props.history,userInfo:this.props.location.state}))}}]),n}(b.Component);n.default=I}}]);
//# sourceMappingURL=Orderinfo.20a5f741.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["components/order/orderinfo.js"],"names":["MyForm","withFormik","mapPropsToValues","props","Object","_Users_xzh_dnmp_www_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_7__","userInfo","validate","values","handleSubmit","FormBag","real_name","cellphone","qq","concat","replace","length","test","same","pathName","id","http","post","API","then","res","console","log","data","errno","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_6___default","a","info","undefined","history","msg","_ref","setFieldValue","errors","touched","handleBlur","isSubmitting","react__WEBPACK_IMPORTED_MODULE_14___default","createElement","antd_mobile_lib_input_item__WEBPACK_IMPORTED_MODULE_13___default","clear","name","onChange","value","placeholder","type","maxLength","style","marginTop","antd_mobile_lib_wing_blank__WEBPACK_IMPORTED_MODULE_9___default","antd_mobile_lib_button__WEBPACK_IMPORTED_MODULE_11___default","onClick","Orderinfo","_Users_xzh_dnmp_www_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__","this","_Users_xzh_dnmp_www_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__","_Users_xzh_dnmp_www_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__","call","_common__WEBPACK_IMPORTED_MODULE_16__","title","arrow","location","state","Component"],"mappings":"kSAgDMA,EAASC,YAAW,CACtBC,iBAAkB,SAAAC,GAAK,OAA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AAqD,GAAAK,KAAAH,KACVxD,0EAIN,OACIuC,EAAAX,EAAAY,cAAA,WACID,EAAAX,EAAAY,cAACoB,EAAA,EAAD,CAAWC,MAAM,2BAAOC,OAAO,IAC/BvB,EAAAX,EAAAY,cAAC3C,EAAD,CAAQkC,QAASyB,KAAKxD,MAAM+B,QAAS5B,SAAUqD,KAAKxD,MAAM+D,SAASC,gBAT3DC,aAgBTX","file":"static/js/Orderinfo.20a5f741.chunk.js","sourcesContent":["import React, { Component } from 'react';\nimport { Flex, NavBar, List, InputItem, Button, WhiteSpace, WingBlank, Toast } from 'antd-mobile';\nimport { Formik, Field, Form, withFormik } from 'formik';\nimport {HeaderBar} from '../../common';\nimport { http } from \"@/utils\";\n\nconst InnerForm = ({\n values,\n errors,\n touched,\n setFieldValue,\n handleBlur,\n handleSubmit,\n isSubmitting,\n}) => (\n <form>\n <InputItem\n clear\n name=\"real_name\"\n onChange={(value) => setFieldValue('real_name', value)}\n placeholder=\"请输入您的真实姓名\"\n value={values.real_name}\n >姓名</InputItem>\n <InputItem\n clear\n type='phone'\n name='cellphone'\n placeholder=\"请输入您的手机号码\"\n onChange={(value) => setFieldValue('cellphone', value)}\n value={values.cellphone}\n >电话</InputItem>\n <InputItem\n clear\n name='qq'\n placeholder=\"请输入您的QQ号码\"\n maxLength='15'\n onChange={(value) => setFieldValue('qq', value)}\n value={values.qq}\n >QQ</InputItem>\n\n <div style={{ marginTop: '21px' }}>\n <WingBlank>\n <Button type='primary' onClick={handleSubmit}>确认</Button>\n </WingBlank>\n </div>\n </form>\n );\n\nconst MyForm = withFormik({\n mapPropsToValues: props => ({ ...props.userInfo }),\n validate: (values, props) => {\n const errors = {};\n return errors;\n },\n handleSubmit: (\n values,\n FormBag\n ) => {\n const {real_name, cellphone, qq} = values;\n if (!real_name) {\n Toast.info('请输入姓名!', undefined, undefined, false);\n return;\n }else if ((`${real_name}`).replace(/\\s+/g, '').length === 0) {\n Toast.info('请输入姓名!', undefined, undefined, false);\n return;\n }\n if (!cellphone) {\n Toast.info('请输入手机号!', undefined, undefined, false);\n return;\n } else if (!/1\\d{10}/g.test((`${cellphone}`).replace(/\\s+/g, ''))) {\n Toast.info('请输入正确的手机号!', undefined, undefined, false);\n return;\n }\n if (!qq) {\n Toast.info('请输入QQ号!', undefined, undefined, false);\n return;\n } else if (!/\\d{5,}/g.test(qq)) {\n Toast.info('请输入正确QQ号!', undefined, undefined, false);\n return;\n }\n let same = 0;\n if(FormBag.props.userInfo) {\n const userInfo = FormBag.props.userInfo;\n if(userInfo.real_name === real_name) {\n same += 1;\n }\n if(userInfo.cellphone === cellphone) {\n same += 1;\n }\n if(userInfo.qq === qq) {\n same += 1;\n }\n }\n let pathName = '/order';\n if(FormBag.props.userInfo.id) {\n pathName = pathName + '?id=' + FormBag.props.userInfo.id;\n }\n if(same === 3) {\n FormBag.props.history.replace(\n pathName,\n {\n ...values,\n }\n );\n return;\n }\n http.post(`${API['base-api']}/m/order/saveUserInfo`, {real_name: values.real_name, cellphone: (`${values.cellphone}`).replace(/\\s+/g, ''), qq: values.qq}).then(res=>{\n console.log(res);\n if(res.data.errno !== 200) {\n Toast.info(res.data.msg, undefined, undefined, false);\n return;\n }\n Toast.info('保存成功!', undefined, undefined, false);\n FormBag.props.history.replace(\n pathName,\n values\n );\n });\n },\n})(InnerForm);\n\nclass Orderinfo extends Component {\n constructor(props) {\n super(props);\n }\n\n render() {\n return (\n <div>\n <HeaderBar title='报名信息' arrow={true}></HeaderBar>\n <MyForm history={this.props.history} userInfo={this.props.location.state}/>\n </div>\n )\n }\n\n};\n\nexport default Orderinfo;"],"sourceRoot":""}
\ No newline at end of file
(window.webpackJsonp=window.webpackJsonp||[]).push([[7],{813:function(e,n,a){"use strict";a.r(n);var o=a(7),r=a(8),t=a(10),l=a(9),i=a(11),c=(a(44),a(14)),s=a.n(c),p=a(24),u=(a(153),a(74)),d=a.n(u),f=(a(785),a(787)),h=a.n(f),m=(a(788),a(790)),v=a.n(m),b=a(0),g=a.n(b),q=a(18),E=a(33),j=a(4),y=Object(q.e)({mapPropsToValues:function(e){return Object(p.a)({},e.userInfo)},validate:function(e,n){return{}},handleSubmit:function(e,n){var a=e.real_name,o=e.cellphone,r=e.qq;if(a)if(0!=="".concat(a).replace(/\s+/g,"").length)if(o)if(/1\d{10}/g.test("".concat(o).replace(/\s+/g,"")))if(r)if(/\d{5,}/g.test(r)){var t=0;if(n.props.userInfo){var l=n.props.userInfo;l.real_name===a&&(t+=1),l.cellphone===o&&(t+=1),l.qq===r&&(t+=1)}var i="/order";n.props.userInfo.id&&(i=i+"?id="+n.props.userInfo.id),console.log(e),3!==t?j.c.post("".concat(API["base-api"],"/m/order/saveUserInfo"),{real_name:e.real_name,cellphone:"".concat(e.cellphone).replace(/\s+/g,""),qq:e.qq}).then(function(a){console.log(a),200===a.data.errno?(s.a.info("\u4fdd\u5b58\u6210\u529f\uff01",void 0,void 0,!1),n.props.history.replace(i,Object(p.a)({},e))):s.a.info(a.data.msg,void 0,void 0,!1)}):n.props.history.replace(i,Object(p.a)({},e))}else s.a.info("\u8bf7\u8f93\u5165\u6b63\u786eQQ\u53f7\uff01",void 0,void 0,!1);else s.a.info("\u8bf7\u8f93\u5165QQ\u53f7\uff01",void 0,void 0,!1);else s.a.info("\u8bf7\u8f93\u5165\u6b63\u786e\u7684\u624b\u673a\u53f7\uff01",void 0,void 0,!1);else s.a.info("\u8bf7\u8f93\u5165\u624b\u673a\u53f7\uff01",void 0,void 0,!1);else s.a.info("\u8bf7\u8f93\u5165\u59d3\u540d\uff01",void 0,void 0,!1);else s.a.info("\u8bf7\u8f93\u5165\u59d3\u540d\uff01",void 0,void 0,!1)}})(function(e){var n=e.values,a=(e.errors,e.touched,e.setFieldValue),o=(e.handleBlur,e.handleSubmit);e.isSubmitting;return g.a.createElement("form",null,g.a.createElement(v.a,{clear:!0,name:"real_name",onChange:function(e){return a("real_name",e)},placeholder:"\u8bf7\u8f93\u5165\u60a8\u7684\u771f\u5b9e\u59d3\u540d",value:n.real_name},"\u59d3\u540d"),g.a.createElement(v.a,{clear:!0,type:"phone",name:"cellphone",placeholder:"\u8bf7\u8f93\u5165\u60a8\u7684\u624b\u673a\u53f7\u7801",onChange:function(e){return a("cellphone",e)},value:n.cellphone},"\u7535\u8bdd"),g.a.createElement(v.a,{clear:!0,name:"qq",placeholder:"\u8bf7\u8f93\u5165\u60a8\u7684QQ\u53f7\u7801",maxLength:"15",onChange:function(e){return a("qq",e)},value:n.qq},"QQ"),g.a.createElement("div",{style:{marginTop:"21px"}},g.a.createElement(d.a,null,g.a.createElement(h.a,{type:"primary",onClick:o},"\u786e\u8ba4"))))}),O=function(e){function n(e){return Object(o.a)(this,n),Object(t.a)(this,Object(l.a)(n).call(this,e))}return Object(i.a)(n,e),Object(r.a)(n,[{key:"render",value:function(){return g.a.createElement("div",null,g.a.createElement(E.e,{title:"\u62a5\u540d\u4fe1\u606f",arrow:!0}),g.a.createElement(y,{history:this.props.history,userInfo:this.props.location.state}))}}]),n}(b.Component);n.default=O}}]);
//# sourceMappingURL=Orderinfo.f574e640.chunk.js.map
\ No newline at end of file
{"version":3,"sources":["components/order/orderinfo.js"],"names":["MyForm","withFormik","mapPropsToValues","props","Object","_Users_xzh_dnmp_www_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_objectSpread__WEBPACK_IMPORTED_MODULE_7__","userInfo","validate","values","handleSubmit","FormBag","real_name","cellphone","qq","concat","replace","length","test","same","pathName","id","console","log","http","post","API","then","res","data","errno","antd_mobile_lib_toast__WEBPACK_IMPORTED_MODULE_6___default","a","info","undefined","history","msg","_ref","setFieldValue","errors","touched","handleBlur","isSubmitting","react__WEBPACK_IMPORTED_MODULE_14___default","createElement","antd_mobile_lib_input_item__WEBPACK_IMPORTED_MODULE_13___default","clear","name","onChange","value","placeholder","type","maxLength","style","marginTop","antd_mobile_lib_wing_blank__WEBPACK_IMPORTED_MODULE_9___default","antd_mobile_lib_button__WEBPACK_IMPORTED_MODULE_11___default","onClick","Orderinfo","_Users_xzh_dnmp_www_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_classCallCheck__WEBPACK_IMPORTED_MODULE_0__","this","_Users_xzh_dnmp_www_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__","_Users_xzh_dnmp_www_mr_julyedu_node_modules_babel_preset_react_app_node_modules_babel_runtime_helpers_esm_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__","call","_common__WEBPACK_IMPORTED_MODULE_16__","title","arrow","location","state","Component"],"mappings":"kSAgDMA,EAASC,YAAW,CACtBC,iBAAkB,SAAAC,GAAK,OAAAC,OAAAC,EAAA,EAAAD,CAAA,GAAUD,EAAMG,WACvCC,SAAU,SAACC,EAAQL,GAEf,MADe,IAGnBM,aAAc,SACVD,EACAE,GACC,IACMC,EAA4BH,EAA5BG,UAAWC,EAAiBJ,EAAjBI,UAAWC,EAAML,EAANK,GAC7B,GAAKF,EAGC,GAAoD,IAAhD,GAAAG,OAAIH,GAAaI,QAAQ,OAAQ,IAAIC,OAI/C,GAAKJ,EAGE,GAAK,WAAWK,KAAK,GAAAH,OAAIF,GAAaG,QAAQ,OAAQ,KAI7D,GAAKF,EAGE,GAAK,UAAUI,KAAKJ,GAApB,CAIP,IAAIK,EAAO,EACX,GAAGR,EAAQP,MAAMG,SAAU,CACvB,IAAMA,EAAWI,EAAQP,MAAMG,SAC5BA,EAASK,YAAcA,IACtBO,GAAQ,GAETZ,EAASM,YAAcA,IACtBM,GAAQ,GAETZ,EAASO,KAAOA,IACfK,GAAQ,GAGhB,IAAIC,EAAW,SACZT,EAAQP,MAAMG,SAASc,KACtBD,EAAWA,EAAW,OAAST,EAAQP,MAAMG,SAASc,IAE1DC,QAAQC,IAAId,GACA,IAATU,EASHK,IAAKC,KAAL,GAAAV,OAAaW,IAAI,YAAjB,yBAAqD,CAACd,UAAWH,EAAOG,UAAWC,UAAW,G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,EAAAX,EAAAY,cAAAC,EAAAb,EAAA,CACIc,OAAK,EACLC,KAAK,KACLG,YAAY,+CACZE,UAAU,KACVJ,SAAU,SAACC,GAAD,OAAWX,EAAc,KAAMW,IACzCA,MAAOxC,EAAOK,IANlB,MASA6B,EAAAX,EAAAY,cAAA,OAAKS,MAAO,CAAEC,UAAW,SACrBX,EAAAX,EAAAY,cAAAW,EAAAvB,EAAA,KACIW,EAAAX,EAAAY,cAAAY,EAAAxB,EAAA,CAAQmB,KAAK,UAAUM,QAAS/C,GAAhC,qBAkFdgD,cACF,SAAAA,EAAYtD,GAAQ,OAAAC,OAAAsD,EAAA,EAAAtD,CAAAuD,KAAAF,GAAArD,OAAAwD,EAAA,EAAAxD,CAAAuD,KAAAvD,OAAAyD,EAAA,EAAAzD,CAAAqD,GAAAK,KAAAH,KACVxD,0EAIN,OACIuC,EAAAX,EAAAY,cAAA,WACID,EAAAX,EAAAY,cAACoB,EAAA,EAAD,CAAWC,MAAM,2BAAOC,OAAO,IAC/BvB,EAAAX,EAAAY,cAAC3C,EAAD,CAAQkC,QAASyB,KAAKxD,MAAM+B,QAAS5B,SAAUqD,KAAKxD,MAAM+D,SAASC,gBAT3DC,aAgBTX","file":"static/js/Orderinfo.f574e640.chunk.js","sourcesContent":["import React, { Component } from 'react';\nimport { Flex, NavBar, List, InputItem, Button, WhiteSpace, WingBlank, Toast } from 'antd-mobile';\nimport { Formik, Field, Form, withFormik } from 'formik';\nimport {HeaderBar} from '../../common';\nimport { http } from \"@/utils\";\n\nconst InnerForm = ({\n values,\n errors,\n touched,\n setFieldValue,\n handleBlur,\n handleSubmit,\n isSubmitting,\n}) => (\n <form>\n <InputItem\n clear\n name=\"real_name\"\n onChange={(value) => setFieldValue('real_name', value)}\n placeholder=\"请输入您的真实姓名\"\n value={values.real_name}\n >姓名</InputItem>\n <InputItem\n clear\n type='phone'\n name='cellphone'\n placeholder=\"请输入您的手机号码\"\n onChange={(value) => setFieldValue('cellphone', value)}\n value={values.cellphone}\n >电话</InputItem>\n <InputItem\n clear\n name='qq'\n placeholder=\"请输入您的QQ号码\"\n maxLength='15'\n onChange={(value) => setFieldValue('qq', value)}\n value={values.qq}\n >QQ</InputItem>\n\n <div style={{ marginTop: '21px' }}>\n <WingBlank>\n <Button type='primary' onClick={handleSubmit}>确认</Button>\n </WingBlank>\n </div>\n </form>\n );\n\nconst MyForm = withFormik({\n mapPropsToValues: props => ({ ...props.userInfo }),\n validate: (values, props) => {\n const errors = {};\n return errors;\n },\n handleSubmit: (\n values,\n FormBag\n ) => {\n const {real_name, cellphone, qq} = values;\n if (!real_name) {\n Toast.info('请输入姓名!', undefined, undefined, false);\n return;\n }else if ((`${real_name}`).replace(/\\s+/g, '').length === 0) {\n Toast.info('请输入姓名!', undefined, undefined, false);\n return;\n }\n if (!cellphone) {\n Toast.info('请输入手机号!', undefined, undefined, false);\n return;\n } else if (!/1\\d{10}/g.test((`${cellphone}`).replace(/\\s+/g, ''))) {\n Toast.info('请输入正确的手机号!', undefined, undefined, false);\n return;\n }\n if (!qq) {\n Toast.info('请输入QQ号!', undefined, undefined, false);\n return;\n } else if (!/\\d{5,}/g.test(qq)) {\n Toast.info('请输入正确QQ号!', undefined, undefined, false);\n return;\n }\n let same = 0;\n if(FormBag.props.userInfo) {\n const userInfo = FormBag.props.userInfo;\n if(userInfo.real_name === real_name) {\n same += 1;\n }\n if(userInfo.cellphone === cellphone) {\n same += 1;\n }\n if(userInfo.qq === qq) {\n same += 1;\n }\n }\n let pathName = '/order';\n if(FormBag.props.userInfo.id) {\n pathName = pathName + '?id=' + FormBag.props.userInfo.id;\n }\n console.log(values);\n if(same === 3) {\n FormBag.props.history.replace(\n pathName,\n {\n ...values,\n }\n );\n return;\n }\n http.post(`${API['base-api']}/m/order/saveUserInfo`, {real_name: values.real_name, cellphone: (`${values.cellphone}`).replace(/\\s+/g, ''), qq: values.qq}).then(res=>{\n console.log(res);\n if(res.data.errno !== 200) {\n Toast.info(res.data.msg, undefined, undefined, false);\n return;\n }\n Toast.info('保存成功!', undefined, undefined, false);\n FormBag.props.history.replace(\n pathName,\n {\n ...values,\n }\n );\n });\n },\n})(InnerForm);\n\nclass Orderinfo extends Component {\n constructor(props) {\n super(props);\n }\n\n render() {\n return (\n <div>\n <HeaderBar title='报名信息' arrow={true}></HeaderBar>\n <MyForm history={this.props.history} userInfo={this.props.location.state}/>\n </div>\n )\n }\n\n};\n\nexport default Orderinfo;"],"sourceRoot":""}
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
!function(e){function r(r){for(var n,a,f=r[0],i=r[1],u=r[2],d=0,l=[];d<f.length;d++)a=f[d],o[a]&&l.push(o[a][0]),o[a]=0;for(n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n]);for(s&&s(r);l.length;)l.shift()();return c.push.apply(c,u||[]),t()}function t(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,a=1;a<t.length;a++){var i=t[a];0!==o[i]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var n={},a={18:0},o={18:0},c=[];function f(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,f),t.l=!0,t.exports}f.e=function(e){var r=[];a[e]?r.push(a[e]):0!==a[e]&&{0:1,1:1,2:1,3:1,4:1,6:1,8:1,9:1,10:1,11:1,12:1,13:1,14:1,16:1,17:1,19:1,20:1,21:1,22:1,23:1,25:1,27:1,28:1,29:1,30:1}[e]&&r.push(a[e]=new Promise(function(r,t){for(var n="static/css/"+({0:"BargainMiddlePage",1:"Classify",2:"CourseList",3:"DrawDocument",4:"Examination",5:"MyEdit",6:"Order",7:"Orderinfo",8:"PayOrder",9:"Preferential",10:"SearchResult",11:"ShopCart",12:"aist-share",13:"coupons",14:"detail",16:"myorders",17:"purchased",19:"search",20:"shareposter",21:"study",22:"togroup",23:"video"}[e]||e)+"."+{0:"6d24aba4",1:"5ed0fc89",2:"5ce769bd",3:"aeb3f822",4:"280c19c2",5:"31d6cfe0",6:"061a2017",7:"31d6cfe0",8:"a9111f28",9:"99c1fc9f",10:"b968f5d5",11:"8f4c32db",12:"a97e13d0",13:"f2c7a13b",14:"bf05380d",16:"99c740b6",17:"fb5cdbc2",19:"ed8f7a59",20:"175bee2a",21:"8867122f",22:"f08bc5f3",23:"f9b71225",25:"73976871",26:"31d6cfe0",27:"42a89c77",28:"bf839917",29:"35e22f8c",30:"57d8b033"}[e]+".chunk.css",o=f.p+n,c=document.getElementsByTagName("link"),i=0;i<c.length;i++){var u=(s=c[i]).getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(u===n||u===o))return r()}var d=document.getElementsByTagName("style");for(i=0;i<d.length;i++){var s;if((u=(s=d[i]).getAttribute("data-href"))===n||u===o)return r()}var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.onload=r,l.onerror=function(r){var n=r&&r.target&&r.target.src||o,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.request=n,delete a[e],l.parentNode.removeChild(l),t(c)},l.href=o,document.getElementsByTagName("head")[0].appendChild(l)}).then(function(){a[e]=0}));var t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var c,i=document.createElement("script");i.charset="utf-8",i.timeout=120,f.nc&&i.setAttribute("nonce",f.nc),i.src=function(e){return f.p+"static/js/"+({0:"BargainMiddlePage",1:"Classify",2:"CourseList",3:"DrawDocument",4:"Examination",5:"MyEdit",6:"Order",7:"Orderinfo",8:"PayOrder",9:"Preferential",10:"SearchResult",11:"ShopCart",12:"aist-share",13:"coupons",14:"detail",16:"myorders",17:"purchased",19:"search",20:"shareposter",21:"study",22:"togroup",23:"video"}[e]||e)+"."+{0:"b44705d9",1:"51d89cce",2:"c76007ff",3:"1aed9418",4:"29e9c55f",5:"085de024",6:"f6cc80c6",7:"20a5f741",8:"b19cb7bf",9:"12ba0792",10:"932745ed",11:"f1503e19",12:"9f7dd020",13:"1a550880",14:"f598b4a0",16:"b8058807",17:"249d4ca9",19:"8e8657cc",20:"c9eef843",21:"d85e86ef",22:"009cca29",23:"f1d18f06",25:"1870eb17",26:"459339e6",27:"3e36787f",28:"d9cbdaaa",29:"d1dc2a9e",30:"425f9e4f"}[e]+".chunk.js"}(e),c=function(r){i.onerror=i.onload=null,clearTimeout(u);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src,c=new Error("Loading chunk "+e+" failed.\n("+n+": "+a+")");c.type=n,c.request=a,t[1](c)}o[e]=void 0}};var u=setTimeout(function(){c({type:"timeout",target:i})},12e4);i.onerror=i.onload=c,document.head.appendChild(i)}return Promise.all(r)},f.m=e,f.c=n,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(e,r){if(1&r&&(e=f(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)f.d(t,n,function(r){return e[r]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/",f.oe=function(e){throw console.error(e),e};var i=window.webpackJsonp=window.webpackJsonp||[],u=i.push.bind(i);i.push=r,i=i.slice();for(var d=0;d<i.length;d++)r(i[d]);var s=u;t()}([]);
//# sourceMappingURL=runtime~main.efc52c9c.js.map
\ No newline at end of file
!function(e){function r(r){for(var n,a,i=r[0],f=r[1],u=r[2],d=0,l=[];d<i.length;d++)a=i[d],o[a]&&l.push(o[a][0]),o[a]=0;for(n in f)Object.prototype.hasOwnProperty.call(f,n)&&(e[n]=f[n]);for(s&&s(r);l.length;)l.shift()();return c.push.apply(c,u||[]),t()}function t(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,a=1;a<t.length;a++){var f=t[a];0!==o[f]&&(n=!1)}n&&(c.splice(r--,1),e=i(i.s=t[0]))}return e}var n={},a={18:0},o={18:0},c=[];function i(r){if(n[r])return n[r].exports;var t=n[r]={i:r,l:!1,exports:{}};return e[r].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.e=function(e){var r=[];a[e]?r.push(a[e]):0!==a[e]&&{0:1,1:1,2:1,3:1,4:1,6:1,8:1,9:1,10:1,11:1,12:1,13:1,14:1,16:1,17:1,19:1,20:1,21:1,22:1,23:1,25:1,27:1,28:1,29:1,30:1}[e]&&r.push(a[e]=new Promise(function(r,t){for(var n="static/css/"+({0:"BargainMiddlePage",1:"Classify",2:"CourseList",3:"DrawDocument",4:"Examination",5:"MyEdit",6:"Order",7:"Orderinfo",8:"PayOrder",9:"Preferential",10:"SearchResult",11:"ShopCart",12:"aist-share",13:"coupons",14:"detail",16:"myorders",17:"purchased",19:"search",20:"shareposter",21:"study",22:"togroup",23:"video"}[e]||e)+"."+{0:"6d24aba4",1:"5ed0fc89",2:"5ce769bd",3:"aeb3f822",4:"280c19c2",5:"31d6cfe0",6:"061a2017",7:"31d6cfe0",8:"a9111f28",9:"99c1fc9f",10:"b968f5d5",11:"8f4c32db",12:"a97e13d0",13:"f2c7a13b",14:"a70a1e9a",16:"99c740b6",17:"fb5cdbc2",19:"ed8f7a59",20:"175bee2a",21:"8867122f",22:"f08bc5f3",23:"f9b71225",25:"73976871",26:"31d6cfe0",27:"42a89c77",28:"bf839917",29:"35e22f8c",30:"57d8b033"}[e]+".chunk.css",o=i.p+n,c=document.getElementsByTagName("link"),f=0;f<c.length;f++){var u=(s=c[f]).getAttribute("data-href")||s.getAttribute("href");if("stylesheet"===s.rel&&(u===n||u===o))return r()}var d=document.getElementsByTagName("style");for(f=0;f<d.length;f++){var s;if((u=(s=d[f]).getAttribute("data-href"))===n||u===o)return r()}var l=document.createElement("link");l.rel="stylesheet",l.type="text/css",l.onload=r,l.onerror=function(r){var n=r&&r.target&&r.target.src||o,c=new Error("Loading CSS chunk "+e+" failed.\n("+n+")");c.request=n,delete a[e],l.parentNode.removeChild(l),t(c)},l.href=o,document.getElementsByTagName("head")[0].appendChild(l)}).then(function(){a[e]=0}));var t=o[e];if(0!==t)if(t)r.push(t[2]);else{var n=new Promise(function(r,n){t=o[e]=[r,n]});r.push(t[2]=n);var c,f=document.createElement("script");f.charset="utf-8",f.timeout=120,i.nc&&f.setAttribute("nonce",i.nc),f.src=function(e){return i.p+"static/js/"+({0:"BargainMiddlePage",1:"Classify",2:"CourseList",3:"DrawDocument",4:"Examination",5:"MyEdit",6:"Order",7:"Orderinfo",8:"PayOrder",9:"Preferential",10:"SearchResult",11:"ShopCart",12:"aist-share",13:"coupons",14:"detail",16:"myorders",17:"purchased",19:"search",20:"shareposter",21:"study",22:"togroup",23:"video"}[e]||e)+"."+{0:"b44705d9",1:"51d89cce",2:"c76007ff",3:"1aed9418",4:"29e9c55f",5:"085de024",6:"d9e85938",7:"f574e640",8:"b19cb7bf",9:"12ba0792",10:"932745ed",11:"f1503e19",12:"9f7dd020",13:"1a550880",14:"447a0b4c",16:"b8058807",17:"249d4ca9",19:"8e8657cc",20:"c9eef843",21:"d85e86ef",22:"009cca29",23:"f1d18f06",25:"1870eb17",26:"459339e6",27:"3e36787f",28:"d9cbdaaa",29:"d1dc2a9e",30:"425f9e4f"}[e]+".chunk.js"}(e),c=function(r){f.onerror=f.onload=null,clearTimeout(u);var t=o[e];if(0!==t){if(t){var n=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src,c=new Error("Loading chunk "+e+" failed.\n("+n+": "+a+")");c.type=n,c.request=a,t[1](c)}o[e]=void 0}};var u=setTimeout(function(){c({type:"timeout",target:f})},12e4);f.onerror=f.onload=c,document.head.appendChild(f)}return Promise.all(r)},i.m=e,i.c=n,i.d=function(e,r,t){i.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,r){if(1&r&&(e=i(e)),8&r)return e;if(4&r&&"object"===typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(i.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var n in e)i.d(t,n,function(r){return e[r]}.bind(null,n));return t},i.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(r,"a",r),r},i.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},i.p="/",i.oe=function(e){throw console.error(e),e};var f=window.webpackJsonp=window.webpackJsonp||[],u=f.push.bind(f);f.push=r,f=f.slice();for(var d=0;d<f.length;d++)r(f[d]);var s=u;t()}([]);
//# sourceMappingURL=runtime~main.a1c7156d.js.map
\ No newline at end of file
......@@ -96,7 +96,7 @@ class BtnStatus extends Component {
}else{
http.get(`${API['base-api']}/m/cart/addtopreorder/[${getParam('id')}]`).then((res) => {
if (res.data.errno === 0) {
this.props.history.push(`/order?id=[${getParam('id')}]`, {simple: 1})
this.props.history.push(`/order?id=${getParam('id')}`, {simple: 1})
} else {
Toast.info(res.data.msg, 2);
}
......@@ -145,7 +145,7 @@ class BtnStatus extends Component {
}else{
http.get(`${API['base-api']}/m/cart/addtopreorder/[${getParam('id')}]`).then((res) => {
if (res.data.errno === 0) {
this.props.history.push(`/order?id=[${getParam('id')}]`, {simple: 1});
this.props.history.push(`/order?id=[${getParam('id')}]`, {bargain: 1});
} else {
Toast.info(res.data.msg, 2);
}
......@@ -248,7 +248,6 @@ class BtnStatus extends Component {
<button className='btn btn-s bg-FCCD05' onClick={e => this.toCart(1)}>加入购物车</button>
}
{/*<Link to='/order' className='btn btn-s bg-FD7700'>立即报名</Link>*/}
<span className='btn btn-s bg-FD7700' onClick={e => this.simpleCourse()}>立即报名</span>
</div>
}
......
......@@ -40,7 +40,7 @@ function OrderList(props) {
return (
<OrderItem {...item} src={image_name} id={course_id} key={index} info={Info} isaist={props.isaist}>
{
is_coupon === 1 ? (
(props.locationState && (props.locationState.type || props.locationState.simple)) ? (
<div className="order-prefer">
<List key={index}>
<Item
......@@ -96,6 +96,18 @@ class Order extends Component {
if (!this.state.perfect) {
Toast.info('请完善报名信息!');
}
if(this.props.location.state && this.props.location.state.group === 1) {
http.post(`${API['base-api']}/pdd/m`, {course_id: getParam("id")}).then(res => {
console.log(res.data.data);
if(res.data.errno === 200) {
sessionStorage.removeItem('orderUseCacheObj');
this.props.history.replace(`/payorder?oid=${res.data.data.oid}`);
}else {
Toast.info(res.data.msg, 2);
return;
}
});
}else{
let url = `${API['base-api']}/m/v34/cart/order?ischeck=${this.state.useBalance}`;
if(this.props.location.state && this.props.location.state.type === 1) {
url += '&type=1'
......@@ -110,6 +122,8 @@ class Order extends Component {
this.props.history.replace(`/payorder?oid=${res.data.data.order_id}`);
});
}
}
// 勾选取消勾选 是否使用余额
useBalance = () => {
let useBalanceFlag = this.state.useBalance;
......@@ -227,7 +241,7 @@ class Order extends Component {
Toast.info(res.data.msg, 2);
}
})
} else if (this.props.location.state && this.props.location.state.simple === 1) {
} else if (this.props.location.state && (this.props.location.state.simple === 1 || this.props.location.state.bargain === 1)) {
// 普通课程立即报名 不带 type = 1
http.get(`${API['base-api']}/m/order/preorder`).then(res => {
if(res.data.errno === 200) {
......@@ -243,7 +257,24 @@ class Order extends Component {
console.log(resList);
let courseInfo = resList[0],
orderInfo = resList[1];
console.log(courseInfo.data);
console.log(orderInfo.data);
if(courseInfo.data.errno === 200) {
}else{
Toast.info(courseInfo.data.msg, 2);
return;
}
if(orderInfo.data.code === 200) {
}else{
Toast.info(courseInfo.data.msg, 2);
return;
}
this.groupPrice = orderInfo.data.data.course_info.pdd_group_info.price;
if(courseInfo.data.data.course.length === 0) {
courseInfo.data.data.course.push(orderInfo.data.data.course_info)
}
this.publicGetData(courseInfo);
this.publicLocalStorage();
});
......@@ -263,7 +294,7 @@ class Order extends Component {
})
}else{
http.get(`${API['base-api']}/m/order/preorder`).then((res) => {
alert('为了验证什么条件下会走这段代码');
console.log('为了验证什么条件下会走这段代码');
if (res.data.errno !== 200) {
Toast.info(res.data.msg, 2);
return;
......@@ -312,7 +343,7 @@ class Order extends Component {
pathname: '/orderinfo',
state: {
...this.state.perfect,
type: this.props.location.state ? this.props.location.state.type : null,
...this.props.location.state,
id: getParam('id')
}
}
......
......@@ -95,6 +95,7 @@ const MyForm = withFormik({
if(FormBag.props.userInfo.id) {
pathName = pathName + '?id=' + FormBag.props.userInfo.id;
}
console.log(values);
if(same === 3) {
FormBag.props.history.replace(
pathName,
......@@ -113,7 +114,9 @@ const MyForm = withFormik({
Toast.info('保存成功!', undefined, undefined, false);
FormBag.props.history.replace(
pathName,
values
{
...values,
}
);
});
},
......
......@@ -69,7 +69,6 @@ class Passport extends Component {
render() {
console.log(this.props);
let {match, location} = this.props
return (
<div className="passport">
......
......@@ -71,7 +71,8 @@ export default [
},
{
path: '/order',
component: Order
component: Order,
isPrivate: true
},
{
path: '/orderinfo',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment