{layout:default} {class:Shop.Admin.user.UserLevel_Edit}
<lbhead>
    <title><%=Shop.Bussiness.Language.Content(model.Name, CurrentLanguage.Code) %>-<%=Tag("会员分组")%>-<%=site.title%></title>
</lbhead>
<lbpath>
    <h3 class="text-themecolor m-b-0 m-t-0"><%=Tag("会员分组")%></h3>
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="<%=site.AdminPath %>/Ajax/ajax_admin.aspx?__Action=MenuJump&pid=0"><%=Tag("管理首页")%></a></li>
        <li class="breadcrumb-item"><a href="<%=site.AdminPath %>/user/default.aspx"><%=Tag("会员管理")%></a></li>
        <li class="breadcrumb-item"><a href="<%=site.AdminPath %>/user/UserLevel.aspx"><%=Tag("会员分组")%></a></li>
        <li class="breadcrumb-item active"><%=Shop.Bussiness.Language.Content(model.Name, CurrentLanguage.Code) %></li>
    </ol>
</lbpath>
<lbbody>
    <div class="col-12">
        <div class="card">
            <div class="card-body">
                <form action="javascript:SaveObj();" novalidate>
                    <ul class="nav nav-tabs customtab" role="tablist">
                        <%
                        List<DB.LebiShop.Lebi_Language_Code> nav_langs = Shop.Bussiness.Language.Languages();foreach (DB.LebiShop.Lebi_Language_Code lang in nav_langs){
                        %>
                        <li class="nav-item"> <a class="nav-link <%if (nav_langs.FirstOrDefault().Code == lang.Code){%>active show<%}%>" data-toggle="tab" href="#lang_<%=lang.Code %>" role="tab" aria-selected="true"><%=lang.Name %></a> </li>
                        <%
                        }
                        %>
                    </ul>
                    <div class="tab-content m-t-20">
                        <%
                        foreach (DB.LebiShop.Lebi_Language_Code lang in nav_langs)
                        {%>
                        <div class="tab-pane <%if (nav_langs.FirstOrDefault().Code == lang.Code){%>active show<%}%>" id="lang_<%=lang.Code %>" role="tabpanel">
                            <div class="form-group">
                                <label for="Name<%=lang.Code %>"><%=Tag("分组名称")%>：</label>
                                <input type="text" id="Name<%=lang.Code %>" name="Name<%=lang.Code %>" value="<%=Shop.Bussiness.Language.Content(model.Name,lang.Code) %>" <%if (nav_langs.FirstOrDefault().Code == lang.Code){%>required<%}%> class="form-control" shop="true">
                            </div>
                            <div class="form-group">
                                <label for="PriceName<%=lang.Code %>"><%=Tag("价格文字")%>：</label>
                                <input type="text" id="PriceName<%=lang.Code %>" name="PriceName<%=lang.Code %>" value="<%=Shop.Bussiness.Language.Content(model.PriceName,lang.Code) %>" <%if (nav_langs.FirstOrDefault().Code == lang.Code){%>required<%}%> class="form-control" shop="true">
                            </div>
                        </div>
                        <%} %>
                    </div>
                    <h5 class="box-title m-t-20 m-b-20"><%=Tag("通用信息")%></h5>
                    <div class="form-group">
                        <label for="Grade"><%=Tag("等级ID")%>：</label>
                        <input type="text" id="Grade" name="Grade" value="<%=model.Grade %>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d]/g,'')">
                        <small class="form-text text-muted"><%=Tag("填0表示未登录的访客")%></small>
                    </div>
                    <div class="form-group">
                        <label for="Lpoint"><%=Tag("升级积分")%>：</label>
                        <input type="text" id="Lpoint" name="Lpoint" value="<%=model.Lpoint %>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d]/g,'')">
                        <small class="form-text text-muted"><%=Tag("升级会员等级所需积分")%></small>
                    </div>
                    <div class="form-group">
                        <label for="Price"><%=Tag("会员价格")%>：</label>
                        <div class="input-group">
                            <div class="input-group-prepend">
                                <span class="input-group-text"><%=Tag("销售价")%>× </span>
                            </div>
                            <input type="text" id="Price" name="Price" value="<%=model.Price %>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d]/g,'')">
                        </div>
                        <small class="form-text text-muted"><%=Tag("1~100的数字")%></small>
                    </div>
                    <div class="form-group">
                        <label for="ImageUrl"><%=Tag("等级图标")%>：</label>
                        <div class="input-group">
                            <div class="input-group-prepend">
                                <span class="input-group-text" id="image_ImageUrl"><%if (model.ImageUrl != ""){%><img src="<%=site.WebPath + model.ImageUrl%>" height="20" /><%}else{ %><i class="ti-image"></i><%}%></span>
                            </div>
                            <input type="text" id="ImageUrl" name="ImageUrl" value="<%=model.ImageUrl %>" class="form-control" shop="true">
                            <div class="input-group-append fileupload">
                                <span class="input-group-text"><i class="ti-upload"></i></span>
                                <input type="file" id="file_ImageUrl" name="file_ImageUrl" class="upload" onchange="uploadImage('ImageUrl')">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="MoneyToPoint"><%=Tag("积分比率")%>：</label>
                        <input type="text" id="MoneyToPoint" name="MoneyToPoint" value="<%=model.MoneyToPoint %>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d]/g,'')">
                        <small class="form-text text-muted"><%=Tag("消费1元可获得积分")%></small>
                    </div>
                    <div class="form-group">
                        <label for="PointToMoney"><%=Tag("积分兑换规则")%>：</label>
                        <input type="text" id="PointToMoney" name="PointToMoney" value="<%=model.PointToMoney %>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d]/g,'')">
                        <small class="form-text text-muted">100:1,200:2,500:5,1000:10</small>
                    </div>
                    <div class="form-group">
                        <label for="RegisterType_1"><%=Tag("会员注册")%>：</label>
                        <div class="input-group">
                            <label class="custom-control custom-radio m-r-20">
                                <input type="radio" id="RegisterType_1" name="RegisterType" value="1" class="custom-control-input" shop="true" <%=model.RegisterType==1?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("开启")%></span>
                            </label>
                            <label class="custom-control custom-radio m-r-20">
                                <input type="radio" id="RegisterType_0" name="RegisterType" value="0" class="custom-control-input" shop="true" <%=model.RegisterType==0?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("关闭")%></span>
                            </label>
                            <label class="custom-control custom-radio">
                                <input type="radio" id="RegisterType_2" name="RegisterType" value="2" class="custom-control-input" shop="true" <%=model.RegisterType==2?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("邀请")%></span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="IsUsedAgent_1"><%=Tag("推广佣金")%>：</label>
                        <div class="input-group">
                            <label class="custom-control custom-radio m-r-20">
                                <input type="radio" id="IsUsedAgent_1" name="IsUsedAgent" value="1" class="custom-control-input" shop="true" <%=model.IsUsedAgent==1?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("开启")%></span>
                            </label>
                            <label class="custom-control custom-radio">
                                <input type="radio" id="IsUsedAgent_0" name="IsUsedAgent" value="0" class="custom-control-input" shop="true" <%=model.IsUsedAgent==0?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("关闭")%></span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="IsHidePrice_1"><%=Tag("隐藏价格")%>：</label>
                        <div class="input-group">
                            <label class="custom-control custom-radio m-r-20">
                                <input type="radio" id="IsHidePrice_1" name="IsHidePrice" value="1" class="custom-control-input" shop="true" <%=model.IsHidePrice==1?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("开启")%></span>
                            </label>
                            <label class="custom-control custom-radio">
                                <input type="radio" id="IsHidePrice_0" name="IsHidePrice" value="0" class="custom-control-input" shop="true" <%=model.IsHidePrice==0?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("关闭")%></span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="BuyRight_1"><%=Tag("购买权限")%>：</label>
                        <div class="input-group">
                            <label class="custom-control custom-radio m-r-20">
                                <input type="radio" id="BuyRight_1" name="BuyRight" value="1" class="custom-control-input" shop="true" <%=model.BuyRight==1?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("开启")%></span>
                            </label>
                            <label class="custom-control custom-radio">
                                <input type="radio" id="BuyRight_0" name="BuyRight" value="0" class="custom-control-input" shop="true" <%=model.BuyRight==0?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("关闭")%></span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="Comment_1"><%=Tag("评论审核")%>：</label>
                        <div class="input-group">
                            <label class="custom-control custom-radio m-r-20">
                                <input type="radio" id="Comment_1" name="Comment" value="1" class="custom-control-input" shop="true" <%=model.Comment==1?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("开启")%></span>
                            </label>
                            <label class="custom-control custom-radio">
                                <input type="radio" id="Comment_0" name="Comment" value="0" class="custom-control-input" shop="true" <%=model.Comment==0?"checked":"" %>>
                                <span class="custom-control-label"><%=Tag("关闭")%></span>
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="Status"><%=Tag("订单提交")%>：</label>
                        <div class="row">
                            <div class="col-sm-6">
                                <label for="OrderSubmit"><%=Tag("金额大于")%>：</label>
                                <input type="text" id="OrderSubmit" name="OrderSubmit" value="<%=model.OrderSubmit%>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d\.]/g,'')">
                            </div>
                            <div class="col-sm-6">
                                <label for="OrderSubmitCount"><%=Tag("数量大于")%>：</label>
                                <input type="text" id="OrderSubmitCount" name="OrderSubmitCount" value="<%=model.OrderSubmitCount%>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d\.]/g,'')">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="Status"><%=Tag("登录积分")%>：</label>
                        <div class="row">
                            <div class="col-sm-6">
                                <label for="LoginPointCut"><%=Tag("增加")%>：</label>
                                <input type="text" id="LoginPointCut" name="LoginPointCut" value="<%=model.LoginPointCut%>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d\.]/g,'')">
                            </div>
                            <div class="col-sm-6">
                                <label for="LoginPointAdd"><%=Tag("减少")%>：</label>
                                <input type="text" id="LoginPointAdd" name="LoginPointAdd" value="<%=model.LoginPointAdd%>" class="form-control" shop="true" onkeyup="value=value.replace(/[^\d\.]/g,'')">
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="Remark"><%=Tag("内部备注")%>：</label>
                        <textarea id="remark" name="remark" rows="6" class="form-control" style="height:60px;" shop="true"><%=model.remark%></textarea>
                        <div class="button-group m-t-5">
                            <button type="button" class="btn btn-default btn-xs btn-sm" onclick="javascript:resizeEditor('remark',100);"><%=Tag("展开")%></button>
                            <button type="button" class="btn btn-default btn-xs btn-sm" onclick="javascript:resizeEditor('remark',-100);"><%=Tag("收缩")%></button>
                        </div>
                    </div>
                    <%if (PageReturnMsg == ""){%>
                    <button type="submit" class="btn btn-success"><i class="ti-check"></i> <%=Tag("保存")%></button>
                    <%}%>
                </form>
            </div>
        </div>
    </div>
</lbbody>
<lbscripts>
    <script src="<%=site.AdminJsPath %>/ajaxfileupload.js"></script>
    <script>
        ! function(window, document, $) {
            "use strict";
            $("input,select,textarea").not("[type=submit]").jqBootstrapValidation()
        }(window, document, jQuery);
        function uploadImage(id) {
            $.ajaxFileUpload({
	            url: WebPath + '/ajax/imageuploadone.aspx?path=config',
	            secureuri: false,
	            fileElementId: 'file_' + id,
	            dataType: 'json',
	            success: function (data, status) {
	                if (data.msg != 'OK') {
	                    MsgBox(2, data.msg, "");
	                }
	                else {
	                    var imageUrl = data.ImageUrl;
	                    if (imageUrl.length > 0) {
	                        $("#image_" + id + "").html('<img src="' + WebPath + imageUrl + '" height="20">');
	                        $("#" + id + "").val(imageUrl);
	                    }
	                }
	            },
	            error: function (data, status, e) {
	                MsgBox(2, data.error, "");
	            }
	        })
        }
        function SaveObj() {
            var postData = GetFormJsonData("shop");
            var url= "<%=site.AdminPath %>/ajax/ajax_user.aspx?__Action=UserLevel_Edit&id=<%=model.id %>";
            RequestAjax(url,postData,function(res){MsgBox(1, "<%=Tag("操作成功")%>", "userLevel.aspx");});
        }
    </script>
</lbscripts>