You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 lines
3.4 KiB

"use strict";const e=require("../../../common/vendor.js"),r=require("../../index.js");require("../../url/index.js");require("../../store/index.js");require("../../store/app.js");require("../../platform/index.js");require("../../platform/provider/wechat/index.js");require("../../platform/provider/wechat/miniProgram.js");require("../../api/member/auth.js");require("../../request/index.js");require("../../config/index.js");require("../../helper/index.js");require("../../helper/test.js");require("../../helper/digit.js");require("../../api/member/social.js");require("../../api/member/user.js");require("../../platform/provider/apple/index.js");require("../../platform/share.js");require("../../router/index.js");require("../../hooks/useModal.js");require("../../helper/throttle.js");require("../../platform/pay.js");require("../../api/pay/order.js");require("../../store/user.js");require("../../store/cart.js");require("../../api/trade/cart.js");require("../../api/pay/wallet.js");require("../../api/trade/order.js");require("../../store/sys.js");require("../../store/modal.js");require("../../config/zIndex.js");const m={__name:"su-fixed",props:{noNav:{type:Boolean,default:!1},bottom:{type:Boolean,default:!1},bg:{type:String,default:""},bgStyles:{type:Object,default(){}},val:{type:Number,default:0},width:{type:[String,Number],default:0},alway:{type:Boolean,default:!0},opacity:{type:Boolean,default:!1},index:{type:[Number,String],default:0},placeholder:{type:[Boolean],default:!1},sticky:{type:[Boolean],default:!1},noFixed:{type:Boolean,default:!1},ui:{type:String,default:""},clickTo:{type:Boolean,default:!1},isInset:{type:Boolean,default:!0}},setup(t){const{safeAreaInsets:a}=r.sheep.$platform.device,f=e.getCurrentInstance(),l=r.sheep.$helper.guid(),c=r.sheep.$platform.navbar,n=e.reactive({content:{},fixed:!0,scrollTop:0,opacityVal:0}),d=e.computed(()=>n.fixed&&i.bottom?i.isInset?i.val+"px":i.val+a.bottom+"px":"auto"),i=t;n.fixed=!e.unref(i.sticky),e.onPageScroll(o=>{let u=o.scrollTop;n.scrollTop=u,n.opacityVal=u>r.sheep.$platform.navbar?1:u*.01}),e.onMounted(()=>{e.nextTick$1(()=>{s()})});const s=()=>{e.index.createSelectorQuery().in(f).select(`#fixed-${l}`).boundingClientRect(o=>{o!=null&&(n.content=o,e.unref(i.sticky)&&x(n.scrollTop))}).exec()},x=o=>{e.unref(i.bottom)?n.fixed=o>=n.content.bottom-r.sheep.$platform.device.windowHeight+n.content.height+e.unref(i.val):n.fixed=o>=n.content.top-(e.unref(i.noNav)?e.unref(i.val):e.unref(i.val)+r.sheep.$platform.navbar)},y=()=>{i.hasToTop&&e.index.pageScrollTo({scrollTop:n.content.top,duration:100})};return(o,u)=>e.e({a:e.unref(a).bottom&&t.bottom&&t.isInset},e.unref(a).bottom&&t.bottom&&t.isInset?{b:e.s({height:e.unref(a).bottom+"px"})}:{},{c:e.o(y),d:e.s({zIndex:t.index+e.unref(r.sheep).$zIndex.navbar}),e:t.bottom},t.bottom?{f:e.n(t.bg)}:{},{g:e.n(t.ui),h:e.n(t.bg),i:e.s({zIndex:t.index+e.unref(r.sheep).$zIndex.navbar-1}),j:e.s(t.bgStyles),k:e.s(t.opacity?{opacity:n.opacityVal}:""),l:`fixed-${e.unref(l)}`,m:e.n({fixed:n.fixed}),n:e.s({left:t.sticky?"auto":"0px",top:n.fixed&&!t.bottom?(t.noNav?t.val:t.val+e.unref(c))+"px":"auto",bottom:d.value,zIndex:t.index+e.unref(r.sheep).$zIndex.navbar}),o:e.s(t.alway?"":{opacity:n.opacityVal}),p:(t.sticky||t.placeholder)&&n.fixed},(t.sticky||t.placeholder)&&n.fixed?{q:e.s({height:n.content.height+"px",width:t.width+"px"})}:{})}},q=e._export_sfc(m,[["__file","D:/xiangmu/佰安出行/app/s-applet/sheep/ui/su-fixed/su-fixed.vue"]]);wx.createComponent(q);