lbquan.html
18.3 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
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
<!DOCTYPE html>
<script type="text/javascript" src="__PUBLIC__/js/rem_new.js"></script>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<title>{$list.lbtitle}</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="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=1.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/category_list.css"/>-->
<link rel="stylesheet" type="text/css" href="__STATIC__/css/index.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/libao.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/appscript.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/goods.css?v=__CSSVERSION__"/>
<script type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/TouchSlide.1.1.js"></script>
<script type="text/javascript" src="__STATIC__/js/jquery.json.js"></script>
<script type="text/javascript" src="__STATIC__/js/touchslider.dev.js"></script>
<script src="__PUBLIC__/js/global.js"></script>
<script src="__PUBLIC__/js/mobile_common.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer.js"></script>
<style type="text/css">
body{background-color: #fdd527;}
.headimg img{ width: 100%;}
.lbqone{margin-top: -.7rem;padding: 0 .2rem;}
.lbqtwo{min-height: 2.5rem;background-color: #fff;border-radius: .2rem;width: 90%;margin: 0 auto;height: auto;margin-top: .2rem;margin-bottom: 1.5rem;
padding-bottom: .2rem;}
dl{ width: 100%; padding: .1rem;box-sizing: border-box;}
dl dt,dl dd{
float: left;}
dl dt{border-bottom: 1px solid #f6f5f6;width: 100%;}
dl dt span{ display: inline-block; width: 100%;}
dl dd{width: 2.7rem;height: 1rem;background-size: 100% 100%; color: #fff;font-size: .22rem; text-align: center; margin: 0 .04rem;margin-top: .2rem;}
dl dd.bgimg1{background-image: url(__STATIC__/images/libao/yhq_1.png);}
dl dd.bgimg0{background-image: url(__STATIC__/images/libao/yhq_2.png); }
dl dd .use1{height: .8rem;width: 1.6rem;line-height: .9rem;display: block;float: left;}
dl dd .use2{width: 1.1rem;height: .8rem;display: block;float: right;line-height: .9rem;}
dl dd .use3{float: left;width: 100%;height: .2rem;display: block;font-size: .12rem;line-height: .2rem;}
</style>
</head>
<body>
<include file="public/navBall" />
<div class="headimg"><img src="__STATIC__/images/libao/yhqxq.jpg"></div>
<div class="cr tar f24 lbqone" style=""><if condition="$mid">兑换结束时间:{$expdate|date='Y/m/d H:i:s',###}<else/>
<if condition="$isstart">
活动结束时间:{$list.endtime|date='Y/m/d H:i:s',###}
<else/>
<if condition="$isstart">
<if condition="$isstart eq 2">
活动已结束
<else/>
活动结束时间:{$list.endtime|date='Y/m/d H:i:s',###}
</if>
<else/>
活动开始时间:{$list.startime|date='Y/m/d H:i:s',###}
</if>
</if>
</if></div>
<div class="lbqtwo">
<dl>
<dt><span class="f36">{$list.lbtitle}</span><span class="cr"><if condition="$list['lbprice'] neq 0.00">{$list['lbprice']}元<if condition="$list.lbintegral neq 0">/</if></if><if condition="$list.lbintegral neq 0">{$list.lbintegral}积分</if></span></dt>
<volist name="list1" id="vo" key="k">
<for star="1" end="$vo.goods_num" name="i">
<dd class="bgimg{$k%2}" >
<div class="use1">满{:number_format($vo.condition,2)}使用</div>
<div class="use2 tal"><if condition="$vo.type eq 6"><span class="f36">包邮</span><else/>¥<span class="f30">{:number_format($vo.money,2)}</span></if></div>
<div style="" class="f18 use3">活动结束日期:
<if condition="empty($vo.endtype)">
<if condition="$vo[use_end_time] gt 0">
{$vo.use_end_time|date='Y-m-d 00:00:00',###}
<else/>
不限
</if>
<else/>
<if condition="$vo[days] gt 0">
有效期{$vo[days]}天
<else/>
不限
</if>
</if>
</div>
<div class="clear"></div>
</dd>
</for>
</volist>
<!--<dd class="bgimg2">-->
<!--<div class="use1">满300元使用</div>-->
<!--<div class="use2 tal">¥<span class="f30">20</span>元</div>-->
<!--<div style="" class="f18 use3">截至日期:2018/12/12 12:12:12</div>-->
<!--<div class="clear"></div>-->
<!--</dd>-->
<!--<dd class="bgimg1">-->
<!--<div class="use1">满300元使用</div>-->
<!--<div class="use2 tal">¥<span class="f30">20</span>元</div>-->
<!--<div style="" class="f18 use3">截至日期:2018/12/12 12:12:12</div>-->
<!--<div class="clear"></div>-->
<!--</dd>-->
<!--<dd class="bgimg2">-->
<!--<div class="use1">满300元使用</div>-->
<!--<div class="use2 tal"><span class="f36">包邮</span></div>-->
<!--<div style="" class="f18 use3">截至日期:2018/12/12 12:12:12</div>-->
<!--<div class="clear"></div>-->
<!--</dd>-->
<!--<dd class="bgimg1">-->
<!--<div class="use1">满300元使用</div>-->
<!--<div class="use2 tal">¥<span class="f30">20</span>元</div>-->
<!--<div style="" class="f18 use3">截至日期:2018/12/12 12:12:12</div>-->
<!--<div class="clear"></div>-->
<!--</dd>-->
<!--<dd class="bgimg2">-->
<!--<div class="use1">满300元使用</div>-->
<!--<div class="use2 tal"></div>-->
<!--<div style="" class="f18 use3">截至日期:2018/12/12 12:12:12</div>-->
<!--<div class="clear"></div>-->
<!--</dd>-->
<div class="clear"></div>
</dl>
</div>
<div class="p20 disfx" style="position: fixed;bottom: 0;width: 100%; max-width: 720px;">
<!--未购买详情-->
<if condition="$mid">
<!--<if condition="$list.codetype eq 0">-->
<!--全商品使用-->
<span class="btn_big fxall mr20 moz_b8 moz_t8 bge">查看优惠券</span>
<!--</if>-->
<else/>
<if condition="$isstart">
<if condition="$isstart eq 2">
<span class="btn_big fxall ml20 moz_b8 moz_t8" style="background-color:#ccc">活动已结束</span>
<else/>
<if condition="$list.lbintegral neq 0"><span class="btn_big fxall mr20 moz_b8 moz_t8" style=" background-color: #fe9f02;" onclick="transjifen(this);">立即兑换</span></if>
<if condition="$list['lbprice'] neq 0.00"><span class="btn_big fxall ml20 moz_b8 moz_t8" onclick="goumai(this);">立即购买</span></if>
</if>
<else/>
<span class="btn_big fxall ml20 moz_b8 moz_t8" style="background-color:#ccc">活动未开始</span>
</if>
</if>
</div>
<form action="/Mobile/Payment/getPay" method="post" name="points" id="points" style="display: none;">
<input name="stoid" value="{$Think.request.stoid}" type="hidden">
<input name="recharge_type" value="5" type="hidden">
<input type="hidden" value="{$list.id}" name="lbid" />
</form>
</body>
</html>
<!--正式环境要用https-->
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>
<script type="text/javascript">
var ShareTitle="{$list.lbtitle}";
var ShareDesc="{$list.lbintro}";
var wxstoid="{$Think.request.stoid}";
var ShareImgUrl = "{:QCLOUD_IMGURL}{$list.lburl}";
var ShareLink = location.href.split('#')[0]; //默认分享链接
if(ShareLink.indexOf("?")!=-1) {
ShareLink = changeURLArg(ShareLink, "code,state", "");
}
var is_distribut = "{$tpshop_config['is_distribut']}"; // 是否分销代理
var user_id = "{$tpshop_config['user_id']}"; // 当前用户id
// 如果已经登录了, 并且是分销商
if(parseInt(user_id) > 0) {
if (ShareLink.indexOf("?") != -1) {
ShareLink = ShareLink + "&first_leader=" + user_id;
}
else {
ShareLink = ShareLink + "?first_leader=" + user_id;
}
}
$(function() {
if(isWeiXin()){
$.ajax({
type : "POST",
url:"/index.php?m=Mobile&c=Index&a=ajaxGetWxConfig&stoid="+wxstoid+"&t="+Math.random(),
data:{'askUrl':encodeURIComponent(location.href.split('#')[0])},
dataType:'JSON',
success: function(res)
{
wx.config({
debug: false,
appId: res.appId,
timestamp: res.timestamp,
nonceStr: res.nonceStr,
signature: res.signature,
jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareQZone', 'hideOptionMenu','addCard'] // 功能列表,我们要使用JS-SDK的什么功能
});
// config信息验证后会执行ready方法,所有接口调用都必须在config接口获得结果之后,config是一个客户端的异步操作,所以如果需要在 页面加载时就调用相关接口,则须把相关接口放在ready函数中调用来确保正确执行。对于用户触发时才调用的接口,则可以直接调用,不需要放在ready 函数中。
wx.ready(function(){
// 获取"分享到朋友圈"按钮点击状态及自定义分享内容接口
wx.onMenuShareTimeline({
title: ShareTitle, // 分享标题
link:ShareLink,
imgUrl:ShareImgUrl // 分享图标
});
// 获取"分享给朋友"按钮点击状态及自定义分享内容接口
wx.onMenuShareAppMessage({
title: ShareTitle, // 分享标题
desc: ShareDesc, // 分享描述
link:ShareLink,
imgUrl:ShareImgUrl // 分享图标
});
// 分享到QQ
wx.onMenuShareQQ({
title: ShareTitle, // 分享标题
desc: ShareDesc, // 分享描述
link:ShareLink,
imgUrl:ShareImgUrl // 分享图标
});
// 分享到QQ空间
wx.onMenuShareQZone({
title: ShareTitle, // 分享标题
desc: ShareDesc, // 分享描述
link:ShareLink,
imgUrl:ShareImgUrl // 分享图标
});
});
},
error:function(){
return false;
}
});
}
});
function isWeiXin(){
var ua = window.navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i) == 'micromessenger'){
return true;
}else{
return false;
}
}
//去掉某参数
//arg 多个以,分开
//arg_val 替换值
function changeURLArg(url,arg,arg_val){
var isgo=false;
var arg1 = arg.split(",");//以逗号作为分隔字符串
for (var e=0;e<arg1.length ;e++) {
if (GetQueryString(arg1[e]) !=null) {
isgo = true;
}
}
if (isgo==true) {
for (var i = 0; i < arg1.length; i++) {
var pattern = arg1[i] + '=([^&]*)';
var replaceText = arg_val;
if (url.match(pattern)) {
var tmp = '/(' + arg1[i] + '=)([^&]*)/gi';
tmp = url.replace(eval(tmp), replaceText);
url = tmp;
}
}
var newtmp = tmp;
var tmp1 = tmp.split('?');
if (tmp1.length >= 2) {
if (tmp1[1] == "") {
newtmp = tmp1[0];
}
else {
//&&fff=111
var newtmp1 = "";
var tmp2 = tmp1[1].split('&');
for (var y = 0; y < tmp2.length; y++) {
if (tmp2[y] != "") {
if (newtmp1 == "") {
newtmp1 = tmp2[y];
}
else {
newtmp1 += "&" + tmp2[y];
}
}
}
if (newtmp1 != "") {
newtmp = tmp1[0] + "?" + newtmp1;
} else {
newtmp = tmp1[0];
}
}
} else {
newtmp = tmp1[0];
}
return newtmp;
}
else
{
return url;
}
}
//取某参数
function GetQueryString(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if(r!=null)return unescape(r[2]); return null;
}
</script>
<script type="text/javascript">
var getstoid = "<?php echo I('stoid')?>";
//积分兑换
function transjifen(obj) {
var uid=getCookie("user_mobile");
if($.trim(uid)=="" || uid==undefined) {
window.location.href = '/index.php/Mobile/User/login/stoid/' + getstoid + '/oldurl/' + encodeURI(window.location.href);
return false;
}
var lbid={$list.id};
layer.open({
content:'是否确定兑换礼包',
btn:['确定','取消'],
yes:function (index) {
layer.closeAll();
console.log('确定');
var ii=layer.open({type: 2,shadeClose: false});
$.ajax({
type: "POST",
url: "{:U('Mobile/Libao/libaoorder',array('stoid'=>$Think.request.stoid))}", //+tab,
data: "lbid="+lbid+"&paytype=1", // 你的formid
dataType: "json",
success: function (data) {
layer.close(ii);
console.log(data.code);
if (data.code == 1) {
layer.open({
content: "兑换成功",
time: 2
});
setTimeout(function () {
location.href = "/Mobile/Payment/payment_success/stoid/" + getstoid+"/ptype/1.html";
}, 1000)
} else {
layer.open({
content: data.msg,
time: 2
});
// setTimeout(function () {
// //location.href = "/Mobile/Cart/cart4/orderno/" + data.result + "/stoid/" + getstoid;
// location.href = '/Mobile/Payment/getCode.html?orderno=' + data.result + '&stoid=' + getstoid;
// }, 1000)
}
},
error:function () {
layer.close(ii);
}
});
},
// no:function (index) {
// console.log('取消');
// }
})
}
//微信购买
function goumai(obj) {
var uid=getCookie("user_mobile");
if($.trim(uid)=="" || uid==undefined) {
window.location.href = '/index.php/Mobile/User/login/stoid/' + getstoid + '/oldurl/' + encodeURI(window.location.href);
return false;
}
var lbid={$list.id};
layer.open({
content:'是否确定购买礼包',
btn:['确定','取消'],
yes:function (index) {
layer.closeAll();
console.log('确定');
$.ajax({
type: "POST",
url: "{:U('Mobile/Libao/libaoorder',array('stoid'=>$Think.request.stoid))}", //+tab,
data: "lbid="+lbid+"&paytype=2", // 你的formid
dataType: "json",
beforeSend:function()
{
layer.open({shadeClose: false,type: 2 ,content: '提交中…'});
},
success: function (data) {
layer.closeAll();
console.log(data.code);
if (data.code == 1) {
$("#points").submit();
} else {
layer.open({
content: data.msg,
time: 2
});
}
}
});
},
// no:function (index) {
// console.log('取消');
// }
})
}
</script>
<!-- 微信浏览器 调用微信 分享js-->
<include file="public/wx_share"/>