"use strict";const e=require("../../../common/vendor.js"),t=require("../../index.js"),r=require("../../hooks/useModal.js");if(require("../../url/index.js"),require("../../store/index.js"),require("../../store/app.js"),require("../../api/promotion/diy.js"),require("../../request/index.js"),require("../../config/index.js"),require("../../platform/index.js"),require("../../platform/provider/wechat/index.js"),require("../../platform/provider/wechat/miniProgram.js"),require("../../api/member/auth.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("../../helper/throttle.js"),require("../../platform/pay.js"),require("../../helper/index.js"),require("../../helper/test.js"),require("../../helper/digit.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("../../api/promotion/coupon.js"),require("../../store/sys.js"),require("../../store/modal.js"),require("../../config/zIndex.js"),require("../../api/member/signin.js"),!Array){(e.resolveComponent("su-status-bar")+e.resolveComponent("uni-search-bar"))()}Math||((()=>"../su-status-bar/su-status-bar.js")+(()=>"../../../uni_modules/uni-search-bar/components/uni-search-bar/uni-search-bar.js"))();const i={__name:"su-navbar",props:{dark:{type:Boolean,default:!1},modelValue:{type:String,default:""},title:{type:String,default:""},titleAlign:{type:String,default:"center"},rightText:{type:String,default:""},leftIcon:{type:String,default:"left"},rightIcon:{type:String,default:""},fixed:{type:[Boolean,String],default:!0},placeholder:{type:[Boolean,String],default:!0},color:{type:String,default:""},backgroundColor:{type:String,default:""},opacity:{type:[Boolean,String],default:!1},opacityBgUi:{type:String,default:"bg-white"},statusBar:{type:[Boolean,String],default:!1},shadow:{type:[Boolean,String],default:!1},border:{type:[Boolean,String],default:!1},height:{type:[Number,String],default:44},leftWidth:{type:[Number,String],default:80},rightWidth:{type:[Number,String],default:0},tools:{type:String,default:"title"},defaultSearch:{type:String,default:""}},emits:["clickLeft","clickRight","clickTitle","search"],setup(i,{emit:o}){const a=e=>"number"==typeof e?e+"px":e,l=o,u=i;e.computed((()=>({width:t.sheep.$platform.capsule.width+"px",height:t.sheep.$platform.capsule.height+"px",margin:"0 "+(t.sheep.$platform.device.windowWidth-t.sheep.$platform.capsule.right)+"px"})));const n=e.computed((()=>u.defaultSearch));e.computed((()=>u.dark?u.backgroundColor?u.backgroundColor:u.dark?"#333":"#FFF":u.backgroundColor||"#FFF"));const s=e.computed((()=>u.dark?u.color?u.color:u.dark?"#fff":"#333":u.color||"#333")),p=e.computed((()=>a(u.height))),d=e.computed((()=>a(u.leftWidth)));function c(e){l("search",e.value)}e.computed((()=>a(u.rightWidth))),e.onLoad((()=>{e.index.report&&""!==u.title&&e.index.report("title",u.title)}));const f=t.sheep.$router.hasHistory();function h(){f?t.sheep.$router.back():t.sheep.$router.go("/pages/index/index"),l("clickLeft")}function g(){l("clickTitle")}return(o,a)=>e.e({a:e.n(i.opacity?"":i.opacityBgUi),b:i.statusBar},(i.statusBar,{}),{c:i.leftIcon.length>0},i.leftIcon.length>0?e.e({d:e.unref(f)},(e.unref(f),{}),{e:e.o(h),f:e.o(((...t)=>e.unref(r.showMenuTools)&&e.unref(r.showMenuTools)(...t)))}):{},{g:"left"===i.titleAlign&&i.title.length&&"WechatOfficialAccount"!==e.unref(t.sheep).$platform.name},"left"===i.titleAlign&&i.title.length&&"WechatOfficialAccount"!==e.unref(t.sheep).$platform.name?{h:e.t(i.title),i:s.value,j:!i.leftIcon.length>0?1:""}:{},{k:d.value,l:"search"===i.tools},"search"===i.tools?{m:e.o(c),n:e.o((e=>n.value=e)),o:e.p({radius:20,placeholder:"请输入关键词",cancelButton:"none",modelValue:n.value})}:e.e({p:"title"===i.tools&&"center"===i.titleAlign&&i.title.length},"title"===i.tools&&"center"===i.titleAlign&&i.title.length?{q:e.t(i.title),r:s.value}:{},{s:e.o(g)}),{t:s.value,v:p.value,w:i.backgroundColor,x:i.fixed?1:"",y:i.shadow?1:"",z:i.border?1:"",A:i.placeholder},i.placeholder?e.e({B:i.statusBar},(i.statusBar,{}),{C:p.value}):{},{D:i.dark?1:""})}},o=e._export_sfc(i,[["__scopeId","data-v-1402f880"]]);wx.createComponent(o);
