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
bb22d5db
Commit
bb22d5db
authored
Aug 17, 2019
by
xuzhenghua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下单
parent
d38495ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
26 deletions
+39
-26
src/components/order/index.js
+39
-26
No files found.
src/components/order/index.js
View file @
bb22d5db
...
...
@@ -80,7 +80,7 @@ class Order extends Component {
perfect
:
this
.
props
.
location
.
state
,
user_account
:
0.00
,
// 账户余额
total
:
0.00
,
// 需要支付总金额
discount
:
0.00
,
//
discount
:
0.00
,
//
useBalance
:
false
,
orderList
:
[],
info
:
false
,
...
...
@@ -278,33 +278,46 @@ class Order extends Component {
this
.
publicGetData
(
courseInfo
);
this
.
publicLocalStorage
();
});
}
else
{
if
(
getParam
(
'id'
))
{
Promise
.
all
([
http
.
get
(
`
${
API
.
home
}
/m/del_cart_order/
${
getParam
(
'id'
)}
`
),
http
.
get
(
`
${
API
[
'base-api'
]}
/m/order/preorder`
)]).
then
(
res
=>
{
console
.
log
(
res
);
let
preorder
=
res
[
1
],
orderList
=
preorder
.
data
.
data
.
course
;
if
(
preorder
.
data
.
errno
!==
200
)
{
Toast
.
info
(
preorder
.
data
.
msg
,
2
);
return
;
}
this
.
publicGetData
(
preorder
);
this
.
publicLocalStorage
();
})
}
else
{
http
.
get
(
`
${
API
[
'base-api'
]}
/m/order/preorder`
).
then
((
res
)
=>
{
console
.
log
(
'为了验证什么条件下会走这段代码'
);
if
(
res
.
data
.
errno
!==
200
)
{
Toast
.
info
(
res
.
data
.
msg
,
2
);
return
;
}
}
else
{
http
.
get
(
`
${
API
[
'base-api'
]}
/m/order/preorder`
).
then
((
res
)
=>
{
console
.
log
(
'为了验证什么条件下会走这段代码'
);
if
(
res
.
data
.
errno
!==
200
)
{
Toast
.
info
(
res
.
data
.
msg
,
2
);
return
;
}
this
.
publicGetData
(
res
);
this
.
publicLocalStorage
();
})
}
this
.
publicGetData
(
res
);
this
.
publicLocalStorage
();
})
}
// else {
// if(getParam('id')) {
// Promise.all([http.get(`${API.home}/m/del_cart_order/${getParam('id')}`), http.get(`${API['base-api']}/m/order/preorder`)]).then(res => {
// console.log(res);
// let preorder = res[1],
// orderList = preorder.data.data.course;
// if(preorder.data.errno !== 200) {
// Toast.info(preorder.data.msg, 2);
// return;
// }
//
// this.publicGetData(preorder);
// this.publicLocalStorage();
// })
// }else{
// http.get(`${API['base-api']}/m/order/preorder`).then((res) => {
// console.log('为了验证什么条件下会走这段代码');
// if (res.data.errno !== 200) {
// Toast.info(res.data.msg, 2);
// return;
// }
//
// this.publicGetData(res);
// this.publicLocalStorage();
// })
// }
// }
};
render
()
{
const
{
...
...
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