Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuy-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
1
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Plain Diff
Browse Files
Authored by
htoooth
8 years ago
Commit
7798e2523f641206dcbe1276b0ac4dfb43149fc3
2 parents
94df02c9
e1ce0491
Merge branch 'release/6.0.2' of
http://git.yoho.cn/fe/yohobuy-node
into release/6.0.2
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
43 additions
and
23 deletions
apps/home/controllers/returns.js
apps/home/models/orders-service.js
apps/home/models/returns-api.js
apps/home/models/returns.js
public/js/home/returns-apply.js
public/js/product/index/top-coupon.js
apps/home/controllers/returns.js
View file @
7798e25
...
...
@@ -135,16 +135,15 @@ const exchangeDetail = (req, res, next) => {
* 我的订单-获取换货方式
*/
const
getDelivery
=
(
req
,
res
,
next
)
=>
{
let
orderCode
=
req
.
body
.
orderCode
;
let
areaCode
=
req
.
body
.
areaCode
;
let
skns
=
req
.
body
.
skns
;
// 获取必要参数
let
uid
=
req
.
user
.
uid
;
let
gender
=
req
.
yoho
.
gender
;
let
channel
=
req
.
yoho
.
channel
;
// 调用接口获得该用户支持的换货方式(白金会员可享受上门换货,偏远地区不支持上门换货)
req
.
ctx
(
returnsModel
).
getDelivery
(
areaCode
,
uid
,
gender
,
channel
).
then
(
result
=>
{
req
.
ctx
(
returnsModel
).
getDelivery
(
orderCode
,
areaCode
,
uid
,
skns
).
then
(
result
=>
{
res
.
send
(
result
);
}).
catch
(
next
);
};
...
...
apps/home/models/orders-service.js
View file @
7798e25
...
...
@@ -445,7 +445,7 @@ module.exports = class extends global.yoho.BaseModel {
op
.
push
(
'refund'
);
}
if
(
+
order
.
attribute
===
9
)
{
if
(
+
order
.
attribute
===
9
||
+
order
.
attribute
===
11
)
{
op
=
[
'deposit'
];
}
...
...
@@ -618,18 +618,18 @@ module.exports = class extends global.yoho.BaseModel {
_getOrderDetailOp
(
orderId
,
payment
,
status
,
isCancel
,
paymentStatus
,
paymentType
,
orderType
,
attribute
,
refundStatus
)
{
orderType
,
attribute
,
refundStatus
,
links
)
{
let
operation
=
{};
// 立刻付款
if
(
paymentType
===
1
&&
paymentStatus
===
'N'
&&
isCancel
===
'N'
&&
payment
!==
19
)
{
if
(
_
.
includes
(
links
,
'buyNow'
)
)
{
Object
.
assign
(
operation
,
{
goPay
:
helpers
.
urlFormat
(
'/shopping/newpay'
,
{
ordercode
:
orderId
})
});
}
// 取消订单
if
(
status
<
3
&&
isCancel
===
'N'
&&
paymentStatus
===
'N'
&&
orderType
!==
5
)
{
if
(
_
.
includes
(
links
,
'closeOrder'
)
)
{
Object
.
assign
(
operation
,
{
cancelOrder
:
true
});
...
...
@@ -874,7 +874,8 @@ module.exports = class extends global.yoho.BaseModel {
detail
.
operation
=
that
.
_getOrderDetailOp
(
orderDetail
.
order_code
,
+
orderDetail
.
payment
,
+
orderDetail
.
status
,
orderDetail
.
is_cancel
,
orderDetail
.
payment_status
,
orderDetail
.
payment_type
,
+
orderDetail
.
order_type
,
+
orderDetail
.
attribute
,
+
orderDetail
.
refund_status
+
orderDetail
.
order_type
,
+
orderDetail
.
attribute
,
+
orderDetail
.
refund_status
,
orderDetail
.
links
);
detail
.
packageTitle
=
orderDetail
.
package_title
;
...
...
apps/home/models/returns-api.js
View file @
7798e25
...
...
@@ -203,14 +203,15 @@ module.exports = class extends global.yoho.BaseModel {
* @param $yhChannel
* @return mixed
*/
getDeliveryAsync
(
areaCode
,
uid
,
gender
,
channel
)
{
getDeliveryAsync
(
orderCode
,
areaCode
,
uid
,
skns
)
{
skns
=
skns
||
[];
let
options
=
{
method
:
'app.change.
get
Delivery'
,
method
:
'app.change.
refresh
Delivery'
,
uid
:
uid
,
order_code
:
orderCode
,
area_code
:
areaCode
,
gender
:
gender
,
yh_channel
:
channel
skns
:
JSON
.
stringify
(
skns
)
};
return
this
.
post
({
data
:
options
});
...
...
apps/home/models/returns.js
View file @
7798e25
...
...
@@ -677,8 +677,16 @@ module.exports = class extends global.yoho.BaseModel {
}
// 获取换货方式
getDelivery
(
areaCode
,
uid
,
gender
,
channel
)
{
return
new
ReturnAPI
(
this
.
ctx
).
getDeliveryAsync
(
areaCode
,
uid
,
gender
,
channel
);
getDelivery
(
orderCode
,
areaCode
,
uid
,
skns
)
{
return
new
ReturnAPI
(
this
.
ctx
).
getDeliveryAsync
(
orderCode
,
areaCode
,
uid
,
_
.
split
(
skns
,
','
)).
then
(
result
=>
{
if
(
+
result
.
code
===
200
)
{
_
.
remove
(
result
.
data
,
n
=>
{
return
n
.
is_support
!==
'Y'
;
});
}
return
result
;
});
}
// 取消退货申请
...
...
public/js/home/returns-apply.js
View file @
7798e25
...
...
@@ -120,12 +120,24 @@ function getRefundCompute() {
});
}
function
syncRefundMode
(
code
)
{
function
syncRefundMode
()
{
var
skns
=
[];
if
(
!
defaultArea
)
{
return
;
}
$goodsTable
.
find
(
'input[type="checkbox"]:checked'
).
each
(
function
()
{
skns
.
push
(
$
(
this
).
siblings
(
'input[name="skn"]'
).
val
());
});
$
.
ajax
({
type
:
'POST'
,
url
:
'/home/returns/getDelivery'
,
data
:
{
areaCode
:
code
orderCode
:
orderCode
,
areaCode
:
defaultArea
,
skns
:
skns
.
join
(
','
)
}
}).
then
(
function
(
jsonData
)
{
var
_html
=
''
;
...
...
@@ -224,7 +236,7 @@ if ($refundInfo.length) {
}
});
}
else
if
(
defaultArea
)
{
syncRefundMode
(
defaultArea
);
syncRefundMode
();
}
defaultArea
=
defaultArea
?
defaultArea
:
''
;
...
...
@@ -282,6 +294,7 @@ $checkBox.change(function() {
$par
.
next
().
hide
();
}
syncRefundMode
();
getRefundCompute
();
});
...
...
@@ -373,11 +386,9 @@ function fileChangeEvent() {
fileChangeEvent
();
// 初始化上传图片事件
$exchange
.
on
(
'change'
,
'#streets'
,
function
()
{
var
code
=
$
(
this
).
val
()
*
1
;
defaultArea
=
$
(
this
).
val
()
*
1
;
if
(
code
)
{
syncRefundMode
(
code
);
}
syncRefundMode
();
});
$refundType
.
change
(
function
()
{
...
...
public/js/product/index/top-coupon.js
View file @
7798e25
...
...
@@ -142,7 +142,7 @@ function syncCouponStatus() {
if
(
couponObj
.
hasOwnProperty
(
i
))
{
coup
=
asyncObj
[
i
];
if
(
coup
)
{
if
(
coup
&&
(
coup
.
status
===
1
||
coup
.
status
===
3
)
)
{
couponObj
[
i
].
status
=
coup
.
status
;
coup
.
status
===
3
?
setPicked
(
couponObj
[
i
])
:
false
;
}
else
{
...
...
Please
register
or
login
to post a comment