acdr-ui/dist/build/mp-weixin/modules/mall/order/detail.js

2 lines
7.7 KiB
JavaScript
Raw Normal View History

2024-09-19 07:20:14 +08:00
"use strict";var e=(e,r,o)=>new Promise(((t,n)=>{var d=e=>{try{a(o.next(e))}catch(r){n(r)}},s=e=>{try{a(o.throw(e))}catch(r){n(r)}},a=e=>e.done?t(e.value):Promise.resolve(e.value).then(d,s);a((o=o.apply(e,r)).next())}));const r=require("../../../common/vendor.js"),o=require("../../../sheep/index.js"),t=require("../../../sheep/hooks/useGoods.js"),n=require("../../../sheep/api/trade/order.js"),d=require("../../../sheep/api/trade/delivery.js");if(!Array){(r.resolveComponent("s-goods-item")+r.resolveComponent("su-fixed")+r.resolveComponent("s-layout")+r.resolveComponent("layout-default-uni"))()}Math||((()=>"../../../sheep/components/s-goods-item/s-goods-item.js")+s+(()=>"../../../sheep/ui/su-fixed/su-fixed.js")+(()=>"../../../sheep/components/s-layout/s-layout.js"))();const s=()=>"./pickUpVerify.js",a={__name:"detail",setup(s){r.useCssVars((e=>({"4d6faa6f":r.unref(i)})));const a=2*o.sheep.$platform.device.statusBarHeight,i=o.sheep.$url.css("/static/img/shop/order/order_bg.png"),u=r.reactive({orderInfo:{},merchantTradeNo:"",comeinType:""}),c=r.ref({}),f=()=>{o.sheep.$helper.copyText(u.orderInfo.no)};function l(t,d=!1){return e(this,null,(function*(){if("WechatMiniProgram"===o.sheep.$platform.name&&!r.isEmpty(u.orderInfo.wechat_extra_data)&&!d)return void function(e){if(!r.wx$1.openBusinessView)return void o.sheep.$helper.toast("请升级微信版本");r.wx$1.openBusinessView({businessType:"weappOrderConfirm",extraData:{merchant_trade_no:u.orderInfo.wechat_extra_data.merchant_trade_no,transaction_id:u.orderInfo.wechat_extra_data.transaction_id},success(r){"openBusinessView:ok"===r.errMsg&&"success"===r.extraData.status&&l(e,!0)},fail(e){},complete(e){}})}(t);const{code:e}=yield n.OrderApi.receiveOrder(t);0===e&&(yield m(t))}))}const p=r.ref();function m(r){return e(this,null,(function*(){let e;if(e="wechat"===u.comeinType?yield n.OrderApi.getOrder(r,{merchant_trade_no:u.merchantTradeNo}):yield n.OrderApi.getOrder(r),0===e.code){if(u.orderInfo=e.data,t.handleOrderButtons(u.orderInfo),e.data.pickUpStoreId){const{data:r}=yield d.DeliveryApi.getDeliveryPickUpStore(e.data.pickUpStoreId);c.value=r||{}}2===u.orderInfo.deliveryType&&u.orderInfo.payStatus&&p.value&&p.value.markCode(e.data.pickUpVerifyCode)}else o.sheep.$router.back()}))}return r.onLoad((r=>e(this,null,(function*(){let e=0;r.id&&(e=r.id),u.comeinType=r.comein_type,"wechat"===u.comeinType&&(u.merchantTradeNo=r.merchant_trade_no),yield m(e)})))),(d,s)=>{var i,I,h,y,v,_,g,x,b,P,S,$,T,w;return r.e({a:"unpaid"==u.orderInfo.status_code||10===u.orderInfo.status||"nocomment"==u.orderInfo.status_code},"unpaid"==u.orderInfo.status_code||10===u.orderInfo.status||"nocomment"==u.orderInfo.status_code?{b:r.unref(o.sheep).$url.static("/static/img/shop/order/order_loading.png")}:{},{c:"completed"==u.orderInfo.status_code||"refund_agree"==u.orderInfo.status_code},"completed"==u.orderInfo.status_code||"refund_agree"==u.orderInfo.status_code?{d:r.unref(o.sheep).$url.static("/static/img/shop/order/order_success.png")}:{},{e:"cancel"==u.orderInfo.status_code||"closed"==u.orderInfo.status_code},"cancel"==u.orderInfo.status_code||"closed"==u.orderInfo.status_code?{f:r.unref(o.sheep).$url.static("/static/img/shop/order/order_close.png")}:{},{g:"noget"==u.orderInfo.status_code},"noget"==u.orderInfo.status_code?{h:r.unref(o.sheep).$url.static("/static/img/shop/order/order_express.png")}:{},{i:r.t(r.unref(t.formatOrderStatus)(u.orderInfo)),j:r.t(r.unref(t.formatOrderStatusDescription)(u.orderInfo)),k:r.s({marginTop:"-"+Number(a+88)+"rpx",paddingTop:Number(a+88)+"rpx"}),l:u.orderInfo.receiverAreaId>0},u.orderInfo.receiverAreaId>0?{m:r.t(u.orderInfo.receiverName),n:r.t(u.orderInfo.receiverMobile),o:r.t(u.orderInfo.receiverAreaName),p:r.t(u.orderInfo.receiverDetailAddress)}:{},{q:r.f(u.orderInfo.items,((e,t,n)=>r.e({a:[10,20,30].includes(u.orderInfo.status)&&0===e.afterSaleStatus},[10,20,30].includes(u.orderInfo.status)&&0===e.afterSaleStatus?{b:r.o((t=>r.unref(o.sheep).$router.go("/modules/mall/order/aftersale/apply",{orderId:u.orderInfo.id,itemId:e.id})),e.goods_id)}:{},{c:10===e.afterSaleStatus}