<view>
  <view class="edit_card" wx:if="{{!streetShow}}">
    <view class="content">
      <view class="state_box">
        <view class="state ul">
          <view class="left li">名片状态</view>
          <view class="right li" style="display:flex;justify-content:center;align-items:center;">
            <van-radio-group value="{{ form.status }}" bind:change="onChangeRadio" style="display:flex;">
              <van-radio style="width:200rpx;height:92rpx;line-height:92rpx;display:flex;align-items:center;" name="1">
                开启</van-radio>
              <van-radio style="width:200rpx;height:92rpx;line-height:92rpx;display:flex;align-items:center;" name="2">
                关闭</van-radio>
            </van-radio-group>
          </view>
        </view>
        <view class="tips p">关闭后用户无法访问您的名片首页</view>
      </view>
      <view class="basic_info">
        <view class="h1">基本信息</view>
        <view class="info_box">
          <van-cell-group>
            <van-cell>
              <text class="span" slot="title">头像</text>
              <view catchtap="onRead" style="display:flex;justify-content:space-between;align-items:center;">
                <view class="header_img span">
                  <image wx:if="{{!form.card_avatar}}" src="https://mini-app-img-1251768088.cos.ap-guangzhou.myqcloud.com/photo-mr.jpg" />
                  <image wx:if="{{imageUrl}}" src="{{imageUrl}}" alt="头像" />
                  <image wx:if="{{form.card_avatar}}" src="{{form.card_avatar}}" alt="头像" />
                </view>
                <!-- <van-icon name="arrow" class="fa fa-angle-right"></van-icon> -->
                <van-icon name="arrow"></van-icon>
              </view>
            </van-cell>
            <van-cell>
              <view class="span" slot="title">姓名<icon class="iconfont icon-info-must"></icon>
              </view>
              <block>
                <van-field value="{{ form.card_name }}" placeholder="请输入姓名" border="{{ false }}"
                  bind:blur="onChangeName" />
              </block>
            </van-cell>
            <van-cell>
              <text class="span" slot="title">手机号</text>
              <view>
                <van-field value="{{form.card_mobile}}" placeholder="请输入手机号" border="{{ false }}"
                  bind:blur="onChangePhone" />
              </view>
            </van-cell>
            <van-cell>
              <text class="span" slot="title">微信号</text>
              <view>
                <van-field value="{{form.card_wechat}}" placeholder="请输入微信号" border="{{ false }}"
                  bind:blur="onChangeWechat" />
              </view>
            </van-cell>
            <van-cell>
              <text class="span" slot="title">公司名称</text>
              <view>
                <van-field value="{{form.company}}" placeholder="请输入公司名称" border="{{ false }}"
                  bind:blur="onChangeCompany" />
              </view>
            </van-cell>
            <van-cell>
              <text class="span" slot="title">角色选择：</text>
              <view catchtap="checkRole" style="display:flex;align-items:center;justify-content:space-between;">
                <van-field readonly value="{{form.role_name}}" placeholder="角色选择" border="{{ false }}"
                  bind:blur="onChange" />
                <van-icon name="arrow"></van-icon>
                <!-- <van-icon name="arrow"  class="fa fa-angle-right"></van-icon> -->
              </view>
            </van-cell>
            <van-cell-group>
              <van-cell>
                <text class="span" slot="title">所在城市</text>
                <!-- <picker mode="region" bindchange="bindRegionChange" value="{{district}}" custom-item="{{customItem}}">
                  <view style="display:flex;align-items:center;justify-content:space-between;">
                    <van-field readonly value="{{form.addressName}}" placeholder="请选择收货地址" border="{{ false }}"
                      bind:blur="onChange" style="width:450rpx;" />
                    <van-icon name="arrow"></van-icon>
                  </view>
                </picker> -->
                <block>
                  <view style="display:flex;align-items:center;justify-content:space-between;" catchtap="checkoutAdress">
                    <van-field readonly value="{{form.addressName}}" placeholder="请选择收货地址" border="{{ false }}"
                      bind:blur="onChange" style="width:450rpx;" />
                    <van-icon name="arrow"></van-icon>
                  </view>
                </block>
              </van-cell>
              <van-cell wx:if="{{strShow}}">
                <text class="span" slot="title">街道：</text>
                <view catchtap="streetChoose" style="display:flex;align-items:center;justify-content:space-between;">
                  <van-field value="{{form.streetName}}" placeholder="请选择街道" border="{{ false }}"
                    bind:blur="streetChoose" />
                  <!-- <van-icon name="arrow" class="fa fa-angle-right"></van-icon> -->
                  <van-icon name="arrow"></van-icon>
                </view>
              </van-cell>
            </van-cell-group>
            <van-cell>
              <text class="span" slot="title">详细地址</text>
              <view>
                <van-field value="{{form.address}}" placeholder="请输入详细地址" border="{{ false }}"
                  bind:blur="onChangeAddress" />
              </view>
            </van-cell>
          </van-cell-group>
        </view>
      </view>
      <view class="card_info">
        <view class="h1">名片设置</view>
        <view class="my_synopsis">
          <view class="h2">我的简介</view>
          <!-- <van-field
                   type="textarea"
                   class="textarea"
                  value="{{form.introduction}}"
                  placeholder="请输入简介"
                  bind:blur="changeLine"
                /> -->
          <textarea wx:if="{{isShowText}}" class="textarea" placeholder="请输入简介" value="{{form.introduction}}"
            bindinput="changeLine" focus="{{onFocus}}" bindconfirm="onShowText" maxlength="-1" />
          <view wx:else class="textarea" catchtap="onShowTextare">{{form.introduction}}</view>
        </view>
        <!-- <view class="my_voice" >
            <view class="h2">我的声音</view>
               <view class="voice_box" wx:if="{{isOldVoice}}">
              <button type="button"  catchtap="playAmr">
                <icon class="iconfont icon-card_voice"></icon>{{playAudio?'暂停':'点击播放已有录音'}}
              </button>
              <button class="btn_a" style="background: #fff;color: #3b4043" catchtap="reloadVoice" >重新录音</button>
            </view>
            <view class="voice_btn"wx:if="{{!isOldVoice}}">
              <view class="btn_a" catchtap="play" style="margin-left:5px;text-align:center;">录音时间{{ time }}<text class="span" wx:if="{{form.voice}}">（点击播放）</text></view>
              <button
                class="btn_b"
                type="button"
                wx:if="{{!showStart}}"
                catchtouchstart="start"
              >
                开始录音
              </button>
              <button
                class="btn_b"
                type="button"
                wx:if="{{showStart}}"
                catchtap="stop"
              >
                停止录音
              </button>
            </view>
          </view> -->
        <view class="my_img">
          <view class="h2">我的图片</view>
          <view class="img_uploader">
            <view wx:for="{{form.picture}}" wx:key="index">
              <view class="photoBox">
                <image src="{{item}}" style="width: 100%;height100%;" />
                <icon data-index="{{index}}" catchtap="removeImg"></icon>
              </view>
            </view>
            <van-icon name="photograph" catchtap="onRead_1"
              style="font-size: 24px;line-height:144rpx;color: #666;width:60px;text-align:center;" />
          </view>
        </view>
      </view>
      <view class="recom_goods"
        wx:if="{{ form.role_id == '1' ||form.role_id == '2' || form.role_id == '3' ||form.role_id == '6'}}">
        <view class="title">
          <view class="block"></view>
          <text class="span">推荐商品</text>
        </view>
        <view class="goods_list">
          <view class="goods_box" wx:for="{{chooseItem}}" wx:key="index">
            <view class="goods_img">
              <image src="{{item.thumb}}" />
            </view>
            <view class="goods_text ul">
              <view class="name li" style="-webkit-box-orient: vertical;">
                {{ item.title || escapeTitle }}
              </view>
              <view class="sum li">
                <text class="span"><text class="font">{{language['money']}}</text>{{ item.price }}</text>
                <icon class="iconfont icon-delete" data-id="{{item.id}}" catchtap="deleteGoods"></icon>
              </view>
            </view>
          </view>
          <view class="goods_box" wx:if="{{chooseItem.length <= 0}}">
            <text class="span" style="width:100%;text-align: center;">暂无商品~</text>
          </view>
        </view>
        <view class="add_btn">
          <button type="button" catchtap="toChooseGood">
            <icon class="iconfont icon-life-game-plus"></icon>添加商品
          </button>
        </view>
      </view>
    </view>
    <view class="car_btm_btn" style="z-index:100;">
      <button type="button" class="btnClass" catchtap="saveData">保存</button>
    </view>
  </view>
  <van-popup show="{{showRole}}" position="bottom">
    <van-picker show-toolbar columns="{{ columns }}" bind:cancel="onCancel" bind:confirm="onConfirm" />
  </van-popup>
  <!-- <van-popup show="{{addressShow}}" position="bottom">
    <van-area area-list="{{ district }}" value="110000" bind:confirm="checkClick" bind:cancel="checkClose" bind:change="bindChange" />
  </van-popup> -->
  <yz_area show="{{addressShow}}" bindconfirm="areaConfirm"></yz_area>

  <van-popup show="{{ streetShow }}" position="right" custom-style="width:100%;height:100%;background:#fff;"
    overlay="{{ false }}">
    <view class="m-dialog1" style="background: #ffffff;">
      <van-nav-bar title="选择街道" left-arrow bind:click-left="onClickLeft" />
      <view style="clear:both;padding-top:10px;"></view>
      <view wx:key="index" wx:for="{{districtVal}}" data-item="{{item}}" catchtap="streetConfirm"
        style="width:700rpx;padding-left:12px;height:100rpx;">
        <text class="span" style="color: #555;font-size: 14.000000000000002px;white-space: nowrap;">{{ item.areaname
          }}</text>
      </view>
    </view>
  </van-popup>
</view>