order.js
1.24 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
// require('css/common.less');
// require('css/order.less');
// var $ = require('jquery');
var Common = require('common');
var Popup = require('popup');
var Circle = require('circle');
Common.initialize();
Circle.initialize();
Popup.initialize();
var Order = {
initialize: function(){
this.bindEvents();
},
bindEvents: function(){
var _this = this;
var _move = $('.actions .move');
$('.m-slide-btn').on('touchend', 'li', function(e){
e.preventDefault();
$(this).addClass('on').siblings().removeClass('on');
var color = $(this).attr('data-color');
var action = $(this).attr('data-action');
_this._action = action;
_move.css({
transform: 'translateX('+ $(this).index() +'00%)',
WebkitTransform: 'translateX('+ $(this).index() +'00%)',
backgroundColor: color
});
});
$('.actions').on('transitionEnd webkitTransitionEnd mozTransitionEnd', '.move', function(){
_this[_this._action] && _this[_this._action]();
});
$('#cancelPopupBtn').on('click', function(){
$('.m-slide-btn').find('li').eq(1).trigger('touchend');
});
},
giveup: function(){
// alert('已放弃');
window.location.href = 'order_pauseing.html';
},
recive: function(){
$('#confirmOrderBtn').trigger('click');
}
};
Order.initialize();