Browse Source

update

pull/81/head
xiaoz 3 years ago
parent
commit
e9b25cb17d
  1. 9
      templates/admin/setting/subscribe.php
  2. 5
      templates/admin/static/embed.js

9
templates/admin/setting/subscribe.php

@ -80,7 +80,8 @@
</form> </form>
<div class="layui-input-inline"> <div class="layui-input-inline">
<button class="layui-btn" lay-submit="" onclick = "update_main()">立即更新</button> <button id = "btn_update" class="layui-btn" lay-submit="" onclick = "update_main()">立即更新</button>
<button id = "btn_updating" style = "display:none;" class="layui-btn layui-btn-disabled" >更新中,请勿关闭窗口</button>
</div> </div>
<!-- 更新进度条 --> <!-- 更新进度条 -->
<div id="progress"> <div id="progress">
@ -117,6 +118,8 @@
} }
//否则可以更新 //否则可以更新
else { else {
$("#btn_update").hide();
$("#btn_updating").show();
update_status("1%","准备更新..."); update_status("1%","准备更新...");
//第一步检查更新信息 //第一步检查更新信息
$.get("/index.php?c=api&method=check_subscribe",function(data,status){ $.get("/index.php?c=api&method=check_subscribe",function(data,status){
@ -143,6 +146,8 @@
$.get("/index.php?c=api&method=check_version",{version:new_version},function(data,status){ $.get("/index.php?c=api&method=check_version",{version:new_version},function(data,status){
if(data.code == 200) { if(data.code == 200) {
update_status("100%","更新完成,请前往后台检查<a href = '/index.php?c=admin'>更新数据库</a>!"); update_status("100%","更新完成,请前往后台检查<a href = '/index.php?c=admin'>更新数据库</a>!");
$("#btn_update").show();
$("#btn_updating").hide();
} }
else { else {
update_error(data.msg); update_error(data.msg);
@ -187,5 +192,7 @@
,icon:5 ,icon:5
}); });
$("#progress").hide(); $("#progress").hide();
$("#btn_update").show();
$("#btn_updating").hide();
} }
</script> </script>

5
templates/admin/static/embed.js

@ -392,6 +392,7 @@ layui.use(['element','table','layer','form','upload'], function(){
//保存订阅信息 //保存订阅信息
form.on('submit(set_subscribe)', function(data){ form.on('submit(set_subscribe)', function(data){
var order_id = data.field.order_id; var order_id = data.field.order_id;
var index = layer.load(1);
$.get('http://down.onenav.top/v1/check_subscribe.php',data.field,function(data,status){ $.get('http://down.onenav.top/v1/check_subscribe.php',data.field,function(data,status){
if(data.code == 200) { if(data.code == 200) {
@ -401,16 +402,20 @@ layui.use(['element','table','layer','form','upload'], function(){
//存储到数据库中 //存储到数据库中
$.post("index.php?c=api&method=set_subscribe",{order_id:order_id,email:email,end_time:end_time},function(data,status){ $.post("index.php?c=api&method=set_subscribe",{order_id:order_id,email:email,end_time:end_time},function(data,status){
if(data.code == 0) { if(data.code == 0) {
layer.closeAll('loading');
layer.msg(data.data, {icon: 1}); layer.msg(data.data, {icon: 1});
} }
else{ else{
layer.closeAll('loading');
layer.msg(data.err_msg, {icon: 5}); layer.msg(data.err_msg, {icon: 5});
} }
}); });
} }
else{ else{
layer.closeAll('loading');
layer.msg(data.msg, {icon: 5}); layer.msg(data.msg, {icon: 5});
} }
}); });
console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value} console.log(data.field) //当前容器的全部表单字段,名值对形式:{name: value}
return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。 return false; //阻止表单跳转。如果需要表单跳转,去掉这段即可。

Loading…
Cancel
Save