Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mr-julyedu
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
baiguangyao
mr-julyedu
Commits
63a5d142
Commit
63a5d142
authored
Oct 21, 2019
by
zhanghaozhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
定金支付页
parent
32916ae4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
113 deletions
+12
-113
src/components/deposit-order/index.js
+1
-1
src/components/deposit-pay-order/index.js
+9
-109
src/components/detail/btnstatus/index.js
+1
-1
src/components/detail/index.js
+1
-2
No files found.
src/components/deposit-order/index.js
View file @
63a5d142
...
...
@@ -121,7 +121,7 @@ class Order extends Component {
}).
then
(
res
=>
{
const
{
data
}
=
res
if
(
data
.
errno
==
200
){
this
.
props
.
history
.
replace
({
pathname
:
'/deposit-pay-order'
,
search
:
`?oid=
${
data
.
data
[
'order_id'
]}
`
})
}
else
{
Toast
.
info
(
data
.
msg
)
}
...
...
src/components/deposit-pay-order/index.js
View file @
63a5d142
...
...
@@ -44,31 +44,6 @@ class PayOrder extends Component {
}
}
// 支付成功后,判断并重定向
redirectAfterPay
=
()
=>
{
// status:0成功,1失败
const
status
=
getParam
(
'status'
)
const
type
=
getParam
(
'type'
)
const
oid
=
getParam
(
'oid'
)
const
{
history
}
=
this
.
props
if
(
status
||
type
)
{
if
(
parseInt
(
status
,
10
)
===
0
)
{
// type订单类型 0普通订单 1团购 2小团 3砍价 4单集购买 5定金课定金 6定金课尾款
if
(
parseInt
(
type
,
10
)
===
2
)
{
history
.
push
(
`/togroup?id=
${
oid
}
`
)
}
else
if
(
parseInt
(
type
,
10
)
===
4
)
{
courseId
&&
window
.
localStorage
.
setItem
(
'payCourse'
,
courseId
)
const
courseId
=
window
.
localStorage
.
getItem
(
'payCourse'
)
courseId
&&
history
.
push
(
`/detail?id=
${
courseId
}
`
,
{
oid
})
}
else
{
history
.
push
(
'/purchased'
)
}
}
else
{
Toast
.
info
(
'支付异常'
,
2
)
}
}
}
onChange
=
(
value
)
=>
{
this
.
setState
({
payType
:
value
,
...
...
@@ -80,16 +55,6 @@ class PayOrder extends Component {
})
}
}
checkStaging
=
(
item
)
=>
{
// console.log(item);
this
.
setState
({
huabei
:
false
,
stageNumber
:
item
.
value
,
singleMoney
:
item
.
everyTotal
,
periodNumber
:
item
.
stage
,
checkPeriod
:
true
,
})
}
print
=
(...
e
)
=>
{
console
.
log
(
e
)
}
...
...
@@ -101,9 +66,6 @@ class PayOrder extends Component {
}
else
if
(
payType
===
1
)
{
this
.
weixinPay
(
orderId
)
}
// else { // 花呗分期暂时不做
// this.huabeiPay(orderId)
// }
}
// 微信支付
weixinPay
=
(
orderId
)
=>
{
...
...
@@ -197,16 +159,7 @@ class PayOrder extends Component {
if
(
res
.
data
.
errno
===
401
)
{
clearInterval
(
_this
.
intervalPayStatus
)
_this
.
intervalPayStatus
=
null
// 获取课程类型
http
.
get
(
`
${
API
[
'base-api'
]}
/m/app_order/detail/
${
getParam
(
'oid'
)}
`
).
then
(
res
=>
{
if
(
Number
(
res
.
data
.
data
.
course_type
)
===
2
)
{
_this
.
props
.
history
.
replace
(
`/togroup?id=
${
getParam
(
'oid'
)}
`
)
}
else
{
// 跳转到已购课程 /purchased 不需要传递任何参数
_this
.
props
.
history
.
replace
(
`/purchased`
)
}
})
window
.
location
.
href
=
'/expand/callback?order_id='
+
getParam
(
'oid'
)
}
})
},
1000
)
...
...
@@ -238,6 +191,7 @@ class PayOrder extends Component {
// 支付宝支付
alipayPay
=
(
orderId
)
=>
{
http
.
get
(
`
${
API
[
'base-api'
]}
/pay/alipay/wap_charge_new/oid/
${
orderId
}
`
).
then
((
res
)
=>
{
console
.
log
(
JSON
.
stringify
(
res
.
data
.
data
))
if
(
res
.
data
.
errno
===
0
)
{
this
.
payCallback
()
window
.
location
=
res
.
data
.
data
.
url
...
...
@@ -248,6 +202,12 @@ class PayOrder extends Component {
}
componentDidMount
()
{
if
(
getParam
(
'weixinpay'
)){
this
.
payCallback
()
}
http
.
post
(
`
${
API
[
"base-api"
]}
/m/deposit/detail`
,
{
order_id
:
this
.
state
.
orderId
}).
then
(
res
=>
{
...
...
@@ -261,67 +221,7 @@ class PayOrder extends Component {
Toast
.
info
(
data
.
msg
)
}
})
/*this.redirectAfterPay()
let data = {}
if(this.props.location.state && this.props.location.state.group){
data = {
order_id: this.state.orderId,
type: 2
}
} else {
data = {
order_id: this.state.orderId,
}
}
http.post(`${API['base-api']}/m/order/detail`,data).then((res) => {
if (res.data.errno !== 200) {
Toast.info(res.data.msg, 2);
return;
}
const {course, pay_amount} = res.data.data;
const fenqiList = [];
[1, 2, 3].map((item) => {
let obj = {};
obj.value = item;
if (item === 1) {
obj.stage = 3; //期数
obj.moneyRate = '2.30%'; // 分期费率展示
obj.rate = 0.023; // 分期费率计算
obj.periodic = (pay_amount / 3).toFixed(2); // 每期本金
} else if (item === 2) {
obj.stage = 6; //期数
obj.moneyRate = '4.50%'; // 分期费率展示
obj.rate = 0.045; // 分期费率计算
obj.periodic = (pay_amount / 6).toFixed(2); // 每期本金
} else {
obj.stage = 12; //期数
obj.moneyRate = '7.50%'; // 分期费率展示
obj.rate = 0.075; // 分期费率计算
obj.periodic = (pay_amount / 9).toFixed(2); // 每期本金
}
obj.serviceFee = ((pay_amount * obj.rate) / obj.stage).toFixed(2); // 每期的手续费 = 总金额 * 费率 / 期数
obj.everyTotal = (parseFloat(obj.periodic) + parseFloat(obj.serviceFee)).toFixed(2);// 每期总费用 = 每期本金 + 每期手续费
fenqiList.push(obj);
});
// console.log(fenqiList);
// { value: 'zhifubao', qishu: '3', lilv: '2.30%', everyMoney: 300, feiyong: 2.3 },
// { value: 'weixin', qishu: '6', lilv: '4.50%', everyMoney: 150, feiyong: 4.5 },
// { value: 'huabei', qishu: '9', lilv: '7.50%', everyMoney: 100, feiyong: 7.5 },
this.setState({
pay_amount,
categoryList: course,
fenqiList,
});
});
if (getParam('is_class') === 1 || getParam('weixinpay')) {
this.payCallback()
}
if (is_weixin()) {
this.setState({
payType: 1
})
this.isweixinPay()
}*/
}
changeAgreement
=
()
=>
{
...
...
src/components/detail/btnstatus/index.js
View file @
63a5d142
...
...
@@ -253,7 +253,7 @@ class BtnStatus extends Component {
}
else
{
if
(
type
==
1
){
this
.
props
.
history
.
push
(
'/
course/smallO
rder'
,
'/
deposit-o
rder'
,
{
id
:
getParam
(
'id'
),
isexpand
:
1
,
...
...
src/components/detail/index.js
View file @
63a5d142
...
...
@@ -737,4 +737,4 @@ const mapDispatchToProps = (dispatch) => {
}
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
Detail
)
\ No newline at end of file
export
default
connect
(
mapStateToProps
,
mapDispatchToProps
)(
Detail
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment