"use strict";const e=require("../../common/vendor.js"),o=require("../../common/assets.js"),a=require("../../api/api.js"),r=require("../../hooks/useNav.js");if(!Array){(e.resolveComponent("search")+e.resolveComponent("up-swiper")+e.resolveComponent("orderList")+e.resolveComponent("z-paging")+e.resolveComponent("cc-myTabbar"))()}Math||((()=>"../../components/search/search.js")+(()=>"../../uni_modules/uview-plus/components/u-swiper/u-swiper.js")+(()=>"../../components/orderList/orderList.js")+(()=>"../../uni_modules/z-paging/components/z-paging/z-paging.js")+(()=>"../../uni_modules/cc-myTabbar/components/cc-myTabbar/cc-myTabbar.js"))();const n={__name:"home",setup(n){const{nav:t,navTo:s}=r.useNav(),l=e.ref([]),i=e.ref(null),c=e.reactive({lon:"",lat:"",orderByType:1,keyWord:""}),u=e.ref([]);e.onLoad((async()=>{let e=await a.bannerList();u.value=e})),e.onShow((()=>{e.index.hideTabBar()}));let d=o=>{e.index.makePhoneCall({phoneNumber:"4008005326"})};const p=async()=>{e.index.showLoading({title:"加载中..."});try{if(!c.lon&&!c.lat){const{longitude:o,latitude:a}=await e.index.getLocation();c.lon=o,c.lat=a}}catch(o){console.log(o)}console.log(c),a.aroundAreaApi(c).then((o=>{console.log(o,"list"),i.value.complete(o),e.index.hideLoading()})).catch((o=>{i.value.complete(!1),e.index.hideLoading()}))};let m=e=>{c.orderByType=e,i.value.reload()},v=()=>!i.value;e.onPullDownRefresh((()=>{v()||i.value.reload().catch((()=>{}))})),e.onPageScroll((e=>{v()||(i.value.updatePageScrollTop(e.scrollTop),e.scrollTop<10&&i.value.doChatRecordLoadMore())})),e.onReachBottom((()=>{v()||i.value.pageReachBottom()}));const g=()=>{e.index.switchTab({url:"/pages/order/order"})};let h=e=>{c.keyWord=e,i.value.reload()},_=()=>{e.index.showModal({title:"提示",content:"暂未开放",showCancel:!1,confirmText:"确认",success:()=>{}})};return(a,r)=>({a:e.o(e.unref(h)),b:e.p({list:u.value,height:"150rpx",keyName:"imageUrl",indicator:!0}),c:o._imports_0,d:e.o(g),e:o._imports_1,f:e.o(((...o)=>e.unref(_)&&e.unref(_)(...o))),g:o._imports_2,h:e.o((o=>e.unref(s)("/pageMake/invoice/invoice"))),i:o._imports_3,j:e.o(((...o)=>e.unref(d)&&e.unref(d)(...o))),k:e.n(1==c.orderByType?"order_list_active":""),l:e.o((o=>e.unref(m)(1))),m:e.n(2==c.orderByType?"order_list_active":""),n:e.o((o=>e.unref(m)(2))),o:e.f(l.value,((o,a,r)=>({a:"c14d5158-3-"+r+",c14d5158-2",b:e.p({toNav:!0,info:o}),c:a}))),p:e.sr(i,"c14d5158-2",{k:"paging"}),q:e.o(p),r:e.o((e=>l.value=e)),s:e.p({"use-page-scroll":!0,modelValue:l.value}),t:e.p({tabBarShow:0})})}},t=e._export_sfc(n,[["__scopeId","data-v-c14d5158"]]);n.__runtimeHooks=1,wx.createPage(t);
