pages-myOrders-orderDetail.Bkjir-4U.js 17 KB

1
  1. var h=(Q,F,b)=>new Promise((v,V)=>{var N=w=>{try{P(b.next(w))}catch(j){V(j)}},l=w=>{try{P(b.throw(w))}catch(j){V(j)}},P=w=>w.done?v(w.value):Promise.resolve(w.value).then(N,l);P((b=b.apply(Q,F)).next())});import{d as Fe,r as y,P as c,u as Ue,v as We,U as Ye,f as m,g as e,aA as Ge,z as He,B as T,D as A,_ as Je,W as Ke,o as p,h as a,F as t,j as Xe,G as M,J as g,H as q,L as i,aY as K,M as o,N as Ze,O as I,I as Ce,l as Qe,n as et,K as X,aZ as tt,Y as Ie,X as H,$ as Pe,aw as at,q as rt}from"./index-CZIX6ZiI.js";import{_ as lt}from"./wd-skeleton.DGyhdHDQ.js";import{_ as ot}from"./wd-card.BE_njzrC.js";import{_ as st}from"./wd-text.DJLq1BRo.js";import{_ as nt}from"./z-paging.Bra-LOfm.js";import{_ as it}from"./circle-check.C-5cnQHd.js";import{o as dt,c as ct,d as ut,e as pt,f as ft}from"./order.3lpjfHTY.js";import{a as xt}from"./wallet.DCWvlizl.js";import{D as mt}from"./DialogBox.Bpd1dP5M.js";import{D as Z}from"./utils.CY6F74uO.js";const _t=Fe({name:"OrderDetail",__name:"orderDetail",setup(Q){const F=y(null),b=y(),v=y(),V=y(!1),N=y(!0),l=y({}),P=y([]),w=y(),j=y(),U=y("00:00"),O=y(),D=y(!1),$=y({}),k=y("");function ee(n){return h(this,null,function*(){try{const f=yield Ge({code:n});if(f.code==="200")switch(n){case"open_red_envelope_rate":w.value=f.data.valueInfo;break;case"join_red_envelope_rate":j.value=f.data.valueInfo;break;default:break}}catch(f){}})}function Oe(){return h(this,null,function*(){try{const n=yield dt({id:1});n.code==="200"&&(P.value=n.data)}catch(n){}})}function Te(){var _,r;if(O.value&&clearInterval(O.value),!((_=l.value)!=null&&_.createTime)||((r=l.value)==null?void 0:r.status)!==1){U.value="00:00";return}D.value=!1;const f=new Date(l.value.createTime).getTime()+20*60*1e3;O.value=setInterval(()=>{const G=Date.now(),u=f-G;if(u<=0){clearInterval(O.value),U.value="00:00",D.value||(D.value=!0,B());return}const L=Math.floor(u/1e3/60),R=Math.floor(u/1e3%60);U.value=`${String(L).padStart(2,"0")}:${String(R).padStart(2,"0")}`},1e3)}function Ae(){return h(this,null,function*(){D.value=!1,yield B()})}function B(){return h(this,null,function*(){var n,f;try{N.value=!0;const _=v.value?{orderNo:v.value}:{id:b.value},r=yield ct(_);r.code==="200"&&(l.value=r.data,v.value&&((n=l.value)!=null&&n.orderId)&&(b.value=l.value.orderId),((f=l.value)==null?void 0:f.status)===1?D.value||Te():D.value=!1,yield Ve(),F.value.complete())}finally{N.value=!1}})}const W=y([]);function Ve(){return h(this,null,function*(){try{const n=yield ut({orderNo:v.value});n.code==="200"&&(W.value=n.data)}catch(n){}})}function Ne(){var n;X({url:"/pages/mine/addressBook",params:{selectMode:"1",orderId:(n=l.value)==null?void 0:n.orderId}})}function je(){k.value="cancel",Object.assign($.value,Z.info(c("orderDetail.dialog.cancel.title"),{showCancel:!0,confirmText:c("orderDetail.dialog.cancel.confirm"),cancelText:c("orderDetail.dialog.cancel.keep"),confirmPlain:!0}))}function $e(){return h(this,null,function*(){try{Ie({title:c("orderDetail.cancel.loading"),mask:!0});const n=yield ft({orderNo:v.value});n.code==="200"?(H.success(c("orderDetail.cancel.success")),B()):H.error(n.message||c("orderDetail.cancel.error"))}catch(n){H.error(c("orderDetail.cancel.error"))}finally{Pe()}})}function Be(){var n;k.value==="cancel"?$e():k.value==="pay"?Re():k.value==="recharge"&&X({url:"/pages/wallet/recharge",params:{price:(n=l.value)==null?void 0:n.payPrice},isRedirect:!0}),Y()}function Y(){$.value.show=!1}function Le(){k.value="recharge",Object.assign($.value,Z.info(c("orderDetail.rechargeDialog.title"),{showCancel:!1,confirmText:c("orderDetail.rechargeDialog.confirm"),cancelText:"",confirmPlain:!0}))}function te(){k.value="pay",Object.assign($.value,Z.info(c("orderDetail.payDialog.title"),{showCancel:!1,cancelText:"",confirmText:c("orderDetail.payDialog.confirm"),confirmPlain:!1}))}function Re(){return h(this,null,function*(){var n,f,_;Ie({title:c("orderDetail.payment.loading"),mask:!0});try{(yield pt({orderId:(n=l.value)==null?void 0:n.orderId,type:(_=(f=l.value)==null?void 0:f.storePink)!=null&&_.kId?"join":"open"})).code==="200"&&(H.success(c("orderDetail.payment.success")),B())}finally{Pe()}})}function Se(){var n;((n=l.value)==null?void 0:n.status)===1&&te()}const ae={create_order:c("orderDetail.time.placed"),pay_success:c("orderDetail.time.paid"),delivery:c("orderDetail.time.shipped"),receive:c("orderDetail.time.completed")};function Ee(){at({data:`${l.value.deliveryName}: ${l.value.deliveryId}`})}Ue(n=>h(this,null,function*(){ee("open_red_envelope_rate"),ee("join_red_envelope_rate");const f=n;v.value=f.orderNo,V.value=f.isPayOrder,yield Oe()}));const J=y(0);return We(()=>h(this,null,function*(){var n,f,_;if(D.value=!1,yield B(),V.value&&((n=l.value)==null?void 0:n.status)===1){const r=yield xt();J.value=(f=r==null?void 0:r.data)==null?void 0:f.balance,J.value<((_=l.value)==null?void 0:_.payPrice)?Le():te()}})),Ye(()=>{O.value&&clearInterval(O.value)}),(n,f)=>{const _=T(A("wd-skeleton"),lt),r=Xe,G=T(A("wd-card"),ot),u=Ze,L=Qe,R=T(A("wd-icon"),Je),ze=T(A("wd-text"),st),re=T(A("wd-button"),Ke),Me=T(A("z-paging"),nt),qe=He("layout-default-uni");return p(),m(qe,null,{default:e(()=>[a(Me,{ref_key:"paging",ref:F,"refresher-only":"",onRefresh:Ae},{bottom:e(()=>{var S;return[((S=t(l))==null?void 0:S.status)===1?(p(),m(r,{key:0,class:"flex items-center justify-end bg-white/60 px-28rpx py-30rpx backdrop-blur-20"},{default:e(()=>{var E;return[((E=t(l))==null?void 0:E.status)===1?(p(),m(re,{key:0,"custom-class":"mr-16rpx!",plain:"",onClick:je},{default:e(()=>[i(o(t(c)("orderDetail.button.cancel")),1)]),_:1})):g("",!0),a(re,{onClick:Se},{default:e(()=>[i(o(t(c)("orderDetail.button.pay")),1)]),_:1})]}),_:1})):g("",!0)]}),default:e(()=>[t(N)?(p(),m(r,{key:0,class:"pt-20rpx"},{default:e(()=>[a(r,{class:"mb-20rpx bg-white py-20rpx text-center"},{default:e(()=>[a(_,{"row-col":[{width:"180rpx",height:"28rpx",marginLeft:"auto",marginRight:"auto"}],animation:"gradient"})]),_:1}),a(r,{class:"mb-20rpx bg-white px-24rpx py-20rpx"},{default:e(()=>[a(_,{"row-col":[{width:"150rpx",height:"28rpx"},{width:"200rpx",height:"24rpx",marginTop:"12rpx"},{width:"100%",height:"22rpx",marginTop:"8rpx"}],animation:"gradient"})]),_:1}),a(G,{type:"rectangle","custom-class":"px-24rpx! py-6rpx!","custom-content-class":"py-18rpx!","custom-title-class":"py-18rpx!"},{title:e(()=>[a(_,{"row-col":[[{width:"250rpx",height:"28rpx"},{width:"60rpx",height:"26rpx",marginLeft:"auto"}]],animation:"gradient"})]),default:e(()=>[a(_,{"row-col":[[{width:"140rpx",height:"140rpx",type:"rect"},[{width:"100%",height:"40rpx"},{width:"80%",height:"40rpx",marginTop:"8rpx"},{width:"120rpx",height:"24rpx",marginTop:"4rpx"},[{width:"100rpx",height:"24rpx"},{width:"80rpx",height:"24rpx",marginLeft:"auto"}]]]],animation:"gradient"})]),_:1}),a(r,{class:"bg-white px-24rpx"},{default:e(()=>[a(r,{class:"border-b-1 border-b-#e8e8e8 border-b-solid py-24rpx"},{default:e(()=>[a(_,{"row-col":[{width:"120rpx",height:"28rpx"},[{width:"80rpx",height:"24rpx"},{width:"100rpx",height:"24rpx",marginLeft:"auto"}]],animation:"gradient"})]),_:1}),a(r,{class:"border-b-1 border-b-#e8e8e8 border-b-solid py-24rpx"},{default:e(()=>[a(_,{"row-col":[[{width:"100rpx",height:"28rpx"},{width:"140rpx",height:"24rpx",marginLeft:"auto"}]],animation:"gradient"})]),_:1}),a(r,{class:"py-24rpx"},{default:e(()=>[a(_,{"row-col":[[{width:"90rpx",height:"24rpx"},{width:"150rpx",height:"24rpx",marginLeft:"auto"}],[{width:"80rpx",height:"24rpx"},{width:"150rpx",height:"24rpx",marginLeft:"auto"}]],animation:"gradient"})]),_:1})]),_:1})]),_:1})):(p(),m(r,{key:1,class:"pt-20rpx"},{default:e(()=>{var S,E,le,oe,se,ne,ie,de,ce,ue,pe,fe,xe,me,_e,ye,ge,he;return[t(l).status!==4&&((S=t(l))==null?void 0:S.status)!==2?(p(),M(q,{key:0},[((E=t(l))==null?void 0:E.status)===9?(p(),m(r,{key:0,class:"mb-20rpx bg-#17AA68/80 py-20rpx text-center text-28rpx text-white"},{default:e(()=>[i(o(t(c)("orderDetail.status9.sellBackPrefix"))+" ",1),a(u,{class:"text-[var(--wot-color-theme)]"},{default:e(()=>{var s;return[i(" ৳"+o(t(I)((s=t(l))==null?void 0:s.recycleAmount)),1)]}),_:1}),K("br"),i(" "+o(t(c)("orderDetail.status9.receivePrefix"))+" ",1),a(u,{class:"text-[var(--wot-color-theme)]"},{default:e(()=>{var s;return[i(" ৳"+o(t(I)((s=t(l))==null?void 0:s.brokerage)),1)]}),_:1}),i(" "+o(t(c)("orderDetail.status9.rewardSuffix")),1)]),_:1})):((oe=(le=t(l))==null?void 0:le.storePink)==null?void 0:oe.status)===2&&((ne=(se=t(l))==null?void 0:se.storePink)==null?void 0:ne.lId)===1?(p(),m(r,{key:1,class:"mb-20rpx bg-#17AA68/80 py-20rpx text-center text-28rpx text-white"},{default:e(()=>[i(o(t(c)("orderDetail.congrats"))+" ",1),K("br"),i(" "+o(t(c)("orderDetail.receiveReward"))+" ",1),a(u,{class:"text-[var(--wot-color-theme)]"},{default:e(()=>[i(" ৳"+o(t(l).brokerage),1)]),_:1})]),_:1})):((de=(ie=t(l))==null?void 0:ie.storePink)==null?void 0:de.status)===2&&((ue=(ce=t(l))==null?void 0:ce.storePink)==null?void 0:ue.lId)===0?(p(),m(r,{key:2,class:"mb-20rpx bg-#E61B28/80 py-20rpx text-center text-28rpx text-white"},{default:e(()=>[i(o(t(c)("orderDetail.sorry"))+" ",1),K("br"),i(" "+o(t(c)("orderDetail.receiveReward"))+" ",1),a(u,{class:"text-#66C59B"},{default:e(()=>[i(" ৳"+o(t(l).brokerage),1)]),_:1})]),_:1})):((fe=(pe=t(l))==null?void 0:pe.storePink)==null?void 0:fe.status)===1||((xe=t(l))==null?void 0:xe.status)===1?(p(),m(r,{key:3,class:"mb-20rpx bg-#fff py-20rpx text-center text-28rpx text-white"},{default:e(()=>{var s,d,x;return[((d=(s=t(l))==null?void 0:s.storePink)==null?void 0:d.status)===1&&((x=t(l))==null?void 0:x.status)!==1?(p(),m(u,{key:0,class:"text-[var(--wot-color-theme)]"},{default:e(()=>[i(o(t(c)("orderDetail.waiting")),1)]),_:1})):(p(),m(u,{key:1,class:"text-[var(--wot-color-theme)]"},{default:e(()=>[i(o(t(c)("orderDetail.paymentCountdown"))+" "+o(t(U)),1)]),_:1}))]}),_:1})):g("",!0),t(W)&&t(W).length?(p(),m(r,{key:4,class:"mb-20rpx bg-white px-20rpx py-20rpx text-center"},{default:e(()=>[(p(!0),M(q,null,Ce(t(W),s=>(p(),m(L,{key:s,class:"mx-4rpx mb-8rpx h-80rpx w-80rpx border-1 border-transparent rounded-full border-solid",style:et({borderColor:s.lId?"var(--wot-color-theme)":"transparent"}),src:s.avatar},null,8,["style","src"]))),128))]),_:1})):g("",!0)],64)):g("",!0),((_e=(me=t(l))==null?void 0:me.storePink)==null?void 0:_e.status)===2&&((ge=(ye=t(l))==null?void 0:ye.storePink)==null?void 0:ge.lId)===1&&((he=t(l))==null?void 0:he.status)!==9?(p(),m(r,{key:1,class:"mb-20rpx bg-white px-24rpx py-20rpx"},{default:e(()=>[t(l).orderAddressVO?(p(),M(q,{key:1},[t(l).deliveryId?(p(),m(r,{key:0,class:"mb-18rpx flex justify-between border-b-1 border-b-#e8e8e8 border-b-solid pb-18rpx text-24rpx"},{default:e(()=>[a(r,null,{default:e(()=>[i(o(n.$t("orderDetail.deliveryPartner")),1)]),_:1}),a(r,{class:"flex items-center gap-8rpx",onClick:Ee},{default:e(()=>[a(u,null,{default:e(()=>[i(o(t(l).deliveryName)+": "+o(t(l).deliveryId||"-"),1)]),_:1}),a(R,{name:"file-copy",size:"28rpx"})]),_:1})]),_:1})):g("",!0),a(r,{class:"mb-20rpx text-24rpx"},{default:e(()=>[a(u,{class:"mr-20rpx"},{default:e(()=>{var s,d;return[i(o((d=(s=t(l))==null?void 0:s.orderAddressVO)==null?void 0:d.realName),1)]}),_:1}),a(u,null,{default:e(()=>{var s,d;return[i(o((d=(s=t(l))==null?void 0:s.orderAddressVO)==null?void 0:d.phone),1)]}),_:1})]),_:1}),a(r,{class:"text-22rpx text-#3A444C"},{default:e(()=>{var s,d,x,z,C,we,ve,be,De,ke;return[i(o((d=(s=t(l))==null?void 0:s.orderAddressVO)==null?void 0:d.province)+" "+o((z=(x=t(l))==null?void 0:x.orderAddressVO)==null?void 0:z.city)+" "+o((we=(C=t(l))==null?void 0:C.orderAddressVO)==null?void 0:we.district)+" "+o((be=(ve=t(l))==null?void 0:ve.orderAddressVO)==null?void 0:be.detail)+" "+o((ke=(De=t(l))==null?void 0:De.orderAddressVO)==null?void 0:ke.postCode),1)]}),_:1})],64)):(p(),m(r,{key:0,class:"flex items-center justify-between",onClick:Ne},{default:e(()=>[a(r,{class:"text-28rpx text-[var(--wot-color-theme)]"},{default:e(()=>[i(o(t(c)("orderDetail.address.add")),1)]),_:1}),a(R,{name:"arrow-right",color:"#7D7D7D",size:"28rpx"})]),_:1}))]),_:1})):g("",!0),a(G,{type:"rectangle","custom-class":"px-24rpx! py-6rpx!","custom-content-class":"py-18rpx!","custom-title-class":"py-18rpx!",onClick:f[0]||(f[0]=s=>{var d,x;return t(X)({url:"/pages/productDetail/productDetail",params:{productId:(x=(d=t(l))==null?void 0:d.orderInfoVO)==null?void 0:x[0].productId}})})},{title:e(()=>[a(r,{class:"flex items-center justify-between"},{default:e(()=>{var s;return[a(r,{class:"text-28rpx text-#000"},{default:e(()=>{var d,x;return[i(o(t(c)("orderDetail.address.orderNo"))+":"+o((x=(d=t(l))==null?void 0:d.orderInfoVO)==null?void 0:x[0].orderNo),1)]}),_:1}),a(ze,{size:"26rpx",type:"primary",text:(s=t(P).find(d=>{var x;return d.code===((x=t(l))==null?void 0:x.status)}))==null?void 0:s.name},null,8,["text"])]}),_:1})]),default:e(()=>[a(r,{class:"flex items-center gap-24rpx"},{default:e(()=>[a(r,{class:"h-140rpx w-140rpx shrink-0"},{default:e(()=>{var s,d,x;return[a(L,{src:(x=(d=(s=t(l))==null?void 0:s.orderInfoVO)==null?void 0:d[0])==null?void 0:x.image,class:"h-full w-full",mode:"aspectFit"},null,8,["src"])]}),_:1}),a(r,{class:"flex-1"},{default:e(()=>[a(r,{class:"line-clamp-2 h-80rpx break-all text-28rpx text-#000"},{default:e(()=>{var s,d;return[i(o((d=(s=t(l))==null?void 0:s.orderInfoVO)==null?void 0:d[0].productName),1)]}),_:1}),a(r,{class:"py-4rpx text-24rpx text-#3A444C"},{default:e(()=>{var s,d;return[i(o(t(c)("orderDetail.address.color"))+":"+o((d=(s=t(l))==null?void 0:s.orderInfoVO)==null?void 0:d[0].sku),1)]}),_:1}),a(r,{class:"flex items-center justify-between text-24rpx"},{default:e(()=>[a(r,{class:"text-[var(--wot-color-theme)]"},{default:e(()=>{var s,d;return[i(" ৳ "+o(t(I)((d=(s=t(l))==null?void 0:s.orderInfoVO)==null?void 0:d[0].price)),1)]}),_:1}),a(r,{class:"text-#3A444C"},{default:e(()=>{var s,d;return[i(o(t(c)("orderDetail.address.quantity"))+":"+o((d=(s=t(l))==null?void 0:s.orderInfoVO)==null?void 0:d[0].payNum),1)]}),_:1})]),_:1})]),_:1})]),_:1})]),_:1}),a(r,{class:"bg-white px-24rpx"},{default:e(()=>{var s,d,x;return[a(r,{class:"border-b-1 border-b-#e8e8e8 border-b-solid py-24rpx"},{default:e(()=>[a(r,{class:"mb-12rpx text-28rpx"},{default:e(()=>[i(o(t(c)("orderDetail.summary.title")),1)]),_:1}),a(r,{class:"flex flex-col gap-16rpx text-#3A444C"},{default:e(()=>[a(r,{class:"flex items-center justify-between text-24rpx"},{default:e(()=>[a(u,null,{default:e(()=>[i(o(n.$t("orderDetail.subTotal")),1)]),_:1}),a(u,null,{default:e(()=>[i("৳"+o(t(I)(t(l).totalPrice)),1)]),_:1})]),_:1})]),_:1})]),_:1}),((s=t(l))==null?void 0:s.status)!==1?(p(),m(r,{key:0,class:"border-b-1 border-b-#e8e8e8 border-b-solid py-24rpx"},{default:e(()=>[a(r,{class:"mb-12rpx text-28rpx"},{default:e(()=>[i(o(t(c)("orderDetail.payment.title")),1)]),_:1}),a(r,{class:"flex flex-col gap-16rpx text-#3A444C"},{default:e(()=>[a(r,{class:"flex items-center justify-between text-24rpx"},{default:e(()=>[a(u,null,{default:e(()=>[i(o(t(l).payType),1)]),_:1}),a(u,null,{default:e(()=>[i("৳"+o(t(I)(t(l).payPrice)),1)]),_:1})]),_:1})]),_:1})]),_:1})):g("",!0),(x=(d=t(l))==null?void 0:d.orderStatusVO)!=null&&x.length?(p(),m(r,{key:1,class:"py-24rpx"},{default:e(()=>{var z;return[(p(!0),M(q,null,Ce((z=t(l))==null?void 0:z.orderStatusVO,C=>(p(),M(q,{key:C.id},[ae[C.changeType]?(p(),m(r,{key:0,class:"mb-16rpx flex flex-col text-#3A444C"},{default:e(()=>[a(r,{class:"flex items-center justify-between text-24rpx"},{default:e(()=>[a(u,null,{default:e(()=>[i(o(ae[C.changeType]),1)]),_:2},1024),a(u,null,{default:e(()=>[i(o(C.createTime),1)]),_:2},1024)]),_:2},1024)]),_:2},1024)):g("",!0)],64))),128))]}),_:1})):g("",!0)]}),_:1})]}),_:1})),a(mt,tt(t($),{onConfirm:Be,onCancel:Y,onClose:Y}),{default:e(()=>[t(k)==="pay"?(p(),m(r,{key:0},{default:e(()=>[a(r,{class:"font-blod relative text-32rpx"},{default:e(()=>[a(u,null,{default:e(()=>[i(o(n.$t("orderDetail.paymentMethod")),1)]),_:1}),a(R,{name:"close-normal","custom-class":"absolute right-0 top-1/2 -translate-y-1/2",size:"40rpx",onClick:Y})]),_:1}),a(r,{class:"py-60rpx"},{default:e(()=>[a(u,{class:"text-40rpx"},{default:e(()=>[i(" ৳ ")]),_:1}),a(u,{class:"text-60rpx"},{default:e(()=>[i(o(t(I)(t(l).payPrice)),1)]),_:1})]),_:1}),a(r,{class:"pb-28rpx text-left"},{default:e(()=>[a(r,{class:"text-24rpx font-bold"},{default:e(()=>[i(o(n.$t("orderDetail.paymentMethod")),1)]),_:1}),a(r,{class:"my-14rpx border-b-1px border-b-#EBEBEB border-b-solid"}),a(r,{class:"flex items-center justify-between text-24rpx"},{default:e(()=>[a(r,{class:"flex items-center"},{default:e(()=>[a(r,{class:"text-24rpx"},{default:e(()=>[a(u,null,{default:e(()=>[i(o(n.$t("orderDetail.bandhuBuyWallet"))+" (",1)]),_:1}),a(u,{class:"text-[var(--wot-color-theme)]"},{default:e(()=>[i(o(n.$t("orderDetail.walletBalanceText"))+": ৳"+o(t(I)(t(J))),1)]),_:1}),a(u,null,{default:e(()=>[i(")")]),_:1})]),_:1})]),_:1}),a(r,null,{default:e(()=>[a(L,{src:it,class:"h-36rpx w-36rpx"})]),_:1})]),_:1})]),_:1})]),_:1})):g("",!0)]),_:1},16)]),_:1},512)]),_:1})}}}),Ot=rt(_t,[["__scopeId","data-v-accd2b7e"]]);export{Ot as default};