"use strict";const e=require("../../../../../common/vendor.js"),t=require("../../../../../sheep/index.js"),o=require("../../../../../sheep/helper/throttle.js"),a=require("../../../../../sheep/hooks/useModal.js");if(!Array){(e.resolveComponent("su-status-bar")+e.resolveComponent("su-fixed"))()}Math||((()=>"../../../../../sheep/ui/su-status-bar/su-status-bar.js")+(()=>"../../../../../sheep/ui/su-fixed/su-fixed.js"))();const l={__name:"detail-navbar",emits:["clickLeft"],setup(l,{emit:s}){const r=t.sheep.$platform.device.statusBarHeight,c=t.sheep.$platform.navbar,u={width:t.sheep.$platform.capsule.width+"px",height:t.sheep.$platform.capsule.height+"px"},i=e.reactive({tabOpacityVal:0,curTab:"goods",tabList:[{label:"商品",value:"goods",to:"detail-swiper-selector"},{label:"评价",value:"comment",to:"detail-comment-selector"},{label:"详情",value:"detail",to:"detail-content-selector"}]}),p=s,n=t.sheep.$router.hasHistory();function b(){n?t.sheep.$router.back():t.sheep.$router.go("/modules/mall/index/index"),p("clickLeft")}function d(){a.showMenuTools()}const h={top:0,bottom:0};return e.onPageScroll((a=>{i.tabOpacityVal=a.scrollTop>t.sheep.$platform.navbar?1:.01*a.scrollTop,0===h.top&&o.throttle((()=>{new Promise(((t,o)=>{e.index.createSelectorQuery().select(".detail-comment-selector").boundingClientRect((e=>{e?(h.top=e.top,h.bottom=e.top+e.height,t(e)):t(null)})).exec()}))}),50),a.scrollTop=h.top-c&&a.scrollTop<=h.bottom-c?i.curTab="comment":i.curTab="detail"})),(t,o)=>e.e({a:e.unref(n)},(e.unref(n),{}),{b:e.o(b),c:e.o(d),d:e.f(i.tabList,((t,o,a)=>({a:e.t(t.label),b:e.n(i.curTab===t.value?"cur-tab-title":""),c:i.curTab===t.value,d:t.value,e:e.o((o=>function(t){let o=0;"comment"===t.value?o=h.top-c+1:"detail"===t.value&&(o=h.bottom-c+1),e.index.pageScrollTo({scrollTop:o,duration:200})}(t)),t.value)}))),e:e.s({opacity:i.tabOpacityVal}),f:e.s(u),g:e.s({height:e.unref(c)-e.unref(r)+"px"}),h:e.p({alway:!0,bgStyles:{background:"#fff"},val:0,noNav:!0,opacity:!0,placeholder:!1})})}},s=e._export_sfc(l,[["__scopeId","data-v-0b0c7ba6"]]);wx.createComponent(s);