set.blade.php 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. @extends('layouts.base')
  2. @section('title', trans('基础设置'))
  3. @section('content')
  4. <div class="w1200 m0a">
  5. <div class="rightlist">
  6. <form action="" method="post" class="form-horizontal" id="form1">
  7. <div class="panel panel-info">
  8. <div class="panel panel-default">
  9. <div class="panel-body">
  10. <div class="tab-content">
  11. <div class="tab-pane active" id="tab_baseset">
  12. <div class="panel-heading">基础设置</div>
  13. <div class="panel-body">
  14. <div class="form-group">
  15. <label class="col-xs-12 col-sm-3 col-md-2 control-label">开启插件</label>
  16. <div class="col-sm-2 col-xs-6">
  17. <input class="mui-switch mui-switch-animbg" id="fight_groups_success_message" type="checkbox" @if($set['is_open'] == 1) checked @endif onclick="message_default()"/>
  18. </div>
  19. </div>
  20. <div>
  21. <label class="col-xs-12 col-sm-3 col-md-2 control-label">新旧域名替换</label>
  22. <input type="text" autocomplete="off" id="oldurl" placeholder="请输入旧域名 不加http://或https://" class="el-input__inner" style="width:30rem;margin-right: 1rem;">
  23. <input type="text" autocomplete="off" id="newurl" placeholder="请输入新域名 不加http://或https://" class="el-input__inner" style="width: 30rem;margin-right: 1rem;">
  24. <button type="button" class="el-button el-button--primary" onclick="urlReplace()"><span>替换</span></button>
  25. <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>
  26. </div>
  27. <div id="ckt_set" style="margin-top: 10px">
  28. <div>
  29. <label class="col-xs-12 col-sm-3 col-md-2 control-label">图片智能设计设置</label>
  30. <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;">
  31. </div>
  32. <div>
  33. <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
  34. <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;">
  35. </div>
  36. <div>
  37. <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
  38. <input type="text" placeholder="请输入appId" class="el-input__inner" name="ckt[app_id]" value="{{ $set['app_id'] }}" style="width: 50%;margin-top: 10px;">
  39. </div>
  40. <div>
  41. <label class="col-xs-12 col-sm-3 col-md-2 control-label"></label>
  42. <input type="text" placeholder="请输入user_flag" class="el-input__inner" name="ckt[user_flag]" value="{{ $set['user_flag'] }}" style="width: 50%;margin-top: 10px;">
  43. <button type="button" class="el-button el-button--primary" onclick="cktSet()"><span>提交</span></button>
  44. </div>
  45. <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>
  46. <div>
  47. <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>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. </div>
  56. </form>
  57. </div>
  58. </div>
  59. <script type="text/javascript">
  60. $('.js-clip').each(function () {
  61. util.clip(this, $(this).attr('data-url'));
  62. });
  63. </script>
  64. <script>
  65. function message_default()
  66. {
  67. var url_open = "{!! yzWebUrl('plugin.decorate.admin.decorate-set.open') !!}"
  68. if ($('#fight_groups_success_message').is(':checked'))
  69. {
  70. //开
  71. $.post(url_open,'is_open=1',function(data){
  72. if (data.result == 1) {
  73. showPopover($('#fight_groups_success_message'),"开启成功")
  74. } else {
  75. showPopover($('#fight_groups_success_message'),"开启失败")
  76. $('#fight_groups_success_message').attr("checked",false);
  77. }
  78. }, "json");
  79. } else {
  80. //关
  81. $.post(url_open,'is_open=2',function(data){
  82. showPopover($('#fight_groups_success_message'),"关闭成功")
  83. }, "json");
  84. }
  85. }
  86. function urlReplace()
  87. {
  88. var newUrl = $('#newurl').val();
  89. var oldUrl = $('#oldurl').val();
  90. var url = "{!! yzWebUrl('plugin.decorate.admin.decorate-set.url-replace') !!}"
  91. $.post(url,'oldDomain='+oldUrl+'&newDomain='+newUrl,function(data){
  92. // if (data.result == 1) {
  93. alert(data.msg);
  94. // } else {
  95. // alert('');
  96. // }
  97. }, "json");
  98. }
  99. function cktSet() {
  100. let modal = $('#ckt_set');
  101. data = {
  102. "yun_app_id": modal.find(':input[name="ckt[yun_app_id]"]').val(),
  103. "yun_app_secret": modal.find(':input[name="ckt[yun_app_secret]"]').val(),
  104. "app_id": modal.find(':input[name="ckt[app_id]"]').val(),
  105. "user_flag": modal.find(':input[name="ckt[user_flag]"]').val(),
  106. };
  107. post_data = {
  108. "ckt": data,
  109. };
  110. $.ajax({
  111. type: 'POST',
  112. url: "{!! yzWebUrl('plugin.decorate.admin.decorate-set.cktSet') !!}",
  113. data: post_data,
  114. success: function(result) {
  115. if (result['result'] == 1) {
  116. alert(result['msg']);
  117. window.location = location;
  118. } else {
  119. alert(result['msg']);
  120. }
  121. }
  122. });
  123. }
  124. function showPopover(target, msg) {
  125. target.attr("data-original-title", msg);
  126. $('[data-toggle="tooltip"]').tooltip();
  127. target.tooltip('show');
  128. target.focus();
  129. //2秒后消失提示框
  130. setTimeout(function () {
  131. target.attr("data-original-title", "");
  132. target.tooltip('hide');
  133. }, 2000
  134. );
  135. }
  136. </script>
  137. @endsection