coupon_pro.html
7.29 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
227
228
229
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>优惠券领取-{$tpshop_config['shop_info_store_title']}</title>
<meta http-equiv="keywords" content="{$tpshop_config['shop_info_store_keyword']}" />
<meta name="description" content="{$tpshop_config['shop_info_store_desc']}" />
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<meta name="format-detection" content="telephone=no" />
<meta name="format-detection" content="email=no" />
<meta name="format-detection" content="address=no" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="default" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/public.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/layer.css" />
<link rel="stylesheet" type="text/css" href="__STATIC__/css/integral.css" />
<script type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer/layer.js"></script>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/index.css?v=__CSSVERSION__"/>
<script src="__PUBLIC__/js/global.js?v=__CSSVERSION__"></script>
<style type="text/css">
.layermchild {
width: 300px;
border-radius: 16px;
-moz-border-radius: 16px;
-webkit-border-radius: 16px;
position: relative;
}
</style>
</head>
<body>
<include file="public/navBall" />
<if condition="$coupon">
<foreach name="coupon" item="coupon">
<ul class="coupon_pro">
<li>
<!--<img class="coupon_bg" src="__STATIC__/images/coupon/bg.png" />-->
<p>
<img src="__STATIC__/images/coupon/coupon_logo.png" style="width: 30px;height: 30px;"/>
{$coupon.name}
</p>
<ul class="coupontxt">
<if condition="$coupon['useobjecttype'] eq 0">
<li>全场通用</li>
</if>
<if condition="$coupon['useobjecttype'] eq 1">
<li>限品牌【{$coupon['useobjectname']}】使用</li>
</if>
<if condition="$coupon['useobjecttype'] eq 2">
<li>限品类【{$coupon['useobjectname']}】使用</li>
</if>
<if condition="$coupon['useobjecttype'] eq 11">
<li>限用途【{$coupon['useobjectname']}】使用</li>
</if>
<if condition="$coupon['useobjecttype'] eq 12">
<li>限分类一【{$coupon['useobjectname']}】使用</li>
</if>
</ul>
<div class="condition">
<p>¥<span class="font28">{$coupon.money}</span></p>
<p>满{$coupon.condition}可用</p>
</div>
<div style="clear: both;"></div>
<p class="time">有效期
<if condition="$coupon.endtype eq 0">
<if condition="$coupon.use_start_time gt 0">{$coupon.use_start_time}</if>
至 <if condition="$coupon.use_end_time gt 0">{$coupon.use_end_time|date='Y-m-d',###}<else/>不限</if>
<else/>
<if condition="$coupon.days gt 0">{$coupon.days}天
<else/>不限
</if>
</if>
</p>
</li>
</ul>
<if condition="$err_text">
<div class="btn btnRed" style="background: #aaa">{$err_text}</div>
<else/>
<div class="btn btnRed" onclick="show(this)" id="{$coupon.id}">立即领取</div>
</if>
</foreach>
<else/>
<ul class="coupon_pro">
<li>
<!--<img class="coupon_bg" src="__STATIC__/images/coupon/bg.png" />-->
<p>
<img src="__STATIC__/images/coupon/coupon_logo.png" style="width: 30px;height: 30px;"/>
不存在此微券或数量已领取完
</p>
<ul class="coupontxt">
<!--<li>未领取</li>-->
<!--<li>全店通用</li>-->
</ul>
<div class="condition">
<!--<p>¥<span class="font28">??</span></p>-->
<!--<p>满???可用</p>-->
</div>
<div style="clear: both;"></div>
<p class="time" style="text-align: center">不存在此微券或数量已领取完</p>
</li>
</ul>
</if>
<div class="layermbox dn">
<div class="laymshade"></div>
<div class="layermmain">
<div class="section">
<div class="layermchild layermanim">
<div class="layermcont" style="padding: 0;">
<img class="couponImg" src="__STATIC__/images/integral/coupon.png" />
<p class="obtain">恭喜您获得【{$coupon.name}】优惠券</p>
<p class="select">查看我的优惠券</p>
</div>
</div>
</div>
</div>
</div>
<p class="guess">
<img src="__STATIC__/images/coupon/love.png" style="width: 23px;height: 20px;" />
猜你喜欢
</p>
<div style=" width: 100%;background-color: #eee;border-top:5px solid #eee;">
<div class="floor_body2" id="J_ItemList">
<ul class="product single_item info">
</ul>
<a href="javascript:;" class="get_more" style="text-align:center; display:block;">
<img src='__STATIC__/images/category/loader.gif' width="12" height="12"> </a>
</div>
</div>
<include file="public/wx_share"/>
</body>
</html>
<script type="text/javascript">
$(function () {
getGoodsList();
})
//猜你喜欢
function getGoodsList() {
$('.get_more').show();
$.ajax({
type: "get",
url: "/index.php?m=Mobile&c=Index&a=ajaxGetMore&p=0&stoid=<?php echo getMobileStoId()?>",
success: function (data) {
$('.get_more').hide();
if (data) {
$("#J_ItemList>ul").append(data);
page++;
} else {
//$('#getmore').remove();
}
},
error:function(XMLHttpRequest, textStatus, errorThrown){
$("#ferweimap").hide();
}
});
}
//领取微券
function show(obj){
var tit="{$coupon.name}";
if ( $(obj).text()=="提交中")
{
layer.open({content:"正在处理中..",time:1});
return;
}
$(obj).html("提交中");
$(obj).attr('onclick','javascript:void();');
var res=layer.open({shadeClose: false,type: 2 ,content: '领取中'});
var cid = $(obj).attr("id");
var getstoid={$Request.param.stoid};
$.ajax({
type: "POST",
url: "/index.php?m=Mobile&c=Integral&a=send_coupon&stoid=" + getstoid+"&cid="+cid, //+tab,
dataType:'json',
error: function(XMLHttpRequest, textStatus, errorThrown) {
$(obj).html("立即领取");
$(obj).attr('onclick','show(this);');//
layer.close(res);
},
before:function () {
layer.open({content: "处理中",time:1});
},
success: function(data) {
layer.close(res);
if(data.status==1){
$(".obtain").text("恭喜您获得【"+tit+"】优惠券");
$(".layermbox").removeClass("dn");
}
else{
layer.open({content: data.msg,time:3});
$(obj).attr('onclick','show(this);');//
$(obj).html("立即领取");
// setTimeout(location.href='/mobile/user/login/stoid/'+getstoid,1500)
}
}
});
}
//返回我的微券
$(".select").click(function () {
window.location.href="/index.php/mobile/User/coupon/stoid/{$Request.param.stoid}";
})
</script>