text: (window.webpackJsonp=window.webpackJsonp||[]).push([[33],{"263":function(e,t,o){var n=o(264);"string"==typeof n&&(n=[[e.i,n,""]]);var r={"sourceMap":!1,"insertAt":"top","hmr":!0,"transform":void 0,"insertInto":void 0};o(75)(n,r);n.locals&&(e.exports=n.locals)},"264":function(e,t,o){(e.exports=o(74)(!1)).push([e.i,".taro-scroll {\n  -webkit-overflow-scrolling: touch;\n}\n\n.taro-scroll::-webkit-scrollbar {\n  display: none;\n}\n\n.taro-scroll-view {\n  overflow: hidden;\n}\n\n.taro-scroll-view__scroll-x {\n  overflow-x: scroll;\n  overflow-y: hidden;\n}\n\n.taro-scroll-view__scroll-y {\n  overflow-x: hidden;\n  overflow-y: scroll;\n}",""])},"268":function(e,t,o){"use strict";o.d(t,"a",function(){return y});var n,r,i=o(1),a=o(2),l=o(51),s=o(280),c=o(10),p=o.n(c),u=o(240),f=o.n(u),d=(o(269),o(77)),h=o(241),m=o(253),v=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e},b=function(){function defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,o){return t&&defineProperties(e.prototype,t),o&&defineProperties(e,o),e}}();var y=(r=n=function(e){function List(e){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,List);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(List.__proto__||Object.getPrototypeOf(List)).call(this,e));return t.getData=function(){if(!t.loading&&!t.isFinished&&!t.showLoading){var e=t.apiName,o=t.params;t.loading=!0,Object(d.b)({"name":e,"data":v({"page":t.page++},o),"success":function success(e){var o=Array.isArray(e)?e:e.data||e.order,n=t.listData;n||(n=[]),n=n.concat(o),t.listData=n,t.props.onLoadData(n,e),0===n.length&&0===o.length&&t.setState({"isEmpty":!0}),o.length<t.props.numberPerPage&&(t.isFinished=!0,t.setState({"showLoading":!1})),t.loading=!1}})}},t.refreshData=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.apiName,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.params;t.isFinished=!1,t.loading=!1,t.page=0,t.listData=[],t.apiName=e,t.params=o,t.setState({"showLoading":!0,"isEmpty":!1}),t.getData()},t.onClickButtonHandle=function(){t.props.onClickButton?t.props.onClickButton():a.a.navigateBack()},t.onScroll=function(e){var o=e.detail,n=o.scrollTop;o.scrollHeight-n<800&&t.getData()},t.page=0,t.isFinished=!1,t.loading=!1,t.listData=[],t.apiName="",t.params={},t.state={"isEmpty":!1,"showLoading":!0},t}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{"constructor":{"value":e,"enumerable":!1,"writable":!0,"configurable":!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(List,a["a"].Component),b(List,[{"key":"componentWillMount","value":function componentWillMount(){var e=this,t=this.props,o=t.event,n=t.onMount;a.a.eventCenter.on("load:"+o,function(){e.getData()}),a.a.eventCenter.on("reload:"+o,function(t,o){e.refreshData(t,o)}),n()}},{"key":"componentWillUnmount","value":function componentWillUnmount(){var e=this.props.event;a.a.eventCenter.off("load:"+e),a.a.eventCenter.off("reload:"+e)}},{"key":"render","value":function render(){var e=this.listData,t=void 0;this.willReload&&(this.willReload=!1),t=e.length>0?i.k.createElement(l.a,null,i.k.createElement(s.a,{"scrollY":!0,"onScroll":this.onScroll,"className":"scroll-content"},this.props.children,e&&this.state.showLoading&&i.k.createElement(h.a,{"type":"inline"}))):this.state.isEmpty?i.k.createElement(m.a,{"icon":"empty","text":this.props.emptyTip,"mainActionType":"back","mainAction":this.props.buttonText,"onClickMain":this.onClickButtonHandle,"type":"full"===this.props.mode?"full":"auto"}):i.k.createElement(h.a,{"type":"block"===this.props.mode?"block":void 0});var o=p()("list",{"block":"block"===this.props.mode,"empty":this.state.isEmpty,"full":"full"===this.props.mode});return i.k.createElement(l.a,{"className":o},t)}}]),List}(),n.options={"addGlobalClass":!0},n.defaultProps={"event":"page","apiName":"","numberPerPage":10,"data":{},"emptyTip":"没有内容","buttonText":"返回上一级","mode":"full","onLoadData":function onLoadData(){},"onMount":function onMount(){}},n.propTypes={"event":f.a.string,"numberPerPage":f.a.number,"emptyTip":f.a.string,"buttonText":f.a.string,"mode":f.a.string,"onLoadData":f.a.func,"onMount":f.a.func},r)},"269":function(e,t,o){},"272":function(e,t,o){"use strict";o.d(t,"a",function(){return c});var n,r,i=o(1),a=o(2),l=o(51),s=(o(273),function(){function defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,o){return t&&defineProperties(e.prototype,t),o&&defineProperties(e,o),e}}());var c=(r=n=function(e){function Tabs(e){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,Tabs);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(Tabs.__proto__||Object.getPrototypeOf(Tabs)).call(this,e));return t.onChange=function(e){e!==t.props.active&&t.props.onChange(e)},t.state={},t}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{"constructor":{"value":e,"enumerable":!1,"writable":!0,"configurable":!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(Tabs,a["a"].Component),s(Tabs,[{"key":"render","value":function render(){var e=this,t=this.props.tabs.map(function(t,o){return i.k.createElement(l.a,{"key":o,"className":o===e.props.active?"active":"","onClick":e.onChange.bind(void 0,o)},t)});return i.k.createElement(l.a,{"className":"tabs"},i.k.createElement(l.a,{"className":"nav-tabs"},t),i.k.createElement(l.a,{"className":"content"},this.props.children))}}]),Tabs}(),n.options={"addGlobalClass":!0},n.defaultProps={"active":0,"tabs":[],"children":void 0,"onChange":function onChange(){}},r)},"273":function(e,t,o){},"280":function(e,t,o){"use strict";o(38);var n=o(1),r=o(76),i=o(10),a=o.n(i),l=(o(263),Object.assign||function(e){for(var t=1;t<arguments.length;t++){var o=arguments[t];for(var n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}),s=function(){function defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,o){return t&&defineProperties(e.prototype,t),o&&defineProperties(e,o),e}}();function _defineProperty(e,t,o){return t in e?Object.defineProperty(e,t,{"value":o,"enumerable":!0,"configurable":!0,"writable":!0}):e[t]=o,e}function easeOutScroll(e,t,o){if(e!==t&&"number"==typeof e){var n=t-e,r=500,i=+new Date,a=t>=e;!function step(){e=function linear(e,t,o,n){return o*e/n+t}(+new Date-i,e,n,r),a&&e>=t||!a&&t>=e?o(t):(o(e),requestAnimationFrame(step))}()}}var c=function(e){function ScrollView(){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,ScrollView);var e=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(ScrollView.__proto__||Object.getPrototypeOf(ScrollView)).apply(this,arguments));return e.onTouchMove=function(e){e.stopPropagation()},e}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{"constructor":{"value":e,"enumerable":!1,"writable":!0,"configurable":!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(ScrollView,n["k"].Component),s(ScrollView,[{"key":"componentDidMount","value":function componentDidMount(){var e=this;setTimeout(function(){var t=e.props;t.scrollY&&"number"==typeof t.scrollTop&&("scrollWithAnimation"in t?easeOutScroll(0,t.scrollTop,function(t){e.container.scrollTop=t}):e.container.scrollTop=t.scrollTop,e._scrollTop=t.scrollTop),t.scrollX&&"number"==typeof t.scrollLeft&&("scrollWithAnimation"in t?easeOutScroll(0,t.scrollLeft,function(t){e.container.scrollLeft=t}):e.container.scrollLeft=t.scrollLeft,e._scrollLeft=t.scrollLeft)},10)}},{"key":"componentWillReceiveProps","value":function componentWillReceiveProps(e){var t=this,o=this.props;e.scrollY&&"number"==typeof e.scrollTop&&e.scrollTop!==this._scrollTop&&("scrollWithAnimation"in e?easeOutScroll(this._scrollTop,e.scrollTop,function(e){t.container.scrollTop=e}):this.container.scrollTop=e.scrollTop,this._scrollTop=e.scrollTop),e.scrollX&&"number"==typeof o.scrollLeft&&e.scrollLeft!==this._scrollLeft&&("scrollWithAnimation"in e?easeOutScroll(this._scrollLeft,e.scrollLeft,function(e){t.container.scrollLeft=e}):this.container.scrollLeft=e.scrollLeft,this._scrollLeft=e.scrollLeft)}},{"key":"render","value":function render(){var e,t=this,o=this.props,i=o.className,s=o.onScroll,c=o.onScrollToUpper,p=o.onScrollToLower,u=o.onTouchMove,f=o.scrollX,d=o.scrollY,h=this.props,m=h.upperThreshold,v=void 0===m?50:m,b=h.lowerThreshold,y=void 0===b?50:b,g=a()("taro-scroll",(_defineProperty(e={},"taro-scroll-view__scroll-x",f),_defineProperty(e,"taro-scroll-view__scroll-y",d),e),i);v=parseInt(v),y=parseInt(y);var _=function throttle(e,t){var o=null;return function(){clearTimeout(o),o=setTimeout(function(){e()},t)}}(function uperAndLower(){var e=t.container,o=e.offsetWidth,n=e.offsetHeight,r=e.scrollLeft,i=e.scrollTop,a=e.scrollHeight,l=e.scrollWidth;p&&(t.props.scrollY&&n+i+y>=a||t.props.scrollX&&o+r+y>=l)&&p(),c&&(t.props.scrollY&&i<=v||t.props.scrollX&&r<=v)&&c()},200);return n.k.createElement("div",l({"ref":function ref(e){t.container=e}},Object(r.a)(this.props,["className","scrollTop","scrollLeft"]),{"className":g,"onScroll":function _onScroll(e){var o=t.container,n=o.scrollLeft,r=o.scrollTop,i=o.scrollHeight,a=o.scrollWidth;t._scrollLeft=n,t._scrollTop=r,e.detail={"scrollLeft":n,"scrollTop":r,"scrollHeight":i,"scrollWidth":a},_(),s&&s(e)},"onTouchMove":function _onTouchMove(e){u?u(e):t.onTouchMove(e)}}),this.props.children)}}]),ScrollView}();t.a=c},"413":function(e,t,o){},"415":function(e,t,o){},"544":function(e,t,o){"use strict";o.r(t);var n,r,i=o(1),a=o(2),l=o(51),s=o(260),c=(o(413),o(272)),p=o(259),u=o(258),f=o(240),d=o.n(f),h=o(283),m=o(329),v=o(265),b=o(244),y=(o(415),function(){function defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,o){return t&&defineProperties(e.prototype,t),o&&defineProperties(e,o),e}}());var g=(r=n=function(e){function OrderCell(e){!function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,OrderCell);var t=function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(OrderCell.__proto__||Object.getPrototypeOf(OrderCell)).call(this,e));return t.gotoOrder=function(){var e=t.props.data.orderInfo;a.a.navigateTo({"url":"../order/order?id="+e.id})},t.onClickMain=function(e,o){o.stopPropagation(),t.props.onClickMain(e)},t.onClickMinor=function(e,o){o.stopPropagation(),t.props.onClickMinor(e)},t.gotoComment=function(e){a.a.navigateTo({"url":"../comment/comment?ordergoods_id="+e})},t.handleClickActionButton=function(e,o){var n=t.props.data.orderInfo,r=Object(m.a)(n);if(r){var i="main"===e?r.mainAction:r.minorAction;i&&i(n),o.stopPropagation()}},t.state={},t}return function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{"constructor":{"value":e,"enumerable":!1,"writable":!0,"configurable":!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(OrderCell,a["a"].Component),y(OrderCell,[{"key":"render","value":function render(){var e=this,t=this.props.data,o=t.orderInfo,n=t.goodsInfo,r=Object(h.c)(o),a=["普通订单","拼团订单","余额充值订单","积分兑换订单"][o.order_type-1],s=["","拼团","余额充值","积分兑换"][o.order_type-1],c=Object(m.a)(o);return i.k.createElement(l.a,{"className":"order-cell","onClick":this.gotoOrder},i.k.createElement(l.a,{"className":"header"},i.k.createElement(l.a,{"className":"left"},i.k.createElement(p.a,null,o.created_at),s&&i.k.createElement(p.a,{"className":"tag"},s)),i.k.createElement(p.a,null,r)),i.k.createElement(l.a,{"className":"order-goods-list"},n.map(function(t){return i.k.createElement(v.a,{"key":t.id,"goods":t,"mainButton":"已完成"===r?0===t.hasComment?"评价":"已评价":void 0,"disableMainButton":1===t.hasComment,"onClickMain":e.gotoComment,"disabled":!0,"isExchange":"积分兑换订单"===a})})),i.k.createElement(l.a,{"className":"footer"},i.k.createElement(l.a,{"className":"total"},"共",o.goods_amount,"件商品， 合计",i.k.createElement(b.a,{"price":o.pay_fee,"isExchange":"积分兑换订单"===a}),o.shipping_fee>0&&i.k.createElement(l.a,null,"含邮费（",i.k.createElement(b.a,{"price":o.shipping_fee}),"）")),i.k.createElement(l.a,{"className":"handle"},c.minorButton&&i.k.createElement(u.a,{"hoverStopPropagation":!0,"size":"mini","className":"btn-yellow","onClick":this.handleClickActionButton.bind(void 0,"minor")},c.minorButton),c.mainButton&&i.k.createElement(u.a,{"type":"primary","hoverStopPropagation":!0,"size":"mini","onClick":this.handleClickActionButton.bind(void 0,"main")},c.mainButton))))}}]),OrderCell}(),n.propTypes={"data":d.a.object,"mainButton":d.a.string,"minorButton":d.a.string,"onClickMain":d.a.func,"onClickMinor":d.a.func},n.defaultProps={"data":{"goodsInfo":[],"orderInfo":{}},"mainButton":void 0,"minorButton":void 0,"onClickMain":function onClickMain(){},"onClickMinor":function onClickMinor(){}},r),_=o(268);o.d(t,"default",function(){return k});var w=function(){function defineProperties(e,t){for(var o=0;o<t.length;o++){var n=t[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(e,t,o){return t&&defineProperties(e.prototype,t),o&&defineProperties(e,o),e}}(),O=function get(e,t,o){null===e&&(e=Function.prototype);var n=Object.getOwnPropertyDescriptor(e,t);if(void 0===n){var r=Object.getPrototypeOf(e);return null===r?void 0:get(r,t,o)}if("value"in n)return n.value;var i=n.get;return void 0!==i?i.call(o):void 0};var k=function(e){function OrderList(e){!function order_list_classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,OrderList);var t=function order_list_possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(OrderList.__proto__||Object.getPrototypeOf(OrderList)).call(this,e));return t.config={"navigationBarTitleText":"全部订单"},t.onReachBottom=function(){a.a.eventCenter.trigger("load:orderList")},t.onLoadData=function(e){var o=t.state.orderList;o[t.state.active]=e,t.setState({"orderList":o})},t.reload=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:t.state.active,o=0===e?"getAllOrders":"getOrdersByStatus",n={"type":e};a.a.eventCenter.trigger("reload:orderList",o,n)},t.changeTab=function(e){t.state.active!==e&&(t.setState({"active":e}),t.reload(e))},t.nowActive=parseInt(t.$router.params.type)||0,t.state={"active":t.nowActive,"orderList":[[],[],[],[],[]]},t}return function order_list_inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{"constructor":{"value":e,"enumerable":!1,"writable":!0,"configurable":!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(OrderList,a["a"].Component),w(OrderList,[{"key":"componentWillMount","value":function componentWillMount(){a.a.eventCenter.on("update:orderList",function(){a.a.eventCenter.trigger("reload:orderList")})}},{"key":"componentDidMount","value":function componentDidMount(){this.reload(this.$router.params.type||0)}},{"key":"onShareAppMessage","value":function onShareAppMessage(){}},{"key":"onPullDownRefresh","value":function onPullDownRefresh(){a.a.eventCenter.trigger("reload:orderList")}},{"key":"render","value":function render(){var e=this,t=this.state.orderList,o=this.state.active,n=void 0,r=["全部","待付款","待收货","已完成","退款"];t[o]&&t[o].length>0&&(n=t[o].map(function(e){return i.k.createElement(g,{"data":e,"key":e.orderInfo.id})}));var a=i.k.createElement(l.a,{"className":"order-list"},i.k.createElement(c.a,{"tabs":r,"active":o,"onChange":this.changeTab},i.k.createElement(_.a,{"event":"orderList","emptyTip":0===o?"当前没有订单":"没有"+r[o]+"的订单","onLoadData":this.onLoadData},n)));return i.k.createElement(s.a,{"onRefresh":this.onPullDownRefresh&&this.onPullDownRefresh.bind(this),"ref":function ref(t){t&&(e.pullDownRefreshRef=t)}},a)}},{"key":"componentDidShow","value":function componentDidShow(){O(OrderList.prototype.__proto__||Object.getPrototypeOf(OrderList.prototype),"componentDidShow",this)&&O(OrderList.prototype.__proto__||Object.getPrototypeOf(OrderList.prototype),"componentDidShow",this).call(this),this.pullDownRefreshRef&&this.pullDownRefreshRef.bindEvent()}},{"key":"componentDidHide","value":function componentDidHide(){O(OrderList.prototype.__proto__||Object.getPrototypeOf(OrderList.prototype),"componentDidHide",this)&&O(OrderList.prototype.__proto__||Object.getPrototypeOf(OrderList.prototype),"componentDidHide",this).call(this),this.pullDownRefreshRef&&this.pullDownRefreshRef.unbindEvent()}}]),OrderList}()}}]);