pages-order-aftersale-apply.fa084cbf.js 6.2 KB

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