pages-order-aftersale-apply.76c2e6fa.js 6.2 KB

1
  1. import{K as e,y as s,o as a,s as t,aa as l,e as o,f as r,w as i,l as n,j as u,t as d,k as c,r as f,F as p,u as m,v as _,ad as y,m as x,i as g,ae as h,E as w,G as b,H as v,I as k}from"./index-b48a414d.js";import{_ as I}from"./s-goods-item.13120f93.js";import{a as j,d as V,_ as M}from"./phone-international-input.feef99c7.js";import{_ as C}from"./s-uploader.af3e7e55.js";import{f as R,a as G,_ as U}from"./s-layout.d6dcdc81.js";import{T as B}from"./config.d4c08989.js";import{A as L}from"./afterSale.e9a3d47e.js";import{_ as P}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";/* empty css */const D=P({__name:"apply",setup(P){const D=e(null),S=s({orderId:0,itemId:0,order:{},item:{},config:{},wayList:[{text:"仅退款",value:"10"},{text:"退款退货",value:"20"}],reasonList:[],showModal:!1,currentValue:""}),T=s({way:"",applyReason:"",applyDescription:"",applyPicUrls:[]}),$=s({});async function A(){if(""==T.way)return y({title:"请选择售后类型",icon:"error",duration:1e3}),!1;if(""==S.currentValue)return y({title:"请选择申请原因",icon:"error",duration:1e3}),!1;if(""==T.applyDescription)return y({title:"请填写相关描述",icon:"error",duration:1e3}),!1;let e={orderItemId:S.itemId,refundPrice:S.item.payPrice,...T};const{code:s}=await L.createAfterSale(e);0===s&&(y({title:"申请成功"}),t.$router.go("/pages/order/aftersale/list"))}function E(e){T.way=e.detail.value,S.reasonList="10"===T.way?S.config.afterSaleRefundReasons||[]:S.config.afterSaleReturnReasons||[],T.applyReason="",S.currentValue=""}function H(e){S.currentValue=e.detail.value}function N(){T.applyReason=S.currentValue,S.showModal=!1}return a((async e=>{if(!e.orderId||!e.itemId)return void t.$helper.toast("缺少订单信息,请检查");S.orderId=e.orderId,S.itemId=parseInt(e.itemId);const{code:s,data:a}=await l.getOrder(S.orderId);0===s&&(S.order=a,S.item=a.items.find((e=>e.id===S.itemId))||{},10===S.order.status&&S.wayList.splice(1,1),S.config=(await B.getTradeConfig()).data)})),(e,s)=>{const a=n(x("s-goods-item"),I),l=g,y=v,B=k,L=h,P=w,F=n(x("uni-easyinput"),j),K=n(x("s-uploader"),C),O=n(x("uni-forms"),V),q=b,z=n(x("su-fixed"),G),J=n(x("su-popup"),M),Q=n(x("s-layout"),U);return o(),r(Q,{title:"申请售后"},{default:i((()=>[u(l,{class:"goods-box"},{default:i((()=>{var e;return[u(a,{img:S.item.picUrl,title:S.item.spuName,skuText:null==(e=S.item.properties)?void 0:e.map((e=>e.valueName)).join(" "),price:S.item.price,num:S.item.count},null,8,["img","title","skuText","price","num"])]})),_:1}),u(O,{ref_key:"form",ref:D,modelValue:T,"onUpdate:modelValue":s[4]||(s[4]=e=>T=e),rules:$,"label-position":"top"},{default:i((()=>[u(l,{class:"refund-item"},{default:i((()=>[u(l,{class:"item-title ss-m-b-20"},{default:i((()=>[d("售后类型")])),_:1}),u(l,{class:"ss-flex-col"},{default:i((()=>[u(L,{onChange:E},{default:i((()=>[(o(!0),c(p,null,f(S.wayList,((e,s)=>(o(),r(B,{class:"ss-flex ss-col-center ss-p-y-10",key:s},{default:i((()=>[u(y,{checked:T.type===e.value,color:"var(--ui-BG-Main)",style:{transform:"scale(0.8)"},value:e.value},null,8,["checked","value"]),u(l,{class:"item-value ss-m-l-8"},{default:i((()=>[d(m(e.text),1)])),_:2},1024)])),_:2},1024)))),128))])),_:1})])),_:1})])),_:1}),u(l,{class:"refund-item ss-flex ss-col-center ss-row-between",onClick:s[0]||(s[0]=e=>S.showModal=!0)},{default:i((()=>[u(P,{class:"item-title"},{default:i((()=>[d("退款金额")])),_:1}),u(l,{class:"ss-flex refund-cause ss-col-center"},{default:i((()=>[u(P,{class:"ss-m-r-20"},{default:i((()=>[d("¥"+m(_(R)(S.item.payPrice)),1)])),_:1})])),_:1})])),_:1}),u(l,{class:"refund-item ss-flex ss-col-center ss-row-between",onClick:s[1]||(s[1]=e=>S.showModal=!0)},{default:i((()=>[u(P,{class:"item-title"},{default:i((()=>[d("申请原因")])),_:1}),u(l,{class:"ss-flex refund-cause ss-col-center"},{default:i((()=>[T.applyReason?(o(),r(P,{key:0,class:"ss-m-r-20"},{default:i((()=>[d(m(T.applyReason),1)])),_:1})):(o(),r(P,{key:1,class:"ss-m-r-20"},{default:i((()=>[d("请选择申请原因~")])),_:1})),u(P,{class:"cicon-forward",style:{height:"28rpx"}})])),_:1})])),_:1}),u(l,{class:"refund-item"},{default:i((()=>[u(l,{class:"item-title ss-m-b-20"},{default:i((()=>[d("相关描述")])),_:1}),u(l,{class:"describe-box"},{default:i((()=>[u(F,{inputBorder:!1,class:"describe-content",type:"textarea",maxlength:"120",autoHeight:"",modelValue:T.applyDescription,"onUpdate:modelValue":s[2]||(s[2]=e=>T.applyDescription=e),placeholder:"客官~请描述您遇到的问题,建议上传照片"},null,8,["modelValue"]),u(l,{class:"upload-img"},{default:i((()=>[u(K,{url:T.applyPicUrls,"onUpdate:url":s[3]||(s[3]=e=>T.applyPicUrls=e),fileMediatype:"image",limit:"9",mode:"grid",imageStyles:{width:"168rpx",height:"168rpx"}},null,8,["url"])])),_:1})])),_:1})])),_:1})])),_:1},8,["modelValue","rules"]),u(z,{bottom:"",placeholder:""},{default:i((()=>[u(l,{class:"foot-wrap"},{default:i((()=>[u(l,{class:"foot_box ss-flex ss-col-center ss-row-between ss-p-x-30"},{default:i((()=>[u(q,{class:"ss-reset-button contcat-btn",onClick:s[5]||(s[5]=e=>_(t).$router.go("/pages/chat/index"))},{default:i((()=>[d(" 联系客服 ")])),_:1}),u(q,{class:"ss-reset-button ui-BG-Main-Gradient sub-btn",onClick:A},{default:i((()=>[d("提交")])),_:1})])),_:1})])),_:1})])),_:1}),u(J,{show:S.showModal,round:"10",showClose:!0,onClose:s[6]||(s[6]=e=>S.showModal=!1)},{default:i((()=>[u(l,{class:"modal-box page_box"},{default:i((()=>[u(l,{class:"modal-head item-title head_box ss-flex ss-row-center ss-col-center"},{default:i((()=>[d(" 申请原因 ")])),_:1}),u(l,{class:"modal-content content_box"},{default:i((()=>[u(L,{onChange:H},{default:i((()=>[(o(!0),c(p,null,f(S.reasonList,(e=>(o(),r(B,{class:"radio ss-flex ss-col-center",key:e},{default:i((()=>[u(l,{class:"ss-flex-1 ss-p-20"},{default:i((()=>[d(m(e),1)])),_:2},1024),u(y,{value:e,color:"var(--ui-BG-Main)",checked:e===S.currentValue},null,8,["value","checked"])])),_:2},1024)))),128))])),_:1})])),_:1}),u(l,{class:"modal-foot foot_box ss-flex ss-row-center ss-col-center"},{default:i((()=>[u(q,{class:"ss-reset-button close-btn ui-BG-Main-Gradient",onClick:N},{default:i((()=>[d(" 确定 ")])),_:1})])),_:1})])),_:1})])),_:1},8,["show"])])),_:1})}}},[["__scopeId","data-v-081ed619"]]);export{D as default};