$(function () {
    const common_request = new SendRequest();
    const {code, msg, data} = common_request.requestSend('/index.php?m=other&c=tools&a=get_tools&scene=2', 'GET', {});
    let str = '';
    const default_str = `<div class="xf_div">&nbsp;</div> 
            <a class="" target="_blank" href="/zjqh/tutorship/2023270328.html">
                <li>冲刺集训营</li>
            </a>
            <div class="xf_div">&nbsp;</div>
            <a class="" target="_blank" href="/zjqh/tutorship/2023276299.html">
                <li>暑期集训营</li>
            </a>
            <div class="xf_div">&nbsp;</div>
            <a class="" target="_blank" href="/zjqh/tutorship/2023272413.html">
                <li>在职考研</li>
            </a>
            <div class="xf_div">&nbsp;</div> 
            <a class="" target="_blank" href="/zt/kygy/">
                <li>启航之家</li>
            </a>
            <div class="xf_div">&nbsp;</div>            
            <a class="" target="_blank" href="/ztm/yiduiyi/">
                <li>考研一对一</li>
            </a>
            <div class="xf_div">&nbsp;</div>
            <a class="" target="_blank" href="/schoollist/">
                <li>考研择校</li>
            </a>`;
    if (code == 20000) {
        if (data.length != 0) {
            $.each(data, (key, val) => {
                $.each(val.options, (k, item) => {
                    str += `
                    <div class="xf_div">&nbsp;</div>
                    <a class="" target="_blank" href="${item.url}">
                    <li>${item.text}</li>
                    </a>
                    `;
                })
            });
        } else {
            str = default_str;
        }
    } else {
        str = default_str;
    }

    $(document.body).append(`<img class="close" src="/images/xf_left/close.png" alt="">
        <script>
        var jump_url = window.location.href;
        </script>
        <div class="xf_right">
            <img class="xf_del" src="/images/xf_left/xf_del.png" alt=""> <!-- 关闭键 -->
            <img class="xf_ren" src="/images/xf_left/xf_ren.png" alt="">
            <ul class="xf_ul">
                ${str}
                <div class="xf_div">&nbsp;</div>
                <p class="xf_tel">
                    <span>400-1087-500</span>
                </p>
            </ul>
        </div>`);

    $(".xf_del").on("click", function () {
        $(".xf_right").hide();
    });
});
