Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
taobao-mini-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
2
Issues
2
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
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
qinhaitao
taobao-mini-template
Commits
24c6eabe
Commit
24c6eabe
authored
Mar 29, 2021
by
mqf_0707
Browse files
Options
Browse Files
Download
Plain Diff
wnf
parents
4f8658da
e9151e29
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
17 deletions
+18
-17
package.json
c_client/package.json
+1
-1
app.js
c_client/src/app.js
+4
-2
TasksModal.jsx
c_client/src/components/TasksModal/TasksModal.jsx
+9
-4
useLogin.js
c_client/src/hooks/useLogin.js
+4
-3
index.jsx
c_client/src/pages/index/index.jsx
+0
-7
No files found.
c_client/package.json
View file @
24c6eabe
...
...
@@ -50,7 +50,7 @@
"react"
:
"^16.10.0"
,
"react-dom"
:
"^16.10.0"
,
"taro-ui"
:
"^3.0.0-alpha.3"
,
"tbcc-sdk-ts"
:
"^1.0.
2
"
"tbcc-sdk-ts"
:
"^1.0.
4
"
},
"devDependencies"
:
{
"@babel/core"
:
"^7.8.0"
,
...
...
c_client/src/app.js
View file @
24c6eabe
...
...
@@ -7,7 +7,7 @@ import './taro-ui.scss'
import
config
from
'./config'
import
'./utils/mdProxy'
const
{
env
}
=
config
const
{
env
,
tornadoAPI
,
defaultActivityId
}
=
config
cloud
.
init
({
env
})
...
...
@@ -16,7 +16,9 @@ class App extends Component {
console
.
log
(
'options :>> '
,
options
)
const
{
activityId
}
=
options
.
query
||
{}
const
app
=
getApp
()
app
.
activityId
=
activityId
||
config
.
defaultActivityId
app
.
cloud
=
cloud
app
.
tornadoAPI
=
tornadoAPI
app
.
activityId
=
activityId
||
defaultActivityId
}
// this.props.children 是将要会渲染的页面
...
...
c_client/src/components/TasksModal/TasksModal.jsx
View file @
24c6eabe
...
...
@@ -9,6 +9,7 @@ import config from '@/config'
import
{
useThrottle
}
from
'@/hooks/useThrottle'
import
{
TASK_STATUS
,
TASK_CONFIG
}
from
'@/const'
import
'./TasksModal.less'
import
{
useDidShow
}
from
'@tarojs/taro'
const
{
commonToast
,
favorShop
,
navigateTo
,
navigateToOutside
,
showSharePanel
}
=
tbccTs
.
tb
...
...
@@ -22,15 +23,17 @@ export default function TasksModal(props) {
const
{
taskList
,
fetchTaskList
}
=
useTasks
()
const
{
taskIcon
,
commonTaskTxt
,
doTaskTxt
,
browseType
,
browseTime
}
=
TASK_CONFIG
useEffect
(()
=>
{
if
(
app
.
isFlashTask
&&
taskFlag
!==
props
.
taskFlag
)
{
useDidShow
(()
=>
{
if
(
app
.
isFlashTask
)
{
app
.
isFlashTask
=
false
if
(
preBrowseTime
&&
((
Date
.
now
()
-
preBrowseTime
)
/
1000
)
>=
browseTime
)
{
doCompleteTaskHandle
(
currentTaskType
,
true
)
}
else
{
commonToast
(
`未达到
${
browseTime
}
秒~`
)
fetchTaskList
()
}
}
}
,
[
props
.
taskFlag
]
)
})
const
handleTapItem
=
useThrottle
(
async
(
item
)
=>
{
const
{
status
,
taskType
}
=
item
...
...
@@ -66,7 +69,9 @@ export default function TasksModal(props) {
jumpLink
:
async
()
=>
{
navigateToOutside
(
url
||
'https://www.feizhu.com'
)
if
(
browseType
===
1
)
{
setTimeout
(()
=>
{
doCompleteTaskHandle
(
taskType
)
},
1000
)
}
else
{
app
.
isFlashTask
=
true
setPreBrowseTime
(
Date
.
now
())
...
...
c_client/src/hooks/useLogin.js
View file @
24c6eabe
...
...
@@ -28,15 +28,16 @@ export function useLogin(callback = noopFn) {
const
{
inviteId
}
=
params
const
res
=
await
login
({
userNick
,
avatar
,
isFollow
,
inviteId
})
if
(
res
?.
success
)
{
setLoginInfo
(
{
const
_loginInfo
=
{
...
res
.
data
,
userNick
,
avatar
,
inviteId
})
}
setLoginInfo
(
_loginInfo
)
setLoginStatus
(
true
)
console
.
log
(
'isLogin :>> '
,
true
)
callback
(
loginInfo
)
callback
(
_
loginInfo
)
}
}
...
...
c_client/src/pages/index/index.jsx
View file @
24c6eabe
...
...
@@ -27,8 +27,6 @@ function Index() {
const
[
ruleModalVisible
,
setRuleModalVisible
]
=
useState
(
false
)
const
[
tasksModalVisible
,
setTasksModalVisible
]
=
useState
(
false
)
const
[
taskFlag
,
setTaskFlag
]
=
useState
(
0
)
const
fetchActivityInfo
=
async
()
=>
{
const
{
success
,
data
}
=
await
API
.
getActivityBaseInfoById
()
success
&&
setActivityInfoAndStatus
(
data
)
...
...
@@ -51,10 +49,6 @@ function Index() {
}
})
useDidShow
(()
=>
{
setTaskFlag
(
Math
.
floor
(
Math
.
random
()
*
1000
))
})
const
onClose
=
()
=>
{
setMemberVisible
(
false
)
}
...
...
@@ -80,7 +74,6 @@ function Index() {
{
tasksModalVisible
&&
<
TasksModal
taskFlag=
{
taskFlag
}
onUpdate=
{
()
=>
{}
}
onClose=
{
()
=>
setTasksModalVisible
(
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