<wxs module="filter" src="c_filter.wxs"></wxs>
<wxs module="filter_s" src="../../../utils/filter.wxs"></wxs>
<view class="page" bindtap="close" style="background-color:#{{bg_color ? bg_color:'d01119'}};">
  <!-- 背景图片 -->
  <image wx:if="{{!(imageUrl)}}" class="lumi" src="{{iurl+'miniapp/images/friendhelp/lumi.png'}}" lazy-load="true"></image>
	
  <view class="zindex" style="color:#{{font_color ? font_color:'black'}};background-color:#{{bg_color ? bg_color:'d01119'}};">
    <view class="top">
			<!-- 上传主图的情况 -->
			<view wx:if="{{imageUrl}}" style="height: 100%;">
				<image src="https://mshopimg.yolipai.net{{imageUrl}}" lazy-load="true" class="bg-img"></image>
			</view>
			<!-- 没有上传主图的情况 -->
			<block wx:else>
				<view class="flex-center">
				  <image class="getgift" src="{{iurl+'miniapp/images/friendhelp/getgift.png'}}" lazy-load="true"></image>
				</view>
				<view class="flex-center fs32">
				  <view class="excitation" style="color:{{font_color ? ('#'+font_color):'white'}};">机会总是留给最有行动力的人</view>
				</view>
				<view class="flex-center">
				  <image class="gift" src="{{(zl_act.imageUrl=='' || zl_act.imageUrl==undefined)?(iurl+'miniapp/images/friendhelp/gift.png'):(iurl+zl_act.imageUrl)}}" lazy-load="true"></image>
				</view>
				<view wx:if="{{zl_act.beginDate && zl_act.endDate}}" class="flex-center fs26 time">
				  <view style="color:{{font_color ? ('#'+font_color):'white'}};">活动时间：{{filter_s.format_time(zl_act.beginDate,0)}} 至 {{filter_s.format_time(zl_act.endDate,0)}}</view>
				</view>
			</block>
     
      <view class="flex-center btn-get" bindtap="go_task">
        <view class="flex-center take" style="color:{{font_color?('#'+font_color):'white'}};background-color: #{{btn_color? btn_color:'FDC107'}};">
          <view>立即领取</view>
        </view>
      </view>
    </view>
		
		

    <!-- 任务及说明栏 -->
    <view class="task-container">
      <!-- 标题 -->
      <view class="flex-vertical-between fs28 padding head"
			 style="color:{{font_color ? ('#'+font_color):'white'}};border-color:{{btn_color ? ('#'+btn_color):'#FDC107'}};">
        <!-- task -->
        <view class="flex-center lhead"
				style="background-color:{{switch_head==0?(btn_color ? ('#'+btn_color):'#FDC107'):'transparent'}};border-color:{{btn_color ? ('#'+btn_color):'#FDC107'}};"
				bindtap="switch_head" data-index="{{0}}">
          <image class="explain" src="{{iurl+'miniapp/images/friendhelp/task.png'}}" lazy-load="true"></image>
          <view>我的任务</view>
        </view>
        <view class="flex-center lhead"
				 style="background-color:{{switch_head==1?(btn_color ? ('#'+btn_color):'#FDC107'):'transparent'}};border-color:{{btn_color ? ('#'+btn_color):'#FDC107'}};"
				 bindtap="switch_head" data-index="{{1}}">
          <image class="explain" src="{{iurl+'miniapp/images/friendhelp/explain.png'}}" lazy-load="true"></image>
          <view>活动说明</view>
        </view>
      </view>

      <!-- 我的任务 -->
      <view wx:if="{{switch_head==0}}" class="task-content">
        <view class="items" style="color:{{font_color ? ('#'+font_color):'white'}};">
          <view class="tesk_list">
            <view class="item fs26 flex-vertical-between padding" wx:for="{{zl_user_list}}">
              <view class="flex-center width">
                <view class="ellipsis-1">{{item.helpTaskName}}</view>
              </view>

              <!-- 已完成的颜色nostate -->
              <view class="flex-center width state" wx:if="{{item.status==1}}">
                <view class="ellipsis-1" bindtap="get_libao" data-help_id="{{item.helpFormId}}" data-taskId="{{item.helpTaskId}}" data-id="{{item.id}}">领取礼包</view>
              </view>
              <view class="flex-center width state" wx:if="{{item.status==0}}" data-taskId="{{item.helpTaskId}}" bindtap="go_to_task">
                <view class="ellipsis-1">{{item.zlHelpNum}}/{{item.helpNum}}</view>
              </view>
              <view class="flex-center width " wx:if="{{item.status==3}}">
                <view class="ellipsis-1">已失效</view>
              </view>
              <view class="flex-center width state" wx:if="{{item.status==2}}">
                <view class="ellipsis-1" bindtap="select_libao" data-orderSn="{{item.orderSn}}">查看礼包</view>
              </view>

            </view>
          </view>
          <!-- 加载更多 -->
          <block wx:if="{{is_show_more==0}}">
            <view class="fs28 flex-center">
              <view class="line"></view>
              <view class="load" bindtap="get_list">点击加载更多</view>
              <view class="line"></view>
            </view>
          </block>
        </view>


        <view class="fs30" style="margin-top: 30rpx;">
          <view class="flex-center nothing" wx:if="{{is_load && zl_user_list.length==0}}" style="color:{{font_color ? ('#'+font_color):'white'}}">
            <view>暂无任务记录</view>
          </view>
          <view class="flex-center receive" wx:if="{{is_load && s_num}}" style="color:{{font_color ? ('#'+font_color):'white'}}">
            <view class="flex-center ai-bas">
              <view>该活动已被领取了{{s_num}}次</view>
            </view>

          </view>
        </view>
				

      </view>
      <!-- 活动说明 -->
      <view wx:if="{{switch_head}}" class="white">
        <view class="items">
          <view class="content fs28 padding" style="color:{{font_color ? ('#'+font_color):'white'}}">
            <block wx:if="{{zl_act.remark!=''}}">
              <rich-text nodes="{{zl_act.remark}}" style="word-break:break-all;word-wrap:break-word"></rich-text>
            </block>
            <block wx:else>
              <view>暂无活动说明</view>
            </block>
          </view>
        </view>
      </view>


    </view>

  </view>
</view>
<!-- 引入提示组件 -->
<warn id="warn"></warn>
<!--  制作一个圆球导航  -->
<nav_b id="nav_b"></nav_b>
