acdr-ui/dist/build/mp-weixin/sheep/components/s-custom-navbar/s-custom-navbar.js

2 lines
1.8 KiB
JavaScript

"use strict";const e=require("../../../common/vendor.js"),t=require("../../index.js"),a=require("../../hooks/useModal.js");Math||(s+o)();const o=()=>"./components/navbar.js",s=()=>"./components/navbar-item.js",d={__name:"s-custom-navbar",props:{data:{type:Object,default:()=>({})},showLeftButton:{type:Boolean,default:!1}},setup(o){const s=o,d=t.sheep.$router.hasHistory(),n=e.computed((()=>("inner"!==s.data.styleType||!s.data.alwaysShow)&&("normal"!==s.data.styleType&&void 0))),r=e.computed((()=>s.data.mapCells||[])),l=t.sheep.$platform.device.windowWidth,u=e.computed((()=>{if(e.unref(r).length){let a=(l-90)/8;return a=(l-80-e.unref(t.sheep.$platform.capsule).width)/6,a}})),p=e=>({width:e.width*u.value+10*(e.width-1)+"px",left:e.left*u.value+10*(e.left+1)+"px","border-radius":e.borderRadius+"px"}),c=e.computed((()=>"inner"!==s.data.styleType||Boolean(s.data.alwaysShow))),i=e.computed((()=>"normal"!==s.data.styleType&&(!s.showLeftButton&&"inner"===s.data.styleType))),h=e.computed((()=>"normal"===s.data.styleType)),m=e.computed((()=>({background:"img"===s.data.bgType&&s.data.bgImg?`url(${t.sheep.$url.cdn(s.data.bgImg)}) no-repeat top center / 100% 100%`:s.data.bgColor})));function y(){d?t.sheep.$router.back():t.sheep.$router.go("/modules/mall/index/index")}function f(){a.showMenuTools()}return(t,a)=>e.e({a:o.showLeftButton},o.showLeftButton?e.e({b:e.unref(d)},(e.unref(d),{}),{c:e.o(y),d:e.o(f),e:"inner"===o.data.styleType?1:""}):{},{f:e.f(r.value,((t,a,o)=>({a:"d3b0c003-1-"+o+",d3b0c003-0",b:e.p({data:t,width:p(t).width}),c:a,d:e.s(p(t)),e:e.n({"ss-flex ss-col-center ss-row-center":"search"!==t.type})}))),g:e.p({alway:c.value,back:!1,bg:"",placeholder:h.value,bgStyles:m.value,opacity:i.value,sticky:n.value})})}},n=e._export_sfc(d,[["__scopeId","data-v-d3b0c003"]]);wx.createComponent(n);