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
b3cfab8b
Commit
b3cfab8b
authored
Sep 11, 2020
by
wildfirecode13
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
0bc61209
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
39 additions
and
28 deletions
+39
-28
.DS_Store
.DS_Store
+0
-0
pageshou_ye.js
dist/pages/pageshou_ye/pageshou_ye.js
+39
-28
No files found.
.DS_Store
View file @
b3cfab8b
No preview for this file type
dist/pages/pageshou_ye/pageshou_ye.js
View file @
b3cfab8b
...
...
@@ -4,6 +4,7 @@ import resList from '../../resconfig/resList'; //import API from '../../api';
import
API
from
'../../api'
;
import
isEnd
from
'/utils/isEnd'
;
import
OPEN_PRIZE_STATUS
from
'/utils/OPEN_PRIZE_STATUS'
;
let
isAuth
=
0
;
const
app
=
getApp
();
const
{
tbcc
}
=
app
;
const
{
commonToast
,
getAuthUserInfo
,
navigateToOutside
}
=
tbcc
.
tb
;
...
...
@@ -27,20 +28,23 @@ Page({
// 页面加载
this
.
getAuth
();
console
.
info
(
`Page onLoad with query:
${
JSON
.
stringify
(
query
)}
`
);
},
gotoVipPage
()
{
console
.
log
(
'isAuth'
,
isAuth
);
if
(
isAuth
===
0
)
{
this
.
getAuth
();
return
;
}
let
{
endTime
,
startTime
}
=
this
.
data
;
// 判断活动时间
let
currentTime
=
new
Date
().
getTime
();
let
currentTime
=
new
Date
().
getTime
();
if
(
currentTime
<
startTime
)
{
commonToast
(
'活动未开始'
);
return
;
};
commonToast
(
'活动未开始'
);
return
;
};
API
.
getVipInfo
().
then
(
res
=>
{
if
(
!
res
.
data
.
isVip
)
{
commonToast
(
'立即加入会员,即可开始盖楼'
)
...
...
@@ -90,28 +94,28 @@ Page({
console
.
log
(
'fuck'
);
let
currentTime
=
new
Date
().
getTime
();
if
(
vipInfo
.
data
.
isVip
&&
isUserJoin
)
{
// vipInfo..data.isVip = true;
if
(
isEnd
(
endTime
)
&&
(
openPrizeStatus
==
OPEN_PRIZE_STATUS
.
SUCCESS
||
openPrizeStatus
==
OPEN_PRIZE_STATUS
.
NOT_OPEN
))
{
//活动结束,开奖成功or不开奖
my
.
redirectTo
({
url
:
'/pages/pagejie_shu_ye/pagejie_shu_ye?data='
+
JSON
.
stringify
({
prize
,
openPrizeStatus
,
isShowPrize
})
});
}
else
{
my
.
redirectTo
({
url
:
'/pages/pagehuo_dong_ye/pagehuo_dong_ye'
});
// my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye?data=' + JSON.stringify({endTime}) });
}
if
(
vipInfo
.
data
.
isVip
&&
isUserJoin
)
{
// vipInfo..data.isVip = true;
if
(
isEnd
(
endTime
)
&&
(
openPrizeStatus
==
OPEN_PRIZE_STATUS
.
SUCCESS
||
openPrizeStatus
==
OPEN_PRIZE_STATUS
.
NOT_OPEN
))
{
//活动结束,开奖成功or不开奖
my
.
redirectTo
({
url
:
'/pages/pagejie_shu_ye/pagejie_shu_ye?data='
+
JSON
.
stringify
({
prize
,
openPrizeStatus
,
isShowPrize
})
});
}
else
{
if
(
isEnd
(
endTime
)
&&
(
openPrizeStatus
==
OPEN_PRIZE_STATUS
.
SUCCESS
||
openPrizeStatus
==
OPEN_PRIZE_STATUS
.
NOT_OPEN
)
)
{
//活动结束,开奖成功or不开奖
my
.
redirectTo
({
url
:
'/pages/pagejie_shu_ye/pagejie_shu_ye?data='
+
JSON
.
stringify
({
isShowPrize
:
false
})
});
}
else
{
//设置状态
this
.
setData
({
myPrizeBtnVisible
:
true
,
startBtnVisible
:
true
,
ruleModalBtnVisible
:
true
})
}
};
my
.
redirectTo
({
url
:
'/pages/pagehuo_dong_ye/pagehuo_dong_ye'
});
// my.redirectTo({ url: '/pages/pagehuo_dong_ye/pagehuo_dong_ye?data=' + JSON.stringify({endTime}) });
}
}
else
{
if
(
isEnd
(
endTime
)
&&
(
openPrizeStatus
==
OPEN_PRIZE_STATUS
.
SUCCESS
||
openPrizeStatus
==
OPEN_PRIZE_STATUS
.
NOT_OPEN
))
{
//活动结束,开奖成功or不开奖
my
.
redirectTo
({
url
:
'/pages/pagejie_shu_ye/pagejie_shu_ye?data='
+
JSON
.
stringify
({
isShowPrize
:
false
})
});
}
else
{
//设置状态
this
.
setData
({
myPrizeBtnVisible
:
true
,
startBtnVisible
:
true
,
ruleModalBtnVisible
:
true
})
}
};
this
.
setData
({
ruleData
:
rule
,
...
...
@@ -140,13 +144,20 @@ Page({
async
getAuth
()
{
const
userInfo
=
await
getAuthUserInfo
().
catch
(
err
=>
{
console
.
log
(
'未授权成功'
,
err
);
this
.
setData
({
startBtnVisible
:
true
,
})
});
if
(
userInfo
)
{
isAuth
=
true
;
console
.
log
(
'授权成功,userInfo=>'
,
userInfo
);
const
{
nickName
,
avatar
}
=
userInfo
;
app
.
nickName
=
nickName
;
app
.
avatar
=
avatar
;
this
.
login
();
this
.
setData
({
startBtnVisible
:
false
,
})
}
},
...
...
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