HEX
Server: nginx/1.28.1
System: Linux 10-41-63-61 6.8.0-31-generic #31-Ubuntu SMP PREEMPT_DYNAMIC Sat Apr 20 00:40:06 UTC 2024 x86_64
User: www (1001)
PHP: 7.4.33
Disabled: 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
Upload Files
File: /www/wwwroot/www.xxlht.com/application/admin/template/shop/conf.htm
{include file="public/layout" /}

<body class="bodystyle" style="overflow-y: scroll;">
<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>
{include file="shop/left" /}
<div class="page" style="min-width:auto; margin-left:98px;">
    <div class="flexigrid">
        <div class="mDiv">
            <div class="ftitle">
                <h3>功能配置</h3>
            </div>
        </div>
        <form class="form-horizontal" id="post_form" action="{:url('Shop/conf')}" method="post">
            <div class="ncap-form-default">
                <dl class="row">
                    <dt class="tit">
                        <label for="uname">商家提示</label>
                    </dt>
                    <dd class="opt">
                        <textarea name="shop[shop_prompt]" placeholder="此处文字将显示在会员下单确认页面上" style="width: 30%; height: 60px;">{$userConfig.shop_prompt}</textarea>
                    </dd>
                </dl>

                <dl class="row">
                    <dt class="tit">
                        <label for="uname">货到付款</label>
                    </dt>
                    <dd class="opt">
                        <label>
                            <input type="radio" name="shop[shop_open_offline]" value="0" {if condition="!isset($userConfig.shop_open_offline) || empty($userConfig.shop_open_offline)"}checked="checked"{/if}/>开启
                        </label>
                        &nbsp;&nbsp;&nbsp;
                        <label>
                            <input type="radio" name="shop[shop_open_offline]" value="1" {if condition="$userConfig.shop_open_offline == 1"}checked="checked"{/if}/>关闭
                        </label>
                    </dd>
                </dl>

                <dl class="row">
                    <dt class="tit">
                        <label for="username">运费模板</label>
                    </dt>
                    <dd class="opt" style="line-height: 30px;">
                        <label>
                            <input type="radio" name="shop[shop_open_shipping]" value="0" {if condition="!isset($userConfig.shop_open_shipping) || empty($userConfig.shop_open_shipping)"}checked="checked"{/if}/>包邮
                        </label>
                        &nbsp;&nbsp;&nbsp;
                        <label>
                            <input type="radio" name="shop[shop_open_shipping]" value="1" {if condition="$userConfig.shop_open_shipping == 1"}checked="checked"{/if}/>需要运费
                            &nbsp;<a id="a_shop_open_shipping" href="javascript:void(0);" onclick="SetShipping();" class="ncap-btn ncap-btn-green" {if condition="!isset($userConfig.shop_open_shipping) || empty($userConfig.shop_open_shipping)"}style="display:none;"{/if}>设置价格</a>
                        </label>
                    </dd>
                </dl>

                <dl class="row">
                    <dt class="tit">
                        <label for="uname">产品类型</label>
                    </dt>
                    <dd class="opt">
                        <label>
                            <input type="radio" name="shop[shop_type]" value="0" {if condition="!isset($userConfig.shop_type) || empty($userConfig.shop_type)"}checked="checked"{/if}/>实物
                        </label>
                        &nbsp;&nbsp;&nbsp;
                        <label>
                            <input type="radio" name="shop[shop_type]" value="1" {if condition="$userConfig.shop_type == 1"}checked="checked"{/if}/>虚拟
                        </label>
                        &nbsp;&nbsp;&nbsp;
                        <label>
                            <input type="radio" name="shop[shop_type]" value="2" {if condition="$userConfig.shop_type == 2"}checked="checked"{/if}/>两者均有
                        </label>
                    </dd>
                </dl>

                <dl class="row">
                    <dt class="tit">
                        <label for="username">商品规格</label>
                    </dt>
                    <dd class="opt" style="line-height: 30px;">
                        <input type="hidden" id="TestPass" name="TestPass" value="{$TestPass}">
                        <label><input type="radio" onclick="tag_call('shop_open', '{$TestPass}');" name="shop[shop_open_spec]" value="1" {if condition="$userConfig.shop_open_spec == 1"}checked="checked"{/if}/>开启</label>
                        &nbsp;&nbsp;&nbsp;
                        <label><input type="radio" name="shop[shop_open_spec]" value="0" {if condition="!isset($userConfig.shop_open_spec) || empty($userConfig.shop_open_spec)"}checked="checked"{/if}/>关闭</label>
                        <!--&nbsp;
                        <span id="a_shop_open_spec" {if condition="!isset($userConfig.shop_open_spec) || empty($userConfig.shop_open_spec)"}style="display:none;"{/if}>
                            <a href="javascript:void(0);" id='shop_open' onclick="tag_call('shop_open');" class="ncap-btn ncap-btn-green">标签调用</a>
                        </span>-->
                    </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" onmouseover="layer_tips = layer.tips('对管理员发送邮件提醒', this, {time:100000});" onmouseout="layer.close(layer_tips);">
                                    <input class="check" type="checkbox" name="smtp_shop_order_pay" {if condition="!empty($smtp.smtp_shop_order_pay)"} value="1" checked="checked" {/if} onclick="OpenSmtp(this);"><span>管理员邮箱</span>
                                </label>
                            </li>
                        </ul>
                    </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" onmouseover="layer_tips = layer.tips('对用户发送邮件提醒', this, {time:100000});" onmouseout="layer.close(layer_tips);">
                                    <input class="check" type="checkbox" name="smtp_shop_order_send" {if condition="!empty($smtp.smtp_shop_order_send)"} value="1" checked="checked" {/if} onclick="OpenSmtp(this);"><span>用户邮箱</span>
                                </label>
                            </li>
                        </ul>
                    </dd>
                </dl>
                <script type="text/javascript">
                    function OpenSmtp(obj) {
                        if (true == $(obj).is(':checked')) {
                            $.ajax({
                                type: "post",
                                url : "{:url('Shop/FindSmptConfig', ['_ajax'=>1])}",
                                data: {field:$(obj).attr('name')},
                                dataType: 'json',
                                success: function (res) {
                                    layer.closeAll();
                                    if(res.code == 0) {
                                        $(obj).removeAttr("checked");
                                        layer.alert(res.msg, {title:false, closeBtn:0, btn:['确认', '取消']}, function(){
                                            window.location.href = res.url;
                                        });
                                    }
                                }
                            });
                        }
                    }
                </script>
            </div>

            <div class="ncap-form-default">
                <dl class="row">
                    <div class="bot">
                        <a href="JavaScript:void(0);" onclick="ShopConfig();" class="ncap-btn-big ncap-btn-green" id="submitBtn">确认提交</a>
                    </div>
                </dl>
            </div>
        </form>
    </div>
</div>
<script type="text/javascript">

    $(function(){
        // 点击刷新数据
        $('.fa-refresh').click(function(){
            location.href = location.href;
        });

        $('input[name="shop[shop_open_shipping]"]').click(function() {
            var shop_open_shipping = $(this).val();
            if (1 == shop_open_shipping) {
                $('#a_shop_open_shipping').show();
            } else {
                $('#a_shop_open_shipping').hide();
            }
        });

        // $('input[name="shop[shop_open_spec]"]').click(function() {
        //     var shop_open_spec = $(this).val();
        //     if (1 == shop_open_spec) {
        //         $('#a_shop_open_spec').show();
        //     } else {
        //         $('#a_shop_open_spec').hide();
        //     }
        // });
    });

    function SetShipping() {
        var url = "{:url('Shop/shipping_template')}";
        //iframe窗
        layer.open({
            type: 2,
            title: '运费模板管理',
            shadeClose: false,
            maxmin: false, //开启最大化最小化按钮
            area: ['60%', '80%'],
            content: url
        });
    }

    // 标签调用
    function tag_call(name, TestPass) {
        if (1 == TestPass) return false
        $.ajax({
            type: "POST",
            url: "{:url('System/ajax_tag_call', ['_ajax'=>1])}",
            data: {name:name},
            dataType: 'json',
            success: function (res) {
                if(res.code == 1){
                    //询问框
                    var confirm = layer.confirm(res.data.msg, {
                            title: false,
                            area: ['80%','80%'],
                            btn: ['已完成,验证下','下次再操作'],
                            cancel: function(){
                                window.location.href = "{:url('Shop/conf',['close'=>1])}";
                            }
                        }, function (){
                            VerifyLatestTemplate(name);

                        }, function(){
                            window.location.href = "{:url('Shop/conf',['close'=>1])}";
                        }
                    );  
                }else{
                    layer.alert(res.msg, {icon: 2, title:false});
                }
            },
            error:function(){
                layer.alert(ey_unknown_error, {icon: 2, title:false});
            }
        });
    }

    // 检测文件是否最新版
    function VerifyLatestTemplate(name, is_close) {
        layer_loading('正在处理');
        $.ajax({
            type: "POST",
            url: "{:url('Shop/VerifyLatestTemplate', ['_ajax'=>1])}",
            data: {name:name, is_close:is_close},
            dataType: 'json',
            success: function (res) {
                layer.closeAll();
                if(res.code == 1){
                    layer.msg(res.msg, {icon: 1, time:1500}, function(){
                        window.location.href = "{:url('Shop/conf')}";
                    });
                }else{
                    layer.alert(res.msg, {
                        icon: 2, 
                        title: false,
                        cancel: function(){ 
                            window.location.href = "{:url('Shop/conf')}";
                        }
                    }, function(){
                        window.location.href = "{:url('Shop/conf')}";
                    });
                }
            },
            error:function(){
                layer.closeAll();
                layer.alert(ey_unknown_error, {icon: 2, title:false});
            }
        });
    }

    // 判断输入框是否为空
    function ShopConfig() {
        layer_loading('正在处理');
        $('#post_form').submit();
    }
</script>
{include file="public/footer" /}