<!--pages/pt-detail/index.wxml-->
<wxs src="../tools.wxs" module="globalTools" />
<import src="../../plugins/wxParse/wxParse.wxml" />
<block wx:if="{{!postitionDetail.isExist}}">
  <view class='panel'>
    <view class='one'>
      <view class='left'>
        {{postitionDetail.position.positionName}}
      </view>
      <view class='salary'>
        <!-- <image src='{{imgServerUrl}}/images/happyjob/dollor.png'></image> -->
        <block wx:if="{{postitionDetail.position.salary}}">
          {{postitionDetail.position.salary}}
        </block>
        <block wx:elif="{{postitionDetail.position.totalSalary}}">
          {{postitionDetail.position.totalSalary}}
        </block>
        <block wx:else>
          {{postitionDetail.position.basicSalary}}
        </block>
      </view>
    </view>
    <view class="two">
      <view class='left'>
        {{postitionDetail.position.hpCompany.companyName}}
      </view>
      <view class='right'>
        <view>
          招聘人数：{{postitionDetail.position.recruitNumber?postitionDetail.position.recruitNumber:'若干'}}{{postitionDetail.position.recruitNumber?'人':''}} 发布于：{{globalTools.subStr(postitionDetail.position.updateDate)}}
        </view>
      </view>
    </view>
    <view class='three'>
      <view class='pt'>
        <view class='title'>{{postitionDetail.myGroupList[0].hpResumeAPI.realName}} 的拼工，已有 {{postitionDetail.myGroupList.length}} 位伙伴加入</view>
        <view class='avtar'>
          <block wx:for="{{postitionDetail.myGroupList}}" wx:for-item="item" wx:for-index="idx" wx:key="il1">
            <view class='border'>
              <block wx:if="{{item.hpResumeAPI.headImg}}">
                <image src='{{item.hpResumeAPI.headImg}}'></image>
              </block>
              <block wx:else>
                <image src='{{imgServerUrl}}/images/avatar/man.png'></image>
              </block>
            </view>
          </block>
        </view>
        <view class='time'>
          距离结束还有：
          <block wx:if="{{leftTime > 0}}">
            <i-count-down target="{{leftTime}}" bindcallback="myLinsterner" class="countdown-class" clear-timer="{{clearTimer}}" format="{{myFormat}}" show-day="{{true}}"></i-count-down>
          </block>
        </view>
        <view class='join'>
          <text bindtap='joinGroup'>加入拼工</text>
        </view>
      </view>
    </view>
    <view class='four' bindtap='ptTip'>
      <view class='left'>
        <image src='{{imgServerUrl}}/images/happyjob/pt_tip.png'></image>
        <text>拼工须知：时间截止后不足拼工人数则按普通岗位提交</text>
      </view>
      <view class='right'>
        <image src='{{imgServerUrl}}/images/happyjob/right.png'></image>
      </view>
    </view>
    <view class='five'>
      <view class='title'>
        <view class='left'></view>
        <view class='right'>招工简章</view>
      </view>
      <view class="company">
        {{postitionDetail.position.hpCompany.companyDescription}}
      </view>
      <view class="com">
        <view class='left'>公司地址:</view>
        <view class='right'>{{postitionDetail.position.hpCompany.adname}}{{postitionDetail.position.hpCompany.address}}</view>
      </view>
      <view class="com">
        <view class='left'>客服电话:</view>
        <view class='right' bindtap='phoneCall'>{{postitionDetail.position.contactPhone}}</view>
      </view>
    </view>
  </view>
</block>
<block wx:else>
  <!-- 拼工中 -->
  <block wx:if="{{postitionDetail.isEnd == 0}}">
    <view class='panel'>
      <view class='one'>
        <view class='left'>
          {{postitionDetail.position.positionName}}
        </view>
        <view class='salary'>
          <!-- <image src='{{imgServerUrl}}/images/happyjob/dollor.png'></image> -->
          <block wx:if="{{postitionDetail.position.salary}}">
            {{postitionDetail.position.salary}}
          </block>
          <block wx:elif="{{postitionDetail.position.totalSalary}}">
            {{postitionDetail.position.totalSalary}}
          </block>
          <block wx:else>
            {{postitionDetail.position.basicSalary}}
          </block>
        </view>
      </view>
      <view class="two">
        <view class='left'>
          {{postitionDetail.position.hpCompany.companyName}}
        </view>
        <view class='right'>
          <view>
            招聘人数：{{postitionDetail.position.recruitNumber?postitionDetail.position.recruitNumber:'若干'}}{{postitionDetail.position.recruitNumber?'人':''}} 发布于：{{globalTools.subStr(postitionDetail.position.updateDate)}}
          </view>
        </view>
      </view>
      <view class='three'>
        <view class='pt'>
          <view class='title_1'>
            <image src='{{imgServerUrl}}/images/happyjob/pting.png'></image>
            拼工中...</view>
          <view class='avtar'>
            <block wx:for="{{postitionDetail.myGroupList}}" wx:for-item="item" wx:for-index="idx" wx:key="il1">
              <view class='border_1'>
                <block wx:if="{{item.hpResumeAPI.headImg}}">
                  <image src='{{item.hpResumeAPI.headImg}}'></image>
                </block>
                <block wx:else>
                  <image src='{{imgServerUrl}}/images/avatar/man.png'></image>
                </block>
              </view>
            </block>
          </view>
          <view class='time_1'>
            距离结束还有：
            <block wx:if="{{leftTime > 0}}">
              <i-count-down target="{{leftTime}}" bindcallback="myLinsterner" class="countdown-class" clear-timer="{{clearTimer}}" format="{{myFormat}}" show-day="{{true}}"></i-count-down>
            </block>
          </view>
          <view class='again'>
            <block wx:if="{{postitionDetail.myGroupList.length<3}}">
              再邀请{{3-postitionDetail.myGroupList.length}}位伙伴，奖励增加{{postitionDetail.position.threeGroupCashback}}元；
            </block>
            <block wx:elif="{{postitionDetail.myGroupList.length>=3 && postitionDetail.myGroupList.length<=5}}">
              再邀请{{5-postitionDetail.myGroupList.length}}位伙伴，奖励增加{{postitionDetail.position.fiveGroupCashback}}元。
            </block>
          </view>
          <view class='interview'>
            <!-- <text bindtap='interviewFriend'> -->
            <button open-type='share' class='share'>邀请好友一起来拼工</button>
            <!-- </text> -->
          </view>
          <view class='join_1'>
            <text bindtap='makeMyPt'>生成我的拼工分享图</text>
          </view>
        </view>
      </view>
      <view class='four' bindtap='ptTip'>
        <view class='left'>
          <image src='{{imgServerUrl}}/images/happyjob/pt_tip.png'></image>
          <text>拼工须知：时间截止后不足拼工人数则按普通岗位提交</text>
        </view>
        <view class='right'>
          <image src='{{imgServerUrl}}/images/happyjob/right.png'></image>
        </view>
      </view>
      <view class='five'>
        <view class='title'>
          <view class='left'></view>
          <view class='right'>招工简章</view>
        </view>
        <view class="company">
          {{postitionDetail.position.hpCompany.companyDescription}}
        </view>
        <view class="com">
          <view class='left'>公司地址:</view>
          <view class='right'>{{postitionDetail.position.hpCompany.adname}}{{postitionDetail.position.hpCompany.address}}</view>
        </view>
        <view class="com">
          <view class='left'>客服电话:</view>
          <view class='right' bindtap='phoneCall'>{{postitionDetail.position.contactPhone}}</view>
        </view>
      </view>
    </view>
  </block>
  <!-- 拼团成功 -->
  <block wx:if="{{postitionDetail.isEnd == 1}}">
    <view class='panel'>
      <view class='one'>
        <view class='left'>
          {{postitionDetail.position.positionName}}
        </view>
        <view class='salary'>
          <!-- <image src='{{imgServerUrl}}/images/happyjob/dollor.png'></image> -->
          <block wx:if="{{postitionDetail.position.salary}}">
            {{postitionDetail.position.salary}}
          </block>
          <block wx:elif="{{postitionDetail.position.totalSalary}}">
            {{postitionDetail.position.totalSalary}}
          </block>
          <block wx:else>
            {{postitionDetail.position.basicSalary}}
          </block>
        </view>
      </view>
      <view class="two">
        <view class='left'>
          {{postitionDetail.position.hpCompany.companyName}}
        </view>
        <view class='right'>
          <view>
            招聘人数：{{postitionDetail.position.recruitNumber?postitionDetail.position.recruitNumber:'若干'}}{{postitionDetail.position.recruitNumber?'人':''}} 发布于：{{globalTools.subStr(postitionDetail.position.updateDate)}}
          </view>
        </view>
      </view>
      <view class='three'>
        <view class='pt'>
          <view class='title_2'>
            <image src='{{imgServerUrl}}/images/happyjob/ptscs.png'></image>
            拼工成功</view>
          <view class='avtar'>
            <block wx:for="{{postitionDetail.myGroupList}}" wx:for-item="item" wx:for-index="idx" wx:key="il1">
              <view class='border_1'>
                <block wx:if="{{item.hpResumeAPI.headImg}}">
                  <image src='{{item.hpResumeAPI.headImg}}'></image>
                </block>
                <block wx:else>
                  <image src='{{imgServerUrl}}/images/avatar/man.png'></image>
                </block>
              </view>
            </block>
          </view>
          <view class='time'>
            共有{{postitionDetail.myGroupList.length}}人加入了{{postitionDetail.myGroupList[0].hpResumeAPI.realName}}的拼工，获得拼工奖励金为：
          </view>
          <view class='pt_money'>
            <block wx:if="{{postitionDetail.myGroupList.length >= 5}}">
              {{successReward}} + {{postitionDetail.position.fiveGroupCashback}} 元
            </block>
            <block wx:else>
              {{successReward}} + {{postitionDetail.position.threeGroupCashback}} 元
            </block>
          </view>
        </view>
      </view>
      <view class='four' bindtap='ptTip'>
        <view class='left'>
          <image src='{{imgServerUrl}}/images/happyjob/pt_tip.png'></image>
          <text>拼工须知：时间截止后不足拼工人数则按普通岗位提交</text>
        </view>
        <view class='right'>
          <image src='{{imgServerUrl}}/images/happyjob/right.png'></image>
        </view>
      </view>
      <view class='five'>
        <view class='title'>
          <view class='left'></view>
          <view class='right'>招工简章</view>
        </view>
        <view class="company">
          {{postitionDetail.position.hpCompany.companyDescription}}
        </view>
        <view class="com">
          <view class='left'>公司地址:</view>
          <view class='right'>{{postitionDetail.position.hpCompany.adname}}{{postitionDetail.position.hpCompany.address}}</view>
        </view>
        <view class="com">
          <view class='left'>客服电话:</view>
          <view class='right' bindtap='phoneCall'>{{postitionDetail.position.contactPhone}}</view>
        </view>
      </view>
    </view>
  </block>
  <!-- 拼团失败 -->
  <block wx:if="{{postitionDetail.isEnd == 2}}">
    <view class='panel'>
      <view class='one'>
        <view class='left'>
          {{postitionDetail.position.positionName}}
        </view>
        <view class='salary'>
          <!-- <image src='{{imgServerUrl}}/images/happyjob/dollor.png'></image> -->
          <block wx:if="{{postitionDetail.position.salary}}">
            {{postitionDetail.position.salary}}
          </block>
          <block wx:elif="{{postitionDetail.position.totalSalary}}">
            {{postitionDetail.position.totalSalary}}
          </block>
          <block wx:else>
            {{postitionDetail.position.basicSalary}}
          </block>
        </view>
      </view>
      <view class="two">
        <view class='left'>
          {{postitionDetail.position.hpCompany.companyName}}
        </view>
        <view class='right'>
          <view>
            招聘人数：{{postitionDetail.position.recruitNumber?postitionDetail.position.recruitNumber:'若干'}}{{postitionDetail.position.recruitNumber?'人':''}} 发布于：{{globalTools.subStr(postitionDetail.position.updateDate)}}
          </view>
        </view>
      </view>
      <view class='three'>
        <view class='pt'>
          <view class='title_3'>
            <image src='{{imgServerUrl}}/images/happyjob/ptfail.png'></image>
            拼工失败</view>
          <view class='avtar'>
            <block wx:for="{{postitionDetail.myGroupList}}" wx:for-item="item" wx:for-index="idx" wx:key="il1">
              <view class='border_1'>
                <block wx:if="{{item.hpResumeAPI.headImg}}">
                  <image src='{{item.hpResumeAPI.headImg}}'></image>
                </block>
                <block wx:else>
                  <image src='{{imgServerUrl}}/images/avatar/man.png'></image>
                </block>
              </view>
            </block>
          </view>
          <view class='time'>
            只有{{postitionDetail.myGroupList.length}}人加入了{{postitionDetail.myGroupList[0].hpResumeAPI.realName}}的拼工，获得基础励金：
          </view>
          <view class='pt_money'>
            {{failReward}}元
          </view>
        </view>
      </view>
      <view class='four' bindtap='ptTip'>
        <view class='left'>
          <image src='{{imgServerUrl}}/images/happyjob/pt_tip.png'></image>
          <text>拼工须知：时间截止后不足拼工人数则按普通岗位提交</text>
        </view>
        <view class='right'>
          <image src='{{imgServerUrl}}/images/happyjob/right.png'></image>
        </view>
      </view>
      <view class='five'>
        <view class='title'>
          <view class='left'></view>
          <view class='right'>招工简章</view>
        </view>
        <view class="company">
          {{postitionDetail.position.hpCompany.companyDescription}}
        </view>
        <view class="com">
          <view class='left'>公司地址:</view>
          <view class='right'>{{postitionDetail.position.hpCompany.adname}}{{postitionDetail.position.hpCompany.address}}</view>
        </view>
        <view class="com">
          <view class='left'>客服电话:</view>
          <view class='right' bindtap='phoneCall'>{{postitionDetail.position.contactPhone}}</view>
        </view>
      </view>
    </view>
  </block>
</block>