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 i,aj as c,m as u,k as f,x as m,i as p,u as _,v as y,B as g,l as I,r as b,F as x,H as k,P as v,a7 as h,y as w,j as $,I as T,J as C,n as P,G as N}from"./index-ba48620e.js";import{_ as S}from"./s-goods-item.32271aab.js";import{a as j,_ as M}from"./s-layout.04b95866.js";import{e as O,g as A,i as G,p as J,f as B}from"./useGoods.edb8879f.js";import{_ as F}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";/* empty css */import"./phone-international-input.dd3ca29e.js";const H=F({__name:"detail",setup(F){k((e=>({"6a439f8d":m(z)}))),e.$store("user").userInfo;const H=2*e.$platform.device.statusBarHeight,z=e.$url.css("/static/images/order_bg.png"),D=s({orderInfo:{},merchantTradeNo:"",comeinType:""}),E=()=>{e.$helper.copyText(D.orderInfo.no)};async function L(s){let t;t="wechat"===D.comeinType?await c.getOrder(s,{merchant_trade_no:D.merchantTradeNo}):await c.getOrder(s),0===t.code?(D.orderInfo=t.data,O(D.orderInfo)):e.$router.back()}const Q=t((()=>e.$store("user").isLogin));return a((()=>Q.value),(e=>{e&&window.location.reload()}),{deep:!0}),r((async s=>{Q.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),D.comeinType=s.comein_type,"wechat"===D.comeinType&&(D.merchantTradeNo=s.merchant_trade_no),await L(t)})),(s,t)=>{const a=w,r=$,o=T,l=C,k=u(P("s-goods-item"),S),O=u(P("su-fixed"),j),F=u(P("s-layout"),M);return n(),d(F,{title:"订单详情",class:"index-wrap",navbar:"inner"},{default:i((()=>{var s;return[f(r,{class:"state-box ss-flex-col ss-col-center ss-row-right",style:g([{marginTop:"-"+Number(H+88)+"rpx",paddingTop:Number(H+88)+"rpx"}])},{default:i((()=>[f(r,{class:"ss-flex ss-m-t-32 ss-m-b-20"},{default:i((()=>["unpaid"==D.orderInfo.status_code||10===D.orderInfo.status||"nocomment"==D.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"==D.orderInfo.status_code||"refund_agree"==D.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"==D.orderInfo.status_code||"closed"==D.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"==D.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:i((()=>[_(y(m(A)(D.orderInfo)),1)])),_:1})])),_:1}),f(r,{class:"ss-font-26 ss-m-x-20 ss-m-b-70"},{default:i((()=>[_(y(m(G)(D.orderInfo)),1)])),_:1})])),_:1},8,["style"]),D.orderInfo.receiverAreaId>0?(n(),d(r,{key:0,class:"order-address-box"},{default:i((()=>[f(r,{class:"ss-flex ss-col-center"},{default:i((()=>[f(o,{class:"address-username"},{default:i((()=>[_(y(D.orderInfo.receiverName),1)])),_:1}),f(o,{class:"address-phone"},{default:i((()=>[_(y(D.orderInfo.receiverMobile),1)])),_:1})])),_:1}),f(r,{class:"address-detail"},{default:i((()=>[_(y(D.orderInfo.receiverAreaName)+" "+y(D.orderInfo.receiverDetailAddress),1)])),_:1})])),_:1})):p("",!0),f(r,{class:"detail-goods",style:g([{marginTop:D.orderInfo.receiverAreaId>0?"0":"-40rpx"}])},{default:i((()=>[(n(!0),I(x,null,b(D.orderInfo.items,(s=>(n(),d(r,{class:"order-list",key:s.goods_id},{default:i((()=>[f(r,{class:"order-card"},{default:i((()=>[f(k,{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:i((()=>[f(r,{class:"ss-flex"},{default:i((()=>[[10,20,30].includes(D.orderInfo.status)&&0===s.afterSaleStatus?(n(),d(l,{key:0,class:"ss-reset-button apply-btn",onClick:N((t=>m(e).$router.go("/pages/order/aftersale/apply",{orderId:D.orderInfo.id,itemId:s.id})),["stop"])},{default:i((()=>[_(" 申请售后 ")])),_:2},1032,["onClick"])):p("",!0),10===s.afterSaleStatus?(n(),d(l,{key:1,class:"ss-reset-button apply-btn",onClick:N((t=>m(e).$router.go("/pages/order/aftersale/detail",{id:s.afterSaleId})),["stop"])},{default:i((()=>[_(" 退款中 ")])),_:2},1032,["onClick"])):p("",!0),20===s.afterSaleStatus?(n(),d(l,{key:2,class:"ss-reset-button apply-btn",onClick:N((t=>m(e).$router.go("/pages/order/aftersale/detail",{id:s.afterSaleId})),["stop"])},{default:i((()=>[_(" 退款成功 ")])),_:2},1032,["onClick"])):p("",!0)])),_:2},1024)])),priceSuffix:i((()=>[s.status_text?(n(),d(l,{key:0,class:"ss-reset-button tag-btn"},{default:i((()=>[_(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:i((()=>[f(r,{class:"notice-box__content"},{default:i((()=>[f(r,{class:"notice-item--center"},{default:i((()=>[f(r,{class:"ss-flex ss-flex-1"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_("订单编号:")])),_:1}),f(o,{class:"detail"},{default:i((()=>[_(y(D.orderInfo.no),1)])),_:1})])),_:1}),f(l,{class:"ss-reset-button copy-btn",onClick:E},{default:i((()=>[_("复制")])),_:1})])),_:1}),f(r,{class:"notice-item"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_("使用积分:")])),_:1}),f(o,{class:"detail"},{default:i((()=>[_(y(m(J)(D.orderInfo.payIntegral)),1)])),_:1})])),_:1}),f(r,{class:"notice-item"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_("用户留言:")])),_:1}),f(o,{class:"detail"},{default:i((()=>[_(y(D.orderInfo.userRemark||"无"),1)])),_:1})])),_:1}),f(r,{class:"notice-item"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_("下单时间:")])),_:1}),f(o,{class:"detail"},{default:i((()=>[_(y(m(e).$helper.timeFormat(D.orderInfo.createTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:1})])),_:1}),D.orderInfo.payTime?(n(),d(r,{key:0,class:"notice-item"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_("支付时间:")])),_:1}),f(o,{class:"detail"},{default:i((()=>[_(y(m(e).$helper.timeFormat(D.orderInfo.payTime,"yyyy-mm-dd hh:MM:ss")),1)])),_:1})])),_:1})):p("",!0),f(r,{class:"notice-item"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_("支付方式:")])),_:1}),f(o,{class:"detail"},{default:i((()=>[_(y(D.orderInfo.payChannelName||"-"),1)])),_:1})])),_:1})])),_:1})])),_:1}),f(r,{class:"order-price-box"},{default:i((()=>[f(r,{class:"notice-item ss-flex ss-row-between"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_("商品总额")])),_:1}),f(r,{class:"ss-flex"},{default:i((()=>[f(o,{class:"detail"},{default:i((()=>[_("¥"+y(m(B)(D.orderInfo.totalPrice)),1)])),_:1})])),_:1})])),_:1}),f(r,{class:"notice-item ss-flex ss-row-between"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_("运费")])),_:1}),f(o,{class:"detail"},{default:i((()=>[_("¥"+y(m(B)(D.orderInfo.deliveryPrice)),1)])),_:1})])),_:1}),D.orderInfo.discountPrice>0?(n(),d(r,{key:0,class:"notice-item ss-flex ss-row-between"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_("优惠金额")])),_:1}),f(o,{class:"detail"},{default:i((()=>[_("¥"+y(m(B)(D.orderInfo.discountPrice)),1)])),_:1})])),_:1})):p("",!0),f(r,{class:"notice-item all-rpice-item ss-flex ss-m-t-20"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_(y(D.orderInfo.payStatus?"已付款":"需付款"),1)])),_:1}),f(o,{class:"detail all-price"},{default:i((()=>[_("¥"+y(m(B)(D.orderInfo.payPrice)),1)])),_:1})])),_:1}),D.orderInfo.refundPrice>0?(n(),d(r,{key:1,class:"notice-item all-rpice-item ss-flex ss-m-t-20"},{default:i((()=>[f(o,{class:"title"},{default:i((()=>[_("已退款")])),_:1}),f(o,{class:"detail all-price"},{default:i((()=>[_("¥"+y(m(B)(D.orderInfo.refundPrice)),1)])),_:1})])),_:1})):p("",!0)])),_:1}),(null==(s=D.orderInfo.buttons)?void 0:s.length)?(n(),d(O,{key:1,bottom:"",placeholder:"",bg:"bg-white"},{default:i((()=>[f(r,{class:"footer-box ss-flex ss-col-center ss-row-right"},{default:i((()=>{var s,a,r,o,u,f;return[(null==(s=D.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 c.cancelOrder(e);0===t&&await L(e)}})}(D.orderInfo.id))},{default:i((()=>[_(" 取消订单 ")])),_:1})):p("",!0),(null==(a=D.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=D.orderInfo.id,void e.$router.go("/pages/pay/index",{id:t,openType:2});var t})},{default:i((()=>[_(" 继续支付 ")])),_:1})):p("",!0),(null==(r=D.orderInfo.buttons)?void 0:r.includes("combination"))?(n(),d(l,{key:2,class:"ss-reset-button cancel-btn",onClick:t[2]||(t[2]=s=>m(e).$router.go("/pages/activity/groupon/detail",{id:D.orderInfo.ext.groupon_id}))},{default:i((()=>[_(" 拼团详情 ")])),_:1})):p("",!0),(null==(o=D.orderInfo.buttons)?void 0:o.includes("express"))?(n(),d(l,{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})}(D.orderInfo.id))},{default:i((()=>[_(" 查看物流 ")])),_:1})):p("",!0),(null==(u=D.orderInfo.buttons)?void 0:u.includes("confirm"))?(n(),d(l,{key:4,class:"ss-reset-button cancel-btn",onClick:t[4]||(t[4]=s=>async function(s,t=!1){v({title:"提示",content:"确认收货?",success:async function(a){if(a.confirm){if("WechatMiniProgram"===e.$platform.name&&!h.isEmpty(D.orderInfo.wechat_extra_data)&&!t)return void mpConfirm(s);const{code:a}=await c.receiveOrder(s);0===a&&await L(s)}}})}(D.orderInfo.id))},{default:i((()=>[_(" 确认收货 ")])),_:1})):p("",!0),(null==(f=D.orderInfo.buttons)?void 0:f.includes("comment"))?(n(),d(l,{key:5,class:"ss-reset-button cancel-btn",onClick:t[5]||(t[5]=s=>{return t=D.orderInfo.id,void e.$router.go("/pages/goods/comment/add",{id:t});var t})},{default:i((()=>[_(" 评价 ")])),_:1})):p("",!0)]})),_:1})])),_:1})):p("",!0)]})),_:1})}}},[["__scopeId","data-v-a40bd96a"]]);export{H as default};
|