Authored by 陈轩

退换货申请

<div class="modal">
<div class="modal {{styleClass}}">
<h2>{{title}}</h2>
<p>{{text}}</p>
<hr>
... ...
... ... @@ -22,6 +22,7 @@ class Modal {
this.defaults = {
isModal: true,
template: template,
styleClass: '',
title: '',
text: '',
buttons: [
... ... @@ -37,6 +38,7 @@ class Modal {
// 初始化参数
this.settings = Object.assign({}, this.defaults, opts);
const tpl = this.settings.template({
styleClass: this.settings.styleClass,
title: this.settings.title,
text: this.settings.text,
buttons: this.settings.buttons
... ...
... ... @@ -15,6 +15,7 @@ console.log(vm);
/* eslint-disable */
// 私有包测试
var $ = require('jquery');
var qs = require('yoho-qs');
console.log(qs);
... ...
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 = interceptClick.titleMap[1];
header.left.action = location.origin + '/me/return';
header.title.des = `${kind.name}状态`;
return yoho.goNewPage({
header: header,
url: location.origin + kind.detailUrl
});
};
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();
};
... ...
... ... @@ -17,8 +17,7 @@
p {
font-size: 21px;
text-align: center;
margin-top: 20px;
margin-bottom: 48px;
margin: 20px 40px 48px;
}
hr {
... ...
.return-success-modal {
p {
font-size: 30px;
}
.button-group .modal-button:first-of-type {
color: #b0b0b0;
}
}
... ...
... ... @@ -37,9 +37,9 @@
const qs = require('yoho-qs');
const tip = require('common/tip');
const bus = require('common/vue-bus');
const modal = require('common/modal');
const interceptClick = require('common/intercept-click');
const Modal = require('common/modal');
const yoho = require('yoho');
const returnUtil = require('me/return/util');
const productList = require('me/return/list.vue');
const featureSelector = require('component/product/feature-selector.vue');
... ... @@ -245,22 +245,15 @@
data
}).then(result => {
if (result.code === 200) {
let header = interceptClick.titleMap[1];
header.left.action = location.origin + '/me/return'
header.title.des = '换货状态';;
return yoho.goNewPage({
header: header,
url: location.origin + `/me/return/exchange/detail/${result.data.applyId}`
});
returnUtil.applySuccuss(self.page, result.data.applyId);
} else {
modal.alert(result.message);
Modal.alert(result.message);
}
}).always(()=>{
self.processing = false;
});
} else {
modal.alert(msg);
Modal.alert(msg);
}
}
},
... ... @@ -302,6 +295,8 @@
</script>
<style>
@import "../../scss/me/_return.css";
body {
background-color: #f6f6f6;
}
... ...
... ... @@ -52,14 +52,15 @@
const $ = require('jquery');
const qs = require('yoho-qs');
const modal = require('common/modal');
const interceptClick = require('common/intercept-click');
const yoho = require('yoho');
const productList = require('me/return/list.vue');
const reasonConfig = require('me/return/reason');
const returnUtil = require('me/return/util');
module.exports = {
data() {
return {
page: 'refund',
list: [],
amount: {},
refundData: {}
... ... @@ -150,6 +151,8 @@
return true;
},
submit() {
const self = this;
if (!this.checkSubmitData()) {
modal.alert('请填写完整退换货信息');
}
... ... @@ -159,14 +162,7 @@
data: this.submitData
}).then(result => {
if (result.code === 200) {
let header = interceptClick.titleMap[1];
header.left.action = location.origin + '/me/return'
header.title.des = '退货状态';;
return yoho.goNewPage({
header: header,
url: location.origin + `/me/return/refund/detail/${result.data.applyId}`
});
returnUtil.applySuccuss(self.page, result.data.applyId);
} else {
modal.alert(result.message);
}
... ... @@ -180,6 +176,8 @@
</script>
<style>
@import "../../scss/me/_return.css";
.main-wrap {
background: #f6f6f6;
}
... ...