1 |
- import{s as e,v as s,o as t,e as a,f as r,w as o,aj as l,l as d,j as n,u as c,g as i,p as u,t as f,y as _,k as m,r as p,F as y,B as g,M as I,a8 as b,q as x,i as k,C as v,D as h,m as w,A as $}from"./index-9880b451.js";import{_ as C}from"./s-goods-item.f5d79fd7.js";import{a as T,_ as j}from"./s-layout.dfc5b0b5.js";import{h as N,g as S,i as M,f as P}from"./useGoods.bdd1c2ea.js";import{_ as A}from"./_plugin-vue_export-helper.1b428a4d.js";/* empty css */import"./index.df38848e.js";const O=A({__name:"detail",setup(A){g((e=>({"6ffd7ff3":c(B)})));const O=2*e.$platform.device.statusBarHeight,B=e.$url.css("/static/img/shop/order/order_bg.png"),F=s({orderInfo:{},merchantTradeNo:"",comeinType:""}),G=()=>{e.$helper.copyText(F.orderInfo.sn)};async function D(s){let t;t="wechat"===F.comeinType?await l.getOrder(s,{merchant_trade_no:F.merchantTradeNo}):await l.getOrder(s),0===t.code?(F.orderInfo=t.data,N(F.orderInfo)):e.$router.back()}return t((async e=>{let s=0;e.id&&(s=e.id),F.comeinType=e.comein_type,"wechat"===F.comeinType&&(F.merchantTradeNo=e.merchant_trade_no),await D(s)})),(s,t)=>{const g=x,N=k,A=v,B=h,q=d(w("s-goods-item"),C),E=d(w("su-fixed"),T),H=d(w("s-layout"),j);return a(),r(H,{title:"订单详情",class:"index-wrap",navbar:"inner"},{default:o((()=>{var s;return[n(N,{class:"state-box ss-flex-col ss-col-center ss-row-right",style:_([{marginTop:"-"+Number(O+88)+"rpx",paddingTop:Number(O+88)+"rpx"}])},{default:o((()=>[n(N,{class:"ss-flex ss-m-t-32 ss-m-b-20"},{default:o((()=>["unpaid"==F.orderInfo.status_code||10===F.orderInfo.status||"nocomment"==F.orderInfo.status_code?(a(),r(g,{key:0,class:"state-img",src:c(e).$url.static("/static/img/shop/order/order_loading.png")},null,8,["src"])):i("",!0),"completed"==F.orderInfo.status_code||"refund_agree"==F.orderInfo.status_code?(a(),r(g,{key:1,class:"state-img",src:c(e).$url.static("/static/img/shop/order/order_success.png")},null,8,["src"])):i("",!0),"cancel"==F.orderInfo.status_code||"closed"==F.orderInfo.status_code?(a(),r(g,{key:2,class:"state-img",src:c(e).$url.static("/static/img/shop/order/order_close.png")},null,8,["src"])):i("",!0),"noget"==F.orderInfo.status_code?(a(),r(g,{key:3,class:"state-img",src:c(e).$url.static("/static/img/shop/order/order_express.png")},null,8,["src"])):i("",!0),n(N,{class:"ss-font-30"},{default:o((()=>[u(f(c(S)(F.orderInfo)),1)])),_:1})])),_:1}),n(N,{class:"ss-font-26 ss-m-x-20 ss-m-b-70"},{default:o((()=>[u(f(c(M)(F.orderInfo)),1)])),_:1})])),_:1},8,["style"]),F.orderInfo.receiverAreaId>0?(a(),r(N,{key:0,class:"order-address-box"},{default:o((()=>[n(N,{class:"ss-flex ss-col-center"},{default:o((()=>[n(A,{class:"address-username"},{default:o((()=>[u(f(F.orderInfo.receiverName),1)])),_:1}),n(A,{class:"address-phone"},{default:o((()=>[u(f(F.orderInfo.receiverMobile),1)])),_:1})])),_:1}),n(N,{class:"address-detail"},{default:o((()=>[u(f(F.orderInfo.receiverAreaName)+" "+f(F.orderInfo.receiverDetailAddress),1)])),_:1})])),_:1})):i("",!0),n(N,{class:"detail-goods",style:_([{marginTop:F.orderInfo.receiverAreaId>0?"0":"-40rpx"}])},{default:o((()=>[(a(!0),m(y,null,p(F.orderInfo.items,(s=>(a(),r(N,{class:"order-list",key:s.goods_id},{default:o((()=>[n(N,{class:"order-card"},{default:o((()=>[n(q,{onClick:t=>{return a=s.skuId,void e.$router.go("/pages/goods/index",{id:a});var a},img:s.picUrl,title:s.spuName,skuText:s.properties.map((e=>e.valueName)).join(" "),price:s.price,num:s.count},{tool:o((()=>[n(N,{class:"ss-flex"},{default:o((()=>[[10,20,30].includes(F.orderInfo.status)&&0===s.afterSaleStatus?(a(),r(B,{key:0,class:"ss-reset-button apply-btn",onClick:$((t=>c(e).$router.go("/pages/order/aftersale/apply",{orderId:F.orderInfo.id,itemId:s.id})),["stop"])},{default:o((()=>[u(" 申请售后 ")])),_:2},1032,["onClick"])):i("",!0),10===s.afterSaleStatus?(a(),r(B,{key:1,class:"ss-reset-button apply-btn",onClick:$((t=>c(e).$router.go("/pages/order/aftersale/detail",{id:s.afterSaleId})),["stop"])},{default:o((()=>[u(" 退款中 ")])),_:2},1032,["onClick"])):i("",!0),20===s.afterSaleStatus?(a(),r(B,{key:2,class:"ss-reset-button apply-btn",onClick:$((t=>c(e).$router.go("/pages/order/aftersale/detail",{id:s.afterSaleId})),["stop"])},{default:o((()=>[u(" 退款成功 ")])),_:2},1032,["onClick"])):i("",!0)])),_:2},1024)])),priceSuffix:o((()=>[s.status_text?(a(),r(B,{key:0,class:"ss-reset-button tag-btn"},{default:o((()=>[u(f(s.status_text),1)])),_:2},1024)):i("",!0)])),_:2},1032,["onClick","img","title","skuText","price","num"])])),_:2},1024)])),_:2},1024)))),128))])),_:1},8,["style"]),n(N,{class:"notice-box"},{default:o((()=>[n(N,{class:"notice-box__content"},{default:o((()=>[n(N,{class:"notice-item--center"},{default:o((()=>[n(N,{class:"ss-flex ss-flex-1"},{default:o((()=>[n(A,{class:"title"},{default:o((()=>[u("订单编号:")])),_:1}),n(A,{class:"detail"},{default:o((()=>[u(f(F.orderInfo.no),1)])),_:1})])),_:1}),n(B,{class:"ss-reset-button copy-btn",onClick:G},{default:o((()=>[u("复制")])),_:1})])),_:1}),n(N,{class:"notice-item"},{default:o((()=>[n(A,{class:"title"},{default:o((()=>[u("下单时间:")])),_:1}),n(A,{class:"detail"},{default:o((()=>[u(f(c(e).$helper.timeFormat(F.orderInfo.createTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:1})])),_:1}),F.orderInfo.payTime?(a(),r(N,{key:0,class:"notice-item"},{default:o((()=>[n(A,{class:"title"},{default:o((()=>[u("支付时间:")])),_:1}),n(A,{class:"detail"},{default:o((()=>[u(f(c(e).$helper.timeFormat(F.orderInfo.payTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:1})])),_:1})):i("",!0),n(N,{class:"notice-item"},{default:o((()=>[n(A,{class:"title"},{default:o((()=>[u("支付方式:")])),_:1}),n(A,{class:"detail"},{default:o((()=>[u(f(F.orderInfo.payChannelName||"-"),1)])),_:1})])),_:1})])),_:1})])),_:1}),n(N,{class:"order-price-box"},{default:o((()=>[n(N,{class:"notice-item ss-flex ss-row-between"},{default:o((()=>[n(A,{class:"title"},{default:o((()=>[u("商品总额")])),_:1}),n(N,{class:"ss-flex"},{default:o((()=>[n(A,{class:"detail"},{default:o((()=>[u("¥"+f(c(P)(F.orderInfo.totalPrice)),1)])),_:1})])),_:1})])),_:1}),n(N,{class:"notice-item ss-flex ss-row-between"},{default:o((()=>[n(A,{class:"title"},{default:o((()=>[u("运费")])),_:1}),n(A,{class:"detail"},{default:o((()=>[u("¥"+f(c(P)(F.orderInfo.deliveryPrice)),1)])),_:1})])),_:1}),F.orderInfo.discountPrice>0?(a(),r(N,{key:0,class:"notice-item ss-flex ss-row-between"},{default:o((()=>[n(A,{class:"title"},{default:o((()=>[u("优惠金额")])),_:1}),n(A,{class:"detail"},{default:o((()=>[u("¥"+f(c(P)(F.orderInfo.discountPrice)),1)])),_:1})])),_:1})):i("",!0),n(N,{class:"notice-item all-rpice-item ss-flex ss-m-t-20"},{default:o((()=>[n(A,{class:"title"},{default:o((()=>[u(f(F.orderInfo.payStatus?"已付款":"需付款"),1)])),_:1}),n(A,{class:"detail all-price"},{default:o((()=>[u("¥"+f(c(P)(F.orderInfo.payPrice)),1)])),_:1})])),_:1}),F.orderInfo.refundPrice>0?(a(),r(N,{key:1,class:"notice-item all-rpice-item ss-flex ss-m-t-20"},{default:o((()=>[n(A,{class:"title"},{default:o((()=>[u("已退款")])),_:1}),n(A,{class:"detail all-price"},{default:o((()=>[u("¥"+f(c(P)(F.orderInfo.refundPrice)),1)])),_:1})])),_:1})):i("",!0)])),_:1}),(null==(s=F.orderInfo.buttons)?void 0:s.length)?(a(),r(E,{key:1,bottom:"",placeholder:"",bg:"bg-white"},{default:o((()=>[n(N,{class:"footer-box ss-flex ss-col-center ss-row-right"},{default:o((()=>{var s,d,n,f,_,m;return[(null==(s=F.orderInfo.buttons)?void 0:s.includes("cancel"))?(a(),r(B,{key:0,class:"ss-reset-button cancel-btn",onClick:t[0]||(t[0]=e=>async function(e){I({title:"提示",content:"确定要取消订单吗?",success:async function(s){if(!s.confirm)return;const{code:t}=await l.cancelOrder(e);0===t&&await D(e)}})}(F.orderInfo.id))},{default:o((()=>[u(" 取消订单 ")])),_:1})):i("",!0),(null==(d=F.orderInfo.buttons)?void 0:d.includes("pay"))?(a(),r(B,{key:1,class:"ss-reset-button pay-btn ui-BG-Main-Gradient",onClick:t[1]||(t[1]=s=>{return t=F.orderInfo.payOrderId,void e.$router.go("/pages/pay/index",{id:t});var t})},{default:o((()=>[u(" 继续支付 ")])),_:1})):i("",!0),(null==(n=F.orderInfo.buttons)?void 0:n.includes("combination"))?(a(),r(B,{key:2,class:"ss-reset-button cancel-btn",onClick:t[2]||(t[2]=s=>c(e).$router.go("/pages/activity/groupon/detail",{id:F.orderInfo.ext.groupon_id}))},{default:o((()=>[u(" 拼团详情 ")])),_:1})):i("",!0),(null==(f=F.orderInfo.buttons)?void 0:f.includes("express"))?(a(),r(B,{key:3,class:"ss-reset-button cancel-btn",onClick:t[3]||(t[3]=s=>async function(s){e.$router.go("/pages/order/express/log",{id:s})}(F.orderInfo.id))},{default:o((()=>[u(" 查看物流 ")])),_:1})):i("",!0),(null==(_=F.orderInfo.buttons)?void 0:_.includes("confirm"))?(a(),r(B,{key:4,class:"ss-reset-button cancel-btn",onClick:t[4]||(t[4]=s=>async function(s,t=!1){if("WechatMiniProgram"===e.$platform.name&&!b.isEmpty(F.orderInfo.wechat_extra_data)&&!t)return void mpConfirm(s);const{code:a}=await l.receiveOrder(s);0===a&&await D(s)}(F.orderInfo.id))},{default:o((()=>[u(" 确认收货 ")])),_:1})):i("",!0),(null==(m=F.orderInfo.buttons)?void 0:m.includes("comment"))?(a(),r(B,{key:5,class:"ss-reset-button cancel-btn",onClick:t[5]||(t[5]=s=>{return t=F.orderInfo.id,void e.$router.go("/pages/goods/comment/add",{id:t});var t})},{default:o((()=>[u(" 评价 ")])),_:1})):i("",!0)]})),_:1})])),_:1})):i("",!0)]})),_:1})}}},[["__scopeId","data-v-a55cb8a4"]]);export{O as default};
|