import{P as t,s as e,p as l,q as a,aX as o,d as s,aO as n,u as i,H as r,Z as c,r as d,K as u,f as p,b as y,c as f,w as m,e as g,n as x,A as _,i as k,y as v,z as h,L as S,a as b,_ as w,am as C,aL as B,l as I,Q as A,D as T,R as V,aN as z}from"./index-83368bfa.js";import{m as R}from"./manifest.3da9c2c5.js";import{_ as j}from"./_plugin-vue_export-helper.1b428a4d.js";function q(s){const n=t();let i=s;1!=n.mapConfig.is_open&&(i=!1);const r=()=>{if(!i)return!1;uni.getStorageSync("manually_select_location_from_map")||l()&&n.mapConfig.is_open&&!uni.getStorageSync("location_address")&&a.init((()=>{a.getLocation((t=>{let e=t.latitude+","+t.longitude;c(e)}))}))},c=(t="")=>{if(!i)return!1;let e={latlng:""};e.latlng=t||n.diyAddressInfo.latitude+","+n.diyAddressInfo.longitude,o(e).then((t=>{if(t.data&&Object.keys(t.data).length){let l={},a=e.latlng.split(",");l.latitude=a[0],l.longitude=a[1],l.full_address=null!=t.data.province?t.data.province:"",l.full_address+=null!=t.data.city?t.data.city:"",l.full_address+=null!=t.data.district?t.data.district:"",l.full_address+=null!=t.data.community?t.data.community:"",l.province_id=t.data.province_id,l.province=t.data.province,l.city_id=t.data.city_id,l.city=t.data.city,l.district_id=t.data.district_id,l.district=t.data.district,l.community=t.data.community,l.formatted_addresses=t.data.formatted_addresses,n.setAddressInfo(l)}else n.setAddressInfo();setTimeout((()=>{uni.removeStorageSync("manually_select_location_from_map")}),500)}))},d=()=>{let t=uni.getStorageSync("location_address");if(t){var e=new Date;n.mapConfig.valid_time>0?t.is_expired=e.getTime()/1e3>t.valid_time:t.is_expired=!1}else t={is_expired:!1};return t};return{init:r,onLoad:(t="")=>{e((e=>{e&&e.latng&&c(e.latng),uni.removeStorageSync("manually_select_location_from_map"),"function"==typeof t&&t(e)}))},refresh:()=>{if(!i)return!1;!uni.getStorageSync("manually_select_location_from_map")&&uni.getStorageSync("location_address")&&(d()&&!d().is_expired?n.setAddressInfo(uni.getStorageSync("location_address")):uni.removeStorageSync("location_address")),!uni.getStorageSync("manually_select_location_from_map")&&d()&&d().is_expired&&r()},reposition:()=>{if(!i)return!1;n.diyAddressInfo&&n.diyAddressInfo.latitude,n.diyAddressInfo&&n.diyAddressInfo.longitude,uni.setStorageSync("manually_select_location_from_map",!0);let t=location.origin+location.pathname;window.location.href="https://apis.map.qq.com/tools/locpicker?search=1&type=0&backurl="+encodeURIComponent(t)+"&key="+R.h5.sdkConfigs.maps.qqmap.key+"&referer=myapp"}}}const F=j(s({__name:"top-tabbar",props:{data:{type:Object,default:{}},titleColor:{type:String,default:"#606266"},customBack:{type:Function,default:null},scrollBool:{type:[String,Number],default:-1},isBack:{type:Boolean,default:!0},isFill:{type:Boolean,default:!0}},setup(e,{expose:l}){const a=e;n().platform;const o=t(),s=i(),R=r((()=>{let t=!0;return t=!Z.value&&a.isFill,t})),j=r((()=>a.data)),F=r((()=>{if(a.data&&a.data.topStatusBar)return a.data.topStatusBar})),L=r((()=>{let t="";return a.isBack?(t+="padding-left: 30rpx;","style-1"==F.value.style&&(t+="padding-right:80rpx;")):("style-1"==F.value.style&&(t+="padding-right: 30rpx;"),t+="padding-left: 30rpx;"),t})),$=r((()=>{let t="";return t+="font-size: 28rpx;",t+=`color: ${G.value};`,"style-1"==F.value.style&&(t+=`text-align: ${F.value.textAlign};`),t})),G=r((()=>{let t="";return t=1==a.scrollBool?F.value.rollTextColor:F.value.textColor,t})),H=r((()=>{let t="";return t=1==a.scrollBool?F.value.rollBgColor:F.value.bgColor,t}));let O=uni.getStorageSync("componentsScrollValGroup");if(O)O.TopTabbar=0,uni.setStorageSync("componentsScrollValGroup",O);else{let t={TopTabbar:0};uni.setStorageSync("componentsScrollValGroup",t)}let P=c();const U=()=>{1===P.length?"app/pages/auth/index"===P[0].route?uni.getStorage({key:"loginBack",success:t=>{b(t?{...t.data,mode:"redirectTo"}:{url:"/app/pages/index/index",mode:"switchTab"})},fail:t=>{b({url:"/app/pages/index/index",mode:"switchTab"})}}):"function"==typeof a.customBack?a.customBack():b({url:"/app/pages/index/index",mode:"switchTab"}):"function"==typeof a.customBack?a.customBack():w()},D=r((()=>`calc(100vw - ${o.menuButtonInfo.right}px + ${o.menuButtonInfo.width}px + 10px)`)),N=d(0),K=z();let Q=!1;F.value&&"style-4"==F.value.style&&(Q=!0);const X=q(Q);X.onLoad(),X.init();let Z=d(!1);u((()=>{C((()=>{B().in(K).select(".ns-navbar-wrap .u-navbar .content-wrap").boundingClientRect((t=>{N.value=t?t.height:0,s.topTabarHeight=N.value})).exec()})),X.refresh(),Z.value=uni.getStorageSync("imageAdsSameScreen")||!1}));return l({refresh:()=>{X.refresh()}}),(t,l)=>{const n=I,i=A,r=T;return"decorate"!=p(s).mode&&p(F)?(y(),f(n,{key:0,class:_(["ns-navbar-wrap",p(F).style])},{default:m((()=>[g(n,{class:_(["u-navbar",{fixed:-1!=a.scrollBool,absolute:-1==a.scrollBool}]),style:x({backgroundColor:p(H)})},{default:m((()=>[g(n,{class:"navbar-inner",style:x({width:"100%",height:N.value+"px"})},{default:m((()=>["style-1"==p(F).style?(y(),f(n,{key:0,class:_(["content-wrap",[p(F).textAlign]]),style:x(p(L))},{default:m((()=>[e.isBack?(y(),f(n,{key:0,class:"back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx",style:x({color:p(G)}),onClick:U},null,8,["style"])):k("v-if",!0),g(n,{class:"title-wrap",style:x(p($))},{default:m((()=>[v(h(p(j).title),1)])),_:1},8,["style"])])),_:1},8,["class","style"])):k("v-if",!0),"style-2"==p(F).style?(y(),f(n,{key:1,class:"content-wrap",style:x(p(L)),onClick:l[0]||(l[0]=t=>p(s).toRedirect(p(F).link))},{default:m((()=>[e.isBack?(y(),f(n,{key:0,class:"back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx",style:x({color:p(G)}),onClick:U},null,8,["style"])):k("v-if",!0),g(n,{class:"title-wrap",style:x({color:p(F).textColor})},{default:m((()=>[g(n,null,{default:m((()=>[g(i,{src:p(V)(p(F).imgUrl),mode:"heightFix"},null,8,["src"])])),_:1}),g(n,{style:x({color:p(F).textColor})},{default:m((()=>[v(h(p(j).title),1)])),_:1},8,["style"])])),_:1},8,["style"])])),_:1},8,["style"])):k("v-if",!0),"style-3"==p(F).style?(y(),f(n,{key:2,style:x(p(L)),class:"content-wrap"},{default:m((()=>[e.isBack?(y(),f(n,{key:0,class:"back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx",style:x({color:p(G)}),onClick:U},null,8,["style"])):k("v-if",!0),g(n,{class:"title-wrap",onClick:l[1]||(l[1]=t=>p(s).toRedirect(p(F).link))},{default:m((()=>[g(i,{src:p(V)(p(F).imgUrl),mode:"heightFix"},null,8,["src"])])),_:1}),g(n,{class:"search",onClick:l[2]||(l[2]=t=>p(s).toRedirect(p(F).link)),style:x({height:p(o).menuButtonInfo.height-2+"px",lineHeight:p(o).menuButtonInfo.height-2+"px"})},{default:m((()=>[g(r,{class:"nc-iconfont nc-icon-sousuo-duanV6xx1 text-[24rpx] absolute left-[20rpx]"}),g(r,{class:"text-[24rpx]"},{default:m((()=>[v(h(p(F).inputPlaceholder),1)])),_:1})])),_:1},8,["style"]),g(n,{style:x({width:p(D)})},null,8,["style"])])),_:1},8,["style"])):k("v-if",!0),"style-4"==p(F).style?(y(),f(n,{key:3,style:x(p(L)),class:"content-wrap"},{default:m((()=>[e.isBack?(y(),f(n,{key:0,class:"back-wrap -ml-[16rpx] text-[26px] nc-iconfont nc-icon-zuoV6xx",style:x({color:p(G)}),onClick:U},null,8,["style"])):k("v-if",!0),g(r,{class:"nc-iconfont nc-icon-dizhiguanliV6xx text-[28rpx]",style:x({color:p(F).textColor})},null,8,["style"]),p(o).diyAddressInfo?(y(),f(n,{key:1,class:"title-wrap",onClick:l[3]||(l[3]=S((t=>p(X).reposition()),["stop"])),style:x({color:p(F).textColor})},{default:m((()=>[v(h(p(o).diyAddressInfo.city),1)])),_:1},8,["style"])):(y(),f(n,{key:2,class:"title-wrap",onClick:l[4]||(l[4]=S((t=>p(X).reposition()),["stop"])),style:x({color:p(F).textColor})},{default:m((()=>[v(h(p(o).defaultPositionAddress),1)])),_:1},8,["style"])),g(r,{class:"nc-iconfont nc-icon-youV6xx text-[26rpx]",onClick:l[5]||(l[5]=S((t=>p(X).reposition()),["stop"])),style:x({color:p(F).textColor})},null,8,["style"])])),_:1},8,["style"])):k("v-if",!0)])),_:1},8,["style"])])),_:1},8,["class","style"]),k(" 解决fixed定位后导航栏塌陷的问题 "),p(R)?(y(),f(n,{key:0,class:"u-navbar-placeholder",style:x({width:"100%",paddingTop:N.value+"px"})},null,8,["style"])):k("v-if",!0)])),_:1},8,["class"])):k("v-if",!0)}}}),[["__scopeId","data-v-7874c2c3"]]);export{F as _,q as u};