prom_list.html
19.4 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
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
<script type="text/javascript" src="__PUBLIC__/js/rem_new.js"></script>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="Generator" content="tpshop"/>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<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/goods.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/layer.css"/>
<link rel="stylesheet" type="text/css" href="__STATIC__/css/goods_info_new.css?v=__CSSVERSION__"/>
<script type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
<script type="text/javascript" src="__STATIC__/js/layer.js"></script>
<script src="__PUBLIC__/js/global.js?v=__CSSVERSION__"></script>
<script type="text/javascript" src="__PUBLIC__/js/mobile_common.js?v=__CSSVERSION__"></script>
<script type="text/javascript" src="__PUBLIC__/js/goodsInfoScroll2.js"></script>
<style>
.border-left-right{
border-left: 1px solid #999 !important;
border-right: 1px solid #999 !important;
}
.border-frame{
width: 95px;
border: 1px solid #999;
float: right;
}
.purchase{
width: 90%;
margin: auto;
border-radius: 50px;
margin-top: 120px;
margin-bottom: 25px;
height: 30px;
line-height: 30px;
}
</style>
</head>
<body>
<include file="public/pk_htm"/>
<div class="main prom_list">
<input type="hidden" id="hidstoid" value="{$Think.request.stoid}">
<div class="tit">搭配商品</div>
<form method="post" id="buy_goods_form">
<input type="hidden" name="goods_id" value="{$good.goods_id}"/>
<ul style="margin-bottom: 55px">
<li>
<div class="mark bgcover on1"></div>
<img class="prom_mark_img" src="{:getImg($good.original_img,NOIMG)}" alt="">
<div class="mark_goods_info">
<p>{$good.goods_name}</p>
<div>
<span class="inline_two inline_left c9">规格:
<if condition="trim($good.goods_spec)">
{$good.goods_spec}<if condition="trim($good.goods_color)">/{$good.goods_color}</if>
<else/>
<if condition="trim($good.goods_color)">{$good.goods_color}<else/>规格1</if>
</if>
</span>
<span class="inline_two inline_rig tar">x1</span>
<div class="clear"></div>
</div>
<div>
<span class="inline_two inline_left">¥{$good.shop_price}</span>
<span class="inline_two inline_rig tar">
<img class="arrow_down_off" src="__STATIC__/images/arrow_down_off.png" alt="">
</span>
<div class="clear"></div>
</div>
</div>
</li>
<volist name="list" id="vv">
<li onclick="add_price(this)" data-val="{$vv.shop_price}" data-name="0" data-price="{$vv.price}"
data-id="{$vv.goods_id}">
<div class="mark bgcover" data-type="{$vv.dist_type}"></div>
<!--<if condition="$vv['dist_type'] eq 0">-->
<!--<div class="pTitle">自选</div>-->
<!--</if>-->
<!--<if condition="$vv['dist_type'] eq 1">-->
<!--<div class="pTitle">自提</div>-->
<!--</if>-->
<!--<if condition="$vv['dist_type'] eq 2">-->
<!--<div class="pTitle">物流</div>-->
<!--</if>-->
<img class="prom_mark_img" src="{:getImg($vv.original_img,NOIMG)}" alt="">
<div class="mark_goods_info">
<p>{$vv.goods_name}</p>
<div>
<span class="inline_two inline_left c9">规格:
<if condition="trim($vv.goods_spec)">
{$vv.goods_spec}<if condition="trim($vv.goods_color)">/{$vv.goods_color}</if>
<else/>
<if condition="trim($vv.goods_color)">{$vv.goods_color}<else/>规格1</if>
</if>
</span>
<span class="inline_two inline_rig tar">x1</span>
<div class="clear"></div>
</div>
<div>
<span class="inline_two inline_left">¥{$vv.price}</span>
<span class="inline_two inline_rig tar">
<img class="arrow_down_off" src="__STATIC__/images/arrow_down_off.png" alt="">
</span>
<div class="clear"></div>
</div>
</div>
</li>
</volist>
</ul>
</form>
</div>
<div class="layermbox layermbox0_1 dn">
<div class="laymshade"></div>
<div class="layermmain">
<div class="section">
<div class="layermchild layermanim">
<div class="layermcont">
<ul class="tcbox">
<li class="liFirst">
<div class="flex" style="width: 100%;height: 101px">
<div class="tcimg">
<img id="fgoodsimg" src="{:getimg($good['original_img'],NOIMG)}"/>
<span class="dis_vm"></span>
</div>
<div style="width: 70%">
<div style="width: 100%;height: 50%">
<div class="cat-goods-name ellipsis-2">
{$good.goods_name}
</div>
</div>
<div class="tcinfo flex ai_fe">
<div>
<div class="tcprice">
<i>¥</i><font id="fpirce">{$good.shop_price}</font>
</div>
<div class="flex fg" style="line-height: 20px;height: 16px;">
<div>已售:<font id="fsalenum">{$good.sales_sum}</font>件</div>
<div>可售:<font id="fcansalenum">{$good.store_count}</font>件</div>
</div>
<!-- <div>已选:<font id="fselected_pro">{$good.spec}</font></div>-->
</div>
</div>
</div>
</div>
<span class="close"></span>
<div class="store-frame">
<div class="flex jc_sb">
<div class="flex" style="width: 75%">
<div class="store_top flex ai_center"><img src="__WEBPUBLIC__/miniapp/images/stores.png"><text class="fs026 fg">选择门店</text></div>
</div>
<div class="flex ai_center fs024 red_bb tt_more_sto dn" onclick="open_store(2)">
更多门店
<text class="bg_jj"></text>
</div>
<div class="flex ai_center sto_loding_div">
<img src="__STATIC__/images/category/loader.gif" class="f_load" width="20" />
</div>
</div>
<div id="ff_page_stos" style="width:100%;"></div>
</div>
</li>
<li class="attribute">
<ul>
<!-- 许程 2019/12/13
<li>
<div class="tcTit">
<div class="subNav" non="1">取货门店(<font id="fselestore">请选择门店</font>)</div>
</div>
</li>-->
<li>
<span class="tcBy"><i>购买数量</i></span>
<span class="tcBy" style="overflow: hidden">
<div class="act_wrap border-frame">
<a class="input-sub active"
onClick="get_event_log('1','减少商品数量');goods_cut()"></a>
<input id="ffgoods_num" type="tel"
onkeydown="if(event.keyCode == 13) event.returnValue = false"
name="goods_num" value="1" class="input-num border-left-right"
type="text">
<a class="input-add active"
onClick="get_event_log('1','增加商品数量');goods_add();"></a>
</div>
</span>
</li>
</ul>
</li>
<!--
许程 2019/12/13
<li id="selecat" class="area dn">
<div class="tcTit" style="border-bottom: 1px solid #dadada;">
< 选择门店
</div>
<ol class="addr-name" id="addr_catlist">
<if condition="is_bline neq 1">
<foreach name="store" item="list">
<li sid="{$list.cat_id}">{$list.cat_name}</li>
</foreach>
</if>
</ol>
</li>
<li id="selepick" class="store dn">
<div class="tcTit" style="border-bottom: 1px solid #dadada;">
< <font id="fcat_name"></font>
</div>
<ol class="addr-name" id="pickuplist">
<!–<li>中山路店</li>–>
</ol>
</li>-->
</ul>
</div>
<div id="fsumbitbtn" type="1" class="layermbtn purchase " onClick="checkup(this)">立即购买</div>
</div>
</div>
</div>
</div>
<div class="prom_footer">
<div class="footbtn left">
<div>搭配价<span style="font-size: 16px;">¥<span id="coll">{$good.shop_price}</span></span></div>
<div>已省<span>¥<span id="free">0</span></span></div>
</div>
<div class="footbtn right dn" id="nokill" style="float: right;background: #adadad">库存不足</div>
<div class="footbtn right goumai" style="float: right">立即购买</div>
<div class="clear"></div>
</div>
<div id="allsto" class="dn"></div>
<input type="hidden" id="is_bline" value="{$is_bline}">
<input type="hidden" id="ulx" value="{:session('ulx')}">
<input type="hidden" id="uly" value="{:session('uly')}">
<input type="hidden" id="goods_list" value="">
<script type="text/javascript">
var is_fast_reg='{:get_fast_reg();}';
var stoid = "<?php echo I('stoid')?>";
var id = "<?php echo I('goods_id')?>";
var selectid = "<?php echo I('goods_id')?>";
var selectpid = "";
var distr_type={$good.distr_type};
var selectpiccount = -1;
var selectnum = 1;
var store_count = {$good.store_count};
var limit_goods = {$good.viplimited};
/*-----------------定位相关------------------*/
var issortsto = "{$is_sort_storage}";
function ismobile() {
var u = navigator.userAgent;
if (/AppleWebKit.*Mobile/i.test(navigator.userAgent) || (/MIDP|SymbianOS|NOKIA|SAMSUNG|LG|NEC|TCL|Alcatel|BIRD|DBTEL|Dopod|PHILIPS|HAIER|LENOVO|MOT-|Nokia|SonyEricsson|SIE-|Amoi|ZTE/.test(navigator.userAgent))) {
if (window.location.href.indexOf("?mobile") < 0) {
try {
if (/iPhone|mac|iPod|iPad/i.test(navigator.userAgent)) {
return '0';
} else {
return '1';
}
} catch (e) {
}
}
} else if (u.indexOf('iPad') > -1) {
return '0';
} else {
return '1';
}
}
var ii0 = 0;
//获取经纬度
function getCurLocation() {
navigator.geolocation.getCurrentPosition( // 该函数有如下三个参数
function (pos) { // 如果成果则执行该回调函数
var x = parseFloat(pos.coords.longitude).toFixed(2);
var y = parseFloat(pos.coords.latitude).toFixed(2);
mapshow(x, y);
}, function (err) { // 如果失败则执行该回调函数
mapshow(0, 0);
}, { // 附带参数
enableHighAccuracy: false, // 提高精度(耗费资源)
timeout: 1000, // 超过timeout则调用失败的回调函数
maximumAge: 1000 // 获取到的地理信息的有效期,超过有效期则重新获取一次位置信息
}
);
}
var isapple = false;
if (ismobile() == "0") {
isapple = true;
}
/*--商品的数量的加减--*/
function goods_cut() {
selectpid=my_sele_pkid;
if (selectpid == "") {
layer.open({content: '请先选择门店', time: 2});
return;
}
var num_val = document.getElementById('ffgoods_num');
var new_num = num_val.value;
var Num = parseInt(new_num);
if (Num > 1) Num = Num - 1;
num_val.value = Num;
selectnum = Num;
}
function goods_add() {
selectpid=my_sele_pkid;
if (selectpid == "") {
layer.open({content: '请先选择门店', time: 2});
return;
}
var num_val = document.getElementById('ffgoods_num');
var new_num = num_val.value;
var Num = parseInt(new_num);
Num = Num + 1;
if (selectpiccount != -1) {
//alert(selectpiccount);
/*--判断库存--*/
if (Num > selectpiccount) {
layer.open({content: '购买数量超出门店库存', time: 2});
num_val.value = Num - 1;
return;
}
} else {
/*--判断库存--*/
if (Num > store_count) {
layer.open({content: '购买数量超出库存', time: 2});
num_val.value = Num - 1;
return;
}
}
if (Num > limit_goods){
layer.open({content: '购买数量超出商品限购数量', time: 2});
num_val.value = Num - 1;
return;
}
num_val.value = Num;
selectnum = Num;
}
$(document).ready(function () {
});
var goods_list = '';
function add_price(obj) {
var type = $(obj).attr('data-name');
var price = parseFloat($('#coll').text());
var free = parseFloat($('#free').text());
if (type == 0) {
var dis_type = $(obj).children().attr('data-type');
if (dis_type != '0') {
var judge = false;
$('.on2').each(function () {
var dis_type0 = $(this).attr('data-type');
if (dis_type0 != 0 && dis_type != dis_type0) {
layer.open({content: "自提和物流商品不能同时选择", time: 2});
judge = true;
return false;
}
});
}
if (judge) {
return false;
}
$(obj).attr('data-name', '1');
$(obj).children(':first').addClass('on2');
price += parseFloat($(obj).attr('data-price'));
free += parseFloat($(obj).attr('data-val')) - parseFloat($(obj).attr('data-price'));
$('#coll').text(price.toFixed(2));
$('#free').text(free.toFixed(2));
goods_list += $(obj).attr('data-id') + ',';
$('#goods_list').val(goods_list);
} else {
$(obj).attr('data-name', '0');
$(obj).children().removeClass('on2');
price -= parseFloat($(obj).attr('data-price'));
free -= parseFloat($(obj).attr('data-val')) - parseFloat($(obj).attr('data-price'));
$('#coll').text(price.toFixed(2));
$('#free').text(free.toFixed(2));
goods_list = goods_list.replace($(obj).attr('data-id') + ',', '');
$('#goods_list').val(goods_list);
}
}
function checkup(ob) {
selectpid=my_sele_pkid;
if (selectpid == "") {
layer.open({content: '请先选择门店', time: 2});
return;
}
if (goods_list == '') {
layer.open({content: '请选择搭配商品', time: 2});
return;
}
var num_val = document.getElementById('ffgoods_num');
var new_num = num_val.value;
var Num = parseInt(new_num);
if (selectpiccount != -1) {
//alert(selectpiccount);
/*--判断库存--*/
if (Num > selectpiccount) {
layer.open({content: '购买数量超出门店库存', time: 2});
return;
}
} else {
/*--判断库存--*/
if (Num > store_count) {
layer.open({content: '购买数量超出库存', time: 2});
return;
}
}
if (limit_goods == 0){
layer.open({content: '购买数量超出商品限购数量', time: 2});
return;
}
var text = $(ob).text();
if (text == "提交中") {
return false;
}
$(ob).text("提交中");
var type = parseInt($(ob).attr("type"));
AjaxAddCart(selectid, Num, type, selectpid);
}
</script>
<style>
#nokill{position: absolute; bottom: 0 ; right: 0}
</style>
<!-- 微信浏览器 调用微信 分享js-->
<include file="public/wx_share"/>
</body>
</html>