|
@@ -10,6 +10,8 @@ var $btnby = $('input.btnby'), |
|
@@ -10,6 +10,8 @@ var $btnby = $('input.btnby'), |
10
|
amount = $btnby.data('amount'),
|
10
|
amount = $btnby.data('amount'),
|
11
|
$formGo = $('.form-go'),
|
11
|
$formGo = $('.form-go'),
|
12
|
Alert = dialog.Alert,
|
12
|
Alert = dialog.Alert,
|
|
|
13
|
+ time = $('.js-time').data('time'),
|
|
|
14
|
+ $timer = $('.js-timer'),
|
13
|
C_ID;
|
15
|
C_ID;
|
14
|
|
16
|
|
15
|
require('../simple-header');
|
17
|
require('../simple-header');
|
|
@@ -21,6 +23,8 @@ payPage = { |
|
@@ -21,6 +23,8 @@ payPage = { |
21
|
this.goPay();
|
23
|
this.goPay();
|
22
|
},
|
24
|
},
|
23
|
setEvent: function() {
|
25
|
setEvent: function() {
|
|
|
26
|
+ var self = this;
|
|
|
27
|
+
|
24
|
// tab切 事件
|
28
|
// tab切 事件
|
25
|
$('ul.tabs').on('click', function(e) {
|
29
|
$('ul.tabs').on('click', function(e) {
|
26
|
var $li = $(e.target).closest('li');
|
30
|
var $li = $(e.target).closest('li');
|
|
@@ -55,6 +59,11 @@ payPage = { |
|
@@ -55,6 +59,11 @@ payPage = { |
55
|
document.location.href = '//www.yohobuy.com/home/orders';
|
59
|
document.location.href = '//www.yohobuy.com/home/orders';
|
56
|
});
|
60
|
});
|
57
|
});
|
61
|
});
|
|
|
62
|
+
|
|
|
63
|
+ this.setTimer();
|
|
|
64
|
+ setInterval(function() {
|
|
|
65
|
+ self.setTimer();
|
|
|
66
|
+ }, 1000);
|
58
|
},
|
67
|
},
|
59
|
goPay: function() {
|
68
|
goPay: function() {
|
60
|
var payType;
|
69
|
var payType;
|
|
@@ -128,6 +137,21 @@ payPage = { |
|
@@ -128,6 +137,21 @@ payPage = { |
128
|
}
|
137
|
}
|
129
|
});
|
138
|
});
|
130
|
});
|
139
|
});
|
|
|
140
|
+ },
|
|
|
141
|
+ setTimer: function() {
|
|
|
142
|
+ var hour = Math.floor(time / 3600);
|
|
|
143
|
+ var minus = Math.floor((time % 3600) / 60);
|
|
|
144
|
+ var second = time % 60;
|
|
|
145
|
+ var text = '';
|
|
|
146
|
+
|
|
|
147
|
+ if (hour > 0) {
|
|
|
148
|
+ text += hour + '小时';
|
|
|
149
|
+ }
|
|
|
150
|
+
|
|
|
151
|
+ text += minus + '分' + second + '秒';
|
|
|
152
|
+
|
|
|
153
|
+ $timer.text(text);
|
|
|
154
|
+ time--;
|
131
|
}
|
155
|
}
|
132
|
};
|
156
|
};
|
133
|
|
157
|
|