"use strict";const e=require("../../common/vendor.js"),c=require("../../api/index.js");require("../../utils/request.js");Array||e.resolveComponent("u-navbar")();const p=()=>"../../uni_modules/uview-plus/components/u-navbar/u-navbar.js";Math||(p+m+_)();const m=()=>"../../componets/searchBox.js",_=()=>"../../componets/shops.js",h={__name:"index",setup(r){const t=e.ref(1),o=e.ref(1);e.onShow(()=>{o.value=1,a.recommendList.splice(0),g()});const i=()=>{e.index.navigateTo({url:"/pages/mine/recharge"})};let a=e.reactive({classList:[],specialList:[],recommendList:[]});const l=s=>{e.index.setStorageSync("classId",s.id),e.index.switchTab({url:"/pages/class/class"})},d=()=>e.index.switchTab({url:"/pages/class/class"}),u=()=>e.index.navigateTo({url:"/pages/index/bargainPrice"}),g=async()=>{try{const s=await c.getIndex({page:o.value});a.classList=s.fenlei,a.specialList=s.tjgoods,a.recommendList=a.recommendList.concat(s.goods.data),console.log(a.recommendList,"推荐商品"),console.log("getIndex",s),t.value=s.goods.last_page}catch(s){e.index.showToast({title:s,icon:"none"}),console.log("getIndex",s)}};return e.onReachBottom(()=>{o.value++,!(o.value>=t.value)&&c.getIndex()}),(s,x)=>({a:e.p({bgColor:"transparent"}),b:e.o(i),c:e.f(e.unref(a).classList,(n,f,b)=>({a:n.image,b:e.t(n.name),c:n.id,d:e.o(L=>l(n),n.id)})),d:e.o(d),e:e.o(u),f:e.p({list:e.unref(a).specialList.slice(0,2),shopWidth:322,shopHeight:322,isTejia:!0}),g:e.p({list:e.unref(a).recommendList,shopWidth:344,shopHeight:344,isTejia:!0})})}},v=e._export_sfc(h,[["__file","D:/vue/大健康商城/healthMall/pages/index/index.vue"]]);wx.createPage(v);