manualStopTransfer.html 2.63 KB
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title>Yoho!Buy运营平台</title>
    <script src="/ufoPlatform/js/include.js"></script>
</head>
<body class="easyui-layout">

<div region="north" style="height:700px;">
    <script>
        document.write(addHead('打款管理', '转账开关'));
    </script>

    <div style="padding:20px;">
        <h3>是否需要用户申请转账</h3>
        <label id="transferNeedUserApplyCash"></label>
        <a id="transferNeedUserApplyCashOpen" class="btn-info">开启</a>
        <a id="transferNeedUserApplyCashClose" class="btn-info">关闭</a>
    </div>

    <div style="padding:20px;">
        <h3>是否可以转账</h3>
        <label id="transferSwitch"></label>
        <a id="transferSwitchOpen" class="btn-info">开启</a>
        <a id="transferSwitchClose" class="btn-info">关闭</a>
    </div>
</div>


<script>
    $(function () {
        loadData();
        buttonAction("#transferNeedUserApplyCashOpen","/tradeBills/switch/transferNeedUserApplyCashOpen");
        buttonAction("#transferNeedUserApplyCashClose","/tradeBills/switch/transferNeedUserApplyCashClose");
        buttonAction("#transferSwitchOpen","/tradeBills/switch/transferSwitchOpen");
        buttonAction("#transferSwitchClose","/tradeBills/switch/transferSwitchClose");
    });

    function buttonAction(btn, url) {
        $(btn).linkbutton({
            iconCls: "icon-search",
            onClick: function () {
                $.ajax({
                    type: "POST",
                    url: contextPath + url,
                    async: false,
                    cache: false,
                    dataType: 'json',
                    success: function (result) {
                        if (result.code == 200) {
                            window.self.$.messager.show({
                                title: "提示",
                                msg: "操作成功!"
                            });
                        }
                        loadData();
                    }
                });
            }
        });
    }

    function loadData() {
        load('/tradeBills/switch/transferSwitch', '#transferSwitch');
        load('/tradeBills/switch/transferNeedUserApplyCash', '#transferNeedUserApplyCash');
    }

    function load(url, view) {
        $.ajax({
            type: "POST",
            url: contextPath + url,
            async: false,
            cache: false,
            dataType: 'json',
            success: function (result) {
                if (result.code == 200) {
                    $(view).text(result.data);
                }
            }
        });
    }

</script>
</body>
</html>