"use strict";var e=require("../common/vendor.js"),t=require("../api/common.js"),o=require("../api/index.js"),s=require("../uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js");require("../common/request.js");const i={mixins:[s.MescrollMixin],data:()=>({typeOptions:[],questionsType:0,keyword:"",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:[]}),onShow(){this.getDictByKey("sys_questions_type")},methods:{getDictByKey(e){var o={key:e};t.getDictByKey(o).then((t=>{200==t.code&&"sys_questions_type"==e&&(this.typeOptions=t.data)}),(e=>{}))},doSearch(){this.mescroll.resetUpScroll()},mescrollInit(e){this.mescroll=e},downCallback(e){e.resetUpScroll()},upCallback(t){var s=this,i={keyword:this.keyword,questionsType:this.questionsType,pageNum:t.num,pageSize:t.size};o.getQuestionsList(i).then((o=>{200==o.code?(1==t.num?s.dataList=o.data.list:s.dataList=s.dataList.concat(o.data.list),s.mescroll.endBySize(o.data.list.length,o.data.total)):(e.index.showToast({icon:"none",title:"请求失败"}),s.dataList=null,s.mescroll.endErr())}))},choseType(e){this.questionsType=e.dictValue,this.mescroll.resetUpScroll()},showDetail(t){e.index.navigateTo({url:"./questionsDetails?id="+t.id})}}};if(!Array){e.resolveComponent("mescroll-body")()}Math;var a=e._export_sfc(i,[["render",function(t,o,s,i,a,l){return{a:e.o(((...e)=>l.doSearch&&l.doSearch(...e))),b:a.keyword,c:e.o((e=>a.keyword=e.detail.value)),d:e.f(a.typeOptions,((t,o,s)=>({a:e.t(t.dictLabel),b:o,c:e.n(a.questionsType==t.dictValue?"item active":"item"),d:e.o((e=>l.choseType(t)),o)}))),e:e.f(a.dataList,((t,o,s)=>({a:e.t(t.title),b:e.t(t.views),c:e.t(t.createTime),d:o,e:e.o((e=>l.showDetail(t)),o)}))),f:e.sr("mescrollRef","6d26dc82-0"),g:e.o(l.mescrollInit),h:e.o(l.downCallback),i:e.o(l.upCallback),j:e.p({top:"192rpx",down:a.downOption,up:a.upOption})}}]]);wx.createPage(a);
