ajaxtemplateList.html
7.76 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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
<style type="text/css">
.flexigrid .bDiv tr{display: block;}
.bd-line{font-size: 0;}
.flexigrid .bDiv td{border: 0;}
.flexigrid div.bDiv tr:hover td{background-color: #F4FCFA;}
.flexigrid div.bDiv tr.trSelected td{ background: #ffffdf none repeat scroll 0 0;}
.flexigrid .bDiv a{color: #999;}
.flexigrid .bDiv .active a,.flexigrid .bDiv span a:hover{color: #FFF;}
.flexigrid .bDiv .row a:hover{text-decoration: none;color: #C4182E;background-color: #EEEEEE;text-decoration: underline;}
.flexigrid .bDiv .row .active a:hover{text-decoration: none;color: #fff;background-color: #999;text-decoration: underline;}
.ncsc-default-table thead {font-size: 0;}
.ncsc-default-table thead th{font-size: 12px; vertical-align: middle;display: inline-block;*display: inline;*zoom: 1;}
.w50{width: 5% !important;}
.w60{width: 6% !important;}
.w80{width: 8% !important;}
.w100{width: 10% !important;}
.w120{width: 12% !important;}
.w160{width: 16% !important;}
.w180{width: 18% !important;}
.dn{display: none;}
.layermbox{text-align: center;}
.layer_box{font-size: 0; background-color: #FFFFFF; text-align: center;position: absolute;left: 45%;border: 1px solid #D7D7D7;padding: 10px;z-index: 9999;}
.contentTxt{width: 300px; height: 20px;line-height: 20px;resize: none;border: 1px solid #D7D7D7;background-color: #999;}
.contentTxt:hover{border-color:#C4182E ;}
.layer_box input{vertical-align: middle;}
.copySuccess{font-size: 14px; width: 150px;padding: 10px; background-color: #FFFFFF;border: 1px solid #D7D7D7;margin: auto;}
.js-copy{font-size: 14px;vertical-align: middle;display: inline-block;*display: inline;*zoom: 1;cursor: pointer;border: 1px solid #D7D7D7;border-left:0 ; height: 22px;padding:0 5px;}
.js-copy:hover{background-color: #EEEEEE;}
</style>
<table class="ncsc-default-table">
<thead>
<tr>
<!--<th class="w50">-->
<!--<div>-->
<!--<i class="ico-check"></i>-->
<!--</div>-->
<!--</th>-->
<th class="w100">页面标题</th>
<th class="w60">模板分类</th>
<th class="w60">模板风格</th>
<th class="w100">模板图片</th>
<th class="w80">价格</th>
<th class="w80">购买人数</th>
<th class="w80">使用次数</th>
<th class="w60">是否显示</th>
<th class="w120">创建/修改时间</th>
<th class="w80">修改人员</th>
<th class="w120">操作</th>
</tr>
</thead>
<tbody>
<empty name="temList">
<tr>
<td colspan="20" class="norecord">
<div class="warning-option"><i class="icon-warning-sign"></i><span>暂无符合条件的数据记录</span></div>
</td>
</tr>
<else/>
<volist name="temList" id="list">
<tr class="bd-line">
<!--<td>-->
<!--<div>-->
<!--<i class="ico-check"></i>-->
<!--</div>-->
<!--</td>-->
<td class="w100"><span>{$list.page_title}</span></td>
<td class="w60"><span>{:get_m_type($list.type)}</span></td>
<td class="w60"><span>{$list.typename}</span></td>
<td class="w100" onmouseover="layer.tips('<img width=190 src={:getimg($list.img,NOIMG)}>',this, {tips: [2, '#fff']});" onmouseout="layer.closeAll();">
<div style="text-align: center; width: 100px; height: 100px; overflow: hidden; margin-bottom: 8px"><img src="{:getimg($list.img,NOIMG)}" width="100px">
</div>
</td>
<td class="w80">
<span>
<if condition='$list[money] gt 0'>
¥{$list.money}/{$list.days}天
<else>
免费
</if>
</span>
</td>
<td class="w80">{$list.countbuynum}</td>
<td class="w80">{$list.usercount}</td>
<td class="w60">
<div style="text-align: center; ">
<if condition='$list[isshow] eq 1'>
<span class="yes" onClick="changeTableVal_m('store_module','id','{$list.id}','isshow',this)"><i class="fa fa-check-circle"></i>是</span>
<else />
<span class="no" onClick="changeTableVal_m('store_module','id','{$list.id}','isshow',this)"><i class="fa fa-ban"></i>否</span>
</if>
</div>
</td>
<td class="w120"><span>{$list.billdate|date="Y-m-d H:i:s",###}</span>
<notempty name="list.editdate">
<br>{$list.editdate|date="Y-m-d H:i:s",###}
</notempty>
</td>
<td class="w80"><span>{$list.editman}</span></td>
<td class="nscs-table-handle w120">
<neq name="list.type" value="3">
<a class="bClick btn" tid="{$list.id}" ><i class="fa fa-envelope-o"></i>复制</a>
<a class="aClick btn green" art="{:U('mobile/template/manatemplate',array('sn'=>$list.template_sn))}"><i class="fa fa-search"></i>链接</a>
</neq>
<a onclick="GetUploadify_new(1,'tem{$list.id}','template','','store_module','id','img','{$list.id}','call_back')" class="btn blue"><i class="fa fa-pencil-square-o"></i>上传图片</a><br>
<input id="tem{$list.id}" type="hidden"/>
<neq name="list.type" value="3">
<a href="{:U('template/templatehandle',array('id'=>$list.id))}" class="btn blue"><i class="fa fa-pencil-square-o"></i>编辑</a>
<a class="btn red" href="javascript:void(0)" tid="{$list.id}" onClick="delfun(this)"><i class="fa fa-trash-o"></i>删除</a>
</neq>
</td>
</tr>
</volist>
</empty>
</tbody>
</table>
<!--分页位置--> {$page}
<!---复制控件--->
<div class="layer_box dn">
<input readonly="readonly" class="contentTxt" id="content" value="这里是需要复制的内容" />
<div id="btn" class="js-copy" data-clipboard-target="#content"><span>复制</span></div>
</div>
<script src="__PUBLIC__/js/clipboard.min.js"></script>
<script>
var btn = document.getElementById('btn');
var clipboard = new Clipboard(btn);//实例化
//复制成功执行的回调,可选
clipboard.on('success', function(e) {
layer.alert('复制成功', {
closeBtn: 0
}, function() {
layer.closeAll();
$(".layer_box").addClass("dn");
});
});
//复制失败执行的回调,可选
clipboard.on('error', function(e) {
layer.alert('复制失败');
});
// 点击分页触发的事件
$(".pagination a").click(function(){
cur_page = $(this).data('p');
ajax_get_table('search-form2',cur_page);
});
$(document).ready(function(){
// 表格行点击选中切换
$('#flexigrid >table>tbody>tr').click(function(){
$(this).toggleClass('trSelected');
});
$('#good_count').empty().html("{$pager->totalRows}");
});
//连接单击事件
$(".aClick").click(function() {
var art = $(this).attr("art");
var http ="";
var ishttps = 'https:' == document.location.protocol ? true : false;
if(ishttps) {http ="https://"; } else {http ="http://";}
var host = window.location.host;
/*--生成全地址--*/
var url = http+host+art;
$("#content").val(url);
var t = $(this).parents("tr").index();
var h = 50;
for(var i=0;i<t;i++){
h+=$(".ncsc-default-table").find(".bd-line").eq(i).height();
}
console.log(h);
$(".layer_box").css("top", h+"px" )
$(".layer_box").removeClass("dn");
});
//点击复制事件,复制一个模板
$(".bClick").click(function() {
var id = $(this).attr("tid");
$.ajax({
type: "POST",
url: "/index.php?m=manager&c=template&a=copytemplate&id=" + id, //+tab,
dataType:'json',
success: function(data) {
if(data.code==1) {
ajax_get_table('search-form2', 0);
}else{
layer.msg("复制失败",{icon:2,time:2000});
}
}
});
});
// 上传商品图片成功回调函数
function call_back(fileurl_tmp){
$("#convertimg").val(fileurl_tmp);
$("#upload").show();
ajax_get_table('search-form2',cur_page);
}
</script>