Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
ccbikai
9 years ago
Commit
79af6a9c7ffce3cb7bab7c8b8b31f2b25eed4e44
1 parent
176bc250
完善用户提交退货信息
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
63 additions
and
3 deletions
apps/home/controllers/refund.js
apps/home/models/refund.js
apps/home/router.js
public/vue/home/refund.vue
apps/home/controllers/refund.js
View file @
79af6a9
...
...
@@ -9,7 +9,7 @@ const refund = {
res
.
render
(
'refund'
);
},
order
(
req
,
res
,
next
)
{
const
uid
=
8050882
;
const
uid
=
req
.
user
.
uid
||
8050882
;
const
orderId
=
req
.
query
.
orderId
;
if
(
!
orderId
)
{
...
...
@@ -20,6 +20,13 @@ const refund = {
res
.
json
(
result
);
}).
catch
(
next
);
},
submit
(
req
,
res
,
next
)
{
const
uid
=
req
.
user
.
uid
||
8050882
;
refundModel
.
submitRefundData
(
uid
,
req
.
body
).
then
(
result
=>
{
res
.
json
(
result
);
}).
catch
(
next
);
},
logistics
(
req
,
res
)
{
res
.
render
(
'logistics'
,
{
module
:
'home'
,
...
...
apps/home/models/refund.js
View file @
79af6a9
...
...
@@ -14,6 +14,16 @@ const refund = {
cache
:
true
,
code
:
200
}).
then
(
global
.
yoho
.
camelCase
);
},
submitRefundData
(
uid
,
params
)
{
console
.
log
(
Object
.
assign
({
method
:
'app.refund.submit'
,
uid
:
uid
,
},
params
));
return
api
.
post
(
''
,
Object
.
assign
({
method
:
'app.refund.submit'
,
uid
:
uid
,
},
params
)).
then
(
global
.
yoho
.
camelCase
);
}
};
...
...
apps/home/router.js
View file @
79af6a9
...
...
@@ -29,8 +29,9 @@ router.get('/favorite', favorite.favorite); // 个人中心 - 收藏
router
.
get
(
'/favorite/favpaging'
,
favorite
.
favpaging
);
// 个人中心 - 收藏商品/品牌(翻页)
router
.
post
(
'/favorite/favdel'
,
favorite
.
favdel
);
// 个人中心 - 收藏商品/品牌(刪除)
router
.
get
(
'/refund'
,
refund
.
refund
);
router
.
get
(
'/refund/order'
,
refund
.
order
);
router
.
get
(
'/refund'
,
refund
.
refund
);
// 退换货
router
.
get
(
'/refund/order'
,
refund
.
order
);
// 查询订单数据
router
.
post
(
'/refund/submit'
,
refund
.
submit
);
// 提交信息
router
.
get
(
'/refund/logistics'
,
refund
.
logistics
);
// 退换货 - 商品寄回信息
...
...
public/vue/home/refund.vue
View file @
79af6a9
...
...
@@ -101,6 +101,7 @@
product.reason = {
id: 0
};
product.imageList = [];
});
res.data.returnAmountMode.forEach(mode => {
if (mode.isDefault === 'Y') {
...
...
@@ -112,6 +113,47 @@
}
});
},
methods: {
checkSubmitData() {
const data = this.submitData;
if (!data.order_code) {
return false;
}
// 退到银行卡
if (this.amount.return_amount_mode === 2) {
if (!this.amount.bank_name || !this.amount.bank_card || !this.amount.payee_name) {
return false;
}
}
// 退到支付宝
if (this.amount.return_amount_mode === 3) {
if (!this.amount.alipay_account || !this.amount.alipay_name) {
return false;
}
}
return true;
},
submit() {
if (!this.checkSubmitData()) {
alert('请填写完整退换货信息');
}
$.ajax({
method: 'POST',
url: '/home/refund/submit',
data: this.submitData
}).then(result => {
if (result.code === 200) {
console.log(result);
} else {
alert(result.message);
}
});
}
},
components: {
productList
}
...
...
Please
register
or
login
to post a comment