index.wxml 2.79 KB
<template name="zan-actionsheet">
  <view class="zan-actionsheet {{ show ? 'zan-actionsheet--show' : '' }}">
    <view
      class="zan-actionsheet__mask"
      catchtap="_handleZanActionsheetMaskClick"
      data-close-on-click-overlay="{{ closeOnClickOverlay }}"
      data-component-id="{{ componentId }}"></view>
    <view class="zan-actionsheet__container">
      <!-- 实际按钮显示 -->
      <button
        wx:if = "{{!isNewShareStyle}}"
        wx:for="{{ actions }}"
        wx:for-index="index"
        wx:for-item="item"
        wx:key="{{ index }}-{{ item.name }}"
        catchtap="_handleZanActionsheetBtnClick"
        data-component-id="{{ componentId }}"
        data-index="{{ index }}"
        open-type="{{ item.openType }}"
        class="zan-btn zan-actionsheet__btn {{ item.loading ? 'zan-btn--loading' : '' }} {{ item.className }}"
      >
        <text>{{ item.name }}</text>
        <text
          wx:if="{{ item.subname }}"
          class="zan-actionsheet__subname">{{ item.subname }}</text>
      </button>

      <!--图标分享按钮-->
      <view wx:if='{{isNewShareStyle}}' class='share_new_container'>
        <!--联盟用户 资源位-->
        <view  class='share_union_soruce_img_container'>
          <image src="{{unionUserImageUrl? unionUserImageUrl:'http://img13.static.yhbimg.com/article/2018/07/05/11/0204b2cb17aebf4ca33557392bb29e0807.jpg'}}" catchtap='_handlerJumpByUrl' class='share_union_soruce_img' mode='aspectFit'></image>
        </view>

        <!--分享的图标及文字容器-->
        <view class='share-icon-container'>
          <block wx:for='{{actions}}' 
            wx:key="{{ index }}-{{ item.name }}" 
            wx:for-index="index"
            wx:for-item="item">
            <view class='share-icon-text-container'>
              <view class='share-image-button'>
                <image src='{{item.image_src}}' style='width:100%;height:100%;'></image>
                <!--使用button是为了使用 open-type属性-->
                <button class='share-btn'
                catchtap="_handleZanActionsheetBtnClick"
                data-component-id="{{ componentId }}"
                data-index="{{ index }}"
                open-type="{{ item.openType }}"></button>
              </view>
              <view class='share-explain-text'>{{item.name}}</view>
            </view>
          </block>
        </view>

        <!-- 分割线 -->
        <view class='divide-line'></view>

      </view>

      <!-- 关闭按钮 -->
      <view
        wx:if="{{ cancelText }}"
        class="zan-actionsheet__footer"
      >
        <button
          class="zan-btn zan-actionsheet__btn"
          catchtap="_handleZanActionsheetCancelBtnClick"
          data-component-id="{{ componentId }}"
        >{{ cancelText }}</button>
      </view>
    </view>
  </view>
</template>