"use strict";const t=require("../common/vendor.js"),r={mixins:[MescrollMixin],data(){return{integral:0,type:"0",typeOptions:[],tabIndex:0,tabs:[],mescroll:null,downOption:{use:!0,auto:!1,textInOffset:"下拉刷新",textOutOffset:"释放更新",textLoading:"加载中..."},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(){this.getDictByKey("sys_integral_goods_type"),this.getUserInfo()},methods:{getUserInfo(){getUserInfo().then(e=>{e.code==200?e.user!=null&&(this.integral=e.user.integral):t.index.showToast({icon:"none",title:"请求失败"})},e=>{})},navTo(e){t.index.navigateTo({url:e})},goIntegral(){let e=getCurrentPages(),s=e[e.length-2];e.length>1&&s&&s.route=="pages/user/integral/points"?t.index.navigateBack():t.index.navigateTo({url:"/pages/user/integral/points"})},getDictByKey(e){var s={key:e},i=this;getDictByKey(s).then(n=>{n.code==200&&(this.typeOptions=n.data,this.typeOptions.forEach(function(a,l){var o={name:a.dictLabel};i.tabs.push(o)}),this.tabs.length>0&&(this.tabIndex=0))},n=>{})},tabChange(e){console.log(e.index),this.type=this.typeOptions[e.index].dictValue,this.mescroll.resetUpScroll()},mescrollInit(e){this.mescroll=e},downCallback(e){e.resetUpScroll()},upCallback(e){var s=this,i={pageNum:e.num,pageSize:e.size};this.type!=null&&(i.goodsType=this.type),getIntegralGoodsList(i).then(n=>{n.code==200?(e.num==1?s.dataList=n.data.list:s.dataList=s.dataList.concat(n.data.list),s.mescroll.endBySize(n.data.list.length,n.data.total)):(t.index.showToast({icon:"none",title:"请求失败"}),s.dataList=null,s.mescroll.endErr())})}}};if(!Array){const e=t.resolveComponent("u-tabs"),s=t.resolveComponent("u-sticky"),i=t.resolveComponent("mescroll-body");(e+s+i)()}const c=()=>"../uni_modules/uview-plus/components/u-tabs/u-tabs.js",d=()=>"../uni_modules/uview-plus/components/u-sticky/u-sticky.js",u=()=>"../uni_modules/mescroll-uni/components/mescroll-body/mescroll-body.js";Math||(c+d+u)();function g(e,s,i,n,a,l){return t.e({a:t.t(a.integral),b:t.o((...o)=>l.goIntegral&&l.goIntegral(...o)),c:t.o(o=>l.navTo("/pages/user/integral/integralLogsList")),d:t.o(o=>l.navTo("/pages/user/integral/integralOrderList")),e:a.tabs.length>0},a.tabs.length>0?{f:t.o(l.tabChange),g:t.p({current:a.tabIndex,scrollable:!0,list:a.tabs,lineColor:"#FF5C03"})}:{},{h:t.f(a.dataList,(o,m,h)=>({a:o.imgUrl,b:t.t(o.goodsName),c:t.t(o.integral),d:t.t(o.otPrice.toFixed(2)),e:t.o(y=>l.navTo("/pages/user/integral/integralGoodsDetails?goodsId="+o.goodsId))})),i:t.sr("mescrollRef","a55124e7-2"),j:t.o(l.mescrollInit),k:t.o(l.downCallback),l:t.o(l.upCallback),m:t.p({bottom:"0",down:a.downOption,up:a.upOption})})}const p=t._export_sfc(r,[["render",g],["__scopeId","data-v-a55124e7"]]);wx.createPage(p);