(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order/order"],{"76d7":function(e,t,n){"use strict";n.d(t,"b",(function(){return r})),n.d(t,"c",(function(){return i})),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,"ef69"))}},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=e.__map(t.orderList,(function(t,n){var o=e.__get_orig(t),r=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=e.moneyNum(t.pay_postage),a=e.moneyNum(t.pay_price);return{$orig:o,l0:r,m0:i,m1:a}}));return{$orig:o,l1:r}})));e.$mp.data=Object.assign({},{$root:{l2:n}})},i=[]},"7e89":function(e,t,n){"use strict";(function(e){n("856e");o(n("66fd"));var t=o(n("fe68"));function o(e){return e&&e.__esModule?e:{default:e}}wx.__webpack_require_UNI_MP_PLUGIN__=n,e(t.default)}).call(this,n("543d")["createPage"])},"8e54":function(e,t,n){},a3ee:function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=n("62c8"),r=function(){n.e("components/uni-load-more/uni-load-more").then(function(){return resolve(n("ef69"))}.bind(null,n)).catch(n.oe)},i=function(){n.e("components/empty").then(function(){return resolve(n("fdb6"))}.bind(null,n)).catch(n.oe)},a={components:{uniLoadMore:r,empty:i},filters:{moneyNum:function(e){return+e}},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){console.log(t),e.navigateTo({url:"/pages/money/pay?type=1&ordid="+t.order_id+"&money="+t.pay_price+"&isP="+(0!=t.combination_id?"1":"0")})},loadData:function(t){var n=this,r=this.tabCurrentIndex,i=this.navList[r],a=i.state;"tabChange"===t&&!0===i.loaded||"loading"!==i.loadingType&&"noMore"!==i.loadingType&&(i.loadingType="loading",(0,o.orderList)({type:a,page:i.page,limit:i.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}));i.orderList=i.orderList.concat(r),i.page++,i.limit!=o.length?(i.loadingType="noMore",e.hideLoading(),n.$set(i,"loaded",!0)):i.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 i=n.navList[n.tabCurrentIndex].orderList,a=i.findIndex((function(e){return e.id===t.id}));-1!==a&&i.splice(a,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=a}).call(this,n("543d")["default"])},b8bf:function(e,t,n){"use strict";n.r(t);var o=n("a3ee"),r=n.n(o);for(var i in o)"default"!==i&&function(e){n.d(t,e,(function(){return o[e]}))}(i);t["default"]=r.a},bd23:function(e,t,n){"use strict";var o=n("8e54"),r=n.n(o);r.a},fe68:function(e,t,n){"use strict";n.r(t);var o=n("76d7"),r=n("b8bf");for(var i in r)"default"!==i&&function(e){n.d(t,e,(function(){return r[e]}))}(i);n("bd23");var a,d=n("f0c5"),u=Object(d["a"])(r["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],a);t["default"]=u.exports}},[["7e89","common/runtime","common/vendor"]]]);