pages-order-aftersale-apply.afcfea25.js 5.9 KB

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