<wxs module="filters" src="../../../utils/addmul.wxs"></wxs>
<view class="flex-col page">
  <view class="flex-row justify-between items-center section" bindtap="showPopup">
    <view class="flex-row items-center">
      <image
        class="shrink-0 image"
        src="./images/tz.png"
      />
      <view class="group ml-5">
        <text class="font text">一键设置下级抽成比例：</text>
        <text class="font text_2">{{ filters.toFix2(fixedRate) }}%</text>
      </view> 
    </view>
    <image
      class="image_2"
      src="./images/yjt1.png"
    />
  </view>
  <view class="flex-col mt-19">
    <view class="flex-col list-item mt-20" wx:for="{{projectList}}" wx:for-item="item" wx:for-index="index" wx:key="index">
      <view class="flex-row group_2">
        <view class="flex-row flex-1 self-center">
          <image
            class="shrink-0 image_3"
            src="{{ globalImgUrl + item.projectImage }}"
          />
          <view class="flex-col items-start flex-1 group_3 ml-13">
            <text class="font">{{ item.projectName }}</text>
            <view class="flex-col justify-start items-center text-wrapper mt-14">
              <text class="font_3 text_4">结算T+{{ item.projectSettlementCycle }}</text>
            </view>
          </view>
        </view>
        <view class="flex-row shrink-0 self-start section_2 ml-21" bind:tap="gotoSubCommission" data-id="{{ item.projectId }}">
          <image
            class="image_4 image_5"
            src="./images/yjt2.png"
          />
          <text class="font_2 text_3">下级单价</text>
        </view>
      </view>
      <view class="flex-col section_3">
        <view class="flex-row justify-between items-center group_4">
          <text class="font_4 text_5">结算标准</text>
          <text class="font_5">单价/代理单价/比例</text>
          <text class="font_4">设置价格</text>
        </view>
        <view class="flex-col mt-16">
          <view
            class="flex-row justify-center items-center relative list-item_2 mt-14"
            wx:for="{{item.projectDetailCommissionVOList}}"
            wx:for-item="CommissionList"
            wx:for-index="index"
            wx:key="index"
          >
            <text class="font_6 text_6 pos">{{ CommissionList.projectDetailName }}</text>
            <text class="font_7 text_9">{{ filters.toFix2(CommissionList.myUnitPrice) }}/{{ filters.toFix2(CommissionList.agentUnitPrice) }}/{{ filters.toFix2(CommissionList.currentCommissionRate) }}%</text>
            <view class="flex-row group_5 pos_2" bindtap="showCommissionRatePop" data-nowMyUnitPrice="{{ CommissionList.myUnitPrice }} " data-currentCommissionRate="{{ CommissionList.currentCommissionRate }}" data-agentUnitPrice="{{ CommissionList.agentUnitPrice }}" data-projectDetailName="{{ CommissionList.projectDetailName }}" data-detailid="{{ CommissionList.id }}" data-maxCommissionRate="{{ CommissionList.maxCommissionRate }}">
              <image
                class="image_4 image_6"
                src="./images/yjt3.png"
              />
              <text class="font_8 text_8">设价</text>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
</view>
 <!-- 弹窗组件 -->
 <commissionPop show="{{showPopup}}" bind:close="closePopup" bind:submit="handleCommissionSubmit" />
 <!-- 弹窗组件 -->
 <!-- 四个变量 -->
<commissionRatePop
  show="{{showCommissionRatePop}}"
  bind:cancel="closeCommissionRatePop"
  bind:close="closeCommissionRatePop"
  bind:confirm="handleCommissionRateConfirm"
  pgencyPrice="{{ nowAgentUnitPrice }}"
  commissionRate="{{ nowCommissionRate }}"
  myUnitPrice="{{ nowMyUnitPrice }}"
  projectDetailName="{{  nowProjectDetailName }}"
  detailId="{{ projectId }}"
  maxCommissionRate="{{ maxCommissionRate }}"
  isSub="{{ isSub }}"
/>
