1 |
- import{s as e,z as s,c as t,Z as a,o as r,t as o,Q as l,f as n,g as d,w as c,aj as i,m as u,k as f,x as m,i as p,u as _,v as y,B as I,l as g,r as b,F as k,H as x,P as v,a6 as h,ak as w,y as $,j as C,I as T,J as P,n as S,G as j}from"./index-a116b7fa.js";import{_ as N}from"./s-goods-item.e5b69bb0.js";import{a as O,_ as M}from"./s-layout.4ae51839.js";import{g as A,i as B,j as G,f as J,p as F}from"./useGoods.6b315a78.js";import{_ as D}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";/* empty css */import"./phone-international-input.b9f6c8e6.js";const H=D({__name:"detail",setup(D){x((e=>({"563bf42c":m(z)}))),e.$store("user").userInfo;const H=2*e.$platform.device.statusBarHeight,z=e.$url.css("/static/images/order_bg.png"),E=s({orderInfo:{},merchantTradeNo:"",comeinType:""}),L=()=>{e.$helper.copyText(E.orderInfo.no)};async function Q(s){let t;t="wechat"===E.comeinType?await i.getOrder(s,{merchant_trade_no:E.merchantTradeNo}):await i.getOrder(s),0===t.code?(E.orderInfo=t.data,A(E.orderInfo)):e.$router.back()}const R=t((()=>e.$store("user").isLogin));return a((()=>R.value),(e=>{e&&window.location.reload()}),{deep:!0}),r((async s=>{R.value?s.username&&(console.log(JSON.parse(l("user-store")).userInfo.username),s.username!=JSON.parse(l("user-store")).userInfo.username&&e.$helper.toast("您当前登录的账号是"+JSON.parse(l("user-store")).userInfo.username+",请切换到"+s.username+"后再试",3e3)):(o(),e.$helper.toast("您尚未登录,请登录:"+s.username+"后再试",3e3));let t=0;s.id&&(t=s.id),E.comeinType=s.comein_type,"wechat"===E.comeinType&&(E.merchantTradeNo=s.merchant_trade_no),await Q(t)})),(s,t)=>{const a=$,r=C,o=T,l=P,x=u(S("s-goods-item"),N),A=u(S("su-fixed"),O),D=u(S("s-layout"),M);return n(),d(D,{title:"订单详情",class:"index-wrap",navbar:"inner"},{default:c((()=>{var s;return[f(r,{class:"state-box ss-flex-col ss-col-center ss-row-right",style:I([{marginTop:"-"+Number(H+88)+"rpx",paddingTop:Number(H+88)+"rpx"}])},{default:c((()=>[f(r,{class:"ss-flex ss-m-t-32 ss-m-b-20"},{default:c((()=>["unpaid"==E.orderInfo.status_code||10===E.orderInfo.status||"nocomment"==E.orderInfo.status_code?(n(),d(a,{key:0,class:"state-img",src:m(e).$url.static("/static/images/order_loading.png")},null,8,["src"])):p("",!0),"completed"==E.orderInfo.status_code||"refund_agree"==E.orderInfo.status_code?(n(),d(a,{key:1,class:"state-img",src:m(e).$url.static("/static/images/order_success.png")},null,8,["src"])):p("",!0),"cancel"==E.orderInfo.status_code||"closed"==E.orderInfo.status_code?(n(),d(a,{key:2,class:"state-img",src:m(e).$url.static("/static/images/order_close.png")},null,8,["src"])):p("",!0),"noget"==E.orderInfo.status_code?(n(),d(a,{key:3,class:"state-img",src:m(e).$url.static("/static/images/order_express.png")},null,8,["src"])):p("",!0),f(r,{class:"ss-font-30"},{default:c((()=>[_(y(m(B)(E.orderInfo)),1)])),_:1})])),_:1}),f(r,{class:"ss-font-26 ss-m-x-20 ss-m-b-70"},{default:c((()=>[_(y(m(G)(E.orderInfo)),1)])),_:1})])),_:1},8,["style"]),E.orderInfo.receiverAreaId>0?(n(),d(r,{key:0,class:"order-address-box"},{default:c((()=>[f(r,{class:"ss-flex ss-col-center"},{default:c((()=>[f(o,{class:"address-username"},{default:c((()=>[_(y(E.orderInfo.receiverName),1)])),_:1}),f(o,{class:"address-phone"},{default:c((()=>[_(y(E.orderInfo.receiverMobile),1)])),_:1})])),_:1}),f(r,{class:"address-detail"},{default:c((()=>[_(y(E.orderInfo.receiverAreaName)+" "+y(E.orderInfo.receiverDetailAddress),1)])),_:1})])),_:1})):p("",!0),f(r,{class:"detail-goods",style:I([{marginTop:E.orderInfo.receiverAreaId>0?"0":"-40rpx"}])},{default:c((()=>[(n(!0),g(k,null,b(E.orderInfo.items,(s=>(n(),d(r,{class:"order-list",key:s.goods_id},{default:c((()=>[f(r,{class:"order-card"},{default:c((()=>[f(x,{onClick:t=>{return a=s.spuId,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:2===s.spuPayType?s.highPrecisionPrice:s.price,num:s.count,virtualPirce:2===s.spuPayType},{tool:c((()=>[f(r,{class:"ss-flex"},{default:c((()=>[[30].includes(E.orderInfo.status)&&0===s.afterSaleStatus?(n(),d(l,{key:0,class:"ss-reset-button apply-btn",onClick:j((t=>m(e).$router.go("/pages/order/aftersale/apply",{orderId:E.orderInfo.id,itemId:s.id})),["stop"])},{default:c((()=>[_(" 申请售后 ")])),_:2},1032,["onClick"])):p("",!0),10===s.afterSaleStatus?(n(),d(l,{key:1,class:"ss-reset-button apply-btn",onClick:j((t=>m(e).$router.go("/pages/order/aftersale/detail",{id:s.afterSaleId})),["stop"])},{default:c((()=>[_(" 退款中 ")])),_:2},1032,["onClick"])):p("",!0),20===s.afterSaleStatus?(n(),d(l,{key:2,class:"ss-reset-button apply-btn",onClick:j((t=>m(e).$router.go("/pages/order/aftersale/detail",{id:s.afterSaleId})),["stop"])},{default:c((()=>[_(" 退款成功 ")])),_:2},1032,["onClick"])):p("",!0)])),_:2},1024)])),priceSuffix:c((()=>[s.status_text?(n(),d(l,{key:0,class:"ss-reset-button tag-btn"},{default:c((()=>[_(y(s.status_text),1)])),_:2},1024)):p("",!0)])),_:2},1032,["onClick","img","title","skuText","price","num","virtualPirce"])])),_:2},1024)])),_:2},1024)))),128))])),_:1},8,["style"]),f(r,{class:"notice-box"},{default:c((()=>[f(r,{class:"notice-box__content"},{default:c((()=>[f(r,{class:"notice-item--center"},{default:c((()=>[f(r,{class:"ss-flex ss-flex-1"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("订单编号:")])),_:1}),f(o,{class:"detail"},{default:c((()=>[_(y(E.orderInfo.no),1)])),_:1})])),_:1}),f(l,{class:"ss-reset-button copy-btn",onClick:L},{default:c((()=>[_("复制")])),_:1})])),_:1}),f(r,{class:"notice-item"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("用户留言:")])),_:1}),f(o,{class:"detail"},{default:c((()=>[_(y(E.orderInfo.userRemark||"无"),1)])),_:1})])),_:1}),f(r,{class:"notice-item"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("下单时间:")])),_:1}),f(o,{class:"detail"},{default:c((()=>[_(y(m(e).$helper.timeFormat(E.orderInfo.createTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:1})])),_:1}),E.orderInfo.payTime?(n(),d(r,{key:0,class:"notice-item"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("支付时间:")])),_:1}),f(o,{class:"detail"},{default:c((()=>[_(y(m(e).$helper.timeFormat(E.orderInfo.payTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:1})])),_:1})):p("",!0),f(r,{class:"notice-item"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("支付方式:")])),_:1}),f(o,{class:"detail"},{default:c((()=>[_(y(E.orderInfo.payChannelName||"-"),1)])),_:1})])),_:1})])),_:1})])),_:1}),f(r,{class:"order-price-box"},{default:c((()=>[f(r,{class:"notice-item ss-flex ss-row-between"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("商品总额")])),_:1}),f(r,{class:"ss-flex"},{default:c((()=>[f(o,{class:"detail"},{default:c((()=>[_("¥"+y(m(J)(E.orderInfo.totalPrice)),1)])),_:1})])),_:1})])),_:1}),f(r,{class:"notice-item ss-flex ss-row-between"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("运费")])),_:1}),f(o,{class:"detail"},{default:c((()=>[_("¥"+y(m(J)(E.orderInfo.deliveryPrice)),1)])),_:1})])),_:1}),E.orderInfo.payIntegral>0?(n(),d(r,{key:0,class:"notice-item ss-flex ss-row-between"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("使用佣金")])),_:1}),f(o,{class:"detail"},{default:c((()=>[_(y(m(F)(E.orderInfo.payIntegral)),1)])),_:1})])),_:1})):p("",!0),E.orderInfo.payConsumptionPoints>0?(n(),d(r,{key:1,class:"notice-item ss-flex ss-row-between"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("使用消费分")])),_:1}),f(o,{class:"detail"},{default:c((()=>[_(y(m(F)(E.orderInfo.payConsumptionPoints)),1)])),_:1})])),_:1})):p("",!0),E.orderInfo.discountPrice>0?(n(),d(r,{key:2,class:"notice-item ss-flex ss-row-between"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("优惠金额")])),_:1}),f(o,{class:"detail"},{default:c((()=>[_("¥"+y(m(J)(E.orderInfo.discountPrice)),1)])),_:1})])),_:1})):p("",!0),f(r,{class:"notice-item all-rpice-item ss-flex ss-m-t-20"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_(y(E.orderInfo.payStatus?"已付款":"需付款"),1)])),_:1}),f(o,{class:"detail all-price"},{default:c((()=>[_("¥"+y(m(J)(E.orderInfo.payPrice)),1)])),_:1})])),_:1}),E.orderInfo.refundPrice>0?(n(),d(r,{key:3,class:"notice-item all-rpice-item ss-flex ss-m-t-20"},{default:c((()=>[f(o,{class:"title"},{default:c((()=>[_("已退款")])),_:1}),f(o,{class:"detail all-price"},{default:c((()=>[_("¥"+y(m(J)(E.orderInfo.refundPrice)),1)])),_:1})])),_:1})):p("",!0)])),_:1}),(null==(s=E.orderInfo.buttons)?void 0:s.length)?(n(),d(A,{key:1,bottom:"",placeholder:"",bg:"bg-white"},{default:c((()=>[f(r,{class:"footer-box ss-flex ss-col-center ss-row-right"},{default:c((()=>{var s,a,r,o,u,f,y,I;return[(null==(s=E.orderInfo.buttons)?void 0:s.includes("cancel"))?(n(),d(l,{key:0,class:"ss-reset-button cancel-btn",onClick:t[0]||(t[0]=e=>async function(e){v({title:"提示",content:"确定要取消订单吗?",success:async function(s){if(!s.confirm)return;const{code:t}=await i.cancelOrder(e);0===t&&await Q(e)}})}(E.orderInfo.id))},{default:c((()=>[_(" 取消订单 ")])),_:1})):p("",!0),(null==(a=E.orderInfo.buttons)?void 0:a.includes("pay"))?(n(),d(l,{key:1,class:"ss-reset-button pay-btn ui-BG-Main-Gradient",onClick:t[1]||(t[1]=s=>{return t=E.orderInfo.payOrderId,void e.$router.go("/pages/pay/index",{id:t,openType:2,type:1});var t})},{default:c((()=>[_(" 继续支付 ")])),_:1})):p("",!0),(null==(r=E.orderInfo.buttons)?void 0:r.includes("express"))&&!(null==(o=E.orderInfo.items[0])?void 0:o.refundStatus)?(n(),d(l,{key:2,class:"ss-reset-button cancel-btn",onClick:t[2]||(t[2]=s=>async function(s){e.$router.go("/pages/order/express/log",{id:s})}(E.orderInfo.id))},{default:c((()=>[_(" 查看物流 ")])),_:1})):p("",!0),(null==(u=E.orderInfo.buttons)?void 0:u.includes("confirm"))?(n(),d(l,{key:3,class:"ss-reset-button cancel-btn",onClick:t[3]||(t[3]=s=>async function(s,t=!1){v({title:"提示",content:"确认收货?",success:async function(a){if(a.confirm){if("WechatMiniProgram"===e.$platform.name&&!h.isEmpty(E.orderInfo.wechat_extra_data)&&!t)return void mpConfirm(s);const{code:a}=await i.receiveOrder(s);0===a&&await Q(s)}}})}(E.orderInfo.id))},{default:c((()=>[_(" 确认收货 ")])),_:1})):p("",!0),(null==(f=E.orderInfo.buttons)?void 0:f.includes("comment"))?(n(),d(l,{key:4,class:"ss-reset-button cancel-btn",onClick:t[4]||(t[4]=s=>{return t=E.orderInfo.id,void e.$router.go("/pages/goods/comment/add",{id:t});var t})},{default:c((()=>[_(" 评价 ")])),_:1})):p("",!0),(null==(y=E.orderInfo.buttons)?void 0:y.includes("aftersaleCancel"))?(n(),d(l,{key:5,class:"ss-reset-button cancel-btn",onClick:t[5]||(t[5]=e=>{return s=E.orderInfo.items[0].afterSaleId,void v({title:"提示",content:"确定要取消此申请吗?",success:async function(e){if(!e.confirm)return;const{code:t}=await w.cancelAfterSale(s);0===t&&await Q(s)}});var s})},{default:c((()=>[_(" 取消申请 ")])),_:1})):p("",!0),(null==(I=E.orderInfo.buttons)?void 0:I.includes("aftersaleDelivery"))?(n(),d(l,{key:6,class:"ss-reset-button cancel-btn",onClick:t[6]||(t[6]=s=>m(e).$router.go("/pages/order/aftersale/return-delivery",{id:E.orderInfo.items[0].afterSaleId}))},{default:c((()=>[_(" 填写退货 ")])),_:1})):p("",!0)]})),_:1})])),_:1})):p("",!0)]})),_:1})}}},[["__scopeId","data-v-6dd55932"]]);export{H as default};
|