order_detail.js 7.3 KB

1
  1. (global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/order_detail/order_detail"],{"05f3":function(e,n,t){"use strict";t.r(n);var o=t("4f23"),r=t.n(o);for(var a in o)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return o[e]}))}(a);n["default"]=r.a},1166:function(e,n,t){"use strict";var o=t("efcb"),r=t.n(o);r.a},"1f67":function(e,n,t){"use strict";(function(e,n){var o=t("47a9");t("b46f");o(t("3240"));var r=o(t("4e5d"));e.__webpack_require_UNI_MP_PLUGIN__=t,n(r.default)}).call(this,t("3223")["default"],t("df3c")["createPage"])},"4e5d":function(e,n,t){"use strict";t.r(n);var o=t("9d91"),r=t("05f3");for(var a in r)["default"].indexOf(a)<0&&function(e){t.d(n,e,(function(){return r[e]}))}(a);t("1166");var u=t("828b"),s=Object(u["a"])(r["default"],o["b"],o["c"],!1,null,"d21f5580",null,!1,o["a"],void 0);n["default"]=s.exports},"4f23":function(e,n,t){"use strict";(function(e){var o=t("47a9");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var r=o(t("7eb4")),a=o(t("ee10")),u=t("0669"),s=o(t("7fd6")),i=t("7398"),d=t("704d"),c={components:{uImage:function(){t.e("components/uview-ui/components/u-image/u-image").then(function(){return resolve(t("566d"))}.bind(null,t)).catch(t.oe)}},name:"OrderDetail",mixins:[s.default],data:function(){return{showQR:!1,pageStatus:d.PageStatusEnum["LOADING"],order_id:"",orderInfo:{delivery_content1:[]},goodsList:[],addressInfo:{},orderButtons:[],showCountDown:!0,orderStatus:{0:{name:"等待买家付款"},1:{name:"等待商家发货",desc:"您的商品正在打包中,请耐心等待…"},2:{name:"待收货",desc:"您的商品正在路中,请耐心等待…"},3:{name:"已完成",desc:"商品已签收,期待再次购买!"},4:{name:"订单已关闭",desc:""}},selffetchStatus:{2:{name:"待取货",desc:"请前往指定门店取货"},3:{name:"已完成",desc:"交易已完成,感谢您的购买!"},4:{name:"订单已关闭",desc:""}},afterSaleStatus:{1:{name:"申请售后",href:"/bundle/pages/post_after_sale/post_after_sale"},2:{name:"售后中",href:"/bundle/pages/after_sale_detail/after_sale_detail"},3:{name:"售后成功",href:"/bundle/pages/after_sale_detail/after_sale_detail"},4:{name:"售后失败",href:"/bundle/pages/after_sale_detail/after_sale_detail"}},teamStatus:{0:"拼团中",1:"拼团成功",2:"拼团失败"}}},computed:{OrderTypeEnum:function(){return d.OrderTypeEnum},orderAction:function(){return this.orderStatus[this.orderInfo.order_status]||{}},shopOpenTime:function(){var e;if(this.orderInfo.selffetch_shop){var n=["周一","周二","周三","周四","周五","周六","周日"],t="",o=null===(e=this.orderInfo.selffetch_shop)||void 0===e?void 0:e.weekdays.split(",").sort(),r=o.length;return 7==o.length?t="每日".concat(this.orderInfo.selffetch_shop.business_start_time.slice(0,5),"-").concat(this.orderInfo.selffetch_shop.business_end_time.slice(0,5)):(o.forEach((function(e,o){for(var a=1;a<=7;a++)e==a&&(t+=n[a-1]+"".concat(o==r-1?"":"、"))})),t+="".concat(this.orderInfo.selffetch_shop.business_start_time.slice(0,5),"-").concat(this.orderInfo.selffetch_shop.business_end_time.slice(0,5))),t}}},methods:{handleImage:function(){e.previewImage({urls:[this.orderInfo.selffetch_shop.image]})},handleLocation:function(){e.openLocation({latitude:Number(this.orderInfo.selffetch_shop.latitude),longitude:Number(this.orderInfo.selffetch_shop.longitude),address:this.orderInfo.selffetch_shop.detailed_address,name:this.orderInfo.selffetch_shop.name,fail:function(e){console.log(e)}})},handlePhone:function(){e.makePhoneCall({phoneNumber:this.orderInfo.selffetch_shop.mobile})},handleshowQR:function(){if(!this.orderInfo.order_status)return this.$toast({title:"付款后可查看"});this.showQR=!0,this.$nextTick((function(){var e=this.$refs["qrcode"];e._makeCode()}))},handletemplateCopy:function(e){var n=e.map((function(e){return e.name+":"+e.content})),t="";n.forEach((function(e){t+=e})),(0,i.copy)(t)},handleCopy:i.copy,refreshOrderData:function(){var e=this;return(0,u.apiOrderDetail)({id:this.order_id}).then((function(n){var t;return e.orderInfo=n,e.addressInfo=n.address,e.goodsList=n.order_goods,e.orderButtons=null!==(t=e.getOrderStatusButtons(n.btn))&&void 0!==t?t:[],Promise.resolve(n)})).then((function(e){e.delivery_type})).catch((function(e){return Promise.reject(e)}))},getPaywayName:function(e){switch(e){case 1:return"余额支付";case 2:return"微信支付";case 3:return"支付宝支付";case 5:return"线下支付"}},getCountDownSegment:function(e){var n=(new Date).getTime()/1e3;return e-n<=0&&(this.showCountDown=!1),e-n},goGoodsDetail:function(e){this.$Router.push({path:"/pages/goods_detail/goods_detail",query:{id:e}})},goAfterSale:function(e,n){this.$Router.push({path:e,query:{id:n}})}},onLoad:function(){var n=this;return(0,a.default)(r.default.mark((function t(){var o;return r.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(o=n.$Route.query,n.isLogin){t.next=3;break}return t.abrupt("return",n.$Router.replace("/pages/login/login"));case 3:if(t.prev=3,o.order_id){t.next=6;break}throw new Error("订单异常");case 6:return n.order_id=o.order_id,t.next=9,n.refreshOrderData();case 9:n.pageStatus=d.PageStatusEnum["NORMAL"],t.next=16;break;case 12:t.prev=12,t.t0=t["catch"](3),console.log(t.t0),n.pageStatus=d.PageStatusEnum["ERROR"];case 16:e.$on("duringPayment",(function(e){var t=e.result;t===d.PaymentStatusEnum["SUCCESS"]&&(n.$Router.back(),setTimeout((function(){n.$toast({title:"支付成功"})}),500),n.refreshOrderData())}));case 17:case"end":return t.stop()}}),t,null,[[3,12]])})))()},onUnload:function(){e.$off("duringPayment")}};n.default=c}).call(this,t("df3c")["default"])},"9d91":function(e,n,t){"use strict";t.d(n,"b",(function(){return r})),t.d(n,"c",(function(){return a})),t.d(n,"a",(function(){return o}));var o={navbar:function(){return Promise.all([t.e("common/vendor"),t.e("components/navbar/navbar")]).then(t.bind(null,"909a"))},uCountDown:function(){return t.e("components/uview-ui/components/u-count-down/u-count-down").then(t.bind(null,"5317"))},addressCard:function(){return t.e("components/address-card/address-card").then(t.bind(null,"6ebb"))},uIcon:function(){return t.e("components/uview-ui/components/u-icon/u-icon").then(t.bind(null,"1340"))},uImage:function(){return t.e("components/uview-ui/components/u-image/u-image").then(t.bind(null,"566d"))},uPopup:function(){return t.e("components/uview-ui/components/u-popup/u-popup").then(t.bind(null,"002f"))},tkiQrcode:function(){return Promise.all([t.e("common/vendor"),t.e("components/tki-qrcode/tki-qrcode")]).then(t.bind(null,"b5d9"))},goodsCard:function(){return t.e("components/goods-card/goods-card").then(t.bind(null,"4daa"))},price:function(){return t.e("components/price/price").then(t.bind(null,"1266"))},pageStatus:function(){return t.e("components/page-status/page-status").then(t.bind(null,"7cfb"))},uEmpty:function(){return t.e("components/uview-ui/components/u-empty/u-empty").then(t.bind(null,"7bc9"))}},r=function(){var e=this,n=e.$createElement,t=(e._self._c,!e.orderInfo.order_status&&e.showCountDown?e.getCountDownSegment(e.orderInfo.cancel_unpaid_orders_time):null),o=e.orderInfo.delivery_content||e.orderInfo.delivery_content1.length,r=e.getPaywayName(e.orderInfo.pay_way),a=e.orderButtons.length;e._isMounted||(e.e0=function(n){e.showCountDown=!1}),e.$mp.data=Object.assign({},{$root:{m0:t,g0:o,m1:r,g1:a}})},a=[]},efcb:function(e,n,t){}},[["1f67","common/runtime","common/vendor"]]]);