order-detail.page.js
1.54 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
var cancelOrder = require('./order/cancel-order');
var confirmReceive = require('./order/confirm-receive');
var editOrder = require('./order/edit-order');
var countDown = require('./order/countdown');
var lazyLoad = require('yoho-jquery-lazyload');
lazyLoad($('img.lazy'));
function reload() {
location.reload();
}
$('.order .cancel-btn').on('click', function() {
var $this = $(this);
var code = $this.closest('.order').data('code');
cancelOrder.start(code, reload);
});
$('.order .edit-btn').on('click', function() {
var $this = $(this);
var $userInfo = $('.user-info.info-box');
var code = $this.closest('.order').data('code');
var areaCode = $userInfo.data('area');
var userName = $userInfo.find('.user-name-sel').data('name');
var address = $userInfo.find('.user-addr-sel').data('address');
var mobile = $userInfo.find('.user-mo-sel').data('mobile');
var phone = $userInfo.find('.user-ph-sel').data('phone');
editOrder.start({
data: {
orderCode: code,
userName: userName,
address: address,
mobile: mobile,
phone: phone,
areaCode: areaCode
}
}, reload);
});
$('.complete-btn').on('click', function() {
var code = $(this).closest('.order').data('code');
confirmReceive.done(code);
});
if ($('.left-time').length) {
countDown.intervalValue = 1000;
countDown.showSec = true;
countDown.start();
}
$('.show-package').on('click', function() {
$(this).next('.package-list').toggleClass('hide');
});