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
0bc61209
Commit
0bc61209
authored
Sep 11, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab2.dui88.com:wanghongyuan/hello_taobao
parents
15257342
096baa8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
48 deletions
+30
-48
comhui_yuan.js
dist/components/comhui_yuan/comhui_yuan.js
+27
-46
pagehuo_dong_ye.axml
dist/pages/pagehuo_dong_ye/pagehuo_dong_ye.axml
+1
-1
pagehuo_dong_ye.js
dist/pages/pagehuo_dong_ye/pagehuo_dong_ye.js
+2
-1
No files found.
dist/components/comhui_yuan/comhui_yuan.js
View file @
0bc61209
...
...
@@ -8,73 +8,54 @@ const { commonToast, getAuthUserInfo, navigateToOutside } = tbcc.tb;
Component
({
props
:
{
onUserCredit
:
()
=>
{
}
onUserCredit
:
()
=>
{
}
},
data
:
{
resList
:
resList
,
enableTap
:
true
enableTap
:
true
},
methods
:
{
// 关闭
onOrderNowModalClose
(){
const
{
onOrderNowModalClose
}
=
this
.
props
;
onOrderNowModalClose
()
{
const
{
onOrderNowModalClose
}
=
this
.
props
;
onOrderNowModalClose
&&
onOrderNowModalClose
();
},
// 购买判断
async
consumeCredits
(){
async
consumeCredits
()
{
let
vipCredits
=
this
.
props
.
vipCredits
;
this
.
setData
({
enableTap
:
false
enableTap
:
false
})
// console.log(this.props,'datas')
// API.getCredits().catch((res)=>{
// console.log('resdata',res)
// // if(res.success){
// let data = res.data;
// 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}) || {};
// API.submit({ floor: vipCredits.canBuyFloor, grade: vipCredits.grade }).catch((res) => {
// console.log(res, 'res');
// this.onOrderNowModalClose();
// this.props.onUserCredit();
// commonToast(res && res.message);
// });
await
API
.
submit
({
floor
:
vipCredits
.
canBuyFloor
,
grade
:
vipCredits
.
grade
}).
then
((
res
)
=>
{
console
.
log
(
res
,
'res'
);
if
(
res
.
success
){
console
.
log
(
'success'
)
// 更新积分
// API.getCredits().then((res)=>{
// if(res.success){
// let userCredits = res.data;
// this.props.onUserCredit();
// }
// })
API
.
submit
({
floor
:
vipCredits
.
canBuyFloor
,
grade
:
vipCredits
.
grade
}).
then
((
resp
)
=>
{
if
(
resp
.
success
&&
resp
.
data
)
{
this
.
setData
({
enableTap
:
true
enableTap
:
true
})
commonToast
(
"恭喜你购买成功"
);
this
.
onOrderNowModalClose
(
);
this
.
props
.
onUserCredit
();
// this.props.onUserCredit();
commonToast
(
resp
.
message
);
}
else
{
// 错误码判断不同情况
commonToast
(
res
.
message
);
// if(res.code === '500000'){
// }
// console.log('fail')
commonToast
(
resp
.
message
)
}
},(
rej
)
=>
{
this
.
onOrderNowModalClose
();
this
.
props
.
onUserCredit
();
commonToast
(
rej
.
message
);
})
this
.
onOrderNowModalClose
();
}
},
...
...
@@ -84,9 +65,9 @@ Component({
// });
},
didMount
(){
let
{
vipCredits
}
=
this
.
props
;
console
.
log
(
this
.
props
,
'huiyuan'
)
didMount
()
{
let
{
vipCredits
}
=
this
.
props
;
console
.
log
(
this
.
props
,
'huiyuan'
)
}
});
\ No newline at end of file
dist/pages/pagehuo_dong_ye/pagehuo_dong_ye.axml
View file @
0bc61209
...
...
@@ -32,7 +32,7 @@
<!-- bianli -->
<image style="width:100rpx;height:100rpx;display:block;marginLeft:25rpx" src={{item.image}}></image>
<!-- <view style="width:100rpx;height:100rpx;background:white;marginLeft:25rpx"></view> -->
<view style="fontSize:22rpx">{{
item.floors
}}楼层</view>
<view style="fontSize:22rpx">{{
totalFloor}}*{{item.probability
}}楼层</view>
<label style="fontSize:22rpx">{{item.name}}</label>
</view>
...
...
dist/pages/pagehuo_dong_ye/pagehuo_dong_ye.js
View file @
0bc61209
...
...
@@ -266,7 +266,8 @@ Page({
textAlign
:
'center'
}
list
[
i
].
liststyle
=
listStyle
;
list
[
i
].
floors
=
Math
.
round
(
list
.
probability
*
totalFloor
*
0.01
);
list
[
i
].
probability
=
list
[
i
].
probability
+
'%'
// list[i].floors = Math.round(list.probability* totalFloor * 0.01);
}
this
.
setData
({
...
...
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