bztang-admin/plugins/decorate/views/admin/set.blade.php

144 lines
8.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@extends('layouts.base')
@section('title', trans('基础设置'))
@section('content')
<div class="w1200 m0a">
<div class="rightlist">
<form action="" method="post" class="form-horizontal" id="form1">
<div class="panel panel-info">
<div class="panel panel-default">
<div class="panel-body">
<div class="tab-content">
<div class="tab-pane active" id="tab_baseset">
<div class="panel-heading">基础设置</div>
<div class="panel-body">
<div class="form-group">
<label class="col-xs-12 col-sm-3 col-md-2 control-label">开启插件</label>
<div class="col-sm-2 col-xs-6">
<input class="mui-switch mui-switch-animbg" id="fight_groups_success_message" type="checkbox" @if($set['is_open'] == 1) checked @endif onclick="message_default()"/>
</div>
</div>
<div>
<label class="col-xs-12 col-sm-3 col-md-2 control-label">新旧域名替换</label>
<input type="text" autocomplete="off" id="oldurl" placeholder="请输入旧域名 不加http://或https://" class="el-input__inner" style="width:30rem;margin-right: 1rem;">
<input type="text" autocomplete="off" id="newurl" placeholder="请输入新域名 不加http://或https://" class="el-input__inner" style="width: 30rem;margin-right: 1rem;">
<button type="button" class="el-button el-button--primary" onclick="urlReplace()"><span>替换</span></button>
<span data-boldtype="0" style="font-family:SourceHanSansSC; font-weight:400; font-size:14px; color:rgb(194, 194, 194); font-style:normal; letter-spacing:0px; margin-top: 5px; line-height:21px; text-decoration:none;margin-left: 8rem;display: flex">已联系客服更换域名后,若装修图片丢失,请在此处进行新旧域名更换。注意:未更换域名谨慎操作!!!</span>
</div>
<div id="ckt_set" style="margin-top: 10px">
<div>
<label class="col-xs-12 col-sm-3 col-md-2 control-label">图片智能设计设置</label>
<input type="text" placeholder="请输入YQappId" class="el-input__inner" name="ckt[yun_app_id]" value="{{ $set['yun_app_id'] }}" style="width: 50%;margin-top: 10px;">
</div>
<div>
<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
<input type="text" placeholder="请输入YQsecret" class="el-input__inner" name="ckt[yun_app_secret]" value="{{ $set['yun_app_secret'] }}" style="width: 50%;margin-top: 10px;">
</div>
<div>
<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
<input type="text" placeholder="请输入appId" class="el-input__inner" name="ckt[app_id]" value="{{ $set['app_id'] }}" style="width: 50%;margin-top: 10px;">
</div>
<div>
<label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
<input type="text" placeholder="请输入user_flag" class="el-input__inner" name="ckt[user_flag]" value="{{ $set['user_flag'] }}" style="width: 50%;margin-top: 10px;">
<button type="button" class="el-button el-button--primary" onclick="cktSet()"><span>提交</span></button>
</div>
<span data-boldtype="0" style="font-family:SourceHanSansSC; font-weight:400; font-size:14px; color:rgb(194, 194, 194); font-style:normal; letter-spacing:0px; line-height:21px; text-decoration:none;margin-left: 8rem;display: flex">每一个企业ID可获得版权授权请勿将账号转借给其他企业使用请确认您使用的是否为本公司授权的企业ID如不是将涉及侵权并承担法律责任。授权请联系客服</span>
<div>
<span data-boldtype="0" style="font-family:SourceHanSansSC; font-weight:400; font-size:14px; color:rgb(194, 194, 194); font-style:normal; letter-spacing:0px; line-height:21px; text-decoration:none;margin-left: 8rem;display: flex">到期时间:{{$set['yun_form']['expireDate']}}</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
<script type="text/javascript">
$('.js-clip').each(function () {
util.clip(this, $(this).attr('data-url'));
});
</script>
<script>
function message_default()
{
var url_open = "{!! yzWebUrl('plugin.decorate.admin.decorate-set.open') !!}"
if ($('#fight_groups_success_message').is(':checked'))
{
//开
$.post(url_open,'is_open=1',function(data){
if (data.result == 1) {
showPopover($('#fight_groups_success_message'),"开启成功")
} else {
showPopover($('#fight_groups_success_message'),"开启失败")
$('#fight_groups_success_message').attr("checked",false);
}
}, "json");
} else {
//关
$.post(url_open,'is_open=2',function(data){
showPopover($('#fight_groups_success_message'),"关闭成功")
}, "json");
}
}
function urlReplace()
{
var newUrl = $('#newurl').val();
var oldUrl = $('#oldurl').val();
var url = "{!! yzWebUrl('plugin.decorate.admin.decorate-set.url-replace') !!}"
$.post(url,'oldDomain='+oldUrl+'&newDomain='+newUrl,function(data){
// if (data.result == 1) {
alert(data.msg);
// } else {
// alert('');
// }
}, "json");
}
function cktSet() {
let modal = $('#ckt_set');
data = {
"yun_app_id": modal.find(':input[name="ckt[yun_app_id]"]').val(),
"yun_app_secret": modal.find(':input[name="ckt[yun_app_secret]"]').val(),
"app_id": modal.find(':input[name="ckt[app_id]"]').val(),
"user_flag": modal.find(':input[name="ckt[user_flag]"]').val(),
};
post_data = {
"ckt": data,
};
$.ajax({
type: 'POST',
url: "{!! yzWebUrl('plugin.decorate.admin.decorate-set.cktSet') !!}",
data: post_data,
success: function(result) {
if (result['result'] == 1) {
alert(result['msg']);
window.location = location;
} else {
alert(result['msg']);
}
}
});
}
function showPopover(target, msg) {
target.attr("data-original-title", msg);
$('[data-toggle="tooltip"]').tooltip();
target.tooltip('show');
target.focus();
//2秒后消失提示框
setTimeout(function () {
target.attr("data-original-title", "");
target.tooltip('hide');
}, 2000
);
}
</script>
@endsection