2 lines
4.0 KiB
JavaScript
2 lines
4.0 KiB
JavaScript
"use strict";var e=Object.defineProperty,o=Object.getOwnPropertySymbols,t=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable,a=(o,t,r)=>t in o?e(o,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):o[t]=r,s=(e,o,t)=>new Promise(((r,a)=>{var s=e=>{try{n(t.next(e))}catch(o){a(o)}},i=e=>{try{n(t.throw(e))}catch(o){a(o)}},n=e=>e.done?r(e.value):Promise.resolve(e.value).then(s,i);n((t=t.apply(e,o)).next())}));const i=require("../../../../common/vendor.js"),n=require("../../sheep/index.js"),p=require("../../sheep/api/trade/order.js"),l=require("../../sheep/api/trade/config.js"),u=require("../../sheep/hooks/useGoods.js"),d=require("../../sheep/api/trade/afterSale.js");if(!Array){(i.resolveComponent("s-goods-item")+i.resolveComponent("uni-easyinput")+i.resolveComponent("s-uploader")+i.resolveComponent("uni-forms")+i.resolveComponent("su-fixed")+i.resolveComponent("su-popup")+i.resolveComponent("s-layout")+i.resolveComponent("layout-default-uni"))()}Math||((()=>"../../sheep/components/s-goods-item/s-goods-item.js")+(()=>"../../../../uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.js")+(()=>"../../sheep/components/s-uploader/s-uploader.js")+(()=>"../../../../uni_modules/uni-forms/components/uni-forms/uni-forms.js")+(()=>"../../sheep/ui/su-fixed/su-fixed.js")+(()=>"../../sheep/ui/su-popup/su-popup.js")+(()=>"../../sheep/components/s-layout/s-layout.js"))();const c={__name:"apply",setup(e){const c=i.ref(null),m=i.reactive({orderId:0,itemId:0,order:{},item:{},config:{},wayList:[{text:"仅退款",value:"10"},{text:"退款退货",value:"20"}],reasonList:[],showModal:!1,currentValue:""}),f=i.reactive({way:"",applyReason:"",applyDescription:"",images:[]}),y=i.reactive({});function h(){return s(this,null,(function*(){const e=((e,s)=>{for(var i in s||(s={}))t.call(s,i)&&a(e,i,s[i]);if(o)for(var i of o(s))r.call(s,i)&&a(e,i,s[i]);return e})({orderItemId:m.itemId,refundPrice:m.item.payPrice},f),{code:s}=yield d.AfterSaleApi.createAfterSale(e);0===s&&(i.index.showToast({title:"申请成功"}),n.sheep.$router.go("/modules/mall/order/aftersale/list"))}))}function v(e){f.way=e.detail.value,m.reasonList="10"===f.way?m.config.afterSaleRefundReasons||[]:m.config.afterSaleReturnReasons||[],f.applyReason="",m.currentValue=""}function g(e){m.currentValue=e.detail.value}function w(){f.applyReason=m.currentValue,m.showModal=!1}return i.onLoad((e=>s(this,null,(function*(){if(!e.orderId||!e.itemId)return void n.sheep.$helper.toast("缺少订单信息,请检查");m.orderId=e.orderId,m.itemId=parseInt(e.itemId);const{code:o,data:t}=yield p.OrderApi.getOrder(m.orderId);0===o&&(m.order=t,m.item=t.items.find((e=>e.id===m.itemId))||{},10===m.order.status&&m.wayList.splice(1,1),m.config=(yield l.TradeConfigApi.getTradeConfig()).data)})))),(e,o)=>{var t;return i.e({a:i.p({img:m.item.picUrl,title:m.item.spuName,skuText:null==(t=m.item.properties)?void 0:t.map((e=>e.valueName)).join(" "),price:m.item.price,num:m.item.count}),b:i.f(m.wayList,((e,o,t)=>({a:f.type===e.value,b:e.value,c:i.t(e.text),d:o}))),c:i.o(v),d:i.t(i.unref(u.fen2yuan)(m.item.payPrice)),e:i.o((e=>m.showModal=!0)),f:f.applyReason},f.applyReason?{g:i.t(f.applyReason)}:{},{h:i.o((e=>m.showModal=!0)),i:i.o((e=>f.applyDescription=e)),j:i.p({inputBorder:!1,type:"textarea",maxlength:"120",autoHeight:!0,placeholder:"客官~请描述您遇到的问题,建议上传照片",modelValue:f.applyDescription}),k:i.o((e=>f.images=e)),l:i.p({fileMediatype:"image",limit:"9",mode:"grid",imageStyles:{width:"168rpx",height:"168rpx"},url:f.images}),m:i.sr(c,"bc3dc18b-3,bc3dc18b-1",{k:"form"}),n:i.o((e=>f=e)),o:i.p({rules:y,"label-position":"top",modelValue:f}),p:i.o((e=>i.unref(n.sheep).$router.go("/modules/mall/chat/index"))),q:i.o(h),r:i.p({bottom:!0,placeholder:!0}),s:i.f(m.reasonList,((e,o,t)=>({a:i.t(e),b:e,c:e===m.currentValue,d:e}))),t:i.o(g),v:i.o(w),w:i.o((e=>m.showModal=!1)),x:i.p({show:m.showModal,round:"10",showClose:!0}),y:i.p({title:"申请售后"})})}}},m=i._export_sfc(c,[["__scopeId","data-v-bc3dc18b"]]);wx.createPage(m);
|