pages-order-aftersale-apply.pjyozDIZ.js 6.7 KB

1
  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 j,M as k,N as I,O as M}from"./index-BCKJ-0Ge.js";import{_ as V}from"./s-goods-item.CMakO_PW.js";import{_ as R,b as C}from"./phone-international-input.DlQn1niu.js";import{_ as L}from"./s-uploader.ClJ_AxCt.js";import{a as U,_ as G}from"./s-layout.BlKiWP6r.js";import{_ as P}from"./phone-international-input.vue_vue_type_style_index_0_scoped_a793e264_lang.gzj6S5Lq.js";import{f as B}from"./useGoods.RKHlFkKU.js";import{_ as S}from"./_plugin-vue_export-helper.BCo6x5W8.js";import"./points.DDTOnulC.js";/* empty css */import"./uni-icons.B3KpsLhk.js";import"./s-menu-tools.IK4uQ0vW.js";import"./s-search-block.vue_vue_type_style_index_0_scoped_f692e81a_lang.PvnEoxKH.js";import"./s-layout.vue_vue_type_style_index_0_scoped_d5f7c468_lang.DAm7RC0r.js";import"./s-search-block.Cv0lfwt6.js";const D=S({__name:"apply",setup(S){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:""}),T=s({way:"",applyReason:"",applyDescription:"",applyPicUrls:[]}),$=s({});async function q(){if(""==T.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(""==T.applyDescription)return g({title:a("order.please_fill_in_description"),icon:"error",duration:1e3}),!1;let e={orderItemId:N.itemId,refundPrice:N.item.payPrice,...T};const{code:s}=await h.createAfterSale(e);0===s&&(g({title:a("wallet.application_successful")}),l.$router.go("/pages/order/aftersale/list"))}function O(e){T.way=e.detail.value,N.reasonList="10"===T.way?N.config.afterSaleRefundReasons||[]:N.config.afterSaleReturnReasons||[],T.applyReason="",N.currentValue=""}function z(e){N.currentValue=e.detail.value}function A(){T.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,T.way="20",T.type="20",N.reasonList=N.config.afterSaleReturnReasons||[])})),(e,s)=>{const t=i(n("s-goods-item"),V),l=b,o=I,r=M,g=v,h=j,S=i(n("uni-easyinput"),R),E=i(n("s-uploader"),L),F=i(n("uni-forms"),C),H=k,J=i(n("su-fixed"),U),K=i(n("su-popup"),P),Q=i(n("s-layout"),G);return p(),d(Q,{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(F,{ref_key:"form",ref:D,modelValue:T,"onUpdate:modelValue":s[4]||(s[4]=e=>T=e),rules:$,"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:O},{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:T.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(B)(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((()=>[T.applyReason?(p(),d(h,{key:0,class:"ss-m-r-20"},{default:u((()=>[_(m(T.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(S,{inputBorder:!1,class:"describe-content",type:"textarea",maxlength:"120",autoHeight:"",modelValue:T.applyDescription,"onUpdate:modelValue":s[2]||(s[2]=e=>T.applyDescription=e),placeholder:c(a)("order.customer_prompt")},null,8,["modelValue","placeholder"]),f(l,{class:"upload-img"},{default:u((()=>[f(E,{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"]),f(J,{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(H,{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(K,{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:z},{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(H,{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};