@using MySystem.BsModels;
@{PublicAccountSet editData = ViewBag.data as PublicAccountSet;}
@{
    string RightInfo = ViewBag.RightInfo as string;
    string right = ViewBag.right as string;
}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>第三方设置(修改)</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/layuiadmin/layui/css/layui.css" media="all">
    <script src="/admin/js/jquery-1.10.1.min.js"></script>
    <script src="/admin/js/LAreaData2.js"></script>
</head>
<body style="background-color:#fff;">

    <div class="layui-form" style="padding: 20px 0 0 0;">
        <form class="layui-form" id="confirmFrm">
            <div class="layui-card">
          <div class="layui-card-body">
        <div class="layui-tab" lay-filter="mytabbar">
                <ul class="layui-tab-title">
                    <li class="layui-this" lay-id="1">支付宝</li>
                    <li lay-id="2">微信</li>
                    <li lay-id="3">阿里云</li>
                    <li lay-id="4">物流</li>
                    <li lay-id="5">短信</li>
                </ul>
                <div class="layui-tab-content mt20">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-form-item">
                            <label class="layui-form-label">支付宝AppId</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="AlipayAppId" name="AlipayAppId" value="@editData.AlipayAppId" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入支付宝AppId">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">支付宝合作者Id</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="AlipayPartnerId" name="AlipayPartnerId" value="@editData.AlipayPartnerId" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入支付宝合作者Id">
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">支付宝私钥</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea" id="AlipayPrivateKey" name="AlipayPrivateKey" lay-verify="" placeholder="请输入支付宝私钥">@editData.AlipayPrivateKey</textarea>
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">支付宝公钥</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea" id="AlipayPublicKey" name="AlipayPublicKey" lay-verify="" placeholder="请输入支付宝公钥">@editData.AlipayPublicKey</textarea>
                            </div>
                        </div>

                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信公众号AppId</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="WeChatAppId" name="WeChatAppId" value="@editData.WeChatAppId" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入微信公众号AppId">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信公众号AppSecret</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="WeChatAppSecret" name="WeChatAppSecret" value="@editData.WeChatAppSecret" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入微信公众号AppSecret">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信商户号</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="WeChatMchId" name="WeChatMchId" value="@editData.WeChatMchId" maxlength="20" lay-verify="" autocomplete="off" placeholder="请输入微信商户号">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信支付密钥</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="WeChatPayKey" name="WeChatPayKey" value="@editData.WeChatPayKey" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入微信支付密钥">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信开放平台AppId</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="WeChatOpenAppId" name="WeChatOpenAppId" value="@editData.WeChatOpenAppId" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入微信开放平台AppId">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信开放平台AppSecret</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="WeChatOpenAppSecret" name="WeChatOpenAppSecret" value="@editData.WeChatOpenAppSecret" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入微信开放平台AppSecret">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信小程序AppId</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="WeChatMiniAppId" name="WeChatMiniAppId" value="@editData.WeChatMiniAppId" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入微信公众号AppId">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">微信小程序AppSecret</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="WeChatMiniAppSecret" name="WeChatMiniAppSecret" value="@editData.WeChatMiniAppSecret" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入微信公众号AppSecret">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">服务器IP</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="ServerIp" name="ServerIp" value="@editData.ServerIp" maxlength="15" lay-verify="" autocomplete="off" placeholder="请输入服务器IP">
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form-item">
                            <label class="layui-form-label">阿里云AccessKeyID</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="AliyunAccessKeyId" name="AliyunAccessKeyId" value="@editData.AliyunAccessKeyId" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入阿里云AccessKeyID">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">阿里云AccessKeySecret</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="AliyunAccessKeySecret" name="AliyunAccessKeySecret" value="@editData.AliyunAccessKeySecret" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入阿里云AccessKeySecret">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">阿里云推送安卓AppId</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="AliyunPushAndroidAppId" name="AliyunPushAndroidAppId" value="@editData.AliyunPushAndroidAppId" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入阿里云推送安卓AppId">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">阿里云推送安卓AppSecret</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="AliyunPushAndroidAppSecret" name="AliyunPushAndroidAppSecret" value="@editData.AliyunPushAndroidAppSecret" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入阿里云推送安卓AppSecret">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">阿里云推送IOSAppId</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="AliyunPushIosAppId" name="AliyunPushIosAppId" value="@editData.AliyunPushIosAppId" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入阿里云推送IOSAppId">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">阿里云推送IOSAppSecret</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="AliyunPushIosAppSecret" name="AliyunPushIosAppSecret" value="@editData.AliyunPushIosAppSecret" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入阿里云推送IOSAppSecret">
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form-item">
                            <label class="layui-form-label">MobAppKey</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="MobAppKey" name="MobAppKey" value="@editData.MobAppKey" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入MobAppKey">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">MobAppSecret</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="MobAppSecret" name="MobAppSecret" value="@editData.MobAppSecret" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入MobAppSecret">
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form-item">
                            <label class="layui-form-label">请求地址</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="ErpApiUrl" name="ErpApiUrl" value="@editData.ErpApiUrl" maxlength="200" lay-verify="" autocomplete="off" placeholder="请输入请求地址">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">appcode</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="ErpAppCode" name="ErpAppCode" value="@editData.ErpAppCode" maxlength="100" lay-verify="" autocomplete="off" placeholder="请输入appcode">
                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-form-item">
                            <label class="layui-form-label">账号</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="SmsApiUserId" name="SmsApiUserId" value="@editData.SmsApiUserId" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入SMS账号">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">密码</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="SmsApiPwd" name="SmsApiPwd" value="@editData.SmsApiPwd" maxlength="50" lay-verify="" autocomplete="off" placeholder="请输入SMS密码">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">签名</label>
                            <div class="layui-input-block">
                                <input class="layui-input" type="text" id="SmsApiSign" name="SmsApiSign" value="@editData.SmsApiSign" maxlength="10" lay-verify="" autocomplete="off" placeholder="请输入SMS签名">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">验证码模板</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea" id="SmsApiDefaultTemplate" name="SmsApiDefaultTemplate" maxlength="200" lay-verify="" placeholder="请输入验证码模板">@editData.SmsApiDefaultTemplate</textarea>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-form-item ml10">
                <div class="layui-input-block">
                    <button type="button" class="layui-btn" onclick="save()">立即提交</button>
                </div>
            </div>
        </form>
    </div>

    <script src="/layuiadmin/layui/layui.js"></script>
    <script src="/other/oss/upload-min@(MySystem.OssHelper.Instance.OssStatus ? "-oss" : "").js"></script>
    <script src="/other/mybjq/kindeditor-min.js"></script>
    <script src="/other/mybjq/lang/zh_CN.js"></script>
    <script>function save() {
            var index = layer.load(1, {
                shade: [0.5, '#000']
            });
            var userdata = $("#confirmFrm").serialize();
            $.ajax({
                type: "POST",
                url: "/Admin/PublicAccountSet/Edit?r=" + Math.random(1),
                data: userdata,
                dataType: "text",
                success: function (data) {
                    layer.close(index); //关闭弹层
                    if (data == "success") {
                        layer.msg("修改成功");
                    } else {
                        layer.msg(data);
                    }
                }
            });
        }

        //编辑器
        KindEditor.ready(function (K) {

        });

        var ids = "";
        function getChildren(obj) {
            $.each(obj, function (index, value) {
                var id = obj[index].id;
                ids += id + ",";
                var children = obj[index].children;
                if (children) {
                    getChildren(children);
                }
            });
        }

        function AreasProvinceInit(tagId, areasVal, form) {
            for (var i = 0; i < provs_data.length; i++) {
                var sel = "";
                if (areasVal.indexOf(provs_data[i].text) > -1) {
                    sel = " selected=selected";
                }
                $("#" + tagId + "Province").append('<option value="' + provs_data[i].value + '"' + sel + '>' + provs_data[i].text + '</option>');
            }
            form.render();
        }

        function AreasProvinceSelected(tagId, areasVal, form, value) {
            $("#" + tagId + "City").html('<option value="">市</option>');
            var list = citys_data[value];
            for (var i = 0; i < list.length; i++) {
                var sel = "";
                if (areasVal.indexOf(list[i].text) > -1) {
                    sel = " selected=selected";
                }
                $("#" + tagId + "City").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
            }
            $("#" + tagId + "Area").html('<option value="">县/区</option>');
            form.render();
            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
        }

        function AreasCitySelected(tagId, areasVal, form, value) {
            $("#" + tagId + "Area").html('<option value="">县/区</option>');
            var list = dists_data[value];
            for (var i = 0; i < list.length; i++) {
                var sel = "";
                if (areasVal.indexOf(list[i].text) > -1) {
                    sel = " selected=selected";
                }
                $("#" + tagId + "Area").append('<option value="' + list[i].value + '"' + sel + '>' + list[i].text + '</option>');
            }
            form.render();
            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
        }

        function AreasAreaSelected(tagId, form) {
            form.render();
            $("#" + tagId + "").val($("#" + tagId + "Province option:selected").text() + "," + $("#" + tagId + "City option:selected").text() + "," + $("#" + tagId + "Area option:selected").text());
        }
        function movePrev(obj, tagId) {
            $(obj).parent().prev().insertAfter($(obj).parent());
            checkPics(tagId);
        }
        function moveNext(obj, tagId) {
            $(obj).parent().next().insertBefore($(obj).parent());
            checkPics(tagId);
        }
        function deletePic(obj, tagId) {
            $(obj).parent().remove();
            checkPics(tagId);
        }
        function checkPics(tagId) {
            var pics = "";
            var texts = "";
            $("#" + tagId + "Image div img").each(function (i) {
                pics += $(this).attr("src").replace(osshost, '') + "|";
            });
            $("#" + tagId + "Image div input").each(function (i) {
                texts += $(this).val() + "|";
            });
            if (pics == "") {
                $("#" + tagId).val("");
            } else {
                pics = pics.substring(0, pics.length - 1);
                texts = texts.substring(0, pics.length - 1);
                $("#" + tagId).val(pics + "#cut#" + texts);
            }
        }
        function checkBox(tagId) {
            var text = "";
            $("input[type=checkbox][name=" + tagId + "List]:checked").each(function (i) {
                text += $(this).val() + ",";
            });
            $("#" + tagId).val(text);
        }
        function showBigPic(picpath) {
            parent.layer.open({
                type: 1,
                title: false,
                closeBtn: 0,
                shadeClose: true,
                area: ['auto', 'auto'],
                content: '<img src="' + picpath + '" style="max-width:800px; max-height:800px;" />'
            });
        }

        var tree;
        layui.config({
            base: '/layuiadmin/' //静态资源所在路径
        }).extend({
            index: 'lib/index' //主入口模块
        }).use(['index', 'form', 'upload', 'layedit', 'laydate', 'element', 'croppers', 'transfer', 'tree', 'util'], function () {
            var $ = layui.$
                , form = layui.form
                , element = layui.element
                , layer = layui.layer
                , layedit = layui.layedit
                , laydate = layui.laydate
                , croppers = layui.croppers
                , upload = layui.upload
                , transfer = layui.transfer
                , util = layui.util;
            tree = layui.tree;

            //Hash地址的定位
            var layid = location.hash.replace(/^#test=/, '');
            element.tabChange('test', layid);
            element.on('tab(test)', function (elem) {
                location.hash = 'test=' + $(this).attr('lay-id');
            });

            //日期


            //上传文件


            //穿梭框


            //TreeView，比如权限管理


            //省市区

        })</script>
</body>
</html>