@page
@model Waste.Web.Entry.Pages.AppApi.EditModel
@{
    ViewData["Title"] = "授权管理";
}
<div class="layui-card">
    <div class="layui-card-body">
        <div class="layui-form">
            <div class="layui-form-item row">
                <label class="layui-form-label col-md-2" for="Name">商户</label>
                <div class="col-md-4">
                    <select id="id" name="id">
                        @foreach (var item in Model.blist)
                        {
                            if (Model.data.Id == item.Id)
                            {
                                <option value="@item.Id" selected>@item.Name</option>
                            }
                            else
                            {
                                <option value="@item.Id">@item.Name</option>
                            }
                        }
                    </select>
                </div>
            </div>
            <div class="layui-form-item row">
                <label class="layui-form-label col-md-2" for="pushurl">推送地址</label>
                <div class="col-md-4">
                    <input type="text" class="layui-input" value="@Model.data.PushUrl" name="pushurl" id="pushurl" placeholder="请输入推送地址" />
                    <span class="tiptext">必须以http开头</span>
                </div>
            </div>
            <div class="layui-form-item row">
                <label class="layui-form-label col-md-2" for="pushurl">IP白名单</label>
                <div class="col-md-8">
                    <textarea name="iplist" class="layui-textarea">@Model.data.IPList</textarea>
                    <span class="tiptext">多个IP之间以;分隔</span>
                </div>
            </div>
            <div class="text-center col-md-7">
                <button class="btn btn-primary btn-lg" lay-submit lay-filter="submit" type="button">提交</button>
            </div>
        </div>
    </div>
</div>
@section Scripts{
    <script type="text/javascript">
             layui.use(['form', 'common'], function () {
                 var form = layui.form,
                     common = layui.common;

                 form.on("submit(submit)", function (data) {
                     common.ajax({
                         url: "/api/business/submitapiform",
                         type: "post",
                         data: data.field
                     });
                 });
        });
    </script>
}