1 |
- import{r as e,v as s,t as a,o as t,s as l,al as o,ap as r,a as i,b as n,d,w as u,u as c,e as p,f,g as _,j as m,x as y,y as x,F as w,aq as g,am as h,i as b,ar as v,l as I,M as j,N as k,O as M}from"./index-DUAp9XEj.js";import{_ as V}from"./s-goods-item.BjLLzKA4.js";import{_ as R,b as C}from"./phone-international-input.D4fi9eUK.js";import{_ as G}from"./s-uploader.CP2G-Fx6.js";import{a as L,_ as U}from"./s-layout.a1_kfpIW.js";import{_ as P}from"./phone-international-input.vue_vue_type_style_index_0_scoped_a793e264_lang.Bv2EixP5.js";import{f as S}from"./useGoods.Cwnq-veC.js";import{_ as B}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./points.DDTOnulC.js";/* empty css */import"./s-menu-tools.Bn3wdRty.js";import"./s-layout.vue_vue_type_style_index_0_scoped_d5f7c468_lang.CKkHKX6k.js";import"./s-tabbar.fodLOlFD.js";const D=B({__name:"apply",setup(B){const D=e(null),N=s({orderId:0,itemId:0,order:{},item:{},config:{},wayList:[{text:a("order.refund_and_return"),value:"20"}],reasonList:[],showModal:!1,currentValue:""}),O=s({way:"",applyReason:"",applyDescription:"",applyPicUrls:[]}),T=s({});async function q(){if(""==O.way)return g({title:a("order.select_after_sales_type"),icon:"error",duration:1e3}),!1;if(""==N.currentValue)return g({title:a("order.reason_for_application"),icon:"error",duration:1e3}),!1;if(""==O.applyDescription)return g({title:a("order.please_fill_in_description"),icon:"error",duration:1e3}),!1;let e={orderItemId:N.itemId,refundPrice:N.item.payPrice,...O};const{code:s}=await h.createAfterSale(e);0===s&&(g({title:a("wallet.application_successful")}),l.$router.go("/pages/order/aftersale/list"))}function H(e){O.way=e.detail.value,N.reasonList="10"===O.way?N.config.afterSaleRefundReasons||[]:N.config.afterSaleReturnReasons||[],O.applyReason="",N.currentValue=""}function $(e){N.currentValue=e.detail.value}function A(){O.applyReason=N.currentValue,N.showModal=!1}return t((async e=>{if(!e.orderId||!e.itemId)return void l.$helper.toast("缺少订单信息,请检查");N.orderId=e.orderId,N.itemId=parseInt(e.itemId);const{code:s,data:a}=await o.getOrder(N.orderId);0===s&&(N.order=a,N.item=a.items.find((e=>e.id===N.itemId))||{},10===N.order.status&&N.wayList.splice(1,1),N.config=(await r.getTradeConfig()).data,O.way="20",O.type="20",N.reasonList=N.config.afterSaleReturnReasons||[])})),(e,s)=>{const t=i(n("s-goods-item"),V),l=b,o=k,r=M,g=v,h=I,B=i(n("uni-easyinput"),R),F=i(n("s-uploader"),G),J=i(n("uni-forms"),C),Z=j,z=i(n("su-fixed"),L),E=i(n("su-popup"),P),K=i(n("s-layout"),U);return p(),d(K,{title:c(a)("order.apply_for_after_sales")},{default:u((()=>[f(l,{class:"goods-box"},{default:u((()=>{var e;return[f(t,{img:N.item.picUrl,title:N.item.spuName,skuText:null==(e=N.item.properties)?void 0:e.map((e=>e.valueName)).join(" "),price:N.item.price,num:N.item.count},null,8,["img","title","skuText","price","num"])]})),_:1}),f(J,{ref_key:"form",ref:D,modelValue:O,"onUpdate:modelValue":s[4]||(s[4]=e=>O=e),rules:T,"label-position":"top"},{default:u((()=>[f(l,{class:"refund-item"},{default:u((()=>[f(l,{class:"item-title ss-m-b-20"},{default:u((()=>[_(m(c(a)("order.after_sales_type")),1)])),_:1}),f(l,{class:"ss-flex-col"},{default:u((()=>[f(g,{onChange:H},{default:u((()=>[(p(!0),y(w,null,x(N.wayList,((e,s)=>(p(),d(r,{class:"ss-flex ss-col-center ss-p-y-10",key:s},{default:u((()=>[f(o,{checked:O.type===e.value,color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},value:e.value},null,8,["checked","value"]),f(l,{class:"item-value ss-m-l-8"},{default:u((()=>[_(m(e.text),1)])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1}),f(l,{class:"refund-item ss-flex ss-col-center ss-row-between",onClick:s[0]||(s[0]=e=>N.showModal=!0)},{default:u((()=>[f(h,{class:"item-title"},{default:u((()=>[_(m(c(a)("order.refund_amount")),1)])),_:1}),f(l,{class:"ss-flex refund-cause ss-col-center"},{default:u((()=>[f(h,{class:"ss-m-r-20"},{default:u((()=>[_("¥"+m(c(S)(N.item.payPrice)),1)])),_:1})])),_:1})])),_:1}),f(l,{class:"refund-item ss-flex ss-col-center ss-row-between",onClick:s[1]||(s[1]=e=>N.showModal=!0)},{default:u((()=>[f(h,{class:"item-title"},{default:u((()=>[_(m(c(a)("order.application_reason")),1)])),_:1}),f(l,{class:"ss-flex refund-cause ss-col-center"},{default:u((()=>[O.applyReason?(p(),d(h,{key:0,class:"ss-m-r-20"},{default:u((()=>[_(m(O.applyReason),1)])),_:1})):(p(),d(h,{key:1,class:"ss-m-r-20"},{default:u((()=>[_(m(c(a)("order.select_reason_for_application")),1)])),_:1})),f(h,{class:"cicon-forward",style:{height:"28rpx"}})])),_:1})])),_:1}),f(l,{class:"refund-item"},{default:u((()=>[f(l,{class:"item-title ss-m-b-20"},{default:u((()=>[_(m(c(a)("order.related_description")),1)])),_:1}),f(l,{class:"describe-box"},{default:u((()=>[f(B,{inputBorder:!1,class:"describe-content",type:"textarea",maxlength:"120",autoHeight:"",modelValue:O.applyDescription,"onUpdate:modelValue":s[2]||(s[2]=e=>O.applyDescription=e),placeholder:c(a)("order.customer_prompt")},null,8,["modelValue","placeholder"]),f(l,{class:"upload-img"},{default:u((()=>[f(F,{url:O.applyPicUrls,"onUpdate:url":s[3]||(s[3]=e=>O.applyPicUrls=e),fileMediatype:"image",limit:"9",mode:"grid",imageStyles:{width:"168rpx",height:"168rpx"}},null,8,["url"])])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue","rules"]),f(z,{bottom:"",placeholder:""},{default:u((()=>[f(l,{class:"foot-wrap"},{default:u((()=>[f(l,{class:"foot_box ss-flex ss-col-center ss-row-between ss-p-x-30"},{default:u((()=>[f(Z,{class:"ss-reset-button ui-BG-Main-Gradient sub-btn",onClick:q},{default:u((()=>[_(m(c(a)("common.submit")),1)])),_:1})])),_:1})])),_:1})])),_:1}),f(E,{show:N.showModal,round:"10",showClose:!0,onClose:s[5]||(s[5]=e=>N.showModal=!1)},{default:u((()=>[f(l,{class:"modal-box page_box"},{default:u((()=>[f(l,{class:"modal-head item-title head_box ss-flex ss-row-center ss-col-center"},{default:u((()=>[_(m(c(a)("order.application_reason")),1)])),_:1}),f(l,{class:"modal-content content_box"},{default:u((()=>[f(g,{onChange:$},{default:u((()=>[(p(!0),y(w,null,x(N.reasonList,(e=>(p(),d(r,{class:"radio ss-flex ss-col-center",key:e},{default:u((()=>[f(l,{class:"ss-flex-1 ss-p-20"},{default:u((()=>[_(m(e),1)])),_:2},1024),f(o,{value:e,color:"var(--ui-BG-Main)",checked:e===N.currentValue},null,8,["value","checked"])])),_:2},1024)))),128))])),_:1})])),_:1}),f(l,{class:"modal-foot foot_box ss-flex ss-row-center ss-col-center"},{default:u((()=>[f(Z,{class:"ss-reset-button close-btn ui-BG-Main-Gradient",onClick:A},{default:u((()=>[_(m(c(a)("common.confirm")),1)])),_:1})])),_:1})])),_:1})])),_:1},8,["show"])])),_:1},8,["title"])}}},[["__scopeId","data-v-f364e5e2"]]);export{D as default};
|