<view wx:if="{{sys_payinstructions}}" class="head">
    {{sys_payinstructions}}
</view>
<view class="remarks">
    <view>备注</view>
    <textarea name='value' value="{{remarks}}" placeholder="请填写" placeholder-style='font-size:14px;color:#bbb;' auto-height bindblur="onblur" />
</view>
<view class="tips">请选择付费版本</view>
<van-radio-group value="{{ sys_site_systempartitionid }}">
    <navigator class="versions" url="#" wx:for="{{versionsList}}" wx:key="sys_site_systempartitionid" data-item="{{item}}" bindtap="changeVer">
        <van-radio name="{{item.sys_site_systempartitionid}}" icon-size="16px">版本：{{item.partitionname}}</van-radio>
        <view data-item="{{item}}" catchtap="checkVer">
            详情
        </view>
    </navigator>
</van-radio-group>
<block wx:if="{{discounts.length}}">
    <view class="tips">使用抵扣劵</view>
    <scroll-view scroll-x>
        <view class="discounts">
            <view class="card" wx:for="{{discounts}}" style="background: {{(index-0+1)<=useDiscount?'linear-gradient(45deg, orange, red)':'linear-gradient(45deg, grey, grey)'}};" wx:key="index">
                <view class="card-left">抵扣一年</view>
                <view class="card-right">
                    <view class="card-info">{{item.type}}折扣券</view>
                    <view class="card-time">有效期至{{item.enddate}}</view>
                </view>
            </view>
        </view>
    </scroll-view>
</block>

<view class="tips">请选择付费{{sys_payincidence==1?'账号':'主体'}}</view>
<van-checkbox-group wx:if="{{sys_payincidence==1}}" value="{{ users }}">
    <view class="user-item" wx:for="{{userList}}" wx:key="userid" data-id="{{item.userid}}" data-isleader="{{item.isleader}}" bindtap="{{(item.isleader && per.query(users,item.userid) && !item.enddate[sys_site_systempartitionid])?'':'onChange'}}">
        <van-checkbox shape='square' icon-size='14' disabled="{{item.isleader && per.query(users,item.userid) && !item.enddate[sys_site_systempartitionid]}}" name="{{item.userid}}" />
        <view class="content">
            <view class="label">
                {{item.name}} <van-tag custom-class='tag1' wx:if="{{item.isleader==1}}" text-color='#fff' round type="danger">主账号</van-tag>
            </view>
            <view>
                账号ID:{{item.accountno}}
            </view>
            <view>
                手机号:{{item.phonenumber||" --"}}
            </view>
            <view>
                到期时间:{{item.enddate[sys_site_systempartitionid]||' --'}}
            </view>
            <view class="tag" wx:if="{{!item.enddate[sys_site_systempartitionid]}}">
                未付费
            </view>
        </view>
    </view>
</van-checkbox-group>
<van-checkbox-group wx:else value="{{ users }}">
    <view class="user-item" wx:for="{{userList}}" wx:key="sa_agentsid" data-id="{{item.sa_agentsid}}" bindtap="onChange">
        <van-checkbox shape='square' icon-size='14' name="{{item.sa_agentsid}}" />
        <view class="content">
            <view class="label">{{item.agentname}}</view>
            <view>
                联系人:{{item.name}} {{item.phonenumber||" --"}}
            </view>
            <view>
                到期时间:{{item.enddate[sys_site_systempartitionid]||' --'}}
            </view>
        </view>
    </view>
</van-checkbox-group>
<inventory id='inventory' />
<view style="height: 130rpx;" />
<view class="footer">
    <view class="left">
        <view>
            支付数量：{{users.length}}
        </view>
        <view>
            总价：<text class="price">{{showAmount}}</text>
        </view>
    </view>
    <view class="but-box">
        <van-button custom-class='but' disabled="{{users.length==0}}" bind:click="payment">确定支付</van-button>
    </view>
</view>
<wxs src='../../utils/wxmlQueryPer.wxs' module="per" />