<ion-header>
    <ion-navbar>
        <ion-title>信息查询</ion-title>
        <ion-buttons end>
            <button ion-button icon-only class="toolbar-signUp">
                <ion-select [(ngModel)]="option.type" cancelText="取消" okText="确定" placeholder="选择"
                            (ngModelChange)="getList()">
                    <ng-container *ngFor="let item of option.list">
                        <ion-option [value]="item.type">{{item.name}}</ion-option>
                    </ng-container>
                </ion-select>
            </button>
        </ion-buttons>
    </ion-navbar>
    <ion-navbar class="input-search">
        <div class="search-input">
            <ion-input type="text" placeholder="请输入统一社会信用代码或者单位名称" [(ngModel)]="info.search"></ion-input>
            <span class="clear" tappable (click)="getList()">搜索</span>
        </div>
    </ion-navbar>
</ion-header>

<ion-content>
    <ion-refresher (ionRefresh)="getList($event)">
        <ion-refresher-content pullingText="下拉刷新"
                               refreshingSpinner="bubbles">
        </ion-refresher-content>
    </ion-refresher>
    <div class="list">
        <div *ngFor="let item of info.list" (click)="goToDetail(item)">
            <div class="group">
                <div class="inner-group">
                    <p *ngIf="option.viewType == '1'" class="person-name">{{item?.mc}}</p>
                    <p *ngIf="option.viewType == '2'" class="person-name">{{item?.name}}</p>
                </div>
            </div>
        </div>
    </div>
    <ion-infinite-scroll (ionInfinite)="doInfinite($event)">
        <ion-infinite-scroll-content
                loadingSpinner="bubbles"
                loadingText="加载中"></ion-infinite-scroll-content>
    </ion-infinite-scroll>
</ion-content>
