Server : Apache
System : Linux iZ6xhqomji47p1Z 5.10.134-15.al8.x86_64 #1 SMP Thu Jul 20 00:44:04 CST 2023 x86_64
User : www ( 1000)
PHP Version : 8.1.30
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Directory :  /www/wwwroot/fsjlkj.cn/application/admin/template/system/
Upload File :
Current Directory [ Writeable ] Root Directory [ Writeable ]


Current File : /www/wwwroot/fsjlkj.cn/application/admin/template/system/sms.htm
{include file="public/layout" /}
<body class="bodystyle" style="overflow-y: scroll;min-width:auto;">
<div id="toolTipLayer" style="position: absolute; z-index: 9999; display: none; visibility: visible; left: 95px; top: 573px;"></div>
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page" style="min-width: auto;box-shadow:none;">
    <div class="fixed-bar">
        <div class="item-title">
            <a class="back_xin" href="{:url('System/api_conf')}" title="返回"><i class="iconfont e-fanhui"></i></a>
            <div class="subject">
                <h3>云短信</h3>
                <h5></h5>
            </div>
            <ul class="tab-base nc-row">
                {eq name="'System@sms'|is_check_access" value="1"}
                <li><a href="{:url('System/sms')}" {if condition="'sms'==$Think.const.ACTION_NAME"}class="current"{/if}><span>短信配置</span></a></li>
                {/eq}

                {eq name="'System@sms_tpl'|is_check_access" value="1"}
                <li><a href="{:url('System/sms_tpl')}" {if condition="'sms_tpl'==$Think.const.ACTION_NAME"}class="current"{/if}><span>自定义模板</span></a></li>
                {/eq}
            </ul>
        </div>
    </div>
    <form class="form-horizontal" id="postSmsForm" method="post">
        <div class="ncap-form-default">
            <dl class="row">
                <dt class="tit">
                    <label for="sms_type">短信平台</label>
                </dt>
                <dd class="opt">
                    <label class="curpoin"><input type="radio" name="sms_type" value="1" onclick="changeSmsType(this);" {if condition="empty($sms.sms_type) || $sms.sms_type eq 1"}checked="checked"{/if}>阿里云短信</label>
                    &nbsp;&nbsp;
                    <label class="curpoin"><input type="radio" name="sms_type" value="2" onclick="changeSmsType(this);" {if condition="isset($sms.sms_type) && $sms.sms_type eq 2"}checked="checked"{/if}>腾讯云短信</label>
                    <input type="hidden" id="old_sms_type" value="{if condition="empty($sms.sms_type) || $sms.sms_type eq 1"}1{else /}2{/if}">
                    <p class="notic"></p>
                </dd>
            </dl>
            <dl class="row" id="sms_appkey_1" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 1"} block{else /}none{/if};" >
                <dt class="tit">
                    <em>*</em>
                    <label for="sms_appkey">平台appkey</label>
                </dt>
                <dd class="opt">
                    <input id="sms_appkey" name="sms_appkey" value="{$sms.sms_appkey|default=''}" class="input-txt" type="text" autocomplete="off" />
                    <p class="notic">短信平台配置appkey</p>
                </dd>
            </dl>
            <dl class="row" id="sms_secretkey_1" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 1"} block{else /}none{/if};">
                <dt class="tit">
                    <em>*</em>
                    <label for="sms_secretkey">平台secretKey</label>
                </dt>
                <dd class="opt">
                    <input id="sms_secretkey" name="sms_secretkey" value="{$sms.sms_secretkey|default=''}" class="input-txt" type="text" autocomplete="off" />
                    <p class="notic">短信平台配置secretKey</p>
                </dd>
            </dl>

            <dl class="row" id="sms_secretkey_2" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 2"} block{else /}none{/if};">
                <dt class="tit">
                    <em>*</em>
                    <label for="sms_appid_tx">平台appid</label>
                </dt>
                <dd class="opt">
                    <input id="sms_appid_tx" name="sms_appid_tx" value="{$sms.sms_appid_tx|default=''}" class="input-txt" type="text" autocomplete="off" />
                    <p class="notic">短信平台配置appid</p>
                </dd>
            </dl>
            <dl class="row" id="sms_appkey_2" style="display: {if condition="!isset($sms.sms_type) || $sms.sms_type eq 2"} block{else /}none{/if};">
                <dt class="tit">
                    <em>*</em>
                    <label for="sms_appkey_tx">平台appkey</label>
                </dt>
                <dd class="opt">
                    <input id="sms_appkey_tx" name="sms_appkey_tx" value="{$sms.sms_appkey_tx|default=''}" class="input-txt" type="text" autocomplete="off" />
                    <p class="notic">短信平台配置appkey</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit"><em>*</em>管理员手机号</dt>
                <dd class="opt">
                    <input value="{$sms.sms_test_mobile|default=''}" name="sms_test_mobile" id="sms_test_mobile" placeholder="多个手机号码可以用逗号隔开" class="input-txt" type="text" onkeyup="this.value=this.value.replace(/,/g,',');" onpaste="this.value=this.value.replace(/,/g,',')" autocomplete="off">
                    <input value="测试发送" class="input-btn" onclick="sendMobile();" type="button">
                    <p class="notic">多个手机号码可以用逗号隔开</p>
                </dd>
            </dl>
            <dl class="row">
                <dt class="tit">接收提醒选项</dt>
                <dd class="opt">
                    <ul class="nc-row ncap-waybill-list">
                        <li style="width: 100%;">
                            <label class="label" >
                                <input class="check" type="checkbox" name="sms_shop_order_pay" {if condition="!empty($sms.sms_shop_order_pay)"} value="1" checked="checked" {/if}><span>有新订单</span>
                            </label>
                            &nbsp; &nbsp;
                            <label class="label" >
                                <input class="check" type="checkbox" name="sms_guestbook_send" {if condition="!empty($sms.sms_guestbook_send)"} value="1" checked="checked" {/if}><span>有新留言</span>
                            </label>
                        </li>
                    </ul>
                </dd>
            </dl>
            <dl class="row">
                <div class="bot" style="padding-bottom:0px;">
                    <a href="JavaScript:void(0);" onclick="submit_sms();" class="ncap-btn-big ncap-btn-green">确认提交</a>
                    &nbsp;<a href="JavaScript:void(0);" onclick="openArticle()" style="font-size: 12px;padding-left: 10px;position:absolute;top: 30px">不会配置?</a>
                </div>
            </dl>
        </div>
    </form>
</div>
<script type="text/javascript">
    var parentObj = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
    function submit_sms(){
        var sms_type = $("#old_sms_type").val();
        if (sms_type == 1) {
            if ($('#postSmsForm input[name="sms_appkey"]').val() == '') {
                showErrorMsg('请填写短信平台[appkey]!');
                $('#postSmsForm input[name=sms_appkey]').focus();
                return false;
            }
            if ($('#postSmsForm input[name="sms_secretkey"]').val() == '') {
                showErrorMsg('请填写短信平台[secretKey]!');
                $('#postSmsForm input[name=sms_secretkey]').focus();
                return false;
            }
        }else{
            if ($('#postSmsForm input[name="sms_appkey_tx"]').val() == '') {
                showErrorMsg('请填写短信平台[appkey]!');
                $('#postSmsForm input[name=sms_appkey_tx]').focus();
                return false;
            }
            if ($('#postSmsForm input[name="sms_appid_tx"]').val() == '') {
                showErrorMsg('请填写短信平台[appid]!');
                $('#postSmsForm input[name=sms_appid_tx]').focus();
                return false;
            }
        }

        var mobile = $('#sms_test_mobile').val();
        if (mobile == '') {
            showErrorMsg('接收的手机号码不能为空!');
            $('#postSmsForm input[name=sms_test_mobile]').focus();
            return false;
        }

        layer_loading("正在处理");
        $.ajax({
            url: "{:url('System/sms', ['_ajax'=>1])}",
            type: 'POST',
            dataType: 'JSON',
            data: $('#postSmsForm').serialize(),
            success: function(res){
                layer.closeAll();
                if (1 == res.code) {
                    layer.msg(res.msg, {shade: 0.1, time: 1000}, function(){
                        window.location.reload();
                    });
                } else {
                    var icon = 5;
                    try{
                        if (res.data.icon) {
                            icon = res.data.icon;
                        }
                    }catch(e){}
                    showErrorAlert(res.msg, icon);
                }
            },
            error: function(e){
                layer.closeAll();
                showErrorAlert(e.responseText);
            }
        });
    }

    function sendMobile() {
        var sms_type = $("#old_sms_type").val();
        if (sms_type == 1) {
            if ($('#postSmsForm input[name="sms_appkey"]').val() == '') {
                showErrorMsg('请填写短信平台[appkey]!');
                $('#postSmsForm input[name=sms_appkey]').focus();
                return false;
            }
            if ($('#postSmsForm input[name="sms_secretkey"]').val() == '') {
                showErrorMsg('请填写短信平台[secretKey]!');
                $('#postSmsForm input[name=sms_secretkey]').focus();
                return false;
            }
        }else{
            if ($('#postSmsForm input[name="sms_appkey_tx"]').val() == '') {
                showErrorMsg('请填写短信平台[appkey]!');
                $('#postSmsForm input[name=sms_appkey_tx]').focus();
                return false;
            }
            if ($('#postSmsForm input[name="sms_appid_tx"]').val() == '') {
                showErrorMsg('请填写短信平台[appid]!');
                $('#postSmsForm input[name=sms_appid_tx]').focus();
                return false;
            }
        }
        var mobile = $('#sms_test_mobile').val();
        if (mobile == '') {
            showErrorMsg('接收的手机号码不能为空!');
            $('#postSmsForm input[name=sms_test_mobile]').focus();
            return false;
        }
        var loading = layer_loading('发送中');
        $.ajax({
            type: "post",
            data: $('#postSmsForm').serialize(),
            dataType: 'json',
            url: "{:url('System/send_mobile')}",
            success: function (res) {
                layer.closeAll();
                if (res.code == 1) {
                    layer.msg('发送成功', {icon: 1, time:1000});
                } else {
                    layer.msg(res.msg, {icon: 2, time: 1000});
                }
            },
            error: function(e){
                layer.closeAll();
                showErrorAlert(e.responseText);
            }
        })
    }

    function changeSmsType(obj) {
        var new_sms_type = $("input[name=sms_type]:checked").val();
        var old_sms_type = $("#old_sms_type").val();
        if (new_sms_type) {
            $("#sms_appkey_"+old_sms_type).hide();
            $("#sms_secretkey_"+old_sms_type).hide();
            $("#sms_appkey_"+new_sms_type).show();
            $("#sms_secretkey_"+new_sms_type).show();
            $("#old_sms_type").val(new_sms_type);
        }
    }

    function openArticle() {
        var new_sms_type = $("input[name=sms_type]:checked").val();
        var aid = new_sms_type == 1?8754:11143;
        click_to_eyou_1575506523('https://www.eyoucms.com/plus/view.php?aid='+aid+'&origin_eycms=1','短信配置教程');
    }
</script> 

{include file="public/footer" /}