hx-navbar.wxml
6.6 KB
<view class="hx-navbar" style="{{'width:'+(screenWidth+'px')+';'}}"><view class="{{['hx-navbar__content',(conf.fixed)?'hx-navbar__fixed':'',(conf.shadow)?'hx-navbar__shadow':'',(conf.border)?'hx-navbar__border':'']}}" style="{{'width:'+(screenWidth+'px')+';'+('background-color:'+(!bgIsLine?backgroundColorRgba:'')+';')+('background-image:'+(bgIsLine?backgroundColorRgba:'')+';')+('height:'+(navbarHeight)+';')+('color:'+(txtColor)+';')}}"><block wx:if="{{backgroundImage}}"><view class="hx-navbar__content__imgctn" style="{{'opacity:'+(bgImgTransparent[1])+';'}}"><image class="hx-navbar__imgctn__img" style="{{'height:'+(conf.height+statusBarHeight+'px')+';'+('width:'+(screenWidth+'px')+';')}}" src="{{backgroundImageEnd}}" mode="scaleToFill"></image></view></block><block wx:if="{{backgroundImage}}"><view class="hx-navbar__content__imgctn" style="{{'opacity:'+(bgImgTransparent[0])+';'}}"><image class="hx-navbar__imgctn__img" style="{{'height:'+(conf.height+statusBarHeight+'px')+';'+('width:'+(screenWidth+'px')+';')}}" src="{{backgroundImage}}" mode="scaleToFill"></image></view></block><block wx:if="{{conf.statusBar}}"><view class="hx-navbar__status" style="{{('height:'+statusBarHeight+'px;'+(statusBarBackground?'background-color:'+statusBarBackground:''))}}"></view></block><view class="hx-navbar__content__main" style="{{'height:'+(conf.height+'px')+';'+('font-size:'+(conf.fontSize)+';')+('max-width:'+('calc(100vw - '+jnWidth+'px - 13px)')+';')}}"><block wx:if="{{conf.back}}"><view data-event-opts="{{[['tap',[['onBack',['$event']]]]]}}" class="hx-navbar__content__main_back" bindtap="__e"><text class="{{['hxicon','hx-navbar__icon',(bgTransparent==0)?'hx-navbar__icontran':'']}}" style="{{'color:'+(txtColor)+';'}}"></text><block wx:if="{{conf.backTxt}}"><text class="hx_font_size" style="{{'color:'+(txtColor)+';'}}">{{conf.backTxt}}</text></block></view></block><block wx:if="{{conf.leftSlot}}"><view class="hx-navbar__content__main_left" style="padding:0;margin:0 13px 0 0;"><block wx:if="{{conf.leftSlotSwitch&&slotSwitchOpacity==0}}"><slot name="leftSwitch"></slot></block><block wx:else><slot name="left"></slot></block></view></block><block wx:if="{{conf.leftButton}}"><view class="hx-navbar__content__main_left" style="{{'padding:'+(conf.back||conf.leftSlot?'0':'0 9px 0 13px;')+';'}}"><block wx:for="{{$root.l0}}" wx:for-item="btn" wx:for-index="index" wx:key="index"><block><view data-event-opts="{{[['tap',[['onClickBtn',['$0'],[[['conf.leftButton','',index]]]]]]]}}" class="{{['hx-navbar__content__main_left_btn',(bgTransparent==0)?'hx-navbar__btntran':'']}}" bindtap="__e"><block wx:if="{{btn.$orig.position&&btn.$orig.position=='left'}}"><text class="{{['hx-navbar__icon',conf.font]}}" style="{{'color:'+(btn.$orig.color?btn.$orig.color:txtColor)+';'+('margin-right:'+(btn.$orig.txt?'2px':'0')+';')}}">{{btn.m0}}</text></block><block wx:if="{{btn.$orig.txt}}"><text class="hx-navbar__content__main_lefticon_txt hx_font_size" style="{{'color:'+(btn.$orig.color?btn.$orig.color:txtColor)+';'}}">{{btn.$orig.txt}}</text></block><block wx:if="{{!btn.$orig.position||btn.$orig.position!='left'}}"><text class="{{['hx-navbar__icon',conf.font]}}" style="{{'color:'+(btn.$orig.color?btn.$orig.color:txtColor)+';'+('margin-left:'+(btn.$orig.txt?'2px':'0')+';')}}">{{btn.m1}}</text></block></view></block></block></view></block><block wx:if="{{!conf.search&&!conf.maxSlot}}"><view class="hx-navbar__content__main_center"><view class="hx-navbar__content__main_center_flex"></view><view class="hx-navbar__content__main_center_txt"><block wx:if="{{!conf.centerSlot&&title}}"><text class="hx_font_size hx_text_overflow" style="{{'color:'+(txtColor)+';'}}">{{title}}</text></block><block wx:if="{{conf.centerSlotSwitch&&slotSwitchOpacity==0}}"><slot name="centerSwitch"></slot></block><block wx:else><slot name="center"></slot></block></view><view class="hx-navbar__content__main_center_flex"></view></view></block><block wx:if="{{!conf.search&&conf.maxSlot}}"><view class="hx-navbar__content__main_center" style="overflow:hidden;"><block wx:if="{{conf.maxSlotSwitch&&slotSwitchOpacity==0}}"><slot name="maxSwitch"></slot></block><block wx:else><slot name="max"></slot></block></view></block><block wx:if="{{conf.search}}"><view data-event-opts="{{[['tap',[['searchClick',['$event']]]]]}}" class="hx-navbar__content__main_search" style="{{'padding-left:'+(conf.leftButton?'9px':'13px')+';'+('padding-right:'+(conf.rightButton?'9px':'13px')+';')}}" bindtap="__e"><text class="hxicon hx-navbar__content__main_search_hxicon" style="color:#dbdbdb;"></text><input class="hx-navbar__content__main_search_input hx_font_size" type="text" placeholder-style="color:#dbdbdb;" confirm-type="search" placeholder="{{conf.search.placeholder?conf.search.placeholder:'请输入搜索内容'}}" disabled="{{conf.search.disabled}}" data-event-opts="{{[['confirm',[['searchConfirm',['$event']]]]]}}" value="{{conf.search.value}}" bindconfirm="__e"/></view></block><block wx:if="{{conf.rightButton}}"><view class="hx-navbar__content__main_right" style="{{'padding:'+(conf.rightSlot?'0':'0 13px 0 9px;')+';'}}"><block wx:for="{{$root.l1}}" wx:for-item="btn" wx:for-index="index" wx:key="index"><block><view data-event-opts="{{[['tap',[['onClickBtn',['$0'],[[['conf.rightButton','',index]]]]]]]}}" class="{{['hx-navbar__content__main_right_btn',(bgTransparent==0)?'hx-navbar__btntran':'']}}" bindtap="__e"><block wx:if="{{btn.$orig.position&&btn.$orig.position=='left'}}"><text class="{{['hxicon','hx-navbar__content__main_right_icon','hx-navbar__icon',conf.font]}}" style="{{'color:'+(btn.$orig.color?btn.$orig.color:'')+';'+('margin-right:'+(btn.$orig.txt?'2px':'0')+';')}}">{{btn.m2}}</text></block><block wx:if="{{btn.$orig.txt}}"><text class="hx-navbar__content__main_right_txt hx_font_size" style="{{'color:'+(btn.$orig.color?btn.$orig.color:txtColor)+';'}}">{{btn.$orig.txt}}</text></block><block wx:if="{{!btn.$orig.position||btn.$orig.position!='left'}}"><text class="{{['hxicon','hx-navbar__content__main_right_icon','hx-navbar__icon',conf.font]}}" style="{{'color:'+(btn.$orig.color?btn.$orig.color:'')+';'+('margin-left:'+(btn.$orig.txt?'2px':'0')+';')}}">{{btn.m3}}</text></block></view></block></block></view></block><block wx:if="{{conf.rightSlot}}"><view class="hx-navbar__content__main_right" style="padding:0;margin:0;"><block wx:if="{{conf.rightSlotSwitch&&slotSwitchOpacity==0}}"><slot name="rightSwitch"></slot></block><block wx:else><slot name="right"></slot></block></view></block></view></view><block wx:if="{{conf.barPlaceholder&&conf.fixed}}"><view><block wx:if="{{conf.statusBar}}"><view style="{{'height:'+(statusBarHeight+'px')+';'}}"></view></block><view style="{{'height:'+(conf.height+'px')+';'}}"></view></view></block></view>