Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
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
Aiden Xu
9 years ago
Commit
8f1b3e998ca4c387743ff6a45d0cbf0ba030d2b2
1 parent
73ca109f
开通有货分期
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
367 additions
and
144 deletions
apps/home/controllers/installment.js
apps/home/models/installment.js
apps/home/models/response.json
apps/home/router.js
apps/home/views/action/installment/order-list.hbs
apps/home/views/action/installment/order.hbs
public/js/home/installment.order.page.js
public/scss/home/installment/_order.css
apps/home/controllers/installment.js
View file @
8f1b3e9
...
...
@@ -134,7 +134,6 @@ const review = (req, res) => {
}
};
const
startingService
=
(
req
,
res
)
=>
{
res
.
render
(
'installment/starting-service'
,
{
module
:
'home'
,
...
...
@@ -171,7 +170,7 @@ const verifyCode = (req, res, next) => {
}).
catch
(
next
);
};
const
order
=
(
req
,
res
)
=>
{
const
order
Index
=
(
req
,
res
)
=>
{
res
.
render
(
'installment/order'
,
{
module
:
'home'
,
page
:
'installment.order'
,
...
...
@@ -180,12 +179,32 @@ const order = (req, res) => {
});
};
const
orderList
=
(
req
,
res
)
=>
{
const
params
=
{
uid
:
req
.
user
.
uid
,
type
:
req
.
query
.
type
||
1
,
page
:
req
.
query
.
page
||
1
,
limit
:
req
.
query
.
limit
||
10
};
installmentModel
.
getInstallmentOrders
(
params
).
then
((
result
)
=>
{
res
.
render
(
'installment/order-list'
,
{
orders
:
result
.
data
.
orderList
,
layout
:
false
});
});
};
const
orderDetail
=
(
req
,
res
)
=>
{
res
.
render
(
'installment/order-detail'
,
{
module
:
'home'
,
page
:
'installment.order-detail'
,
navTitle
:
'分期详情'
,
navBtn
:
false
const
params
=
{};
installmentModel
.
getInstallmentOrders
(
params
).
then
(()
=>
{
res
.
render
(
'installment/order-detail'
,
{
module
:
'home'
,
page
:
'installment.order-detail'
,
navTitle
:
'分期详情'
,
navBtn
:
false
});
});
};
...
...
@@ -196,6 +215,7 @@ module.exports = {
activateService
,
verifyCode
,
getBankInfo
,
order
,
orderIndex
,
orderList
,
orderDetail
};
...
...
apps/home/models/installment.js
View file @
8f1b3e9
...
...
@@ -7,10 +7,12 @@
const
utils
=
'../../../utils'
;
const
productProcess
=
require
(
`
$
{
utils
}
/product-process`
)
;
const
api
=
global
.
yoho
.
API
;
const
camelCase
=
global
.
yoho
.
camelCase
;
const
logger
=
global
.
yoho
.
logger
;
// const camelCase = global.yoho.camelCase;
const
response
=
require
(
'./response.json'
);
const
_DEBUG
=
true
;
// 获取分期开通状态
const
getStauts
=
(
uid
)
=>
{
...
...
@@ -245,11 +247,11 @@ const sendVerifyCode = (uid, mobile) => {
* 开通服务
*
* @param uid 用户id
* @param userName
姓名
* @param userName
姓名
* @param identityCardNo 身份证号码
* @param cardNo 银行卡号码
* @param mobile 手机号码
* @param snsCheckCode
验证码
* @param snsCheckCode
验证码
* @returns {*}
*/
const
activateService
=
(
params
)
=>
{
...
...
@@ -266,8 +268,34 @@ const activateService = (params) => {
*/
const
getBankInfo
=
(
cardNo
)
=>
{
return
api
.
get
(
''
,
{
method
:
'user.instalment.getBankInfoByCardNo'
},
cardNo
);
method
:
'user.instalment.getBankInfoByCardNo'
,
cardNo
:
cardNo
});
};
/**
* 分期订单列表
*
* uid
* type 订单类型 1:全部订单,2:还款中,3:已还清
* page 页数
* limit
* @returns {*}
*/
const
getInstallmentOrders
=
(
params
)
=>
{
const
method
=
'app.SpaceOrders.getInstallment'
;
if
(
!
_DEBUG
)
{
return
api
.
get
(
''
,
{
method
:
method
,
uid
:
params
.
uid
,
type
:
params
.
type
||
1
,
page
:
params
.
page
||
1
,
limit
:
params
.
limit
||
10
});
}
else
{
return
Promise
.
resolve
(
camelCase
(
response
[
method
]));
}
};
module
.
exports
=
{
...
...
@@ -277,5 +305,6 @@ module.exports = {
getSearchIntallment
,
sendVerifyCode
,
activateService
,
getBankInfo
getBankInfo
,
getInstallmentOrders
};
...
...
apps/home/models/response.json
0 → 100644
View file @
8f1b3e9
{
"app.SpaceOrders.getInstallment"
:
{
"code"
:
200
,
"data"
:
{
"order_list"
:
[
{
"order_code"
:
"1519273880"
,
"uid"
:
"5772257"
,
"create_time"
:
"2016/08/01"
,
"amount"
:
"¥100.00"
,
"buy_total"
:
1
,
"install_status"
:
"已还清"
,
"order_goods"
:
[
{
"buy_number"
:
1
,
"goods_image"
:
"http://img10.static.yhbimg.com/goodsimg/2014/06/19/02/0118c2721e4f2219f69539dd389f4bacac.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80"
,
"goods_price"
:
"¥1.00"
,
"goods_amount"
:
"¥1.00"
,
"product_id"
:
84230
,
"product_name"
:
"004 满版龙纹迷彩七分休闲裤"
,
"cn_alphabet"
:
"004QiFenBuKu004PA095"
,
"product_skn"
:
51055461
}
]
},
{
"order_code"
:
"1519273880"
,
"uid"
:
"5772257"
,
"create_time"
:
"2016/08/01"
,
"amount"
:
"¥100.00"
,
"buy_total"
:
1
,
"install_status"
:
"已还清"
,
"order_goods"
:
[
{
"buy_number"
:
1
,
"goods_image"
:
"http://img10.static.yhbimg.com/goodsimg/2014/06/19/02/0118c2721e4f2219f69539dd389f4bacac.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80"
,
"goods_price"
:
"¥1.00"
,
"goods_amount"
:
"¥1.00"
,
"product_id"
:
84230
,
"product_name"
:
"004 满版龙纹迷彩七分休闲裤"
,
"cn_alphabet"
:
"004QiFenBuKu004PA095"
,
"product_skn"
:
51055461
}
]
},
{
"order_code"
:
"1519273880"
,
"uid"
:
"5772257"
,
"create_time"
:
"2016/08/01"
,
"amount"
:
"¥100.00"
,
"buy_total"
:
1
,
"install_status"
:
"已还清"
,
"order_goods"
:
[
{
"buy_number"
:
1
,
"goods_image"
:
"http://img10.static.yhbimg.com/goodsimg/2014/06/19/02/0118c2721e4f2219f69539dd389f4bacac.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80"
,
"goods_price"
:
"¥1.00"
,
"goods_amount"
:
"¥1.00"
,
"product_id"
:
84230
,
"product_name"
:
"004 满版龙纹迷彩七分休闲裤"
,
"cn_alphabet"
:
"004QiFenBuKu004PA095"
,
"product_skn"
:
51055461
}
]
},
{
"order_code"
:
"1519273880"
,
"uid"
:
"5772257"
,
"create_time"
:
"2016/08/01"
,
"amount"
:
"¥100.00"
,
"buy_total"
:
1
,
"install_status"
:
"已还清"
,
"order_goods"
:
[
{
"buy_number"
:
1
,
"goods_image"
:
"http://img10.static.yhbimg.com/goodsimg/2014/06/19/02/0118c2721e4f2219f69539dd389f4bacac.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80"
,
"goods_price"
:
"¥1.00"
,
"goods_amount"
:
"¥1.00"
,
"product_id"
:
84230
,
"product_name"
:
"004 满版龙纹迷彩七分休闲裤"
,
"cn_alphabet"
:
"004QiFenBuKu004PA095"
,
"product_skn"
:
51055461
}
]
},{
"order_code"
:
"1519273880"
,
"uid"
:
"5772257"
,
"create_time"
:
"2016/08/01"
,
"amount"
:
"¥100.00"
,
"buy_total"
:
1
,
"install_status"
:
"已还清"
,
"order_goods"
:
[
{
"buy_number"
:
1
,
"goods_image"
:
"http://img10.static.yhbimg.com/goodsimg/2014/06/19/02/0118c2721e4f2219f69539dd389f4bacac.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80"
,
"goods_price"
:
"¥1.00"
,
"goods_amount"
:
"¥1.00"
,
"product_id"
:
84230
,
"product_name"
:
"004 满版龙纹迷彩七分休闲裤"
,
"cn_alphabet"
:
"004QiFenBuKu004PA095"
,
"product_skn"
:
51055461
}
]
},{
"order_code"
:
"1519273880"
,
"uid"
:
"5772257"
,
"create_time"
:
"2016/08/01"
,
"amount"
:
"¥100.00"
,
"buy_total"
:
1
,
"install_status"
:
"已还清"
,
"order_goods"
:
[
{
"buy_number"
:
1
,
"goods_image"
:
"http://img10.static.yhbimg.com/goodsimg/2014/06/19/02/0118c2721e4f2219f69539dd389f4bacac.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80"
,
"goods_price"
:
"¥1.00"
,
"goods_amount"
:
"¥1.00"
,
"product_id"
:
84230
,
"product_name"
:
"004 满版龙纹迷彩七分休闲裤"
,
"cn_alphabet"
:
"004QiFenBuKu004PA095"
,
"product_skn"
:
51055461
}
]
},{
"order_code"
:
"1519273880"
,
"uid"
:
"5772257"
,
"create_time"
:
"2016/08/01"
,
"amount"
:
"¥100.00"
,
"buy_total"
:
1
,
"install_status"
:
"已还清"
,
"order_goods"
:
[
{
"buy_number"
:
1
,
"goods_image"
:
"http://img10.static.yhbimg.com/goodsimg/2014/06/19/02/0118c2721e4f2219f69539dd389f4bacac.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80"
,
"goods_price"
:
"¥1.00"
,
"goods_amount"
:
"¥1.00"
,
"product_id"
:
84230
,
"product_name"
:
"004 满版龙纹迷彩七分休闲裤"
,
"cn_alphabet"
:
"004QiFenBuKu004PA095"
,
"product_skn"
:
51055461
}
]
},{
"order_code"
:
"1519273880"
,
"uid"
:
"5772257"
,
"create_time"
:
"2016/08/01"
,
"amount"
:
"¥100.00"
,
"buy_total"
:
1
,
"install_status"
:
"已还清"
,
"order_goods"
:
[
{
"buy_number"
:
1
,
"goods_image"
:
"http://img10.static.yhbimg.com/goodsimg/2014/06/19/02/0118c2721e4f2219f69539dd389f4bacac.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80"
,
"goods_price"
:
"¥1.00"
,
"goods_amount"
:
"¥1.00"
,
"product_id"
:
84230
,
"product_name"
:
"004 满版龙纹迷彩七分休闲裤"
,
"cn_alphabet"
:
"004QiFenBuKu004PA095"
,
"product_skn"
:
51055461
}
]
},{
"order_code"
:
"1519273880"
,
"uid"
:
"5772257"
,
"create_time"
:
"2016/08/01"
,
"amount"
:
"¥100.00"
,
"buy_total"
:
1
,
"install_status"
:
"已还清"
,
"order_goods"
:
[
{
"buy_number"
:
1
,
"goods_image"
:
"http://img10.static.yhbimg.com/goodsimg/2014/06/19/02/0118c2721e4f2219f69539dd389f4bacac.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80"
,
"goods_price"
:
"¥1.00"
,
"goods_amount"
:
"¥1.00"
,
"product_id"
:
84230
,
"product_name"
:
"004 满版龙纹迷彩七分休闲裤"
,
"cn_alphabet"
:
"004QiFenBuKu004PA095"
,
"product_skn"
:
51055461
}
]
},{
"order_code"
:
"1519273880"
,
"uid"
:
"5772257"
,
"create_time"
:
"2016/08/01"
,
"amount"
:
"¥100.00"
,
"buy_total"
:
1
,
"install_status"
:
"已还清"
,
"order_goods"
:
[
{
"buy_number"
:
1
,
"goods_image"
:
"http://img10.static.yhbimg.com/goodsimg/2014/06/19/02/0118c2721e4f2219f69539dd389f4bacac.jpg?imageMogr2/thumbnail/{width}x{height}/extent/{width}x{height}/background/d2hpdGU=/position/center/quality/80"
,
"goods_price"
:
"¥1.00"
,
"goods_amount"
:
"¥1.00"
,
"product_id"
:
84230
,
"product_name"
:
"004 满版龙纹迷彩七分休闲裤"
,
"cn_alphabet"
:
"004QiFenBuKu004PA095"
,
"product_skn"
:
51055461
}
]
}
],
"page"
:
1
,
"page_total"
:
27
,
"total"
:
265
},
"message"
:
"ok"
}
}
...
...
apps/home/router.js
View file @
8f1b3e9
...
...
@@ -19,6 +19,7 @@ router.get('/installment/starting-service', installment.startingService); // 分
router
.
get
(
'/installment/starting-service/verify-code'
,
installment
.
verifyCode
);
router
.
get
(
'/installment/bank-info'
,
installment
.
getBankInfo
);
router
.
post
(
'/installment/activate-service'
,
installment
.
activateService
);
router
.
get
(
'/installment/order'
,
installment
.
order
);
router
.
get
(
'/installment/order'
,
installment
.
orderIndex
);
router
.
get
(
'/installment/order.html'
,
installment
.
orderList
);
router
.
get
(
'/installment/order/{:id}'
,
installment
.
orderDetail
);
module
.
exports
=
router
;
...
...
apps/home/views/action/installment/order-list.hbs
0 → 100644
View file @
8f1b3e9
<ul>
{{#
each
orders
}}
<li>
<a
href=
"/home/installment/order/
{{
orderCode
}}
"
>
{{#
orderGoods
}}
<div
class=
"image-box"
>
<img
src=
"
{{
image
goodsImage
90
120
}}
"
alt=
"
{{
productName
}}
"
>
</div>
<div
class=
"title-box"
>
<div>
{{
productName
}}
</div>
<div
class=
"date-box"
>
{{
..
/
createTime
}}
</div>
</div>
{{/
orderGoods
}}
</a>
<div
class=
"right-box"
>
<div
class=
"amount"
>
{{
amount
}}
</div>
<div
class=
"status"
>
{{
installStatus
}}
</div>
</div>
<div
class=
"clearfix"
></div>
</li>
{{/
each
}}
</ul>
...
...
apps/home/views/action/installment/order.hbs
View file @
8f1b3e9
<div
class=
"installment-order-page"
>
{{>
resources
/
banner-top
}}
<ul
class=
"header"
>
<li>
<a
href=
""
>
全部
</a>
</li>
<li>
<a
href=
""
>
还款中
</a>
</li>
<li>
<a
href=
""
>
已还清
</a>
</li>
</ul>
<ul
class=
"order-list"
>
<li>
<div
class=
"image-box"
>
<img
src=
""
alt=
""
>
</div>
<div
class=
"title-box"
>
<div>
adidas original LMXLALSDLALASLDMKLAD
</div>
<div
class=
"date-box"
>
2016/06/19
</div>
</div>
<div
class=
"right-box"
>
<div>
¥199.00
</div>
<div>
还款中1/3
</div>
</div>
</li>
<li>
<div
class=
"image-box"
>
<img
src=
""
alt=
""
>
</div>
<div
class=
"title-box"
>
<div>
adidas original LMXLALSDLALASLDMKLAD
</div>
<div
class=
"date-box"
>
2016/06/19
</div>
</div>
<div
class=
"right-box"
>
<div>
¥199.00
</div>
<div>
还款中1/3
</div>
</div>
</li>
<li>
<div
class=
"image-box"
>
<img
src=
""
alt=
""
>
</div>
<div
class=
"title-box"
>
<div>
adidas original LMXLALSDLALASLDMKLAD
</div>
<div
class=
"date-box"
>
2016/06/19
</div>
</div>
<div
class=
"right-box"
>
<div>
¥199.00
</div>
<div>
还款中1/3
</div>
</div>
</li>
<li>
<div
class=
"image-box"
>
<img
src=
""
alt=
""
>
</div>
<div
class=
"title-box"
>
<div>
adidas original LMXLALSDLALASLDMKLAD
</div>
<div
class=
"date-box"
>
2016/06/19
</div>
</div>
<div
class=
"right-box"
>
<div>
¥199.00
</div>
<div>
还款中1/3
</div>
</div>
</li>
<li>
<div
class=
"image-box"
>
<img
src=
""
alt=
""
>
</div>
<div
class=
"title-box"
>
<div>
adidas original LMXLALSDLALASLDMKLAD
</div>
<div
class=
"date-box"
>
2016/06/19
</div>
</div>
<div
class=
"right-box"
>
<div>
¥199.00
</div>
<div>
还款中1/3
</div>
</div>
</li>
<li>
<div
class=
"image-box"
>
<img
src=
""
alt=
""
>
</div>
<div
class=
"title-box"
>
<div>
adidas original LMXLALSDLALASLDMKLAD
</div>
<div
class=
"date-box"
>
2016/06/19
</div>
</div>
<div
class=
"right-box"
>
<div>
¥199.00
</div>
<div>
还款中1/3
</div>
</div>
</li>
<li>
<div
class=
"image-box"
>
<img
src=
""
alt=
""
>
</div>
<div
class=
"title-box"
>
<div>
adidas original LMXLALSDLALASLDMKLAD
</div>
<div
class=
"date-box"
>
2016/06/19
</div>
</div>
<div
class=
"right-box"
>
<div>
¥199.00
</div>
<div>
还款中1/3
</div>
</div>
</li>
1 ` `12q345678432123-=aZwertc7773231`1`
<li>
<div
class=
"image-box"
>
<img
src=
""
alt=
""
>
</div>
<div
class=
"title-box"
>
<div>
adidas original LMXLALSDLALASLDMKLAD
</div>
<div
class=
"date-box"
>
2016/06/19
</div>
</div>
<div
class=
"right-box"
>
<div>
¥199.00
</div>
<div>
还款中1/3
</div>
</div>
</li>
</ul>
<ul
class=
"header-tab"
>
<li
class=
"active"
>
<a
href=
"/home/installment/order.html?type=1"
data-type=
"1"
>
全部
</a>
</li>
<li>
<a
href=
"/home/installment/order.html?type=2"
data-type=
"2"
>
还款中
</a>
</li>
<li>
<a
href=
"/home/installment/order.html?type=3"
data-type=
"3"
>
已还清
</a>
</li>
</ul>
<div
id=
"order-list"
class=
"order-list"
></div>
</div>
...
...
public/js/home/installment.order.page.js
View file @
8f1b3e9
const
$
=
require
(
'yoho-jquery'
);
/**
* 订单状态样式
*/
$
(
'.status'
).
each
(
function
()
{
const
text
=
$
(
this
).
text
();
if
(
text
.
indexOf
(
/已还清|已取消|已退款/
))
{
$
(
this
).
addClass
(
'faded'
);
}
});
/**
* 加载订单明细
*
* @param type
*/
const
loadOrderList
=
(
type
)
=>
{
if
(
type
)
{
$
.
get
(
'/home/installment/order.html'
,
{
type
:
type
}).
then
((
result
)
=>
{
$
(
'#order-list'
).
empty
().
append
(
result
);
});
}
};
/**
* 顶部TAB
*/
$
(
'.header-tab a'
).
click
(
function
()
{
$
(
this
).
parent
().
addClass
(
'active'
);
$
(
this
).
parent
().
siblings
().
removeClass
(
'active'
);
loadOrderList
(
$
(
this
).
data
(
'type'
));
return
false
;
});
// 默认加载第一页
loadOrderList
(
1
);
...
...
public/scss/home/installment/_order.css
View file @
8f1b3e9
.installment-order-page
{
background
:
#f0f0f0
;
.header
{
.header
-tab
{
text-align
:
center
;
height
:
90px
;
border-bottom
:
1px
solid
#e1e1e1
;
...
...
@@ -14,6 +14,16 @@
min-width
:
120px
;
height
:
90px
;
line-height
:
90px
;
a
{
color
:
#b1b1b1
;
}
&
.active
{
a
{
color
:
#444
;
}
}
}
}
...
...
@@ -55,6 +65,12 @@
font-size
:
27px
;
text-align
:
right
;
}
.status
{
&.faded
{
color
:
#b1b1b1
;
}
}
}
}
}
...
...
Please
register
or
login
to post a comment