import{E as e,o as a,c as t,w as s,n as l,e as r,i as d,a as o,b as u,F as n,f as i,t as c,d as _,l as f,g as m,k as p,x as y}from"./index-ae8bbb19.js";import{_ as E}from"./u-popup.d74d5514.js";import{r as v}from"./uni-app.es.ee1d5b08.js";import{O as g,a as h,D as k,b as C,P as D,R as x}from"./OrderType.fdcce3af.js";import{d as R,c as S,r as T,e as b}from"./order.76bebd87.js";import{_ as I,a as O,b as P,c as L,d as N}from"./close.45fd8c32.js";import{_ as w}from"./_plugin-vue_export-helper.1b428a4d.js";import"./u-icon.b463ad8a.js";const A=new e([{key:"MANUAL",name:"手动发货",value:10},{key:"UNWANTED",name:"无需物流",value:20},{key:"EORDER",name:"电子面单",value:30}]);const V=w({data:()=>({OrderTypeEnum:g,DeliveryStatusEnum:h,DeliveryTypeEnum:k,OrderStatusEnum:C,PayStatusEnum:D,ReceiptStatusEnum:x,DeliveryMethodEnum:A,orderId:null,isLoading:!0,order:{},setting:{},showQRCodePopup:!1,qrcodeImage:"",canReset:!1}),onLoad({orderId:e}){this.orderId=e,this.getOrderDetail(),uni.$on("syncRefresh",((e,a)=>{a||(this.canReset=e)}))},onShow(){this.canReset&&this.getOrderDetail(),this.canReset=!1},methods:{getOrderDetail(e=!1){const a=this;a.isLoading=!0,R(a.orderId).then((e=>{a.order=e.data.order,a.setting=e.data.setting,a.isLoading=!1})),e&&uni.$emit("syncRefresh",!0,!0)},handleCopy(e){const a=this;uni.setClipboardData({data:e,success(){a.$toast("复制成功")}})},handleTargetExtract(e){this.$navTo("pages/shop/detail",{shopId:e})},handleTargetExpress(){this.$navTo("pages/order/express/index",{orderId:this.orderId})},handleTargetGoods(e){this.$navTo("pages/goods/detail",{goodsId:e})},handleApplyRefund(e){this.$navTo("pages/refund/apply",{orderGoodsId:e})},onCancel(e){const a=this;uni.showModal({title:"友情提示",content:"确认要取消该订单吗?",success(t){t.confirm&&S(e).then((e=>{a.$toast(e.message),setTimeout((()=>{a.getOrderDetail(!0)}),1500)}))}})},onReceipt(e){const a=this;uni.showModal({title:"友情提示",content:"确认收到商品了吗?",success(t){t.confirm&&T(e).then((e=>{a.$success(e.message),setTimeout((()=>{a.getOrderDetail(!0)}),1500)}))}})},onExtractQRCode(e){const a=this;b(e,{channel:a.platform}).then((e=>{a.qrcodeImage=e.data.qrcode,a.showQRCodePopup=!0}))},onPay(e){this.$navTo("pages/checkout/cashier/index",{orderId:e})},handleTargetComment(e){this.$navTo("pages/order/comment/index",{orderId:e})}}},[["render",function(e,g,h,k,C,D){const x=m,R=d,S=p,T=v(y("u-popup"),E);return C.isLoading?r("",!0):(a(),t(R,{key:0,class:"container",style:l(e.appThemeStyle)},{default:s((()=>[o(R,{class:"header"},{default:s((()=>[o(R,{class:"order-status"},{default:s((()=>[o(R,{class:"status-icon"},{default:s((()=>[C.order.order_status==C.OrderStatusEnum.NORMAL.value?(a(),u(n,{key:0},[C.order.pay_status==C.PayStatusEnum.PENDING.value?(a(),t(x,{key:0,class:"image",src:I,mode:"aspectFit"})):C.order.delivery_status==C.DeliveryStatusEnum.NOT_DELIVERED.value?(a(),t(x,{key:1,class:"image",src:O,mode:"aspectFit"})):C.order.receipt_status==C.ReceiptStatusEnum.NOT_RECEIVED.value?(a(),t(x,{key:2,class:"image",src:P,mode:"aspectFit"})):r("",!0)],64)):r("",!0),C.order.order_status==C.OrderStatusEnum.COMPLETED.value?(a(),t(x,{key:1,class:"image",src:L,mode:"aspectFit"})):r("",!0),C.order.order_status==C.OrderStatusEnum.CANCELLED.value||C.order.order_status==C.OrderStatusEnum.APPLY_CANCEL.value?(a(),t(x,{key:2,class:"image",src:N,mode:"aspectFit"})):r("",!0)])),_:1}),o(R,{class:"status-text"},{default:s((()=>[o(S,null,{default:s((()=>[i(c(C.order.state_text),1)])),_:1})])),_:1})])),_:1}),C.order.order_status==C.OrderStatusEnum.NORMAL.value?(a(),t(R,{key:0,class:"next-action"},{default:s((()=>[C.order.pay_status==C.PayStatusEnum.PENDING.value?(a(),t(R,{key:0,class:"action-btn",onClick:g[0]||(g[0]=e=>D.onPay(C.order.order_id))},{default:s((()=>[i(" 去支付")])),_:1})):r("",!0),C.order.delivery_status==C.DeliveryStatusEnum.DELIVERED.value&&C.order.receipt_status==C.ReceiptStatusEnum.NOT_RECEIVED.value?(a(),t(R,{key:1,class:"action-btn",onClick:g[1]||(g[1]=e=>D.onReceipt(C.order.order_id))},{default:s((()=>[i("确认收货")])),_:1})):r("",!0)])),_:1})):r("",!0)])),_:1}),o(R,{class:"card-area"},{default:s((()=>[C.order.order_type==C.OrderTypeEnum.PHYSICAL.value?(a(),u(n,{key:0},[C.order.delivery_type==C.DeliveryTypeEnum.EXPRESS.value?(a(),t(R,{key:0,class:"delivery-address i-card"},{default:s((()=>[o(R,{class:"link-man"},{default:s((()=>[o(S,{class:"name"},{default:s((()=>[i(c(C.order.address.name),1)])),_:1}),o(S,{class:"phone"},{default:s((()=>[i(c(C.order.address.phone),1)])),_:1})])),_:1}),o(R,{class:"address"},{default:s((()=>[(a(!0),u(n,null,_(C.order.address.region,((e,l)=>(a(),t(S,{class:"region",key:l},{default:s((()=>[i(c(e),1)])),_:2},1024)))),128)),o(S,{class:"detail"},{default:s((()=>[i(c(C.order.address.detail),1)])),_:1})])),_:1})])),_:1})):r("",!0),C.order.delivery_type==C.DeliveryTypeEnum.EXTRACT.value?(a(),t(R,{key:1,class:"delivery-extract i-card",onClick:g[2]||(g[2]=e=>D.handleTargetExtract(C.order.extract_shop.shop_id))},{default:s((()=>[o(R,{class:"extract-top"},{default:s((()=>[o(S,{class:"title"},{default:s((()=>[i("自提门店")])),_:1}),o(S,{class:"subtitle"},{default:s((()=>[i("您须到该自提点取货")])),_:1})])),_:1}),o(R,{class:"shop-info"},{default:s((()=>[o(R,{class:"icon-location"},{default:s((()=>[o(S,{class:"iconfont icon-dingwei"})])),_:1}),o(R,{class:"shop-content"},{default:s((()=>[o(R,{class:"shop-name"},{default:s((()=>[o(S,null,{default:s((()=>[i(c(C.order.extract_shop.shop_name),1)])),_:1})])),_:1}),o(R,{class:"shop-describe"},{default:s((()=>[o(S,{class:"item-text"},{default:s((()=>[i(c(C.order.extract_shop.region.province),1)])),_:1}),o(S,{class:"item-text"},{default:s((()=>[i(c(C.order.extract_shop.region.city),1)])),_:1}),o(S,{class:"item-text"},{default:s((()=>[i(c(C.order.extract_shop.region.region),1)])),_:1}),o(S,{class:"item-text"},{default:s((()=>[i(c(C.order.extract_shop.address),1)])),_:1})])),_:1})])),_:1}),o(R,{class:"icon-arrow"},{default:s((()=>[o(S,{class:"iconfont icon-arrow-right"})])),_:1})])),_:1})])),_:1})):r("",!0)],64)):r("",!0),C.order.delivery_type==C.DeliveryTypeEnum.EXPRESS.value&&C.order.delivery_status==C.DeliveryStatusEnum.DELIVERED.value&&C.order.delivery&&C.order.delivery.length?(a(),t(R,{key:1,class:"express i-card",onClick:g[4]||(g[4]=e=>D.handleTargetExpress())},{default:s((()=>[C.order.delivery.length>1?(a(),t(R,{key:0,class:"main"},{default:s((()=>[o(R,{class:"info-item"},{default:s((()=>[o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i("订单已拆分多个包裹发货")])),_:1})])),_:1})])),_:1}),o(R,{class:"info-item"},{default:s((()=>[o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i("已发货"+c(C.order.delivery.length)+"个包裹",1)])),_:1})])),_:1})])),_:1})])),_:1})):(a(),t(R,{key:1,class:"main"},{default:s((()=>[o(R,{class:"info-item"},{default:s((()=>[o(R,{class:"item-lable"},{default:s((()=>[i("物流公司")])),_:1}),o(R,{class:"item-content"},{default:s((()=>[C.order.delivery[0].delivery_method!=C.DeliveryMethodEnum.UNWANTED.value?(a(),t(S,{key:0},{default:s((()=>[i(c(C.order.delivery[0].express?C.order.delivery[0].express.express_name:"--"),1)])),_:1})):(a(),t(S,{key:1},{default:s((()=>[i("无需物流")])),_:1}))])),_:1})])),_:1}),o(R,{class:"info-item"},{default:s((()=>[o(R,{class:"item-lable"},{default:s((()=>[i("物流单号")])),_:1}),o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i(c(C.order.delivery[0].express_no?C.order.delivery[0].express_no:"--"),1)])),_:1}),C.order.delivery[0].express_no?(a(),t(R,{key:0,class:"act-copy",onClick:g[3]||(g[3]=f((e=>D.handleCopy(C.order.delivery[0].express_no)),["stop"]))},{default:s((()=>[o(S,null,{default:s((()=>[i("复制")])),_:1})])),_:1})):r("",!0)])),_:1})])),_:1})])),_:1})),o(R,{class:"right-arrow"},{default:s((()=>[o(S,{class:"iconfont icon-arrow-right"})])),_:1})])),_:1})):r("",!0),o(R,{class:"goods-list i-card"},{default:s((()=>[(a(!0),u(n,null,_(C.order.goods,((e,l)=>(a(),t(R,{class:"goods-item",key:l},{default:s((()=>[o(R,{class:"goods-main",onClick:a=>D.handleTargetGoods(e.goods_id)},{default:s((()=>[o(R,{class:"goods-image"},{default:s((()=>[o(x,{class:"image",src:e.goods_image,mode:"scaleToFill"},null,8,["src"])])),_:2},1024),o(R,{class:"goods-content"},{default:s((()=>[o(R,{class:"goods-title"},{default:s((()=>[o(S,{class:"twoline-hide"},{default:s((()=>[i(c(e.goods_name),1)])),_:2},1024)])),_:2},1024),o(R,{class:"goods-props clearfix"},{default:s((()=>[(a(!0),u(n,null,_(e.goods_props,((e,l)=>(a(),t(R,{class:"goods-props-item",key:l},{default:s((()=>[o(S,null,{default:s((()=>[i(c(e.value.name),1)])),_:2},1024)])),_:2},1024)))),128))])),_:2},1024)])),_:2},1024),o(R,{class:"goods-trade"},{default:s((()=>[o(R,{class:"goods-price"},{default:s((()=>[o(S,{class:"unit"},{default:s((()=>[i("¥")])),_:1}),o(S,{class:"value"},{default:s((()=>[i(c(e.is_user_grade?e.grade_goods_price:e.goods_price),1)])),_:2},1024)])),_:2},1024),o(R,{class:"goods-num"},{default:s((()=>[o(S,null,{default:s((()=>[i("×"+c(e.total_num),1)])),_:2},1024)])),_:2},1024)])),_:2},1024)])),_:2},1032,["onClick"]),o(R,{class:"goods-refund"},{default:s((()=>[e.refund?(a(),t(S,{key:0,class:"stata-text"},{default:s((()=>[i("已申请售后")])),_:1})):C.order.isAllowRefund?(a(),t(R,{key:1,class:"action-btn",onClick:f((a=>D.handleApplyRefund(e.order_goods_id)),["stop"])},{default:s((()=>[i("申请售后")])),_:2},1032,["onClick"])):r("",!0)])),_:2},1024)])),_:2},1024)))),128))])),_:1}),o(R,{class:"order-info i-card"},{default:s((()=>[o(R,{class:"info-item"},{default:s((()=>[o(R,{class:"item-lable"},{default:s((()=>[i("订单编号")])),_:1}),o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i(c(C.order.order_no),1)])),_:1}),o(R,{class:"act-copy",onClick:g[5]||(g[5]=e=>D.handleCopy(C.order.order_no))},{default:s((()=>[o(S,null,{default:s((()=>[i("复制")])),_:1})])),_:1})])),_:1})])),_:1}),o(R,{class:"info-item"},{default:s((()=>[o(R,{class:"item-lable"},{default:s((()=>[i("下单时间")])),_:1}),o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i(c(C.order.create_time),1)])),_:1})])),_:1})])),_:1}),o(R,{class:"info-item"},{default:s((()=>[o(R,{class:"item-lable"},{default:s((()=>[i("买家留言")])),_:1}),o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i(c(C.order.buyer_remark?C.order.buyer_remark:"--"),1)])),_:1})])),_:1})])),_:1})])),_:1}),o(R,{class:"trade-info i-card"},{default:s((()=>[o(R,{class:"info-item"},{default:s((()=>[o(R,{class:"item-lable"},{default:s((()=>[i("订单金额")])),_:1}),o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i("¥"+c(C.order.total_price),1)])),_:1})])),_:1})])),_:1}),C.order.coupon_money>0?(a(),t(R,{key:0,class:"info-item"},{default:s((()=>[o(R,{class:"item-lable"},{default:s((()=>[i("优惠券抵扣")])),_:1}),o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i("-¥"+c(C.order.coupon_money),1)])),_:1})])),_:1})])),_:1})):r("",!0),C.order.points_money>0?(a(),t(R,{key:1,class:"info-item"},{default:s((()=>[o(R,{class:"item-lable"},{default:s((()=>[i(c(C.setting.points_name)+"抵扣",1)])),_:1}),o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i("-¥"+c(C.order.points_money),1)])),_:1})])),_:1})])),_:1})):r("",!0),o(R,{class:"info-item"},{default:s((()=>[o(R,{class:"item-lable"},{default:s((()=>[i("运费")])),_:1}),o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i("+¥"+c(C.order.express_price),1)])),_:1})])),_:1})])),_:1}),"0.00"!=C.order.update_price.value?(a(),t(R,{key:2,class:"info-item"},{default:s((()=>[o(R,{class:"item-lable"},{default:s((()=>[i("后台改价")])),_:1}),o(R,{class:"item-content"},{default:s((()=>[o(S,null,{default:s((()=>[i(c(C.order.update_price.symbol),1)])),_:1}),o(S,null,{default:s((()=>[i("¥"+c(C.order.update_price.value),1)])),_:1})])),_:1})])),_:1})):r("",!0),o(R,{class:"divider"}),o(R,{class:"trade-total"},{default:s((()=>[o(S,{class:"lable"},{default:s((()=>[i("实付款")])),_:1}),o(R,{class:"goods-price"},{default:s((()=>[o(S,{class:"unit"},{default:s((()=>[i("¥")])),_:1}),o(S,{class:"value"},{default:s((()=>[i(c(C.order.pay_price),1)])),_:1})])),_:1})])),_:1})])),_:1})])),_:1}),C.order.order_status!=C.OrderStatusEnum.CANCELLED.value?(a(),t(R,{key:0,class:"footer-fixed"},{default:s((()=>[o(R,{class:"btn-wrapper"},{default:s((()=>[C.order.pay_status==C.PayStatusEnum.PENDING.value?(a(),t(R,{key:0,class:"btn-item",onClick:g[6]||(g[6]=e=>D.onCancel(C.order.order_id))},{default:s((()=>[i("取消")])),_:1})):r("",!0),C.order.order_status!=C.OrderStatusEnum.APPLY_CANCEL.value?(a(),u(n,{key:1},[C.order.pay_status==C.PayStatusEnum.SUCCESS.value&&C.order.delivery_status==C.DeliveryStatusEnum.NOT_DELIVERED.value?(a(),t(R,{key:0,class:"btn-item",onClick:g[7]||(g[7]=e=>D.onCancel(C.order.order_id))},{default:s((()=>[i("申请取消")])),_:1})):r("",!0),C.order.pay_status==C.PayStatusEnum.SUCCESS.value&&C.order.delivery_type==C.DeliveryTypeEnum.EXTRACT.value&&C.order.delivery_status==C.DeliveryStatusEnum.NOT_DELIVERED.value?(a(),t(R,{key:1,class:"btn-item active",onClick:g[8]||(g[8]=e=>D.onExtractQRCode(C.order.order_id))},{default:s((()=>[o(S,{class:"iconfont icon-qr-extract"}),o(S,{class:"m-l-10"},{default:s((()=>[i("核销码")])),_:1})])),_:1})):r("",!0)],64)):(a(),t(R,{key:2,class:"f-28 col-8"},{default:s((()=>[i("取消申请中")])),_:1})),C.order.pay_status==C.PayStatusEnum.PENDING.value?(a(),t(R,{key:3,class:"btn-item active",onClick:g[9]||(g[9]=e=>D.onPay(C.order.order_id))},{default:s((()=>[i("去支付")])),_:1})):r("",!0),C.order.delivery_status==C.DeliveryStatusEnum.DELIVERED.value&&C.order.receipt_status==C.ReceiptStatusEnum.NOT_RECEIVED.value?(a(),t(R,{key:4,class:"btn-item active",onClick:g[10]||(g[10]=e=>D.onReceipt(C.order.order_id))},{default:s((()=>[i("确认收货")])),_:1})):r("",!0),C.order.order_status==C.OrderStatusEnum.COMPLETED.value&&0==C.order.is_comment?(a(),t(R,{key:5,class:"btn-item",onClick:g[11]||(g[11]=e=>D.handleTargetComment(C.order.order_id))},{default:s((()=>[i("评价")])),_:1})):r("",!0)])),_:1})])),_:1})):r("",!0),o(T,{modelValue:C.showQRCodePopup,"onUpdate:modelValue":g[12]||(g[12]=e=>C.showQRCodePopup=e),mode:"center","border-radius":"26",closeable:!0},{default:s((()=>[o(R,{class:"qrcode-popup"},{default:s((()=>[o(R,{class:"title"},{default:s((()=>[i("自提核销二维码")])),_:1}),o(R,{class:"pop-content"},{default:s((()=>[C.qrcodeImage?(a(),t(x,{key:0,class:"image",src:C.qrcodeImage},null,8,["src"])):r("",!0)])),_:1})])),_:1})])),_:1},8,["modelValue"])])),_:1},8,["style"]))}],["__scopeId","data-v-bcb07766"]]);export{V as default};