pages-order-aftersale-apply.48eccf99.js 6.2 KB

1
  1. import{N as e,z as s,o as a,s as t,aj as l,am 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,an as x,ao 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-0faec82b.js";import{_ as V}from"./s-goods-item.19ab5cc0.js";import{a as M,d as C,_ as R}from"./phone-international-input.38423d06.js";import{_ as G}from"./s-uploader.2d9958d3.js";import{a as L,_ as U}from"./s-layout.88d8cb8b.js";import{f as P}from"./useGoods.b071619b.js";import{_ as B}from"./_plugin-vue_export-helper.1b428a4d.js";import"./points.c381a8e1.js";/* empty css */const D=B({__name:"apply",setup(B){const D=e(null),S=s({orderId:0,itemId:0,order:{},item:{},config:{},wayList:[{text:"仅退款",value:"10"},{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(""==S.currentValue)return x({title:"请选择申请原因",icon:"error",duration:1e3}),!1;if(""==N.applyDescription)return x({title:"请填写相关描述",icon:"error",duration:1e3}),!1;let e={orderItemId:S.itemId,refundPrice:S.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,S.reasonList="10"===N.way?S.config.afterSaleRefundReasons||[]:S.config.afterSaleReturnReasons||[],N.applyReason="",S.currentValue=""}function A(e){S.currentValue=e.detail.value}function F(){N.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 o.getTradeConfig()).data)})),(e,s)=>{const a=u(w("s-goods-item"),V),l=h,o=I,x=j,g=b,B=v,H=u(w("uni-easyinput"),M),J=u(w("s-uploader"),G),K=u(w("uni-forms"),C),O=k,q=u(w("su-fixed"),L),E=u(w("su-popup"),R),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: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}),d(K,{ref_key:"form",ref:D,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(S.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=>S.showModal=!0)},{default:n((()=>[d(B,{class:"item-title"},{default:n((()=>[c("退款金额")])),_:1}),d(l,{class:"ss-flex refund-cause ss-col-center"},{default:n((()=>[d(B,{class:"ss-m-r-20"},{default:n((()=>[c("¥"+_(y(P)(S.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=>S.showModal=!0)},{default:n((()=>[d(B,{class:"item-title"},{default:n((()=>[c("申请原因")])),_:1}),d(l,{class:"ss-flex refund-cause ss-col-center"},{default:n((()=>[N.applyReason?(r(),i(B,{key:0,class:"ss-m-r-20"},{default:n((()=>[c(_(N.applyReason),1)])),_:1})):(r(),i(B,{key:1,class:"ss-m-r-20"},{default:n((()=>[c("请选择申请原因~")])),_:1})),d(B,{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:S.showModal,round:"10",showClose:!0,onClose:s[6]||(s[6]=e=>S.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(S.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===S.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-081ed619"]]);export{D as default};