{$layout "layout_popup"}

<!-- <h3>新购用户套餐</h3> -->

<form class="ui form" data-tea-action="$" data-tea-success="success">
    <csrf-token></csrf-token>

    <table class="ui table definition selectable">
        <tr>
            <td class="title">用户 *</td>
            <td>
                <user-selector></user-selector>
            </td>
        </tr>
        <tr>
            <td>套餐 *</td>
            <td>
                <b-select
                    name="planId"
                    v-model="planId"
                    auto-width
                    :options="[
                        {label: '[选择套餐]', value: '0'},
                        ...plans.map(plan => ({
                            label: plan.name,
                            value: plan.id,
                        }))
                    ]"
                ></b-select>

                <!-- <select class="ui dropdown auto-width" name="planId">
                    <option value="0">[选择套餐]</option>
                    <option v-for="plan in plans" :value="plan.id">{{plan.name}}</option>
                </select> -->
            </td>
        </tr>
        <tr>
            <td>周期 *</td>
            <td>
                <b-select
                    name="periodUnit"
                    v-model="periodUnit"
                    auto-width
                    :options="[
                        {label: '按月', value: 'monthly'},
                        {label: '按年', value: 'yearly'},
                    ]"
                ></b-select>

                <!-- <select class="ui dropdown auto-width" name="periodUnit">
                    <option value="monthly">按月</option>
                    <option value="yearly">按年</option>
                </select> -->
            </td>
        </tr>
        <tr>
            <td>到期日期 *</td>
            <td>
                <datepicker :v-name="'dayTo'"></datepicker>
            </td>
        </tr>
    </table>

    <submit-btn></submit-btn>
</form>