util.js
1.36 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
const yoho = require('yoho');
const interceptClick = require('common/intercept-click');
const Modal = require('common/modal');
// 退换货 申请 成功, 打开 modal
exports.applySuccuss = function(type, applyId) {
let config = {
exchange: {
name: '换货',
detailUrl: `/me/return/exchange/detail/${applyId}`
},
refund: {
name: '退货',
detailUrl: `/me/return/refund/detail/${applyId}`
}
};
let kind = config[type];
let goStatusPage = function() {
let header = Object.assign({}, interceptClick.defaultTitleMap[1]);
header.left.action = location.origin + '/me/return';
header.title.des = `${kind.name}状态`;
return yoho.goNewPage({
header: header,
url: location.origin + kind.detailUrl,
backThrough: '1'
});
};
const modal = new Modal({
styleClass: 'return-success-modal',
text: `${kind.name}申请已提交,请等待审核.....`,
buttons: [{
text: '返回订单',
handler: function() {
this.hide();
yoho.goBack();
}
}, {
text: '查看进度',
handler: function() {
this.hide();
goStatusPage();
}
}]
});
modal.show();
};