rule.php
6.3 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html>
<head>
<meta charset="UTF-8">
<title>表单填写</title>
<link rel="stylesheet" type="text/css" href="/assets/common/css/themes/gray/easyui.css" />
<link rel="stylesheet" type="text/css" href="/assets/common/css/themes/gray/menu.css" />
<link rel="stylesheet" type="text/css" href="/assets/common/css/themes/icon.css" />
<link rel="stylesheet" type="text/css" href="/assets/web/css/jitnry.css" />
<link rel="stylesheet" type="text/css" href="/assets/web/css/common_car.css" />
<script type="text/javascript" src="/assets/common/js/jquery.min.1.9.4.js"></script>
<script type="text/javascript" src="/assets/common/js/jquery.easyui.min.1.9.4.js"></script>
<script type="text/javascript" src="/assets/common/js/jquery.cookie.1.4.1.js"></script>
<!-- 插件调用 --->
<script type="text/javascript" src="/assets/common/js/datagrid-detailview.js"></script>
<script type="text/javascript" src="/assets/common/locale/easyui-lang-zh_CN.js"></script>
<!-- 基础 JS 调用 -->
<script type="text/javascript" src="/assets/web/js/src/easyui.base.js"></script>
<script type="text/javascript" src="/assets/web/js/src/allCity.js"></script>
</head>
<body style="margin-bottom: 54px;">
<div id="win" class="easyui-dialog" title="提示" style="width: 800px; padding: 10px 20px; height: auto" closed="false" buttons="#dlg-buttons">
<form id="fm" name="frm" method="post" style="margin-top: 20px; margin-left: 20px;">
<table style="padding: 10px 20px;" cellspacing="10">
<!-- <tr style="">-->
<!-- <td>名称:</td>-->
<!-- <td><input class="easyui-textbox" type="text" name="name" id="old_name" /></td>-->
<!-- <input class="easyui-textbox" id="prize_id" name="prize_id" type="hidden">-->
<!-- </tr>-->
<tr>
<td>重置资格:</td>
<td> <a id="name_add_but" href="#" data-options="iconCls:'icon-edit'" class="my_but" style="vertical-align: middle;">重置</a></td>
</tr>
<tr>
<td>抽奖次数:</td>
<td><input class="easyui-textbox" type="number" name="number" id="old_number" /></td>
<input class="easyui-textbox" id="rule_id" name="rule_id" type="hidden">
</tr>
<tr>
<td>是否开启:</td>
<td><input id="statusId" name="open" class="easyui-switchbutton" style="height:30px"></td>
</tr>
<tr>
<td>抽奖规则:</td>
<td><input class="easyui-textbox" id="title" name="title" data-options="multiline:true" style="height:100px;width: 500px"></td>
</tr>
<!-- <div id="html_table"></div>-->
<div id="dlg-buttons" style="display: block">
<a id="confirm" href="javascript:void(0)" class="easyui-linkbutton c6" iconcls="icon-ok" onclick="submitForm()" style="width: 90px">修改</a>
<!-- <a id="name_add_but111" href="#" data-options="iconCls:'icon-edit'" class="my_but" style="vertical-align: middle;">重置</a>-->
</div>
</table>
</form>
</div>
</body>
<tbody id="html_table"></tbody>
<script type="text/javascript" src="/assets/web/js/src/common_prize.js"></script>
<script>
$(function(){
addFile();
})
function addFile(){
$('#win').dialog({
title: '规则设置',
width: 800,
height: "auto",
top:150,
closed: false,//显示对话框
cache: false,
modal: true,
closable:false
});
var result='';
$.ajax({
type: "post",
data: result,
async: false,
url: "/products/prize/prize_rule",
success: function(arr) {
//var arr = JSON.parse(data);
// console.log(arr);
$('#rule_id').textbox('setValue',arr.id);
$('#old_number').textbox('setValue',arr.number);
if(arr.open == "1") {
$('#statusId').switchbutton('check');
}else {
$('#statusId').switchbutton('uncheck');
}
$('#title').textbox('setValue',arr.title);
},
error:function(data){
console.log(data)
}
});
}
//提交
function submitForm(){
$('#fm').form('submit', {
url:'/products/prize/prize_rule_edit',
onSubmit: function(){
console.log($(this))
},
success:function(data){
var arr = JSON.parse(data);
console.log(arr);
$.messager.alert("提示", arr.msg);
}
});
}
//添加
$('#name_add_but').linkbutton({
onClick: function () {
editFile();
}
});
function editFile(){
var id='';
if(confirm("确实要重置抽奖资格?")){
$.ajax({
url:'/products/prize/prize_reset',
type: "POST",
data: id,
contentType: false,
processData: false,
success: function (data) {
console.log(data);
$.messager.alert("提示", data.msg);
},
error:function(data){
console.log(data)
}
})
}else {
alert("已经取消了操作");
}
}
</script>
</html>