<view class="item" wx:for="{{editFields}}" wx:key="index">
  <view class="name"> <text wx:if="{{item.required}}" style="color: red;">*</text> {{item.name}}：</view>
  <view class="content">
    <block wx:if="{{item.type=='String'}}">
      <block wx:if="{{!item.view}}">
        <view class="text">
          <textarea value="{{editMap[item.key].val}}" data-key="{{item.key}}" bindblur="changeTextarea" placeholder="请输入{{item.name}}" auto-height disabled="{{item.disabled}}"></textarea>
        </view>
      </block>
      <block wx:elif="{{item.view=='edit-image'}}">
        <view class="image">
          <block wx:if="{{item.disabled}}">
            <image style="width:160rpx;height: 160rpx;" src="{{editMap[item.key].val[0].url}}" mode="" />
          </block>
          <block wx:else>
            <upload fileList="{{editMap[item.key].val}}" accept="all" data-key="{{item.key}}" bind:onChangeFile="changeFile" accept="image" maxCount="1" uploadURL="{{uploadURL}}" domain="{{domain}}" uptokenURL="{{uptokenURL}}"></upload>
          </block>
        </view>
      </block>
      <block wx:elif="{{item.view=='edit-select'}}">
        <van-radio-group disabled="{{item.disabled}}" value="{{editMap[item.key].val}}" class="radioGroup" data-key="{{item.key}}" bind:change="radioChange">
          <view wx:for="{{item.options}}" wx:for-item="option" wx:key="option" class="radio">
            <van-radio checked-color="{{color}}" name="{{option.value}}">{{option.label}}</van-radio>
          </view>
        </van-radio-group>
      </block>
    </block>
    <block wx:elif="{{item.type=='Number'}}">
      <van-field disabled="{{item.disabled}}" value="{{editMap[item.key].val}}" data-key="{{item.key}}" bindblur="changeNumber" type="digit" placeholder="请输入{{item.name}}" border="{{ false }}" />
    </block>
    <block wx:elif="{{item.type=='Boolean'}}">
      <van-switch disabled="{{item.disabled}}" active-color="{{color}}" checked="{{ editMap[item.key].val }}" data-key="{{item.key}}" bind:change="switchChange" size="40rpx" />
    </block>
    <block wx:elif="{{item.type=='Array'}}">
      <block wx:if="{{!item.view}}">
        <view class="tags">
          <block wx:for="{{editMap[item.key].val}}" wx:for-item="tag" wx:for-index="tag_index" wx:key="tag">
            <van-tag type="primary" closeable="{{!item.disabled}}" size="medium" data-key="{{item.key}}" data-index="{{tag_index}}" bind:close="delTextarea" color="{{color}}" text-color="{{text_color}}">{{tag}}</van-tag>
          </block>
        </view>
        <view class="text">
          <textarea disabled="{{item.disabled}}" confirm-type="点击添加" data-key="{{item.key}}" bindconfirm="addTextarea" placeholder="请输入{{item.name}}" auto-height></textarea>
        </view>
      </block>
      <block wx:elif="{{item.view=='edit-image'}}">
        <block wx:if="{{item.disabled}}">
          <image wx:for="{{editMap[item.key].val}}" wx:for-item="disabled_item" wx:for-index="disabled_index" wx:key="disabled_item" style="width:160rpx;height: 160rpx;margin-right: 10rpx;" src="{{disabled_item.url}}" mode="" />
        </block>
        <block wx:else>
          <upload fileList="{{editMap[item.key].val}}" data-key="{{item.key}}" bind:onChangeFile="changeFile_array" accept="image" maxCount="9" uploadURL="{{uploadURL}}" domain="{{domain}}" uptokenURL="{{uptokenURL}}"></upload>
        </block>

      </block>
      <block wx:elif="{{item.view=='pointer-array'}}">
        <view class="tags">
          <block wx:for="{{editMap[item.key].text}}" wx:for-item="tag" wx:for-index="tag_index" wx:key="tag">
            <van-tag type="primary" closeable="{{!item.disabled}}" size="medium" data-key="{{item.key}}" data-index="{{tag_index}}" bind:close="delPointer" color="{{color}}" text-color="{{text_color}}">{{tag}}</van-tag>
          </block>
        </view>
        <view class="btn_Pointer" wx:if="{{!item.disabled}}">
          <button data-index="{{index}}" data-key="{{item.key}}" bind:tap="openPointer" style="background: {{color}};color: {{text_color}};">
            <van-icon name="plus" />添加
          </button>
        </view>
      </block>
    </block>
    <block wx:elif="{{item.type=='Pointer'}}">
      <view class="text" data-index="{{index}}" data-key="{{item.key}}" bind:tap="openPointer">
        <text class="title">{{editMap[item.key].text||'请选择'}}</text>
        <van-icon name="arrow" />
      </view>
    </block>
    <block wx:elif="{{item.type=='GeoPoint'}}">
      <view class="btn_Pointer" wx:if="{{!item.disabled}}">
        <button data-index="{{index}}" data-key="{{item.key}}" bind:tap="chooseGeoPoint" style="background: {{color}};color: {{text_color}};">
          选择{{item.name}}
        </button>
      </view>
      <view class="geoPoint" wx:if="{{editMap[item.key].val.longitude&&editMap[item.key].val.latitude}}">
        <block wx:if="{{editMap[item.key].val.longitude}}">
          经：{{editMap[item.key].val.longitude}}
        </block>
        <block wx:if="{{editMap[item.key].val.latitude}}">
          纬：{{editMap[item.key].val.latitude}}
        </block>
        <view wx:if="{{editMap[item.key].text}}" data-str="{{editMap[item.key].text}}" bind:tap="copyStr">
          {{editMap[item.key].text}}
          <van-icon name="orders-o" />
        </view>
      </view>
    </block>
    <block wx:elif="{{item.type=='Object'}}">
      <block wx:if="{{item.view=='edit-spec'}}">
        <view class="specMap">
          <view class="tip">不同规格价格不同可在规格属性里面填写价格，价格一样可不填写，编辑完之后需要保存</view>
          <view class="list">
            <view class="tags">
              <text class="title">属性名称：</text>
              <block wx:for="{{editMap[item.key].val.specList}}" wx:for-item="spec_item" wx:for-index="spec_index" wx:key="spec_item">
                <van-tag closeable="{{!item.disabled}}" type="primary" size="medium" color="{{color}}" text-color="{{text_color}}" data-key="{{item.key}}" data-spec_index="{{spec_index}}" bind:close="delKey_ShopGoods_specMap">{{spec_item}}</van-tag>
              </block>
            </view>
            <view class="text">
              <textarea disabled="{{item.disabled}}" confirm-type="点击添加" data-key="{{item.key}}" bindconfirm="addKey_ShopGoods_specMap" placeholder="请输入规格名称（可填多个）" auto-height></textarea>
            </view>
          </view>
          <view class="obj">
            <view class="title">属性对象：</view>
            <block wx:for="{{editMap[item.key].val.specList}}" wx:for-item="spec_item" wx:for-index="spec_index" wx:key="spec_item">
              <view class="obj_item">
                <view class="key">{{spec_item}}：</view>
                <view class="info">
                  <block wx:for="{{editMap[item.key].val[spec_item]}}" wx:for-item="spec_map_item" wx:for-index="spec_map_index" wx:key="spec_map_item">
                    <view class="info_item">
                      <view>
                        <text>属性值：</text>
                        <input disabled="{{item.disabled}}" data-key="{{item.key}}" data-spec="{{spec_item}}" data-spec_map_index="{{spec_map_index}}" bindinput="setValue" value="{{spec_map_item.value}}" placeholder="输入属性值" type="text" />
                      </view>
                      <view>
                        <text>价格：</text>
                        <input disabled="{{item.disabled}}" data-key="{{item.key}}" data-spec="{{spec_item}}" data-spec_map_index="{{spec_map_index}}" bindinput="setPrice" value="{{spec_map_item.price}}" placeholder="输入价格" type="digit" />
                      </view>
                      <view>
                        <text>会员价格：</text>
                        <input disabled="{{item.disabled}}" data-key="{{item.key}}" data-spec="{{spec_item}}" data-spec_map_index="{{spec_map_index}}" bindinput="setVipPrice" value="{{spec_map_item.vipPrice}}" placeholder="输入会员价格" type="digit" />
                      </view>
                      <view wx:if="{{editMap[item.key].val[spec_item].length>1&&!item.disabled}}" class="del" data-key="{{item.key}}" data-spec="{{spec_item}}" data-spec_map_index="{{spec_map_index}}" bind:tap="delSpecMapItem">
                        <van-icon name="cross" />
                      </view>
                    </view>
                  </block>
                  <view wx:if="{{!item.disabled}}" class="btn_specMap" style="border:1rpx solid {{color}};">
                    <button data-key="{{item.key}}" data-spec="{{spec_item}}" bind:tap="addSpecMap" style="color: {{color}};">
                      <van-icon name="plus" />添加
                    </button>
                  </view>
                </view>
              </view>
            </block>
          </view>
        </view>
      </block>
      <block wx:elif="{{item.view=='json-object'}}">
        <view class="jsonObj">
          <block wx:for="{{item.jsonArr}}" wx:for-item="json_item" wx:for-index="json_index" wx:key="json_item">
            <view class="">{{json_item.label}}：</view>
            <view class="text">
              <textarea value="{{editMap[item.key].val[json_item.key]}}" data-json_key="{{json_item.key}}" data-key="{{item.key}}" bindblur="changeJsonTextarea" placeholder="{{json_item.value}}" auto-height disabled="{{item.disabled}}"></textarea>
            </view>
          </block>
        </view>
      </block>
    </block>
  </view>
</view>
<block wx:if="{{is_btn}}">
  <view class="footer">
    <button class="btn" style="background: {{color}};color: {{text_color}};" bindtap="submit">提交</button>
  </view>
</block>

<!-- 指针查询 -->
<van-popup show="{{ isShowPointer }}" position="bottom" bind:close="closePointer" round>
  <view class="popup">
    <view class="title">选择内容</view>
    <van-search bind:change="valChange" placeholder="请输入搜索关键词" />
    <scroll-view class="itemBox" bindscrolltolower="getPointerItem" scroll-y>
      <block wx:for="{{pointerList}}" wx:for-item="pointer_item" wx:key="pointer_item">
        <view class="item" data-index="{{index}}" bind:tap="{{editFields[fieldIndex].type=='Array'?'checkPointer_Array':'checkPointer'}}" style="color:{{pointer_item.dev_router_check?color:'black'}};">
          {{pointer_item.storeName||pointer_item.name||pointer_item.title||pointer_item.orderNum||pointer_item.mobile}}
          <van-icon name="success" wx:if="{{pointer_item.dev_router_check}}" color="{{color}}" />
        </view>
      </block>
    </scroll-view>
  </view>
</van-popup>