<!--pages/project-user/index.wxml-->
<view class="sg-container">
  <view class="sg-search-box sg-shadow">
    <van-icon name="search" class="sg-index-color sg-search-icon" />
    <input class="sg-search-input" placeholder="搜索成员的姓名或绑定手机号" bindblur="blur" bindinput="updateInput"
      data-name="keyword" value="{{keyword}}"></input>
    <van-icon name="close" class="sg-search-icon" bind:click="clear"/>
  </view>
  <view class="sg-user-box">
    <view class="sg-user-list sg-margin-tb">
      <view class="sg-user-item sg-pad sg-margin-top-sm {{ item.selected ? 'sg-selected' : '' }}" wx:for="{{list}}" wx:key="index" bindtap="selectUser" data-index="{{index}}">
        <image class="sg-big-avatar" src="{{item.user ? item.user.avatar : ''}}" mode="widthFix"></image>
        <view class="sg-right sg-flex-grow">
          <view class="sg-name">{{item.user ? item.user.name : ''}}</view>
          <view class="sg-project-role sg-gray-color sg-font-small sg-flex sg-align-center sg-space-between sg-margin-tb-sm">
            <view class="sg-project">{{ project.name }}</view>
            <view class="sg-role">{{ item.project_role ? item.project_role.name : '' }}</view>
          </view>
          <view class="sg-phone sg-gray-color sg-font-small">{{ item.user ? item.user.phone : '' }}</view>
        </view>
      </view>
    </view>
  </view>
  <view class="sg-bottom-submit-box sg-center" wx:if="{{showAction}}">
    <view class="sg-action sg-delete sg-red-bg sg-pad" bindtap="delete">删除成员</view>
    <view class="sg-action sg-change sg-pad" bindtap="change">修改权限</view>
  </view>
  <van-dialog id="van-dialog" />
</view>
