<!--packageE/notice/notice.wxml-->
<wxs module="util">
  var inOf = function(val, str) { if (val) {return val.indexOf(str) }};
  module.exports.inOf = inOf;
</wxs>
<view class="component-wrapper">

  <view class="notice-box" style="height: {{datas.is_scroll ?'40':datas.search_height}}px;background-color: {{datas.preview_color.color}}; background-image: url('{{datas.preview_color.isColor == 2 ? datas.preview_color.image || emptyImage: null}}');background-size: 100% 100%;background-position: center;background-repeat: no-repeat;font-size: {{datas.font_size}}px;font-weight: {{ util.inOf(datas.text_style,'1') > -1 ? 'bold':''}}; font-style: {{ util.inOf(datas.text_style,'2') > -1 ? 'italic':''}};color: {{datas.font_color}};">
    <view class="icon-box" wx:if="{{datas.is_showIcon}}" style="background-color: {{datas.preview_color.isColor == 2? '#ffffff' : datas.preview_color.color}};height: {{datas.is_scroll ?'34':datas.search_height-6}}px; line-height: {{datas.is_scroll ?'34':datas.search_height-6}}px;">
      <icon wx:if="{{!datas.icon_value || datas.icon_value.isIcon != 2}}" class="i iconfont {{datas.icon_value && datas.icon_value.icon ? datas.icon_value.icon : 'icon-ht_btn_news'}}"></icon>
      <image class="icon-img" wx:if="{{datas.icon_value && datas.icon_value.isIcon == 2}}" src="{{datas.icon_value.image}}" />
    </view>

    <view class="wrap" style="height: {{datas.is_scroll ?'40':datas.search_height}}px; line-height: {{datas.is_scroll ?'40':datas.search_height}}px;" wx:if="{{datas.is_scroll}}" catchtap="goimgurl" data-url="{{datas.notice_link.link}}">
      <van-notice-bar scrollable="{{true}}" background="{{datas.preview_color.isColor == 2? 'url('+datas.preview_color.image+')' : datas.preview_color.color}}" speed="{{datas.scroll_speed || ''}}" color="{{datas.font_color}}" fontSize="{{datas.font_size}}" text="{{datas.search_title|| '请填写内容'}}" />
    </view>

    <view class="scroll-notice" style="height: {{datas.is_scroll ?'40':datas.search_height}}px; line-height: {{datas.is_scroll ?'40':datas.search_height}}px;" wx:if="{{!datas.is_scroll}}" catchtap="goimgurl" data-url="{{datas.notice_link.link}}">
      {{datas.search_title || "请填写内容"}}
    </view>
  </view>

</view>
