(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/order"],{"0ebc":function(e,t,n){},"11ed":function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return a})),n.d(t,"a",(function(){return o}));var o={uniLoadMore:function(){return n.e("components/uni-load-more/uni-load-more").then(n.bind(null,"eaf8"))}},r=function(){var e=this,t=e.$createElement,n=(e._self._c,e.__map(e.navList,(function(t,n){var o=e.__get_orig(t),r=!0===t.loaded&&0===t.orderList.length,a=e.__map(t.orderList,(function(t,n){var o=e.__get_orig(t),r=t.cartInfo.length,a=e.__map(t.cartInfo,(function(t,n){var o=e.__get_orig(t),r=e._f("moneyNum")(t.productInfo.price);return{$orig:o,f0:r}})),i=t.cartInfo.length,d=e.moneyNum(t.pay_postage),c=e.moneyNum(t.pay_price);return{$orig:o,g1:r,l0:a,g2:i,m0:d,m1:c}}));return{$orig:o,g0:r,l1:a}})));e.$mp.data=Object.assign({},{$root:{l2:n}})},a=[]},2431:function(e,t,n){"use strict";(function(e,t){var o=n("4ea4");n("3e39");o(n("66fd"));var r=o(n("6b7a"));e.__webpack_require_UNI_MP_PLUGIN__=n,t(r.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"24e0":function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("2101"),r=(n("5635"),{components:{uniLoadMore:function(){n.e("components/uni-load-more/uni-load-more").then(function(){return resolve(n("eaf8"))}.bind(null,n)).catch(n.oe)},empty:function(){n.e("components/empty").then(function(){return resolve(n("afbc"))}.bind(null,n)).catch(n.oe)}},data:function(){return{tabCurrentIndex:0,navList:[{state:0,text:"待付款",loadingType:"more",orderList:[],page:1,limit:10},{state:1,text:"待发货",loadingType:"more",orderList:[],page:1,limit:10},{state:2,text:"待收货",loadingType:"more",orderList:[],page:1,limit:10},{state:3,text:"待评价",loadingType:"more",orderList:[],page:1,limit:10},{state:4,text:"已完成",loadingType:"more",orderList:[],page:1,limit:10}]}},onLoad:function(e){this.tabCurrentIndex=+e.state,0==e.state&&this.loadData()},methods:{moneyNum:function(e){return+e},orderTake:function(t,n){var r=this;e.showModal({title:"是否确认收货？",success:function(){(0,o.orderTake)({uni:t.order_id}).then((function(t){r.navList[r.tabCurrentIndex].orderList.splice(n,1),e.showToast({title:"收货成功"})})).catch((function(e){console.log(e)}))}})},goToOrderDetail:function(t){e.navigateTo({url:"/pages/order/orderDetail?id="+t.order_id})},orderRefund:function(t){e.navigateTo({url:"/pages/order/orderRefund?id="+t.order_id})},orderPay:function(t){e.navigateTo({url:"/pages/money/pay?type=1&ordid="+t.order_id+"&money="+t.pay_price})},loadData:function(t){var n=this,r=this.tabCurrentIndex,a=this.navList[r],i=a.state;"tabChange"===t&&!0===a.loaded||"loading"!==a.loadingType&&"noMore"!==a.loadingType&&(a.loadingType="loading",(0,o.orderList)({type:i,page:a.page,limit:a.limit}).then((function(t){var o=t.data,r=o.map((function(e){var t=n.orderStateExp(e.status);return e.stateTip=t.stateTip,e.stateTipColor=t.stateTipColor,e}));a.orderList=a.orderList.concat(r),a.page++,a.limit!=o.length?(a.loadingType="noMore",e.hideLoading(),n.$set(a,"loaded",!0)):a.loadingType="more"})).catch((function(e){console.log(e)})))},changeTab:function(e){this.tabCurrentIndex=e.target.current,this.loadData("tabChange")},tabClick:function(e){this.tabCurrentIndex=e},deleteOrder:function(t){var n=this;e.showLoading({title:"请稍后"}),setTimeout((function(){n.navList[n.tabCurrentIndex].orderList.splice(t,1),e.hideLoading()}),600)},cancelOrder:function(t){var n=this;e.showModal({title:"订单取消",content:"是否取消订单？",success:function(r){if(r.confirm){e.showLoading({title:"请稍后"}),(0,o.orderCancel)({id:t.order_id}).then((function(t){e.showToast({title:"取消成功",duration:2e3,position:"top"})})).catch((function(e){console.log(e)}));var a=n.navList[n.tabCurrentIndex].orderList,i=a.findIndex((function(e){return e.id===t.id}));-1!==i&&a.splice(i,1),e.hideLoading()}}})},orderStateExp:function(e){var t="",n="#fa436a";switch(+e){case 0:t="待付款";break;case 1:t="待发货";break;case 2:t="待收货";break;case 3:t="待评价";break;case 4:t="已完成",n="#5dbc7c";break;case 9:t="订单已关闭",n="#909399";break}return{stateTip:t,stateTipColor:n}}}});t.default=r}).call(this,n("543d")["default"])},"6b7a":function(e,t,n){"use strict";n.r(t);var o=n("11ed"),r=n("a275");for(var a in r)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return r[e]}))}(a);n("b156");var i=n("f0c5"),d=Object(i["a"])(r["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=d.exports},a275:function(e,t,n){"use strict";n.r(t);var o=n("24e0"),r=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);t["default"]=r.a},b156:function(e,t,n){"use strict";var o=n("0ebc"),r=n.n(o);r.a}},[["2431","common/runtime","common/vendor"]]]);