"use strict";var e=require("../common/vendor.js"),d=require("../api/common.js"),h=require("../api/index.js");require("../common/request.js");const u={data(){return{tabIndex:1,indication:"",flavor:"",vessel:"",title:"",pageNum:1,pageSize:20,flavorOptions:[],indicationOptions:[],tabs:[{name:"\u6309\u4E94\u5473",id:"1"},{name:"\u6309\u75BE\u75C5",id:"2"}],keyword:"",dataList:[]}},onLoad(){this.getDictByKey("sys_chinese_medicine_flavor"),this.getDictByKey("sys_indication"),this.getChineseMedicineList()},methods:{scrolltolower(i){this.pageNum++,this.getChineseMedicineList(),console.log(i)},indicationClick(i){this.flavor="",this.indication=i.dictLabel,this.title=i.dictLabel,this.pageNum=1,this.getChineseMedicineList()},flavorClick(i){console.log(i),this.indication="",this.flavor=i.dictLabel,this.title=i.dictLabel,this.pageNum=1,this.getChineseMedicineList()},getDictByKey(i){var o={key:i};d.getDictByKey(o).then(a=>{a.code==200&&(i=="sys_indication"&&(this.indicationOptions=a.data),i=="sys_chinese_medicine_flavor"&&(this.flavorOptions=a.data))},a=>{})},tabChange(i){this.tabIndex=i.id,this.getChineseMedicineList()},doSearch(){this.pageNum=1,this.getChineseMedicineList()},getChineseMedicineList(){var i=this,o={indication:this.indication,flavor:this.flavor,vessel:this.vessel,keyword:this.keyword,pageNum:this.pageNum,pageSize:this.pageSize};h.getChineseMedicineList(o).then(a=>{a.code==200?this.pageNum==1?i.dataList=a.data.list:i.dataList=i.dataList.concat(a.data.list):(e.index.showToast({icon:"none",title:"\u8BF7\u6C42\u5931\u8D25"}),i.dataList=[])})},showDetail(i){e.index.navigateTo({url:"./chineseMedicineDetails?id="+i.id})}}};Array||e.resolveComponent("u-tabs")();const v=()=>"../uni_modules/uview-plus/components/u-tabs/u-tabs.js";Math||v();function g(i,o,a,_,s,n){return e.e({a:e.o((...t)=>n.doSearch&&n.doSearch(...t)),b:s.keyword,c:e.o(t=>s.keyword=t.detail.value),d:e.o(n.tabChange),e:e.p({scrollable:!1,list:s.tabs,lineColor:"#C39A58"}),f:s.tabIndex==1},s.tabIndex==1?{g:e.f(s.flavorOptions,(t,c,l)=>e.e({a:t.dictValue==s.flavor},t.dictValue==s.flavor?{}:{},{b:e.t(i.$parseText(t.dictLabel,4)),c:e.o(r=>n.flavorClick(t)),d:e.n(t.dictValue==s.flavor?"item ellipsis active":"item ellipsis")}))}:{},{h:s.tabIndex==2},s.tabIndex==2?{i:e.f(s.indicationOptions,(t,c,l)=>e.e({a:t.dictLabel==s.indication},t.dictLabel==s.indication?{}:{},{b:e.t(i.$parseText(t.dictLabel,4)),c:e.o(r=>n.indicationClick(t)),d:e.n(t.dictLabel==s.indication?"item ellipsis active":"item ellipsis")}))}:{},{j:e.t(s.title),k:e.f(s.dataList,(t,c,l)=>({a:e.t(t.medicineName),b:e.o(r=>n.showDetail(t))})),l:e.o((...t)=>n.scrolltolower&&n.scrolltolower(...t))})}var f=e._export_sfc(u,[["render",g],["__file","E:/Project/2023/\u95EE\u8BCA\u5E73\u53F0/his_user_miniapp/pages_index/chineseMedicineList.vue"]]);wx.createPage(f);
