PageSourceSearch

https://snapbox.ai/assets/ShoppingOrderExchange-ekrcMmy9.js

js snapbox.ai collected 2026-10-05 12:40:29 UTC 8,610 bytes, 1 lines download raw bytes

1import{_ as B,m as V,B as _,H as q,o as C,p as D,c as r,b as e,h as j,F as v,t as c,w as y,bM as U,f as T,q as N,n as R,i as b,e as M,z as H,u as I,E as P,j as Y,g as d,I as z}from"./index-GRB8Jcml.js";import{T as X}from"./top-DaACZfYm.js";import{_ as O}from"./bootpay-Cq7F2cVP.js";import{S as F}from"./ShoppingService-C2Pshse4.js";import{U as A}from"./UserService-B39Vk0W_.js";import"./ContentsService-DKa2qyOq.js";const G=["id","variant_code","price","display","selling","use_inventory","display_soldout","stock","is_current","price_diff","has_stock"],J={name:"ShoppingOrderExchange",components:{TOP:X},setup(){const a=H(),s=I(),o=V({loaded:!1,order_item_id:a.params.order_item_id,order_item:{},options:[],delivery_fee_info:{customer_fault:0,seller_fault:0,waived:!1},seller_fault_reasons:[],selected_option_id:null,reason:"",note:"",my:{},is_submitting:!1}),i=n=>n?Object.entries(n).filter(([l])=>!G.includes(l)).map(([,l])=>l).join(" / "):"",h=_(()=>i(o.order_item.current_option)),g=_(()=>o.options.find(n=>n.id===o.selected_option_id)),m=_(()=>{var n;return((n=g.value)==null?void 0:n.price_diff)||0}),t=_(()=>o.seller_fault_reasons.includes(o.reason)),f=_(()=>t.value?o.delivery_fee_info.seller_fault:o.delivery_fee_info.customer_fault),k=_(()=>Math.max(m.value,0)+f.value),E=_(()=>Math.max(-m.value,0));q(t,n=>{var l;!n&&((l=g.value)!=null&&l.is_current)&&(o.selected_option_id=null)});const S=()=>{const n=a.query.from;if(n){s.push("/shopping-order-info/"+n);return}if(window.history.length>1){s.go(-1);return}s.push("/shopping-orders")},w=n=>{let l={order_item_id:o.order_item_id,new_option_id:o.selected_option_id,reason:o.reason,note:o.note,receipt_id:n};F.exchangeRequest(l).then(p=>{p.data.code==="S"?(alert("교환 신청이 접수되었습니다."),S()):(alert(p.data.msg),o.is_submitting=!1)}).catch(p=>{console.log(p),alert("교환 신청에 실패하였습니다."),o.is_submitting=!1})},K=()=>{if(!o.reason){alert("교환 사유를 선택해 주세요.");return}if(!o.selected_option_id){alert("교환할 옵션을 선택해 주세요.");return}if(o.is_submitting)return;const n=k.value,l=n>0?`추가 결제 금액 ${n.toLocaleString("ko-KR")}원을 결제하고 교환 신청하시겠습니까?`:"교환 신청하시겠습니까?";if(!confirm(l))return;if(o.is_submitting=!0,n<=0){w(null);return}let p=P().format("YYMMDDHHmm"),L=Math.floor(1e4+Math.random()*9e4),x="EX"+p+L;O.request({price:n,application_id:"62b12e8de38c3000215aeae2",name:"스냅박스 쇼핑 교환",pg:"nicepay",method:"",show_agree_window:0,items:[],user_info:{username:o.my.name,email:o.my.email,phone:o.my.phone},order_id:x,params:{order_item_id:o.order_item_id,new_option_id:o.selected_option_id},extra:{}}).error(function(u){console.log(u),o.is_submitting=!1}
1).cancel(function(u){console.log(u),o.is_submitting=!1}).confirm(function(u){O.transactionConfirm(u)}).close(function(u){console.log(u)}).done(function(u){w(u.receipt_id)})};return C(()=>{A.myinfo().then(n=>{n.status==200&&(o.my=n.data)}).catch(n=>{console.log(n)}),F.exchangeInfo(o.order_item_id).then(n=>{let l=n.data;l.code==="S"?(o.order_item=l.order_item,o.options=l.options,o.delivery_fee_info=l.delivery_fee,o.seller_fault_reasons=l.seller_fault_reasons,o.loaded=!0):(alert(l.msg),s.go(-1))}).catch(n=>{console.log(n),alert("교환 정보를 불러오지 못했습니다."),s.go(-1)})}),{...D(o),goBackToOrder:S,optionText:i,currentOptionText:h,priceDiff:m,deliveryFee:f,payTotal:k,refundTotal:E,isSellerFault:t,submit:K}}},Q={class:"header header_color",id:"main_header"},W={class:"exchange-page"},Z={class:"exchange-container"},$={class:"info-card"},ee={class:"product-name"},se={class:"current-option"},oe={class:"qty-badge"},te={class:"info-card"},ne={label:"판매자 귀책 (교환 배송비 무료)"},ie=["value"],ae={class:"info-card option-list"},le=["value","disabled"],re={class:"option-text"},de={class:"option-meta"},ce={key:0,class:"meta-badge current"},ue={key:1,class:"meta-badge current"},_e={key:2,class:"meta-badge soldout"},pe={key:3,class:"meta-badge diff-plus"},me={key:4,class:"meta-badge diff-minus"},fe={key:5,class:"meta-badge"},ve={class:"info-card payment-card"},ge={class:"payment-row"},ye={class:"pay-value"},be={class:"payment-row"},he={key:0,class:"fee-notice"},ke={class:"payment-row total-row"},Se={class:"pay-value total-amount"},we={key:1,class:"refund-notice"},Te={class:"submit-wrap"},Re=["disabled"];function Me(a,s,o,i,h,g){const m=Y("TOP");return d(),r(v,null,[e("div",Q,[j(m)]),e("section",W,[e("div",Z,[e("button",{type:"button",class:"cs-back-btn",onClick:s[0]||(s[0]=(...t)=>i.goBackToOrder&&i.goBackToOrder(...t))},s[5]||(s[5]=[e("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[e("polyline",{points:"15 18 9 12 15 6"})],-1),e("span",null,"주문내역으로",-1)])),s[19]||(s[19]=e("div",{class:"page-title"},[e("h1",null,"옵션 교환 신청")],-1)),a.loaded?(d(),r(v,{key:0},[s[15]||(s[15]=e("div",{class:"section-header"},[e("span",{class:"section-icon"},"📦"),e("h2",null,"교환 상품")],-1)),e("div",$,[e("div",ee,c(a.order_item.name),1),e("div",se,[s[6]||(s[6]=e("span",{class:"opt-label"},"현재 옵션",-1)),e("span",null,c(i.currentOptionText),1),e("span",oe,c(a.order_item.quantity)+"개",1)])]),s[16]||(s[16]=e("div",{class:"section-header"},[e("span",{class:"section-icon"},"📝"),e("h2",null,"교환 사유")],-1)),e("div",te,[y(e("select",{"onUpdate:modelValue":s[1]||(s[1]=t=>a.reason=t),class:"reason-select"},[s[7]||(s[7]=e("option",{value:"",disabled:""},"사유를 선택해 주세요",-1)),s[8]||(s[8]=e("optgroup",{label:"단순 변심 (교환 배송비 고객 부담)"},[e("option",{value:"단순변심"},"단순변심"),e("option",{value:"사이즈/옵션 변경"},"사이즈/옵션 변경")],-1)),e("optgroup",ne,[(d(!0),r(v,null,T(a.seller_fault_reasons,t=>(d(),r("option",{key:t,value:t},c(t),9,ie))),128))])],512),[[U,a.reason]]),y(e("textarea",{"onUpdate:modelValue":s[2]||(s[2]=t=>a.note=t),class:"note-input",placeholder:"상세 사유를 입력해 주세요. (선택)"},null,512),[[N,a.note]])]),s[17]||(s[17]=e("div",{class:"section-header"},[e("span",{class:"section-icon"},"🔁"),e("h2",null,"교환할 옵션 선택")],-1)),e("div",ae,[(d(!0),r(v,null,T(a.options,t=>(d(),r("label",{key:t.id,class:R(["option-row",{disabled:t.is_current&&!i.isSellerFault||!t.has_stock,selected:a.selected_option_id===t.id}])},[y(e("input",{type:"radio",name:"new_option",value:t.id,"onUpdate:modelValue":s[3]||(s[3]=f=>a.selected_option_id=f),disabled:t.is_current&&!i.isSellerFault||!t.has_stock},null,8,le),[[z,a.selected_option_id]]),e("span",re,c(i.optionText(t)),1),e("span",de,[t.is_current&&i.isSellerFault?(d(),r("span",ce,"동일 옵션 재발송")):t.is_current?(d(),r("span",ue,"현재 옵션")):t.has_stock?t.price_diff>
10?(d(),r("span",pe," +"+c(t.price_diff.toLocaleString("ko-KR"))+"원 ",1)):t.price_diff<0?(d(),r("span",me,c(t.price_diff.toLocaleString("ko-KR"))+"원 ",1)):(d(),r("span",fe,"차액 없음")):(d(),r("span",_e,"품절"))])],2))),128))]),s[18]||(s[18]=e("div",{class:"section-header"},[e("span",{class:"section-icon"},"💳"),e("h2",null,"결제 정보")],-1)),e("div",ve,[e("div",ge,[s[9]||(s[9]=e("span",{class:"pay-label"},"옵션 차액",-1)),e("span",ye,c(i.priceDiff.toLocaleString("ko-KR"))+"원",1)]),e("div",be,[s[10]||(s[10]=e("span",{class:"pay-label"},"교환 배송비 (왕복)",-1)),e("span",{class:R(["pay-value",{free:i.deliveryFee===0}])},c(i.deliveryFee?i.deliveryFee.toLocaleString("ko-KR")+"원":"무료"),3)]),a.delivery_fee_info.waived&&!i.isSellerFault?(d(),r("div",he," 같은 주문의 다른 상품에 교환 배송비가 이미 포함되어 있어 추가 배송비가 발생하지 않습니다. ")):b("",!0),s[14]||(s[14]=e("div",{class:"payment-divider"},null,-1)),e("div",ke,[s[11]||(s[11]=e("span",{class:"pay-label"},"추가 결제 금액",-1)),e("span",Se,c(i.payTotal.toLocaleString("ko-KR"))+"원",1)]),i.refundTotal>0?(d(),r("div",we,[s[12]||(s[12]=M(" 더 저렴한 옵션으로의 교환입니다. 브랜드 승인 시 차액 ")),e("b",null,c(i.refundTotal.toLocaleString("ko-KR"))+"원",1),s[13]||(s[13]=M("이 환불됩니다. "))])):b("",!0)]),e("div",Te,[e("button",{type:"button",class:"submit-btn",disabled:a.is_submitting,onClick:s[4]||(s[4]=(...t)=>i.submit&&i.submit(...t))},c(i.payTotal>0?i.payTotal.toLocaleString("ko-KR")+"원 결제하고 교환 신청":"교환 신청"),9,Re)])],64)):b("",!0)])])],64)}const Be=B(J,[["render",Me],["__scopeId","data-v-93f85820"]]);export{Be as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.