Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
7
7-Eleven
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
高淑倩
7-Eleven
Commits
25b4f037
Commit
25b4f037
authored
Sep 18, 2019
by
高淑倩
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tabBar 授权
parent
29bfb064
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
38 deletions
+44
-38
bottomTabs.js
src/component/bottomTabs/bottomTabs.js
+41
-33
bottomTabs.wxml
src/component/bottomTabs/bottomTabs.wxml
+3
-4
picNav.js
src/component/picNav/picNav.js
+0
-1
No files found.
src/component/bottomTabs/bottomTabs.js
View file @
25b4f037
...
@@ -26,40 +26,48 @@ Component({
...
@@ -26,40 +26,48 @@ Component({
this
.
setData
({
this
.
setData
({
baseImgUrl
:
app
.
globalData
.
imageUrl
baseImgUrl
:
app
.
globalData
.
imageUrl
})
})
const
{
tabBar
}
=
this
.
data
const
{
tabBar
}
=
this
.
data
let
currentTab
=
tabBar
.
images
let
currentTab
=
tabBar
.
images
currentTab
.
forEach
(
item
=>
{
currentTab
.
forEach
(
item
=>
{
// 存在 row 处理数据 8 商品 9 分类
// 存在 row 处理数据 8 商品 9 分类
let
newRow
=
null
let
newRow
=
null
if
(
item
.
link
)
{
if
(
item
.
link
)
{
if
(
item
.
link
.
type
==
2
){
if
(
item
.
link
.
type
==
2
){
// 父组件 更新
// 父组件 更新
const
urls
=
getCurrentPages
()
const
urls
=
getCurrentPages
()
const
currentPath
=
urls
[
0
]
const
currentPath
=
urls
[
0
]
const
pageId
=
item
.
link
.
url
const
pageId
=
item
.
link
.
url
console
.
log
(
'currentPath'
,
currentPath
.
route
,
item
.
link
.
url
)
item
.
link
.
newPath
=
`/
${
currentPath
.
route
}
`
item
.
link
.
newPath
=
`/
${
currentPath
.
route
}
`
}
return
}
else
if
(
item
.
row
)
{
newRow
=
JSON
.
parse
(
item
.
row
)
if
(
newRow
.
type
==
8
)
{
newRow
.
newPath
=
'/pages/productDetail/productDetail'
}
else
if
(
newRow
.
type
==
9
)
{
newRow
.
newPath
=
'/subPackage/page/pages/categoryPro/categoryPro'
}
else
{
newRow
.
newPath
=
''
}
}
// item.row = JSON.stringify(newRow)
return
item
.
row
=
newRow
}
else
if
(
item
.
row
)
{
}
newRow
=
JSON
.
parse
(
item
.
row
)
})
if
(
newRow
.
type
==
8
)
{
newRow
.
newPath
=
'/pages/productDetail/productDetail'
}
else
if
(
newRow
.
type
==
9
)
{
newRow
.
newPath
=
'/subPackage/page/pages/categoryPro/categoryPro'
}
else
{
newRow
.
newPath
=
''
}
item
.
row
=
newRow
}
})
this
.
setData
({
tabBar
},
()
=>
{
// 当前匹配路径是否需要授权 true 需要 false 不需要
tabBar
.
images
.
forEach
(
item
=>
{
})
let
checkUrl
=
''
},
if
(
item
.
link
)
{
checkUrl
=
item
.
link
.
newPath
?
item
.
link
.
newPath
:
item
.
link
.
url
}
else
if
(
item
.
row
)
{
checkUrl
=
item
.
row
.
newPath
?
item
.
row
.
newPath
:
item
.
row
.
url
}
wxService
.
NoLoginPage
(
checkUrl
).
then
(
res
=>
{
item
.
needAuth
=
res
.
needAuth
this
.
setData
({
tabBarList
:
tabBar
.
images
})
})
})
},
ready
()
{
ready
()
{
this
.
setData
({
this
.
setData
({
currentRoute
:
`/
${
utils
.
getCurrentPageUrl
()}
`
currentRoute
:
`/
${
utils
.
getCurrentPageUrl
()}
`
...
@@ -70,9 +78,9 @@ Component({
...
@@ -70,9 +78,9 @@ Component({
*/
*/
data
:
{
data
:
{
currentRoute
:
''
,
currentRoute
:
''
,
tabs
:
[],
type
:
1
,
type
:
1
,
baseImgUrl
:
''
baseImgUrl
:
''
,
tabBarList
:[]
},
},
/**
/**
* 组件的方法列表
* 组件的方法列表
...
...
src/component/bottomTabs/bottomTabs.wxml
View file @
25b4f037
...
@@ -2,11 +2,10 @@
...
@@ -2,11 +2,10 @@
<wxs src="../../wxs/utils.wxs" module="utils" />
<wxs src="../../wxs/utils.wxs" module="utils" />
<!--<wxs src="./handlerData.wxs" module="tools" />-->
<!--<wxs src="./handlerData.wxs" module="tools" />-->
<view class='bgc fixed-bottom0' style="background-image:url({{tabBar.num == 4 ? '': '/assets/imgs/7_1_0/bg.png'}});" wx:if="{{tabBar.num == 4}}">
<view class='bgc fixed-bottom0' style="background-image:url({{tabBar.num == 4 ? '': '/assets/imgs/7_1_0/bg.png'}});" wx:if="{{tabBar.num == 4}}">
<block wx:for="{{tabBar
.images
}}" wx:key="{{index}}" wx:for-item="tab">
<block wx:for="{{tabBar
List
}}" wx:key="{{index}}" wx:for-item="tab">
<view class="tab">
<view class="tab">
<!--当前页面需要授权 且未授权-->
<!--当前页面需要授权 且未授权-->
<!--<view wx:if="{{utils.hanlerLinkNeedAuth(tab.link.url)}}" class="btn-tab">-->
<view wx:if="{{tab.needAuth}}" class="btn-tab">
<view wx:if="{{tab.link ? utils.hanlerLinkNeedAuth(typeOf(tab.link.newPath) != undefined ? tab.link.newPath : tab.link.url) : utils.hanlerLinkNeedAuth(tab.row.newPath ? tab.row.newPath : tab.row.url)}}" class="btn-tab">
<view wx:if="{{!currentHasUserInfo}}" class="btn-tab">
<view wx:if="{{!currentHasUserInfo}}" class="btn-tab">
<button
<button
bindgetuserinfo="_getUserInfo"
bindgetuserinfo="_getUserInfo"
...
@@ -44,7 +43,7 @@
...
@@ -44,7 +43,7 @@
</block>
</block>
</view>
</view>
<view class="bottom-tab fixed-bottom0" wx:if="{{tabBar.num == 5}}">
<view class="bottom-tab fixed-bottom0" wx:if="{{tabBar.num == 5}}">
<block wx:for="{{tab
s
}}" wx:key="{{index}}" wx:for-item="tab">
<block wx:for="{{tab
BarList
}}" wx:key="{{index}}" wx:for-item="tab">
<view class="tab" data-item="{{tab}}" bindtap="handelToPage">
<view class="tab" data-item="{{tab}}" bindtap="handelToPage">
<!--当前页面需要授权 且未授权-->
<!--当前页面需要授权 且未授权-->
<view wx:if="{{utils.hanlerLinkNeedAuth(tab.link.url)}}" class="btn-tab">
<view wx:if="{{utils.hanlerLinkNeedAuth(tab.link.url)}}" class="btn-tab">
...
...
src/component/picNav/picNav.js
View file @
25b4f037
...
@@ -49,7 +49,6 @@ Component({
...
@@ -49,7 +49,6 @@ Component({
}
else
{
}
else
{
newRow
.
newPath
=
''
newRow
.
newPath
=
''
}
}
// item.row = JSON.stringify(newRow)
item
.
row
=
newRow
item
.
row
=
newRow
}
}
})
})
...
...
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