Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
X
xiaoya-agent-program
Project
Project
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenqian
xiaoya-agent-program
Commits
c1e3a70a
Commit
c1e3a70a
authored
Apr 09, 2020
by
18868195926
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 获取米雅openId
parent
4c187b40
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
32 deletions
+24
-32
app.jsx
src/app.jsx
+15
-15
index.jsx
src/pages/home/index.jsx
+8
-16
user.js
src/reducers/user.js
+1
-1
No files found.
src/app.jsx
View file @
c1e3a70a
...
...
@@ -59,21 +59,21 @@ class App extends Component {
navigationBarTextStyle
:
'black'
,
navigationStyle
:
'custom'
,
},
tabBar
:
{
"color"
:
"#a9b7b7"
,
"selectedColor"
:
"#11cd6e"
,
"borderStyle"
:
"black"
,
"list"
:
[
{
"pagePath"
:
"pages/index/index"
,
"text"
:
"首页"
},
{
"pagePath"
:
"pages/mine/index"
,
"text"
:
"我的"
}
]
}
//
tabBar: {
//
"color": "#a9b7b7",
//
"selectedColor": "#11cd6e",
//
"borderStyle": "black" ,
//
"list": [
//
{
//
"pagePath": "pages/index/index",
//
"text": "首页"
//
},
//
{
//
"pagePath": "pages/mine/index",
//
"text": "我的"
//
}
//
]
//
}
}
...
...
src/pages/home/index.jsx
View file @
c1e3a70a
...
...
@@ -21,9 +21,9 @@ class Index extends Component {
webview
:
''
,
SDKVersion
:
''
,
}
componentWillReceiveProps
(
nextProps
)
{
console
.
log
(
this
.
props
,
nextProps
)
}
//
componentWillReceiveProps (nextProps) {
// console.log('死循环',
this.props, nextProps)
//
}
componentWillUnmount
()
{
}
componentDidMount
()
{
...
...
@@ -38,11 +38,6 @@ class Index extends Component {
},
()
=>
{
console
.
log
(
'我是h5的链接'
,
this
.
state
)
})
setTimeout
(()
=>
{
Taro
.
navigateTo
({
url
:
'/pages/index/index'
})
},
2000
)
}
componentDidShow
()
{
}
...
...
@@ -75,19 +70,16 @@ class Index extends Component {
if
(
typeof
data
.
slice
!==
'function'
){
data
=
[
data
]
}
let
page
=
decodeURIComponent
(
this
.
launch
.
page
)
//处理H5中不能处理的逻辑:通过首页过渡打开目标页面【打开方式, 1:到首页过渡, 2: 不通过首页过渡(专属活动使用较多)】
setTimeout
(()
=>
{
Taro
.
navigateTo
({
url
:
'/pages/index/index'
})
},
2000
)
// setTimeout(()=>{
// Taro.navigateTo({
// url: '/pages/index/index'
// })
// }, 2000)
data
.
forEach
(
item
=>
{
if
(
item
.
type
===
'auth'
){
this
.
props
.
setUserInfo
({
payOpenId
:
item
.
data
.
openId
,
clientId
:
Config
.
clientId
})
}
})
...
...
src/reducers/user.js
View file @
c1e3a70a
...
...
@@ -9,7 +9,7 @@ const INITIAL_STATE = {
}
export
default
function
userInfo
(
state
=
INITIAL_STATE
,
action
)
{
console
.
log
(
'action'
,
action
)
console
.
log
(
'action
...
'
,
action
)
switch
(
action
.
type
)
{
case
SET_USER_INFO
:
...
...
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