(window.webpackJsonp=window.webpackJsonp||[]).push([[15],{690:function(e,a,t){},754:function(e,a,t){"use strict";t.r(a);t(43);var n=t(14),c=t.n(n),r=t(7),s=t(8),m=t(10),i=t(9),o=t(11),l=(t(250),t(95)),d=t.n(l),u=t(0),p=t.n(u),E=(t(690),t(37)),f=t(152),N=t(3),b=t(16),g=t(85),v=d.a.alert,h=function(e){function a(e){var t;return Object(r.a)(this,a),(t=Object(m.a)(this,Object(i.a)(a).call(this,e))).getList=function(){N.d.get("".concat(N.a.home,"/m/my/orders/1/1")).then(function(e){200===e.data.code?t.setState({data:e.data.data,isLoading:!1}):c.a.info(e.data.msg,2)})},t.cancel=function(e){v("\u786e\u8ba4\u53d6\u6d88\u8ba2\u5355\uff1f","\u8ba2\u5355\u53d6\u6d88\u540e\uff0c\u4f18\u60e0\u5238\u548c\u62b5\u6263\u7684\u4f59\u989d\u4f1a\u8fd4\u56de\u5230\u60a8\u7684\u8d26\u6237\u3002",[{text:"\u53d6\u6d88",onPress:function(){return console.log("cancel")}},{text:"\u786e\u8ba4",onPress:function(){var a={order_id:e};N.d.post("".concat(N.a.home,"/m/cancel_order"),a).then(function(e){200===e.data.code?t.getList():c.a.info(e.data.msg,2)})}}])},t.state={data:[],isLoading:!0},t}return Object(o.a)(a,e),Object(s.a)(a,[{key:"componentDidMount",value:function(){this.getList()}},{key:"render",value:function(){var e=this;return p.a.createElement("div",{className:"myorders-box"},p.a.createElement(E.e,{title:"\u6211\u7684\u8ba2\u5355",arrow:!0,cart:!1}),p.a.createElement(g.a,{isLoading:this.state.isLoading},this.state.data&&this.state.data.length>0?this.state.data.map(function(a,t){return p.a.createElement("div",{className:"order-body",key:t},p.a.createElement(_,{item:a}),a.course&&a.course.length>0&&a.course.map(function(e,a){var t=p.a.createElement("div",{className:"order-info"},p.a.createElement("p",{className:"order-title text-overflow-one"},p.a.createElement(b.b,{to:"/detail?id=".concat(e.course_id)},e.course_title)),p.a.createElement("p",{className:"order-content text-overflow-2"},e.description),p.a.createElement("p",{className:"order-des"},p.a.createElement("span",{className:"order-newprice"},"\xa5",e.pay_amount),p.a.createElement("span",{className:"order-price"},"\xa5",e.price0)));return p.a.createElement("div",{className:"order-wrap",key:a},p.a.createElement(f.a,{info:t,src:e.image_name,id:e.course_id}))}),p.a.createElement(y,{item:a,cancel:e.cancel}))}):p.a.createElement("div",{className:"cart-tip"},p.a.createElement("p",{className:"cart-mess"},"\u60a8\u8fd8\u6ca1\u6709\u8ba2\u5355\u54e6\uff0c\u5feb\u53bb\u901b\u901b\u5427~"),p.a.createElement(b.b,{to:"/classify"},"\u53bb\u901b\u901b"))))}}]),a}(u.Component);function _(e){var a;return a="0"===e.item.pay_time&&0===e.item.member_num?p.a.createElement("span",{className:"oid-status"},"\u7b49\u5f85\u652f\u4ed8"):e.item.member_num===e.item.pdd_info.length&&0!==e.item.member_num?p.a.createElement("span",{className:"oid-success"},"\u62fc\u56e2\u6210\u529f"):p.a.createElement("span",{className:"oid-success"},"\u652f\u4ed8\u6210\u529f"),p.a.createElement("div",{className:"order-head"},p.a.createElement("span",{className:"oid-num"},"\u8ba2\u5355\u53f7\uff1a",e.item.oid),a)}function y(e){return p.a.createElement("div",{className:"order-btm"},p.a.createElement("div",{className:"price-info"},p.a.createElement("p",null,p.a.createElement("span",{className:"payable"},"\u5e94\u4ed8\uff1a"),p.a.createElement("span",{className:"price"},"\xa5",e.item.pay_amount)),p.a.createElement("p",null,p.a.createElement("span",{className:"payable"},"\u5df2\u4f18\u60e0\uff1a"),p.a.createElement("span",{className:"price"},"\xa5",e.item.coupon_amount))),"0"===e.item.pay_time&&0===e.item.member_num&&p.a.createElement("div",{className:"btm-right"},p.a.createElement("button",{className:"cancel",onClick:function(a){return e.cancel(e.item.oid)}},"\u53d6\u6d88\u8ba2\u5355"),p.a.createElement(b.b,{to:"/payorder?oid=".concat(e.item.oid)},"\u53bb\u652f\u4ed8")),0!==e.item.member_num&&p.a.createElement("div",{className:"btm-right"},p.a.createElement("div",{className:"group"},e.item.pdd_info&&e.item.pdd_info.length>0&&e.item.pdd_info.map(function(e,a){return p.a.createElement("img",{src:""===e.user_avatar?"https://julyedu-cdn.oss-cn-beijing.aliyuncs.com/tinypng-spreadtrain8/ellipsis.png":e.user_avatar,key:a,alt:""})}))))}a.default=h}}]);
//# sourceMappingURL=myorders.df325028.chunk.js.map