<view class="flex-col page">
  <view class="flex-col group">
    <view class="flex-row items-center">
      <image
        class="shrink-0 image"
        src="{{ globalImgUrl + projectDetail.projectImage }}"
      />
      <view class="flex-col flex-1 group_1 ml-20">
        <text class="self-start font text">{{projectDetail.projectName}}</text>
        <view class="flex-row items-center self-stretch mt-7">
          <text class="flex-1 font_2 text_2">{{ projectDescription }}</text>
          <view class="flex-row items-center shrink-0 section ml-13" bindtap="gotoSettlement" data-id="{{ projectDetail.id }}" data-url="{{ projectDetail.projectImage }}" data-name="{{ projectDetail.projectName }}">
            <image
              class="shrink-0 image_2"
              src="./images/jsmx.png"
            />
            <text class="font_3 text_3 ml-4">结算明细</text>
          </view>
        </view>
        <view class="self-start group_2 mt-7">
          <text class="font_2 text_4">最高价</text>
          <text class="font_4 text_5">￥{{projectDetail.projectPrice}}</text>
        </view>
      </view>
    </view>
    <view class="flex-col mt-35">
      <view class="flex-col group_3">
        <view class="flex-row justify-between group_4">
          <text class="font text_6 {{ activeTab===0 ? 'tab-active' : 'tab-inactive' }}"
          bindtap="switchTab"
          data-index="0">项目详情</text>
          <text class="font text_7 {{ activeTab===1 ? 'tab-active' : 'tab-inactive' }}"
          bindtap="switchTab"
          data-index="1"
          >我的推广码</text>
        </view>
        <view class="flex-row justify-between group_5">
          <view class="section_2 {{ activeTab===0 ? 'line-active' : 'line-hidden' }}"></view>
          <view class="section_2 view {{ activeTab===1 ? 'line-active' : 'line-hidden' }}"></view>
        </view>
      </view>
      <view class="flex-col group_6">
        <!-- 项目详情tab -->
        <view wx:if="{{ activeTab === 0 }}" class="flex-col section_3">
          <view class="flex-row items-center">
            <image
              class="image_3"
              src="./images/tz.png"
            />
            <text class="font_5 text_8 ml-10">项目通知</text>
          </view>
          <view class="flex-col mt-13">
            <view
              class="flex-row justify-center items-center relative list-item_1 mt-8"
              wx:for="{{notificationList}}"
              wx:key="id"
              bindtap="goToNotificationDetail"
              data-id="{{item.id}}"
            >
              <view class="flex-col justify-start items-center text-wrapper pos">
                <text class="font_3 text_9">最新</text>
              </view>
              <text class="font_6 text_10">{{item.notificationTitle}}</text>
            </view>
          </view>
        </view>
        <view wx:if="{{ activeTab === 0 }}" class="flex-col section_4">
          <view class="flex-row items-center">
            <image
              class="image_4"
              src="./images/xmzc.png"
            />
            <text class="font_5 ml-10">项目政策</text>
          </view>
          <view class="flex-col mt-15">
            <view class="flex-row justify-between section_5">
              <text class="font_5">结算标准</text>
              <text class="font_5 text_11">结算价</text>
            </view>
            <view class="flex-col group_8">
              <view
                class="flex-row justify-between items-center section_6"
                wx:for="{{settlementDetailList}}"
                wx:key="id"
              >
                <text class="font_7 text_12">{{item.projectDetailName}}</text>
                <text class="font_4 text_13">{{item.projectSettlementPrice}}</text>
              </view>
            </view>
          </view>
        </view>
        <!-- 结算说明/项目说明/项目流程，图标已补充 -->
        <view wx:if="{{ activeTab === 0 }}" class="flex-col list">
          <view class="flex-col relative section_7">
            <text class="self-start font_5 text_15">结算说明</text>
            <image
              class="image_5 pos_4"
              src="./images/sm.png"
            />
            <rich-text class="self-stretch section_8 view_2" nodes="{{ settlementDesc }}"></rich-text>
          </view>
          <view class="flex-col relative section_1 mt-21">
            <text class="self-start font_5 text_1">项目说明</text>
            <image
              class="image_5 pos_5"
              src="./images/sm.png"
            />
            <rich-text class="self-stretch section_8" nodes="{{ projectDesc }}"></rich-text>
          </view>
          <view class="flex-col relative section_1 mt-21">
            <text class="self-start font_5 text_1">项目流程</text>
            <image
              class="image_5 pos_6"
              src="./images/sm.png"
            />
            <rich-text class="self-stretch section_8" nodes="{{ projectFlow }}"></rich-text>
          </view>
        </view>
        <!-- 我的推广码tab -->
        <view wx:if="{{ activeTab === 1 }}" class="flex-col list_2">
          <view
            class="flex-col relative list-item_2 mt-18"
            wx:for="{{promoCodeList}}"
            wx:key="id"
          >
            <view class="flex-col justify-start items-start text-wrapper_2">
              <text class="font_8 text_16">审核通过</text>
            </view>
            <view class="flex-col group_13">
              <view class="flex-row justify-between items-center self-stretch">
                <view class="flex-col group_9">
                  <text class="self-stretch font_9">业务员：{{item.salespersonName}} {{item.salespersonPhone}}</text>
                  <text class="self-start font_10 text_17">绑定日期:{{item.createTime}}</text>
                  <view class="flex-row items-center self-stretch group_11">
                    <text class="font_11 text_18">推广码id:{{item.promoCodeInfoKey}}</text>
                    <text class="font_12 text_19 ml-5" bindtap="copyPromoCode" data-code="{{item.promoCodeInfoKey}}">复制</text>
                  </view>
                </view>
                <image
                  class="image_6"
                  src="./images/code.png"
                  bindtap="onShowPromoPop"
                  data-qrcode="{{item.promoCodeImage}}"
                  data-link="{{item.promoCodeLink}}"
                /> 
              </view>
              <text class="self-end font_13 text_27" bindtap="onShowPromoPop"
              data-qrcode="{{item.promoCodeImage}}"
              data-link="{{item.promoCodeLink}}"
               >查看推广码</text>
              <view class="flex-row self-stretch group_12">
                <view data-promoId="{{item.id}}" class="flex-col justify-start items-center text-wrapper_3" bindtap="gotoSubSettlement" data-id="{{ item.id }}" data-image="{{ projectDetail.projectImage }}" data-name="{{ item.salespersonName }}">
                  <text class="font_14 text_21">结算明细</text>
                </view>
                <view class="flex-col justify-start items-center text-wrapper_4 ml-12" bindtap="goToPromoMaterial" data-id="{{item.projectId}}"
                data-name="{{item.salespersonName}}"
                data-phone="{{item.salespersonPhone}}">
                  <text class="font_15 text_22">查看资料</text>
                </view>
              </view>
            </view>
          </view>
        </view>
      </view>
    </view>
  </view>
  <view class="flex-row mt-57 foot-bottom">
    <view class="flex-col justify-start items-center text-wrapper_5" bindtap="goToPromoTab"><text class="font_5 text_23">开码记录</text></view>
    <view class="flex-col justify-start items-center text-wrapper_6" bindtap="addPromoCode"><text class="font_5 text_24">新增推广码</text></view>
  </view>
</view>

<promo-pop
  show="{{showPromoPop}}"
  qrcode="{{ globalImgUrl + currentQrcode }}"
  link="{{currentPromoLink}}"
  close-icon="../promoPop/images/cha.png"
  bind:close="onClosePromoPop"
/>
