<!--packageF/debt/userManagement/userManagement.wxml-->
<wxs module="addp">
  var addPP = function add(a, b) {
    return (a + b).toFixed(2)
  }
  module.exports.add = addPP
</wxs>
<view id="userManagement">
  <view class="searchBox">
    <i class="iconfont icon-member-left" catchtap="blackGo"></i>
    <view class="searchMin">
      <i class="iconfont icon-all_search_2"></i>
      <van-field model:value="{{keyWord}}" bind:blur='fieldChange' placeholder="搜索会员昵称/手机号" />
    </view>
  </view>
  <van-tabs active="{{active}}" bind:change="changeTap">
    <van-tab title="债权人"></van-tab>
    <van-tab title="VIP"></van-tab>
  </van-tabs>
  <view class="listbox">
    <view class="list" wx:if="{{active == 0}}" wx:for="{{listData}}" wx:key="index">
      <view class="lsitTop">
        <view class="img">
          <image src="{{item.has_one_owner_member.avatar}}" alt="" />
        </view>
        <view class="user">
          <view class="name">
            {{item.has_one_owner_member.nickname}}
            <view class="grade">{{item.debtor_uid}}</view>
          </view>
          <view class="time">化债期：{{item.end_time_str}}</view>
        </view>
        <view class="typeTxt">{{item.status_name}}</view>
      </view>
      <view class="lisConten">
        <view class="lis">
          <view class="price">￥{{item.total_credit || 0}}</view>
          <view class="lisTxt">总提货券</view>
        </view>
        <view class="lis">
          <view class="price">￥{{item.sum_credit}}</view>
          <view class="lisTxt">剩余提货券</view>
        </view>
        <view class="lis">
          <view class="price">{{item.has_many_order_count}}</view>
          <view class="lisTxt">订单数</view>
        </view>
      </view>
      <view class="listBottom">
        <view class="listBottom_txt">身份有效期：{{item.has_one_debtor.end_time_str}}</view>
        <view class="renew" wx:if="{{item.has_one_debtor.status == '-1' || item.has_one_debtor.status == '1'}}" catchtap="renewTap" data-item='{{item}}'>续费</view>
      </view>
    </view>
    <view class="list" wx:if="{{active == 1}}" wx:for="{{listData}}" wx:key="index">
      <view class="lsitTop">
        <view class="img" wx:if="{{item.has_one_vip_member}}">
          <image src="{{item.has_one_vip_member.avatar}}" alt="" />
        </view>
        <view class="user">
          <view class="name" wx:if="{{item.has_one_vip_member}}">
            {{item.has_one_vip_member.nickname}}
            <view class="grade">{{item.has_one_vip_member.uid}}</view>
          </view>
          <view class="time">化债期：{{item.end_time_str}}</view>
        </view>
        <view class="typeTxt">{{item.status_name}}</view>
      </view>
      <view class="contenVip" wx:if="{{item.has_one_owner_member}}">
        <view class="contenVip_txt">债权人：</view>
        <view class="contenVip_img">
          <image src="{{item.has_one_owner_member.avatar}}" alt="" />
        </view>
        <view class="contenVip_name">{{item.has_one_owner_member.nickname}}</view>
        <view class="grade">{{item.has_one_owner_member.uid}}</view>
      </view>
      <view class="lisConten lisConten2">
        <view class="lis">
          <view class="price">￥{{item.common_credit}}</view>
          <view class="lisTxt">{{plugin_setting.common_credit_name || '消费账户'}}</view>
        </view>
        <view class="lis">
          <view class="price">￥{{item.order_count}}</view>
          <view class="lisTxt">订单数</view>
        </view>
        <view class="lis">
          <view class="price">￥{{item.order_price}}</view>
          <view class="lisTxt">订单金额</view>
        </view>
      </view>
    </view>
  </view>
</view>
<van-popup show="{{RenewShow}}" bind:close="tapclose" position="bottom" custom-style="height: 492rpx, borderRadius: 10rpx 10rpx 0px 0px" closeable>
  <view class="shopShowTxt">续费</view>
  <view class="flexCell">
    <view>当前拥有商品数量：{{active == 0?owner_goods_count:vip_goods_count}}</view>
    <view class="right">
      <view class="pay" catchtap='toDetail'>
        购买商品
        <i class="iconfont icon-member_right"></i>
      </view>
    </view>
  </view>
  <view class="flexCell">
    <view>充值数量</view>
    <view class="right">
      <van-stepper class="pay" bind:change='stepperTap' value="{{goodsTotal}}" theme="round" button-size="22" />
    </view>
  </view>
  <view class="btn" catchtap='renewPost'>充值</view>
</van-popup>