coupons_sear.html
7.89 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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
<!DOCTYPE html >
<html>
<head>
<meta charset="UTF-8">
<title>微券查询</title>
<style>
.mypop{
width: 100%;
height:100%;
position: fixed;
background: #fff;
top: 0;
left:0
}
.loadBtns {
font-size: 14px;
text-align: center;
color: #888;
padding: 10px 0;
}
.mypop .imgshow {
position: absolute;
margin-top: 30%;
width: 100%;
left: 50%;
margin-left: -50%;
text-align: center;
}
.quanlist{
font-size: 14px;
text-align: center;
color: #888;
padding: 10px 0;
}
</style>
<include file="public/header"/>
<body>
<include file="public/menu"/>
<include file="public/navBall"/>
<div class="funds">
<form id="searform">
<input name="stoid" value="{$Think.request.stoid}" type="hidden"/>
<div class="fundsQuery">
<span>日期:</span>
<input type="date" placeholder="请输入开始时间" name="start" value="{$Think.request.start}"/>
<span class="ml10 mr10">至</span>
<input type="date" placeholder="请输入结束时间" name="end" value="{$Think.request.end}"/>
<div class="mt20">
<span>查询内容</span>
<!--微券查询-->
<select name="type">
<option value=""
<eq name="$Think.request.type" value="">selected</eq>
>所有</option>
<option value="1"
<eq name="$Think.request.type" value="1">selected</eq>
>已使用</option>
<option value="2"
<eq name="$Think.request.type" value="2">selected</eq>
>已过期</option>
<option value="3"
<eq name="$Think.request.type" value="3">selected</eq>
>未使用</option>
</select>
</div>
<div class="sub-btn" onclick="sumup();">查询明细</div>
</div>
</form>
<!--微券查询-->
<ul class="coupons">
<foreach name="quanlist" item="v">
<li alt='{$v['CashRepNo']}' onclick='showimg(this)' style='text-align: center'>
<img src="/index.php?m=Home&c=Index&a=qr_code&data={$v['CashRepNo']}" style="width: 200px;"/>
<p style="text-align: center;">{$v['CashRepNo']}</p>
<div class="numCoupons">{$v['Sum']}元微券</div>
<p>微券来源:
<if condition="$v['Operator']">
{$v['Operator']}
<else/>
微信商城
</if>
</p>
<p>有效期:{$v['BillDate']} 至 {$v['ValidDate']}</p>
<p>使用说明:
{$v.Sum}元优惠券,
<if condition="$v.UseObjectID">
仅限{$v.UseObjectName}使用,
<else/>
全场通用,
</if>
满{$v.BuySum}元使用
</p>
</li>
</foreach>
</ul>
<if condition="$quanlist eq null">
<div class="quanlist">没有数据</div>
</if>
<eq name="mshow" value="1">
<div id="getmore" class="loadBtn" onclick="ajax_sourch_submit();">加载更多</div>
</eq>
</div>
<div id="fselePop" class="mypop dn" onclick="closemyp()" style="text-align: center">
<div class="imgshow">
<img id="fselePopimg" src="" style="margin-bottom: 20px; display:inline-block"><br>
<img id="fselePopimg1" src="" style=" display:inline-block">
</div>
</div>
</body>
<script>
var page = 1;
/*** ajax 提交表单 查询订单列表结果*/
function ajax_sourch_submit() {
page += 1;
$.ajax({
type: "GET",
url: "/index.php?m=Mobile&c=User&a=coupons_sear&isajax=1&p=" + page, //+tab,
data: $('#searform').serialize(),
success: function (data) {
if (data.code == '-1')
$('#getmore').hide();
else {
//$(".Funds > ul").append(data);
var len = data.data.length;
var htm="";
for (var i = 0; i < len; i++) {
var row = data.data[i];
var getOperator="微信商城";
if (row.Operator)
{
getOperator=row.Operator;
}
var useObjectName="";
var remark=row.Sum+"元优惠券,";
if(row.UseObjectID!=null && row.UseObjectID!="") {
remark += "仅限" + row.UseObjectName + "使用,";
}else{
remark+="全场通用,"
}
remark+="满"+row.BuySum+"元使用";
/*---
if (row.useObjectID!=undefined && row.useObjectID!="")
{
useObjectName=",只支持到门店使用";
}--*/
htm+= "<li alt='"+row.CashRepNo+"' onclick='showimg(this)' style='text-align: center'><img src='/index.php?m=Home&c=Index&a=qr_code&data="+row.CashRepNo+"' style =' width:200px;'/><p style='text - align:center;'>" + row['CashRepNo'] + "</p><div class='numCoupons'>" + row['Sum'] + "元微券</div><p>微券来源:"+getOperator+"</p><p>有效期:" + row['BillDate'] + "至 " + row['ValidDate'] + "</p><p>使用说明:" + remark+ "</p></li>";
}
$(".coupons").append(htm);
if(data.isshow==0) {
$('#getmore').hide();
}
}
}
});
}
function sumup() {
layer.open({type: 2, content: '查询中'});
setTimeout(function () {
$("#searform").submit();
},200);
setTimeout(function () {
layer.closeAll();
},800);
}
function goTop() {
$('html,body').animate({
'scrollTop': 0
}, 600);
}
function showimg(ob){
var text=$(ob).attr('alt');
var img="/vendor/barcodegen/test_1D2.php?text="+text;
var img1="/index.php?m=Home&c=Index&a=qr_code&data="+text;
$("#fselePop").show();
$('#fselePopimg').attr('src',img);
$('#fselePopimg1').attr('src',img1);
}
function closemyp(){
$("#fselePop").hide();
}
Date.prototype.format = function(fmt) {
var o = {
"M+" : this.getMonth()+1, //月份
"d+" : this.getDate(), //日
"h+" : this.getHours(), //小时
"m+" : this.getMinutes(), //分
"s+" : this.getSeconds(), //秒
"q+" : Math.floor((this.getMonth()+3)/3), //季度
"S" : this.getMilliseconds() //毫秒
};
if(/(y+)/.test(fmt)) {
fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
}
for(var k in o) {
if(new RegExp("("+ k +")").test(fmt)){
fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
}
}
return fmt;
}
function fmtD(d) {
if(d=='null' || d==""){
return "";
}
var oldTime = (new Date(d)).getTime();
var curTime = new Date(oldTime).format("yyyy-MM-dd hh:mm:ss");
return curTime;
}
</script>
</html>