"use strict";var o=require("../common/vendor.js"),m=require("../api/common.js"),h=require("../api/index.js"),_=require("../uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js");require("../common/request.js");const u={mixins:[_.MescrollMixin],data(){return{foodOptions:[],actionOptions:[],indicationOptions:[],action:"",food:"",indications:"",keyword:"",mescroll:null,downOption:{use:!0,auto:!1},upOption:{onScroll:!1,use:!0,page:{pae:0,size:10},noMoreSize:10,textNoMore:"\u5DF2\u7ECF\u5230\u5E95\u4E86",empty:{icon:"https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png",tip:"\u6682\u65E0\u6570\u636E"}},dataList:[]}},onShow(){this.getDictByKey("sys_medicated_food"),this.getDictByKey("sys_medicated_food_action"),this.getDictByKey("sys_indication")},methods:{getDictByKey(e){var s={key:e};m.getDictByKey(s).then(a=>{a.code==200&&(e=="sys_medicated_food"&&(this.foodOptions=a.data),e=="sys_medicated_food_action"&&(this.actionOptions=a.data),e=="sys_indication"&&(this.indicationOptions=a.data))},a=>{})},doSearch(){this.mescroll.resetUpScroll()},mescrollInit(e){this.mescroll=e},downCallback(e){e.resetUpScroll()},upCallback(e){var s=this,a={food:this.food,action:this.action,indications:this.indications,keyword:this.keyword,pageNum:e.num,pageSize:e.size};h.getMedicatedFoodList(a).then(l=>{l.code==200?(e.num==1?s.dataList=l.data.list:s.dataList=s.dataList.concat(l.data.list),s.mescroll.endBySize(l.data.list.length,l.data.total)):(o.index.showToast({icon:"none",title:"\u8BF7\u6C42\u5931\u8D25"}),s.dataList=null,s.mescroll.endErr())})},choseAction(e){this.action=e.dictLabel,this.mescroll.resetUpScroll()},choseFood(e){this.food=e.dictLabel,this.mescroll.resetUpScroll()},choseIndications(e){this.indications=e.dictLabel,this.mescroll.resetUpScroll()},showDetail(e){o.index.navigateTo({url:"./medicatedFoodDetails?id="+e.id})}}};Array||o.resolveComponent("mescroll-body")();const p=()=>"../uni_modules/mescroll-uni/components/mescroll-body/mescroll-body.js";Math||p();function f(e,s,a,l,t,n){return{a:o.o((...i)=>n.doSearch&&n.doSearch(...i)),b:t.keyword,c:o.o(i=>t.keyword=i.detail.value),d:o.f(t.foodOptions,(i,c,d)=>({a:o.t(i.dictLabel),b:c,c:o.n(t.food==i.dictLabel?"item active":"item"),d:o.o(r=>n.choseFood(i),c)})),e:o.f(t.actionOptions,(i,c,d)=>({a:o.t(i.dictLabel),b:c,c:o.n(t.action==i.dictLabel?"item active":"item"),d:o.o(r=>n.choseAction(i),c)})),f:o.f(t.indicationOptions,(i,c,d)=>({a:o.t(i.dictLabel),b:c,c:o.n(t.indications==i.dictLabel?"item active":"item"),d:o.o(r=>n.choseIndications(i),c)})),g:o.f(t.dataList,(i,c,d)=>({a:i.imgUrl,b:o.t(i.foodName),c:o.t(i.actionTitle),d:c,e:o.o(r=>n.showDetail(i),c)})),h:o.sr("mescrollRef","345252e8-0"),i:o.o(n.mescrollInit),j:o.o(n.downCallback),k:o.o(n.upCallback),l:o.p({top:"376rpx",down:t.downOption,up:t.upOption})}}var y=o._export_sfc(u,[["render",f],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/medicatedFoodList.vue"]]);wx.createPage(y);
