<!-- pages/addOrEditMember/index.wxml -->
<view class="container" hover-class="none" hover-stop-propagation="false">
  <form catchsubmit="beforeFormSubmit">
    <view class="cellBox" hover-class="none" hover-stop-propagation="false">
      <view class="weui-cell f16">
        <view class="weui-cell__hd">
          <label class="weui-label c6">手机号</label>
        </view>
        <view class="weui-cell__bd">
          <input class="weui-input  {{pageType == 1 && memberInfo.agencyRole == 1 ? 'c9':'c3'}}" type="number" disabled="{{pageType == 1 && memberInfo.agencyRole == 1}}" name="tel" bindblur="setDesp" value="{{memberInfo.tel}}" data-type="tel" placeholder="请输入手机号" maxlength="11" placeholder-class="c9" />
        </view>
      </view>
      <view class="weui-cell f16">
        <view class="weui-cell__hd">
          <label class="weui-label c6">备注名</label>
        </view>
        <view class="weui-cell__bd fsa">
          <textarea class="textarea tr c3" bindblur="setDesp" value="{{memberInfo.aliasName}}" placeholder="请输入备注名" data-type="nickName" placeholder-class="c9" name="nickName" auto-height></textarea>
        </view>
      </view>

      <view class="weui-cell f16">
        <view class="weui-cell__hd">
          <label class="weui-label c6">
            <!-- <text class="cfred">*</text> -->
            <!-- 用户名 -->
            角色
          </label>
        </view>
        <view class="weui-cell__bd">
          <!-- <input class="weui-input" type="" name="userName" data-type='userName' value="{{memberInfo.userName}}" placeholder="请输入姓名" placeholder-class="input__placeholder" /> -->
          <picker mode="selector" class value="{{0}}" wx:if="{{memberInfo.agencyRole != 1}}" bindchange="changeRole" range="{{memeber}}" range-key="value" name="agencyRole" style>
            <view class="fsa" style="justify-content:flex-end" hover-class="none" hover-stop-propagation="false">
              <view class="{{memberInfo.agencyRoleText ? 'c3' : 'c9'}}" hover-class="none" hover-stop-propagation="false">{{!!memberInfo.agencyRoleText ? memberInfo.agencyRoleText : '请选择角色' }}</view>
              <view class="iconfont icon-gengduo11 cccc f14 ml8" hover-class="none" hover-stop-propagation="false"></view>
            </view>
          </picker>
          <view class='tar c9' wx:else hover-class="none" hover-stop-propagation="false">创建人</view>
        </view>
      </view>
      <view class="weui-cell f16">
        <view class="weui-cell__hd">
          <label class="weui-label c6">
            <!-- <text class="cfred">*</text> -->
            <!-- 用户名 -->
            部门选择
          </label>
        </view>
        <view class="weui-cell__bd" bindtap="showDrawer">
          <view class="fse" hover-class="none" hover-stop-propagation="false">
            <view class="c3" hover-class="none" hover-stop-propagation="false">{{groupList[currentGroup].teamName}}</view>
            <view class="iconfont icon-gengduo11 cccc f14 ml8" hover-class="none" hover-stop-propagation="false"></view>
          </view>

          <!-- <input class="weui-input" type="" name="userName" data-type='userName' value="{{memberInfo.userName}}" placeholder="请输入姓名" placeholder-class="input__placeholder" /> -->

          <!-- <picker mode="selector" class value="{{0}}" bindchange="changeRole" range="{{}}" range-key="name" name="agencyRole" style>
            <view class="fsa" style="justify-content:flex-end" hover-class="none" hover-stop-propagation="false">
              <view class="{{memberInfo.agencyRoleText ? 'c3' : 'c9'}}" hover-class="none" hover-stop-propagation="false">{{!!memberInfo.agencyRoleText ? memberInfo.agencyRoleText : groupList[0].name }}</view>
              <view class="iconfont icon-gengduo11 cccc f14 ml8" hover-class="none" hover-stop-propagation="false"></view>
            </view>
          </picker>-->
        </view>
      </view>
    </view>
    <view class="cellBox mt10" hover-class="none" hover-stop-propagation="false">
      <view class="weui-cell f16">
        <view class="weui-cell__hd">
          <label class="weui-label c6">参与统计</label>
        </view>
        <view class="weui-cell__bd tar">
          <switch checked="{{joinSta}}" color="#1890ff" data-type="joinSta" bindchange="switchChange" />
        </view>
      </view>
      <view class="weui-cell f16">
        <view class="weui-cell__hd">
          <label class="weui-label c6">大屏显示</label>
        </view>
        <view class="weui-cell__bd tar">
          <switch checked="{{showOnScreen}}" color="#1890ff" data-type="showOnScreen" bindchange="switchChange" />
        </view>
      </view>
    </view>

    <view class="fsa bgf p10 pt16 pb16 br8 mt10" bindtap='transferCreator' wx:if="{{pageType == 1 && loginUserInfo.user.agencyRole == 1}}">
      <label class="c6">转让创建人</label>
      <view class="weui-cell__bd tar">
        <view class="iconfont icon-gengduo11 cccc f14 ml8" hover-class="none" hover-stop-propagation="false"></view>
      </view>
    </view>
    <!-- bindtap='addMember' -->
    <button class="loginOut normalBtn f18" style="margin-top:120px;" hover-class="thover" form-type="submit">
      <i class="weui-loading"></i>
      确定
    </button>
    <!-- <view class="ysd-base-color mt16" style='text-align:center' hover-class="none" hover-stop-propagation="false">
      删除成员
    </view>-->
  </form>
  <view class="delete mt16" style="color:#576B95" hover-class="none" hover-stop-propagation="false" bindtap="showDelModal" wx:if="{{pageType == 1}}">删除成员</view>
</view>
<bottom-drawer show="{{drawerShow}}" drawerType="drawerShow" bindhidedrawer="hidedrawershow" height="80vh">
  <view slot="title" class="tac fw500 f18 bb1" style="line-height:56px" hover-class="none" hover-stop-propagation="false">选择部门</view>
  <scroll-view class="pb32" scroll-y="true" style="height:calc(100% - 82px)">
    <radio-group class="radio-group mb32" bindchange="radioChange" hover-class="none">
      <label class="weui-cell_active weui-check__label fsa p16 bb1" hover-class="none" wx:for="{{groupList}}" wx:key="name" wx:for-index="index">
        <view class="weui-cell__bd">
          <view class="f17">{{item.teamName}}</view>
        </view>
        <view class="weui-cell__ft">
          <radio class="weui-check" value="{{item.id}}" checked="{{item.checked}}" />
          <i class="iconfont icon-duihao ysd-base-color" wx:if="{{item.checked}}"></i>
        </view>
      </label>
    </radio-group>
  </scroll-view>
  <!-- <view class="f17 p16 bb1" bindtap="showgroupDialog" hover-class="none" hover-stop-propagation="false">添加新部门</view> -->
</bottom-drawer>

<view aria-role="dialog" aria-modal="true" catchtouchmove="modalMove" class="fadeIn" wx:if="{{groupDialog}}">
  <view class="weui-mask"></view>
  <view class="weui-dialog groupBox" style="box-sizing:border-box;">
    <!-- <i class="iconfont icon-guanbi guanbi c6 biggerSize" bindtap="closegroupDialog"></i> -->
    <view class="tac pt8" hover-class="none" hover-stop-propagation="false">
      <view class="weui-dialog__hd f18">添加部门</view>
      <input class="groupInput mt4" type name="userName" data-type="userName" value="{{memberInfo.userName}}" placeholder="请输入部门名" placeholder-class="input__placeholder" />
    </view>
    <view class="fsa f18 groupBtn bt1" hover-class="none" hover-stop-propagation="false">
      <view class="tac p10 flex-1 br1" hover-class="none" hover-stop-propagation="false" bindtap="closegroupDialog">取消</view>
      <view class="tac p10 fw500 flex-1" hover-class="none" hover-stop-propagation="false">添加</view>
    </view>
  </view>
</view>
