acdr-ui/dist/build/mp-weixin/modules/mall/order/aftersale/detail.js
2024-10-01 09:15:35 +08:00

2 lines
3.8 KiB
JavaScript

"use strict";var e=(e,t,o)=>new Promise(((i,n)=>{var s=e=>{try{l(o.next(e))}catch(t){n(t)}},r=e=>{try{l(o.throw(e))}catch(t){n(t)}},l=e=>e.done?i(e.value):Promise.resolve(e.value).then(s,r);l((o=o.apply(e,t)).next())}));const t=require("../../../../common/vendor.js"),o=require("../../sheep/index.js"),i=require("../../sheep/hooks/useGoods.js"),n=require("../../sheep/api/trade/afterSale.js");if(!Array){(t.resolveComponent("s-goods-item")+t.resolveComponent("s-empty")+t.resolveComponent("su-fixed")+t.resolveComponent("s-layout")+t.resolveComponent("layout-default-uni"))()}Math||((()=>"../../sheep/components/s-goods-item/s-goods-item.js")+(()=>"../../sheep/components/s-empty/s-empty.js")+(()=>"../../sheep/ui/su-fixed/su-fixed.js")+(()=>"../../sheep/components/s-layout/s-layout.js"))();const s={__name:"detail",setup(s){t.useCssVars((e=>({"4ce49f4b":t.unref(l)})));const r=2*o.sheep.$platform.device.statusBarHeight,l=o.sheep.$url.css("/static/img/shop/order/order_bg.png"),a=t.reactive({id:0,info:{},loading:!1,active:0,list:[{title:"提交申请"},{title:"处理中"},{title:"完成"}]});const u=()=>{o.sheep.$helper.copyText(a.info.no)};function f(t){return e(this,null,(function*(){a.loading=!0;const{code:e,data:o}=yield n.AfterSaleApi.getAfterSale(t);0===e?(a.info=o,i.handleAfterSaleButtons(a.info),[10].includes(a.info.status)?a.active=0:[20,30].includes(a.info.status)?a.active=1:([40,50].includes(a.info.status)||[61,62,63].includes(a.info.status))&&(a.active=2)):a.info=null}))}return t.onLoad((e=>{e.id?(a.id=e.id,f(e.id)):o.sheep.$helper.toast("缺少订单信息,请检查")})),(s,l)=>{var d,c,p,m;return t.e({a:!t.unref(t.isEmpty)(a.info)&&a.loading},!t.unref(t.isEmpty)(a.info)&&a.loading?{b:t.f(a.list,((e,o,i)=>t.e({a:a.list.length-1===o&&[61,62,63].includes(a.info.status)},a.list.length-1===o&&[61,62,63].includes(a.info.status)?{}:{b:t.n(a.active>=o?"activity-color":"info-color")},{c:a.list.length-1!==o},a.list.length-1!==o?{d:t.n(a.active>=o?"activity-bg":"info-bg")}:{},{e:t.t(e.title),f:t.n(a.active>=o?"activity-color":"info-color"),g:o}))),c:t.s({marginTop:"-"+Number(r+88)+"rpx",paddingTop:Number(r+88)+"rpx"}),d:t.t(t.unref(i.formatAfterSaleStatusDescription)(a.info)),e:t.t(t.unref(o.sheep).$helper.timeFormat(a.info.updateTime,"yyyy-mm-dd hh:MM:ss")),f:t.o((e=>t.unref(o.sheep).$router.go("/modules/mall/order/aftersale/log",{id:a.id}))),g:t.t(t.unref(i.fen2yuan)(a.info.refundPrice)),h:t.p({img:a.info.picUrl,title:a.info.spuName,titleWidth:480,skuText:a.info.properties.map((e=>e.valueName)).join(" "),num:a.info.count}),i:t.t(a.info.no),j:t.o(u),k:t.t(t.unref(o.sheep).$helper.timeFormat(a.info.createTime,"yyyy-mm-dd hh:MM:ss")),l:t.t(10===a.info.way?"仅退款":"退款退货"),m:t.t(a.info.applyReason),n:t.t(a.info.applyDescription)}:{},{o:t.unref(t.isEmpty)(a.info)&&a.loading},t.unref(t.isEmpty)(a.info)&&a.loading?{p:t.p({icon:"/static/order-empty.png",text:"暂无该订单售后详情"})}:{},{q:!t.unref(t.isEmpty)(a.info)},t.unref(t.isEmpty)(a.info)?{}:t.e({r:null==(d=a.info.buttons)?void 0:d.includes("cancel")},(null==(c=a.info.buttons)?void 0:c.includes("cancel"))?{s:t.o((o=>{return i=a.info.id,void t.index.showModal({title:"提示",content:"确定要取消此申请吗?",success:function(t){return e(this,null,(function*(){if(!t.confirm)return;const{code:e}=yield n.AfterSaleApi.cancelAfterSale(i);0===e&&(yield f(i))}))}});var i}))}:{},{t:null==(p=a.info.buttons)?void 0:p.includes("delivery")},(null==(m=a.info.buttons)?void 0:m.includes("delivery"))?{v:t.o((e=>t.unref(o.sheep).$router.go("/modules/mall/order/aftersale/return-delivery",{id:a.info.id})))}:{},{w:t.o((e=>t.unref(o.sheep).$router.go("/modules/mall/chat/index"))),x:t.p({bottom:!0,placeholder:!0,bg:"bg-white"})}),{y:t.p({title:"售后详情",navbar:!t.unref(t.isEmpty)(a.info)&&a.loading?"inner":"normal"}),z:t.s(s.__cssVars())})}}},r=t._export_sfc(s,[["__scopeId","data-v-a4b57224"]]);wx.createPage(r);