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