(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/order"],{2101:function(t,e,n){"use strict";var o=n("59f2"),r=n.n(o);r.a},"2ec3":function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=n("1b3d"),r={components:{uniLoadMore:function(){n.e("components/uni-load-more/uni-load-more").then(function(){return resolve(n("bfdb"))}.bind(null,n)).catch(n.oe)},empty:function(){n.e("components/empty").then(function(){return resolve(n("be9e"))}.bind(null,n)).catch(n.oe)}},filters:{moneyNum:function(t){return+t}},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){e.cartInfo[0].coupon_id&&0==e.cartInfo[0].couponstatus?t.navigateTo({url:"/user/page/coupon?id="+e.cartInfo[0].coupon_id}):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){console.log(e),t.navigateTo({url:"/pages/money/pay?type=1&ordid="+e.order_id+"&money="+e.pay_price+"&isP="+(0!=e.combination_id?"1":"0")})},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=r}).call(this,n("543d")["default"])},3411:function(t,e,n){"use strict";n.r(e);var o=n("c3da"),r=n("c661");for(var a in r)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return r[t]}))}(a);n("2101");var i=n("f0c5"),d=Object(i["a"])(r["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);e["default"]=d.exports},"59f2":function(t,e,n){},c3da: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,"bfdb"))}},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=!0===e.loaded&&0===e.orderList.length,a=t.__map(e.orderList,(function(e,n){var o=t.__get_orig(e),r=e.cartInfo.length,a=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}})),i=e.cartInfo.length,d=t.moneyNum(e.pay_postage),c=t.moneyNum(e.pay_price);return{$orig:o,g1:r,l0:a,g2:i,m0:d,m1:c}}));return{$orig:o,g0:r,l1:a}})));t.$mp.data=Object.assign({},{$root:{l2:n}})},a=[]},c661:function(t,e,n){"use strict";n.r(e);var o=n("2ec3"),r=n.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(a);e["default"]=r.a},dbb1:function(t,e,n){"use strict";(function(t,e){var o=n("4ea4");n("12d5");o(n("66fd"));var r=o(n("3411"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(r.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])}},[["dbb1","common/runtime","common/vendor"]]]);