Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
hello_taobao
Project
Project
Details
Activity
Releases
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
wildfirecode13
hello_taobao
Commits
096baa8b
Commit
096baa8b
authored
Sep 11, 2020
by
汪欢
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
381bdd91
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
46 deletions
+27
-46
comhui_yuan.js
dist/components/comhui_yuan/comhui_yuan.js
+27
-46
No files found.
dist/components/comhui_yuan/comhui_yuan.js
View file @
096baa8b
...
@@ -8,73 +8,54 @@ const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
...
@@ -8,73 +8,54 @@ const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
Component
({
Component
({
props
:
{
props
:
{
onUserCredit
:
()
=>
{
}
onUserCredit
:
()
=>
{
}
},
},
data
:
{
data
:
{
resList
:
resList
,
resList
:
resList
,
enableTap
:
true
enableTap
:
true
},
},
methods
:
{
methods
:
{
// 关闭
// 关闭
onOrderNowModalClose
(){
onOrderNowModalClose
()
{
const
{
onOrderNowModalClose
}
=
this
.
props
;
const
{
onOrderNowModalClose
}
=
this
.
props
;
onOrderNowModalClose
&&
onOrderNowModalClose
();
onOrderNowModalClose
&&
onOrderNowModalClose
();
},
},
// 购买判断
// 购买判断
async
consumeCredits
(){
async
consumeCredits
()
{
let
vipCredits
=
this
.
props
.
vipCredits
;
let
vipCredits
=
this
.
props
.
vipCredits
;
this
.
setData
({
this
.
setData
({
enableTap
:
false
enableTap
:
false
})
})
// console.log(this.props,'datas')
// API.submit({ floor: vipCredits.canBuyFloor, grade: vipCredits.grade }).catch((res) => {
// API.getCredits().catch((res)=>{
// console.log(res, 'res');
// console.log('resdata',res)
// this.onOrderNowModalClose();
// // if(res.success){
// this.props.onUserCredit();
// let data = res.data;
// commonToast(res && res.message);
// console.log(data,vipCredits.gradeCredits,'1111')
// });
// // if(data >= vipCredits.gradeCredits){
// // console.log('购买成功!')
// // } else {
// // console.log('购买失败!')
// // }
// // }
// })
// let {message,data,code,success} = API.submit({floor: vipCredits.canBuyFloor, grade:vipCredits.grade}) || {};
await
API
.
submit
({
floor
:
vipCredits
.
canBuyFloor
,
grade
:
vipCredits
.
grade
}).
then
((
res
)
=>
{
API
.
submit
({
floor
:
vipCredits
.
canBuyFloor
,
grade
:
vipCredits
.
grade
}).
then
((
resp
)
=>
{
console
.
log
(
res
,
'res'
);
if
(
resp
.
success
&&
resp
.
data
)
{
if
(
res
.
success
){
console
.
log
(
'success'
)
// 更新积分
// API.getCredits().then((res)=>{
// if(res.success){
// let userCredits = res.data;
// this.props.onUserCredit();
// }
// })
this
.
setData
({
this
.
setData
({
enableTap
:
true
enableTap
:
true
})
})
commonToast
(
"恭喜你购买成功"
);
this
.
onOrderNowModalClose
(
);
this
.
props
.
onUserCredit
();
this
.
props
.
onUserCredit
();
commonToast
(
resp
.
message
);
// this.props.onUserCredit();
}
else
{
}
else
{
// 错误码判断不同情况
commonToast
(
resp
.
message
)
commonToast
(
res
.
message
);
// if(res.code === '500000'){
// }
// console.log('fail')
}
}
},(
rej
)
=>
{
this
.
onOrderNowModalClose
();
this
.
props
.
onUserCredit
();
commonToast
(
rej
.
message
);
})
})
this
.
onOrderNowModalClose
();
}
}
},
},
...
@@ -84,9 +65,9 @@ Component({
...
@@ -84,9 +65,9 @@ Component({
// });
// });
},
},
didMount
(){
didMount
()
{
let
{
vipCredits
}
=
this
.
props
;
let
{
vipCredits
}
=
this
.
props
;
console
.
log
(
this
.
props
,
'huiyuan'
)
console
.
log
(
this
.
props
,
'huiyuan'
)
}
}
});
});
\ No newline at end of file
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