|
|
const yoho = require('yoho');
|
|
|
const interceptClick = require('common/intercept-click');
|
|
|
const Modal = require('common/modal');
|
|
|
|
|
|
const getImgHost = function(url, bucket = 'goodsimg') {
|
|
|
let urlArr = url.split('/'),
|
...
|
...
|
@@ -34,8 +36,57 @@ const getImgUrl = function(src, width = 300, height = 300, mode = 2) { |
|
|
}) : '';
|
|
|
};
|
|
|
|
|
|
// 退换货 申请 成功, 打开 modal
|
|
|
const applySuccuss = function(type, applyId) {
|
|
|
yoho.store.set('orderDetail', true);
|
|
|
|
|
|
const config = {
|
|
|
exchange: {
|
|
|
name: '换货',
|
|
|
detailUrl: `/me/return/exchange/detail/${applyId}`
|
|
|
},
|
|
|
refund: {
|
|
|
name: '退货',
|
|
|
detailUrl: `/me/return/refund/detail/${applyId}`
|
|
|
}
|
|
|
};
|
|
|
const kind = config[type];
|
|
|
const goStatusPage = function() {
|
|
|
const 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();
|
|
|
};
|
|
|
|
|
|
module.exports = {
|
|
|
getImgHost,
|
|
|
getImgUrl,
|
|
|
applySuccuss,
|
|
|
visibilitychange
|
|
|
}; |
...
|
...
|
|