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
56e88e64
Commit
56e88e64
authored
Sep 09, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
d2245e7a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
59 deletions
+61
-59
pagehuo_dong_ye.js
dist/pages/pagehuo_dong_ye/pagehuo_dong_ye.js
+60
-59
pageshou_ye.js
dist/pages/pageshou_ye/pageshou_ye.js
+1
-0
No files found.
dist/pages/pagehuo_dong_ye/pagehuo_dong_ye.js
View file @
56e88e64
'use strict'
;
import
resList
from
'../../resconfig/resList'
;
import
resList
from
'../../resconfig/resList'
;
import
API
from
'../../api'
;
Page
({
data
:
{
// 购买楼层数
canBuyFloor
:
10
,
canBuyFloor
:
10
,
// 购买记录弹窗显示隐藏
orderModalVisible
:
false
,
orderModalVisible
:
false
,
// 立即购买弹窗
orderNowModalVisible
:
false
,
orderNowModalVisible
:
false
,
// 倒计时
endTime
:{
d
:
''
,
h
:
''
,
m
:
''
,
s
:
''
,
endTime
:
{
d
:
''
,
h
:
''
,
m
:
''
,
s
:
''
,
},
// 奖品列表数据
prizeList
:[],
prizeList
:
[],
startTime
:
''
,
endingTime
:
''
,
startTime
:
''
,
endingTime
:
''
,
},
...
...
@@ -39,78 +39,79 @@ Page({
// 减楼层
reduceFloor
(){
let
{
canBuyFloor
}
=
this
.
data
if
(
canBuyFloor
>
1
)
{
reduceFloor
()
{
let
{
canBuyFloor
}
=
this
.
data
if
(
canBuyFloor
>
1
)
{
this
.
setData
({
canBuyFloor
:
canBuyFloor
-
1
canBuyFloor
:
canBuyFloor
-
1
})
}
},
// 加楼层
addFloor
(){
let
{
canBuyFloor
}
=
this
.
data
;
if
(
canBuyFloor
<
100
)
{
addFloor
()
{
let
{
canBuyFloor
}
=
this
.
data
;
if
(
canBuyFloor
<
100
)
{
this
.
setData
({
canBuyFloor
:
canBuyFloor
+
1
canBuyFloor
:
canBuyFloor
+
1
})
}
},
// 购买记录弹窗
orderRecord
(){
orderRecord
()
{
// let {orderModalVisible} = this.data
console
.
log
(
'click'
,
this
.
data
)
console
.
log
(
'click'
,
this
.
data
)
this
.
setData
({
orderModalVisible
:
true
orderModalVisible
:
true
})
},
// 关闭弹窗
orderModalClose
(){
orderModalClose
()
{
this
.
setData
({
orderModalVisible
:
false
orderModalVisible
:
false
})
},
// 购买楼层
async
buyFloors
(){
async
buyFloors
()
{
// 购买楼层数
let
{
canBuyFloor
}
=
this
.
data
let
{
canBuyFloor
}
=
this
.
data
// 判断会员等级
let
{
isVip
,
grade
,
gradeName
,
gradeCredits
}
=
await
API
.
getVipInfo
()
||
{};
// let { data: { isVip, grade, gradeName, gradeCredits }
} = await API.getVipInfo() || {};
API
.
submit
({
floor
:
canBuyFloor
,
grade
:
grade
}).
catch
((
res
)
=>
{
console
.
log
(
res
);
API
.
getVipInfo
().
then
(({
data
:
{
grade
}
})
=>
{
API
.
submit
({
floor
:
canBuyFloor
,
grade
:
grade
}).
catch
((
res
)
=>
{
console
.
log
(
res
);
})
})
// 显示
this
.
setData
({
orderNowModalVisible
:
true
orderNowModalVisible
:
true
})
},
// 获取奖品列表数据
async
getBaseInfo
(){
async
getBaseInfo
()
{
let
listStyleArr
=
[]
let
{
data
}
=
await
API
.
getActivityBaseInfoById
()
||
{};
console
.
log
(
data
,
'data'
)
let
{
data
}
=
await
API
.
getActivityBaseInfoById
()
||
{};
console
.
log
(
data
,
'data'
)
let
list
=
data
.
list
;
let
prize
=
data
.
prize
;
// startTime = data.startTime;
// endingTime = data.endTime;
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
list
.
length
;
i
++
)
{
let
listStyle
=
{
left
:
200
*
i
+
'rpx'
,
left
:
200
*
i
+
'rpx'
,
width
:
200
+
'rpx'
,
height
:
200
+
'rpx'
,
position
:
'absolute'
,
color
:
'white'
,
textAlign
:
'center'
position
:
'absolute'
,
color
:
'white'
,
textAlign
:
'center'
}
// listStyleArr.push(listStyle);
list
[
i
].
liststyle
=
listStyle
;
...
...
@@ -123,24 +124,24 @@ Page({
// }
// }
this
.
setData
({
prizeList
:
list
,
startTime
:
data
.
startTime
,
endingTime
:
data
.
endingTime
prizeList
:
list
,
startTime
:
data
.
startTime
,
endingTime
:
data
.
endingTime
})
},
// 关闭立即购买
orderNowModalClose
(){
orderNowModalClose
()
{
this
.
setData
({
orderNowModalVisible
:
false
orderNowModalVisible
:
false
})
},
// 倒计时
getEndTime
()
{
let
{
prizeList
,
endingTime
}
=
this
.
data
let
{
prizeList
,
endingTime
}
=
this
.
data
if
(
!
prizeList
||
!
prizeList
.
length
)
return
null
// const endTime = prizeList[0].expiredTime
// if (!endTime) return null
...
...
@@ -166,27 +167,27 @@ Page({
let
hh
=
t2
.
padStart
(
2
,
'0'
);
let
mm
=
t3
.
padStart
(
2
,
'0'
);
let
ss
=
t4
.
padStart
(
2
,
'0'
);
let
timer
=
setTimeout
(()
=>
{
let
ss
=
t4
.
padStart
(
2
,
'0'
);
let
timer
=
setTimeout
(()
=>
{
this
.
setData
({
stringTime
:
stringTime
-
1
})
console
.
log
(
stringTime
,
'stringTime'
);
console
.
log
(
stringTime
,
'stringTime'
);
if
(
stringTime
<=
0
)
{
if
(
stringTime
<=
0
)
{
clearTimeout
(
timer
);
}
this
.
setData
({
// endTime: t1 + " " + t2.padStart(2, '0') + ":" + t3.padStart(2, '0') + ":" + t4.padStart(2, '0')
endTime
:{
d
:
d1
,
h
:
hh
,
m
:
mm
,
s
:
ss
endTime
:
{
d
:
d1
,
h
:
hh
,
m
:
mm
,
s
:
ss
}
})
},
1000
)
},
1000
)
}
...
...
dist/pages/pageshou_ye/pageshou_ye.js
View file @
56e88e64
...
...
@@ -25,6 +25,7 @@ Page({
},
gotoVipPage
()
{
API
.
getVipInfo
().
then
(
res
=>
{
// res.data.isVip=true;
if
(
!
res
.
data
.
isVip
)
navigateToOutside
(
res
.
data
.
url
)
else
...
...
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