coupon_list.html
13.6 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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
<script type="text/javascript" src="__PUBLIC__/js/rem_new.js"></script>
<!DOCTYPE html >
<html>
<head>
<head>
<meta charset="UTF-8">
<title>{:I('title','抵用券列表')}_{$tpshop_config.shop_info_store_title}</title>
<include file="public/header"/>
<link rel="stylesheet" href="__STATIC__/css/user_index.css?v=__CSSVERSION__">
<link rel="stylesheet" type="text/css" href="__STATIC__/css/public.css?v=__CSSVERSION__"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/swiper/css/swiper.min.css"/>
<script type="text/javascript" src="__STATIC__/swiper/js/swiper.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
<!--<script type="text/javascript" src="__STATIC__/js/my_msg.js"></script>-->
<include file="public/my_msg"/>
<style>
.code {
background: rgba(0, 0, 0, 0) url(__STATIC__/images/index/rect.png) no-repeat scroll center center / cover;
height: 200px;
margin: 20px auto;
width: 200px;
}
.code img {
height: 90%;
margin: 5% auto;
width: 90%;
}
.userhead {
border-radius: 50%;
position: absolute;
right: -10px;
top: 0;
width: 20px;
height: 20px;
padding: 3px;
background: #ea5551 url(__STATIC__/images/user/userhead.png) no-repeat scroll center center / 18px 13.2px;
border: 2px solid #fff;
}
.erpapp {
width: 100%;
height: 50px;
background-color: #ca3043;
}
.erpapp img {
height: 30px;
width: 30px;
border-radius: 30px;
margin: 10px;
display: inline-block;
vertical-align: top;
}
.erptext {
color: #fff;
line-height: 50px;
width: 50%;
display: inline-block;
height: 50px;
}
.openapp {
background-color: #fff;
color: #c93145;
border-radius: 5px;
display: inline-block;
margin: 12px;
vertical-align: top;
height: 25px;
width: 70px;
text-align: center;
line-height: 25px;
margin-right: 0;
margin-left: 0;
float: right;
margin-right: 20px; ;
}
.coupon-left-money{
height: 0.62rem;
margin-top: 0.2rem;
margin-bottom: 0.1rem;
}
</style>
<!--<script src="__STATIC__/js/my_msg.js"></script>-->
<include file="public/my_msg"/>
<body>
<div id="tbh5v0">
<div class="user_com ">
<!--二维码弹框-->
<include file="public/qr_coed"/>
<include file="public/popup"/>
<!-- 优惠券头部 -->
<div class="com_top">
<img class="b_img" src="{:get_quan_list_img($Img)}" style="width: 100%;">
</div>
<div class="background">
<foreach name="quan_list" item="v">
<div id="q_item">
<div class="xc-coupon-frame flex jc_center ai_center">
<div class="coupon-frame flex rel">
<!-- 锯齿 -->
<div class="coupon-left rel " style="background-color: {:setbgcolor($v.UseObjectType)}">
<!-- 锯齿 -->
<div class="circle-frame abs">
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
<div class='circle circle-sawtooth'></div>
</div>
<if condition="$v.ObtainTimes">
<div class="white oval abs" style="background-color:{:setbgbackground($v.UseObjectType)}">
<div class="xc-valuer">x<font class="residual_t">{$v.ObtainTimes}</font></div>
</div>
</if>
<div class="white xc-money-frame">
<div class="flex jc_center ai_bas coupon-left-money">
<div class="xc-rmb-symbol ">¥</div>
<div class="xc-rmb-val">{$v.CashSum}</div>
</div>
<if condition="$v.BuySum gt 0">
<div class="coupon-explain t_c">
满{$v.BuySum}元可用
</div>
<else/>
<div class="coupon-explain t_c">
无使用门槛
</div>
</if>
</div>
</div>
<div class="coupon-right flex jc_center ai_center rel">
<div class="coupon-annotation flex">
<div class="flex top-frame">
<div class="frame">
<div class="coupon-wode ellipsis-2 ">
<text class="xc-brand fs11 t_c disi"
style="background-color:{:setbgcolor($v.UseObjectType)}">
{:get_type_card($v.UseObjectType)}
</text>
<text class="fs022">{$v.PrivilegeName}</text>
</div>
<div class="coupon-time">
{:date('Y-m-d')}至{$v.Validay}
</div>
</div>
</div>
<if condition="$v.Obtain gt 0">
<div class="code-img" Id="{$v.Id}" Validay="{$v.Validay}" now="{:date('Y-m-d')}" onclick="hexiao_quan(this)">
<img class="coupon-code" src='__STATIC__/images/weixin/user_r_code.png'></img>
</div>
<else/>
<div class="code-img" Id="{$v.Id}" Validay="{$v.Validay}" isno="1" now="{:date('Y-m-d')}">
<img class="coupon-code" src='__STATIC__/images/weixin/hui-ewm.png'></img>
</div>
</if>
</div>
<if condition="$v.ObtainTimes gt 0 || $v.SecondNo eq 0" ind>
<div class="clik-get t_c white abs" onclick="ling_quan(this)"
Id="{$v.Id}" btainTimes="{$v.ObtainTimes}" Obtain="{$v.Obtain}"
style="background-color:{:setbgcolor($v.UseObjectType)}">
立即领取
</div>
<else/>
<div class="clik-get t_c white abs g_gray"onclick="have_received()">已领取</div>
</if>
<div id="show_remarks" class="abs flex bottmo-explain" onclick="show_remarks(this)" style="justify-content: flex-end" >
<div class="fs015 flex ai_center" >优惠券使用说明
<div class="circle circle-size flex t-c jc_center">
<div class="xc-jiantou" ></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="xc-buttom" is_show="0">
<text id="instructions" class="fs020" value="{$v.Remark}">{:replay_huiche($v.Remark)}</text>
</div>
</div>
</foreach>
</div>
</div>
</div>
</div>
</body>
</html>
<include file="public/popup"/>
<script>
// 已领取
function have_received(){
show_pop_text("","已领取");
return false;
}
var stoid="{$Think.request.stoid}";
var user_id="{$tpshop_config['user_id']}";
//--领取券要调用领券的接口---
function ling_quan(ob) {
var privilegeId=$(ob).attr("Id");
var can_get = $(ob).attr('btainTimes');
var Obtain = $(ob).attr('Obtain');
var pre=$(ob).prev();
if(can_get<=0){
return false;
}
var url="{$mini_host}/api/weshop/users/grade/cash/insert";
//url="http://172.20.3.102:8022"+url;
var data={
privilegeId:privilegeId,
storeId:stoid,
userId:user_id,
operator:'微信商城'
};
var ii=layer.open({type:2, shadeClose: false});
$.ajax({
url: url, data: data, type: "post",
dataType: "json",
success: function(res) {
layer.close(ii);
if(res.code==0){
my_msg("您已成功领取该券",1);
can_get--;
Obtain++;
$(ob).attr('btainTimes',can_get);
$(ob).attr('Obtain',Obtain);
$(ob).parent().prev().find(".oval").find(".xc-valuer").find(".residual_t").text(can_get);
if(can_get<=0){
$(ob).addClass("g_gray"); $(ob).text("已领取");
$(ob).parent().prev().find(".oval").remove();
$(ob).removeAttr("style");
}
if(pre.find(".code-img").attr("isno")=="1"){
pre.find(".code-img").attr("onclick","hexiao_quan(this);")
pre.find(".code-img").find('img').attr("src","__STATIC__/images/weixin/user_r_code.png");
}
}else{
my_msg(res.msg);
}
}
});
}
//--核销券---
function hexiao_quan(ob) {
var validay = $(ob).attr('Validay');
var pId=$(ob).attr('Id');
var now=$(ob).attr('now');
var url="{$mini_host}/api/weshop/users/grade/cash/code/get";
//url="http://172.20.3.102:8022"+url;
var data={
privilegeId:pId,
storeId:stoid,
userId:user_id};
$.ajax({
url: url, data: data, type: "get",
dataType: "json",
success: function(res) {
if(res.code==0){
var name= res.data.UseObjectName;
var quan_no=res.data.CashRepNo;
xc_text_qr_code(quan_no,0,now,validay,name);
}
}
});
}
//---显示下拉说明---
function show_remarks(ob) {
var obj=$(ob).parent().parent().parent().parent();
var is_show=obj.find('.xc-buttom').attr("is_show");
if(is_show=="0"){
obj.find('.xc-buttom').show();
obj.find('.xc-buttom').attr("is_show",1);
}else{
obj.find('.xc-buttom').hide();
obj.find('.xc-buttom').attr("is_show",0);
}
}
</script>