domain.php
3.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
use yii\helpers\Url;
?>
<?=$this->render("_header", ['tab' => 'wechat_domain'])?>
<div class="container" style="padding-left: 0px;">
<div class="col-md-12" style="padding-left: 0px;">
<div class="panel panel-default">
<div class="panel-heading">
<b>公众号域名设置</b>
</div>
<div class="panel-body">
<table class="table">
<tr>
<td>
<form id="appForm" class="form-horizontal" role="form">
<div class="form-group">
<label class="col-md-2 control-label" > 微信端域名</label>
<div class="col-md-4">
<input id="domain" type="text" class="form-control" value="<?=$settings->domain ?>">
</div>
</div>
<!-- <div class="form-group">
<label class="col-md-2 control-label">微信端异步通知域名</label>
<div class="col-md-4">
<input id="payDomain" type="text" class="form-control" value="<?/*=$settings->pay_domain*/?>">
</div>
</div>-->
<div class="form-group">
<div class="col-md-6 col-md-offset-3">
<button id="appSubmit" class="btn btn-primary ladda-button" data-style="slide-up">保存</button>
</div>
</div>
</form>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
<script>
(function($, window, document){
$(document).ready(function(){
//功能设置 更新
$('#appForm #appSubmit').on('click', function(){
var domain = $("#appForm #domain").val();
var payDomain = $('#appForm #payDomain').val();
//AJAX
var l = $.ladda(this);
$.ajax({
url : '<?= Url::toRoute(['/setting/wechat/domain-save']) ?>',
type : 'post',
dataType : 'json',
data : $.csrf({
domain : domain,
payDomain : payDomain,
}),
beforeSend : function(){
l.start();
},
success : function(e){
//成功返回数据
if (false == e.success) {
if (101 == e.code) {
alert('操作有误,请重新操作');
}
}
location.reload();
},
error : function(){},
complete : function(){}
});
});
});
}(jQuery, window, document));
</script>