gettemplatelist.html
5.58 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<include file="public/layout" />
<body style="background-color: rgb(255, 255, 255); overflow: auto; cursor: default; -moz-user-select: inherit;">
<div id="append_parent"></div>
<div id="ajaxwaitid"></div>
<div class="page" style="padding-top: 10px;">
<div class="flexigrid">
<div class="hDiv">
<div class="hDivBox">
<table cellspacing="0" cellpadding="0">
<thead>
<tr>
<th align="left" abbr="ac_id" axis="col4" class="w90">
<div style="text-align: left;" class="">版本号</div>
</th>
<th align="left" abbr="ac_id" axis="col4" class="w300">
<div style="text-align: left;" class="">描述</div>
</th>
<th align="left" abbr="ac_id" axis="col4" class="w120">
<div style="text-align: center;" class="">TemplateID</div>
</th>
<th align="center" abbr="article_time" axis="col4" class="w140">
<div style="text-align: center;" class="">添加到模版库时间</div>
</th>
<th align="center" axis="col1" class="handle w150">
<div style="text-align: center;">操作</div>
</th>
</tr>
</thead>
</table>
</div>
</div>
<div class="bDiv" style="height: auto;">
<div id="flexigrid" cellpadding="0" cellspacing="0" border="0">
<table>
<tbody>
<foreach name="list" item="vo" key="k" >
<tr>
<td align="center" class="w90">
<div style="text-align: left;">{$vo.user_version}</div>
</td>
<td align="center" class="user_desc" class="w300">
<div style="text-align: left;width: 300px; ">{$vo.user_desc}</div>
</td>
<td align="center" class="w120">
<div style="text-align: center; ">{$vo.template_id}</div>
</td>
<td align="center" class="w140">
<div style="text-align: center;">{$vo.create_time|date="Y-m-d H:i:s",###}</div>
</td>
<td align="center" class="handle w150">
<div style="text-align: center;">
<a class="btn red" href="javascript:void(0)" data-url="{:U('Weapp/sumbitcode')}" data-id="{$stoid}" data-user_version="{$vo.user_version}" data-user_desc="{$vo.user_desc}" data-template_id="{$vo.template_id}" onClick="sumbitcode(this)"><i class="fa fa-th-list">选择提交</i></a>
<a class="btn red" href="javascript:void(0)" data-url="{:U('Weapp/deletetemplate')}" data-id="{$stoid}" data-template_id="{$vo.template_id}" onClick="deletetemplate(this)"><i class="fa fa-del">删除</i></a>
</div>
</td>
</tr>
</foreach>
</tbody>
</table>
</div>
<div class="iDiv" style="display: none;"></div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
// 表格行点击选中切换
$('#flexigrid > table>tbody >tr').click(function(){
$(this).toggleClass('trSelected');
});
// 点击刷新数据
$('.fa-refresh').click(function(){
location.href = location.href;
});
});
// 提交
function sumbitcode(obj) {
layer.confirm('确认提交至体验版?', {
btn: ['营销版', '取消'] //按钮
}, function () {
// $.ajax({
// type: 'post',
// url: $(obj).attr('data-url'),
// data : {stoid:$(obj).attr('data-id'),user_version:$(obj).attr('data-user_version'),user_desc:$(obj).attr('data-user_desc'),template_id:$(obj).attr('data-template_id')},
// dataType: 'json',
// success: function (data) {
//
// if (data.errcode == 0) {
// layer.alert('提交成功', {icon: 1});
//
// } else {
// layer.alert('提交失败'+data.errmsg, {icon: 2});
// }
// }
// })
var ii=layer.msg('处理中...', {icon: 16, shade: [0.5, '#f5f5f5'], scrollbar: false, offset: '200px', time: 100000});
var getbatchtype="{$batchtype}";
var sumbiturl=$(obj).attr('data-url');
if (getbatchtype==1)
{
sumbiturl="/index.php/manager/Weapp/batchsubmit_audit.html";
}
$.ajax({
type: 'post',
url: sumbiturl,
data : {stoid:$(obj).attr('data-id'),user_version:$(obj).attr('data-user_version'),user_desc:$(obj).attr('data-user_desc'),template_id:$(obj).attr('data-template_id'),type:2,batchtype:getbatchtype},
dataType: 'json',
success: function (data) {
layer.close(ii);
if (data.errcode == 0) {
layer.alert('提交成功', {icon: 1});
} else {
layer.alert('提交失败'+data.errmsg, {icon: 2});
}
},
error:function () {
layer.close(ii);
}
})
}, function () {
}, function () {
});
}
// 删除指定小程序代码模版
function deletetemplate(obj) {
layer.confirm('确认删除该模版?', {
btn: ['确定', '取消'] //按钮
}, function () {
$.ajax({
type: 'post',
url: $(obj).attr('data-url'),
data : {stoid:$(obj).attr('data-id'),template_id:$(obj).attr('data-template_id')},
dataType: 'json',
success: function (data) {
if (data.errcode == 0) {
layer.alert('删除成功', {icon: 1});
setTimeout(function () {
location.href=location.href;
},1000)
} else {
layer.alert('删除失败'+data.errmsg, {icon: 2});
}
}
})
}, function () {
});
}
</script>
</body>
</html>