mobliehtmpingdlist.html
8.18 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
<style>
.goods_img{position: relative;}
.goods_img .round_show{ width: 0.5rem; height:0.5rem; color: #fff; font-size: 0.18rem; line-height: 0.48rem; background:#E9030D; border-radius: 100%;position: absolute; top: 2px; right:3px;}
</style>
<script> var tf=new Array();var tf2=new Array();var isyu=new Array();var Dif=new Array(); </script>
<div class="floor_body">
<h2>
<a href="/index.php/mobile/team/team_list/stoid/{$Think.request.stoid}.html">
<em></em>拼单
<div class="geng">
</div>
<p class="clear"></p>
</a>
</h2>
<ul class="seckill_off seckill_list" >
<pind no="{{no}}" idlist='{{idlist}}' item="v" limit='9'>
<li onclick="javascript:window.location.href='{:U('Mobile/team/team_info',array('stoid'=>$Think.request.stoid,'id'=>$v.goods_id))}'" >
<div class="imgbox">
<img src="{:getimg($v.original_img,NOIMG,0,1);}"/>
<switch name="v.kttype" >
<case value="1"><em class="round_show">商家</em></case>
<case value="2"><em class="round_show">会员</em></case>
<case value="3"><em class="round_show">阶梯</em></case>
</switch>
</div>
<div class="content">
<p class="tit">{$v.title}</p>
<p class="tit" style="font-size: 12px">已团{$v.buy_num}件
<font style="font-size: 10px; color: grey">{$v.ct_num}人团</font></p>
<p class="price">¥<span>{$v.price}</span><i>¥{$v.market_price}</i></p>
<p class="time">
<img src="__STATIC__/images/time.png" />
<span id="jstimerBox{$v.goods_id}"> </span>
</p>
<if condition="$v.goods_num gt $v.buy_num">
<if condition="$v.isyure eq 0">
<if condition="$v['kttype'] eq 1">
<div class="btnRed">去参团</div>
<else/>
<div class="btnRed">去开团</div>
</if>
<else/>
<div class="btnRed" style="background: gainsboro; color: #888;">正在预热</div>
</if>
<else/>
<div class="btnRed" style="background: gainsboro; color: #888;">已拼完</div>
</if>
</div>
<div style="clear: both"></div>
</li>
<script>
$(function () {
isyu['$v.goods_id']="{$v.isyure}";
tf2['{$v.goods_id}']=new Date('{$v.end_time|date="Y/m/d H:i:s",###}');
<if condition="$v.isyure eq 1">
var ttt= tf2['{$v.goods_id}']-new Date().getTime();
if(ttt<=0){
$("#jstimerBox{$v.goods_id}").parent().parent().find(".btnRed").css("color", "#888");
$("#jstimerBox{$v.goods_id}").parent().parent().find(".btnRed").css("background-color", "gainsboro");
$("#jstimerBox{$v.goods_id}").parent().parent().find(".btnRed").text("已结束");
$("#jstimerBox{$v.goods_id}").parent().remove();
tf['{$v.goods_id}'] = "false";
}else{
tf['{$v.goods_id}'] = new Date('{$v.start_time|date="Y/m/d H:i:s",###}');
Dif['{$v.goods_id}'] =tf['{$v.goods_id}'] - new Date().getTime();
if(Dif['{$v.goods_id}']<=0) {
$("#jstimerBox{$v.goods_id}").parent().parent().find(".btnRed").css("color", "#fff");
$("#jstimerBox{$v.goods_id}").parent().parent().find(".btnRed").css("background-color", "#C4182E");
<if condition = "$v['kttype'] eq 1" >
$("#jstimerBox{$v.goods_id}").parent().parent().find(".btnRed").text('去参团');
<else/>
$("#jstimerBox{$v.goods_id}").parent().parent().find(".btnRed").text('去开团');
</if>
isyu['$v.goods_id']="0";
}
}
<else/>
tf['{$v.goods_id}'] = new Date('{$v.end_time|date="Y/m/d H:i:s",###}');
Dif['{$v.goods_id}'] =tf['{$v.goods_id}'] - new Date().getTime();
if(Dif['{$v.goods_id}']<=0) {
$("#jstimerBox{$v.goods_id}").parent().parent().find(".btnRed").css("color", "#888");
$("#jstimerBox{$v.goods_id}").parent().parent().find(".btnRed").css("background-color", "gainsboro");
$("#jstimerBox{$v.goods_id}").parent().parent().find(".btnRed").text("已结束");
$("#jstimerBox{$v.goods_id}").parent().remove();
tf['{$v.goods_id}'] = "false";
}
</if>
window.setInterval(function(){clock11('{$v.goods_id}',"{$v['kttype']}");}, 1000);
});
</script>
</pind>
</ul>
</div>
<script type="text/javascript">
var daysms0 = 24 * 60 * 60 * 1000;
var hoursms0 = 60 * 60 * 1000;
var Secondms0 = 60 * 1000;
var microsecond0 = 1000;
var DifferHour0 = -1;
var DifferMinute0 = -1;
var DifferSecond0 = -1;
// 倒计时
function clock11(key,t) {
if(tf[key]=="false") return false;
var time = new Date()
var hour = time.getHours()
var minute = time.getMinutes()
var second = time.getSeconds()
var timevalue = "" + ((hour > 12) ? hour - 12 : hour)
timevalue += ((minute < 10) ? ":0" : ":") + minute
timevalue += ((second < 10) ? ":0" : ":") + second
timevalue += ((hour > 12 ) ? " PM" : " AM")
var convertHour = DifferHour0
var convertMinute = DifferMinute0
var convertSecond = DifferSecond0
var Diffms = tf[key].getTime() - time.getTime()
if(Diffms<=0)
{
//$("#jstimerBox" + key).parent().parent().parent().remove();
if(isyu[key]=="0") {
$("#jstimerBox" + key).parent().parent().find(".btnRed").css("color","#888");
$("#jstimerBox" + key).parent().parent().find(".btnRed").css("background-color","gainsboro");
$("#jstimerBox" + key).parent().parent().find(".btnRed").text("已结束");
$("#jstimerBox" + key).parent().remove();
tf[key]="false";
}else{
$("#jstimerBox" + key).parent().parent().find(".btnRed").css("color","#fff");
$("#jstimerBox" + key).parent().parent().find(".btnRed").css("background-color","#C4182E");
tf[key]=tf2[key];
if(t=="1"){
$("#jstimerBox" + key).parent().parent().find(".btnRed").text('去参团');
}else{
$("#jstimerBox" + key).parent().parent().find(".btnRed").text('去开团');
}
isyu[key]="0";
}
}
else
{
DifferHour0 = Math.floor(Diffms / daysms0);
Diffms -= DifferHour0 * daysms0;
DifferMinute0 = Math.floor(Diffms / hoursms0);
Diffms -= DifferMinute0 * hoursms0;
DifferSecond0 = Math.floor(Diffms / Secondms0);
Diffms -= DifferSecond0 * Secondms0;
var dSecs = Math.floor(Diffms / microsecond0);
if (convertHour != DifferHour0) e = "<span class=hour>" + DifferHour0 + "</span><font color=black>天</font>";
if (convertMinute != DifferMinute0) f = "<span class=min>" + DifferMinute0 + "</span><font color=black>时</font>";
if (convertSecond != DifferSecond0) g = "<span class=sec>" + DifferSecond0+ "</span><font color=black>分</font>";
h = "<span class=msec>" + dSecs + "</span><font color=black>秒</font>";
if (DifferHour0 > 0) {
e = e;
}
else {
e = '';
}
document.getElementById("jstimerBox" + key).innerHTML = e + f + g + h;
}
}
</script>