<page-container>
  <view class="passenger-popup-content">
    <view onTap="openBuyInfo">
      <slot></slot>
    </view>
    <popup
      show="{{showBottom}}"
      position="bottom"
      zIndex="100"
      onClose="closeBuyInfo"
      disableScroll="{{false}}"
    >
      <view class="buy-titles">
        <text class="font-color">选择游客</text>
        <view onTap="closeBuyInfo">
          <am-icon
            type="close"
            color="#ccc"
            class="close-info"
          />
        </view>
      </view>

      <view
        class="add-empty"
        a:if="{{!passengerList || passengerList.length === 0}}"
      >
        <view
          class="add-scenic"
          onTap="goTouristsOperate"
          data-info=""
          data-tag="add"
        >+ 新增游客信息</view>
        <page-result
          type="empty"
          title="什么都没有"
          brief=""
        />
      </view>

      <view a:else>
        <scroll-view
          scroll-y="{{true}}"
          style="height: 600rpx;"
        >
          <view class="list-content-info">
            <view
              class="add-scenic"
              onTap="goTouristsOperate"
              data-info=""
              data-tag="add"
            >+ 新增游客信息</view>
            <view class="add-content">
              <list
                class="add-content-list"
                a:for="{{passengerList}}"
                a:for-item="item"
              >
                <list-item
                  arrow="{{false}}"
                  index="{{index}}"
                  key="items-{{index}}"
                >
                  <view class="add-pub-list">
                    <view class="pub-list-left">
                      <view
                        onTap="goTouristsOperate"
                        data-info="{{item}}"
                        data-tag="update"
                      >
                        <am-icon
                          type="share"
                          size="20"
                          class="add-icon"
                        />
                      </view>
                      <view>
                        <view>
                          <label
                            for="{{'check'+item.id}}"
                            class="add-title1"
                          >{{ item.name }}</label>
                        </view>
                        <view>
                          <label
                            for="{{'check'+item.id}}"
                            class="add-title2"
                            a:if="{{item.certType === 'Idcard'}}"
                          >身份证 {{ item.idCardNo }}</label>
                          <label
                            for="{{'check'+item.id}}"
                            class="add-title2"
                            a:if="{{item.certType === 'Passport'}}"
                          >护照 {{ item.idCardNo }}</label>
                          <label
                            for="{{'check'+item.id}}"
                            class="add-title2"
                            a:if="{{item.certType === 'HKAndMacauTaiwanPermit'}}"
                          >港澳台通行证 {{ item.idCardNo }}</label>
                        </view>
                        <view>
                          <label
                            for="{{'check'+item.id}}"
                            class="add-title3"
                          >手机号 {{ item.mobile }}</label>
                        </view>
                      </view>
                    </view>
                    <am-checkbox
                      data-id="{{item.id}}"
                      value="{{item.id}}"
                      id="{{'check'+item.id}}"
                      ctrlChecked="{{!!item.checked}}"
                      onChange="onChangeInfo"
                      class="add-checkbox"
                    />
                  </view>
                </list-item>
              </list>
            </view>
          </view>
        </scroll-view>

        <view
          class="sure-info"
          onTap="sureGoBack"
        >
          <view class="sure">确定</view>
        </view>
      </view>
    </popup>
  </view>
</page-container>