"use strict";var e=require("../common/vendor.js"),t=require("../api/packageOrder.js"),s=require("../api/common.js"),a=require("../uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js");require("../common/request.js");const o={mixins:[a.MescrollMixin],data:()=>({orderStatusOptions:[],searchKey:"",status:"0",tabs:[{name:"全部",id:"0"},{name:"待支付",id:"1"},{name:"服务中",id:"2"},{name:"已完成",id:"3"},{name:"已取消",id:"-1"},{name:"已退款",id:"-2"}],mescroll:null,downOption:{use:!0,auto:!1},upOption:{onScroll:!1,use:!0,page:{pae:0,size:10},noMoreSize:10,textNoMore:"已经到底了",empty:{icon:"https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png",tip:"暂无数据"}},dataList:[]}),onLoad(t){null!=t.status&&(this.status=t.status);var s=this;e.index.$on("refreshPackageOrder",(()=>{s.mescroll.resetUpScroll()})),this.getDictByKey("sys_package_order_status")},onShow(){},methods:{pay(t){e.index.navigateTo({url:"/pages_order/packageOrderPay?orderId="+t.orderId})},getDictByKey(e){var t={key:e};s.getDictByKey(t).then((t=>{200==t.code&&"sys_package_order_status"==e&&(this.orderStatusOptions=t.data)}),(e=>{}))},cancelOrder(s){e.index.showModal({title:"提示",content:"确认取消订单吗?",showCancel:!0,cancelText:"取消",confirmText:"确定",success:a=>{if(a.confirm){var o={orderId:s.orderId};t.cancelOrder(o).then((t=>{200==t.code?(e.index.$emit("refreshPackageOrder"),e.index.showToast({icon:"success",title:"操作成功"})):e.index.showToast({icon:"none",title:t.msg})}),(e=>{}))}}})},showDetails(t){e.index.navigateTo({url:"/pages_order/packageOrderDetails?orderId="+t.orderId})},tabChange(e){this.status=e.id,console.log(e),this.mescroll.resetUpScroll()},mescrollInit(e){this.mescroll=e},downCallback(e){e.resetUpScroll()},upCallback(s){var a=this,o={status:this.status,pageNum:s.num,pageSize:s.size};t.getMyPackageOrderList(o).then((t=>{200==t.code?(1==s.num?a.dataList=t.data.list:a.dataList=a.dataList.concat(t.data.list),a.mescroll.endBySize(t.data.list.length,t.data.total)):(e.index.showToast({icon:"none",title:"请求失败"}),a.dataList=null,a.mescroll.endErr())}))}}};if(!Array){(e.resolveComponent("u-tabs")+e.resolveComponent("mescroll-body"))()}Math||((()=>"../uni_modules/uview-plus/components/u-tabs/u-tabs.js")+(()=>"../uni_modules/mescroll-uni/components/mescroll-body/mescroll-body.js"))();var r=e._export_sfc(o,[["render",function(t,s,a,o,r,i){return{a:e.o(i.tabChange),b:e.p({current:r.status,scrollable:!0,list:r.tabs,lineColor:"#C39A58"}),c:e.f(r.dataList,((s,a,o)=>e.e({a:e.t(s.orderSn),b:1==s.status},1==s.status?{c:e.t(t.$getDictLabelName(r.orderStatusOptions,s.status))}:{},{d:s.status>1},s.status>1?{e:e.t(t.$getDictLabelName(r.orderStatusOptions,s.status))}:{},{f:s.status<0},s.status<0?{g:e.t(t.$getDictLabelName(r.orderStatusOptions,s.status))}:{},{h:s.imgUrl,i:e.t(s.packageName),j:e.t(s.cycle),k:e.t(s.duration),l:e.t(s.payPrice.toFixed(2)),m:1==s.status},1==s.status?{n:e.o((e=>i.cancelOrder(s)))}:{},{o:1==s.status},1==s.status?{p:e.o((e=>i.pay(s)))}:{},{q:e.o((e=>i.showDetails(s)))}))),d:e.sr("mescrollRef","c96dda4c-1"),e:e.o(i.mescrollInit),f:e.o(i.downCallback),g:e.o(i.upCallback),h:e.p({top:"88rpx",bottom:"0",down:r.downOption,up:r.upOption})}}],["__scopeId","data-v-c96dda4c"]]);wx.createPage(r);
