"use strict";var o=require("../common/vendor.js"),t=require("../api/common.js"),i=require("../api/index.js"),e=require("../uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js");require("../common/request.js");const a={mixins:[e.MescrollMixin],data:()=>({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:"已经到底了",empty:{icon:"https://cos.his.cdwjyyh.com/fs/20240423/cf4a86b913a04341bb44e34bb4d37aa2.png",tip:"暂无数据"}},dataList:[]}),onShow(){this.getDictByKey("sys_medicated_food"),this.getDictByKey("sys_medicated_food_action"),this.getDictByKey("sys_indication")},methods:{getDictByKey(o){var i={key:o};t.getDictByKey(i).then((t=>{200==t.code&&("sys_medicated_food"==o&&(this.foodOptions=t.data),"sys_medicated_food_action"==o&&(this.actionOptions=t.data),"sys_indication"==o&&(this.indicationOptions=t.data))}),(o=>{}))},doSearch(){this.mescroll.resetUpScroll()},mescrollInit(o){this.mescroll=o},downCallback(o){o.resetUpScroll()},upCallback(t){var e=this,a={food:this.food,action:this.action,indications:this.indications,keyword:this.keyword,pageNum:t.num,pageSize:t.size};i.getMedicatedFoodList(a).then((i=>{200==i.code?(1==t.num?e.dataList=i.data.list:e.dataList=e.dataList.concat(i.data.list),e.mescroll.endBySize(i.data.list.length,i.data.total)):(o.index.showToast({icon:"none",title:"请求失败"}),e.dataList=null,e.mescroll.endErr())}))},choseAction(o){this.action=o.dictLabel,this.mescroll.resetUpScroll()},choseFood(o){this.food=o.dictLabel,this.mescroll.resetUpScroll()},choseIndications(o){this.indications=o.dictLabel,this.mescroll.resetUpScroll()},showDetail(t){o.index.navigateTo({url:"./medicatedFoodDetails?id="+t.id})}}};if(!Array){o.resolveComponent("mescroll-body")()}Math;var s=o._export_sfc(a,[["render",function(t,i,e,a,s,c){return{a:o.o(((...o)=>c.doSearch&&c.doSearch(...o))),b:s.keyword,c:o.o((o=>s.keyword=o.detail.value)),d:o.f(s.foodOptions,((t,i,e)=>({a:o.t(t.dictLabel),b:i,c:o.n(s.food==t.dictLabel?"item active":"item"),d:o.o((o=>c.choseFood(t)),i)}))),e:o.f(s.actionOptions,((t,i,e)=>({a:o.t(t.dictLabel),b:i,c:o.n(s.action==t.dictLabel?"item active":"item"),d:o.o((o=>c.choseAction(t)),i)}))),f:o.f(s.indicationOptions,((t,i,e)=>({a:o.t(t.dictLabel),b:i,c:o.n(s.indications==t.dictLabel?"item active":"item"),d:o.o((o=>c.choseIndications(t)),i)}))),g:o.f(s.dataList,((t,i,e)=>({a:t.imgUrl,b:o.t(t.foodName),c:o.t(t.actionTitle),d:i,e:o.o((o=>c.showDetail(t)),i)}))),h:o.sr("mescrollRef","345252e8-0"),i:o.o(c.mescrollInit),j:o.o(c.downCallback),k:o.o(c.upCallback),l:o.p({top:"376rpx",down:s.downOption,up:s.upOption})}}]]);wx.createPage(s);
