Commit 96c70a15 by 高淑倩

bottomTab

parent d4b8fd3d
...@@ -25,7 +25,40 @@ Component({ ...@@ -25,7 +25,40 @@ Component({
attached() { attached() {
this.setData({ this.setData({
baseImgUrl: app.globalData.imageUrl baseImgUrl: app.globalData.imageUrl
}) })
const { tabBar } = this.data
tabBar.forEach(item => {
// 存在 row 处理数据 8 商品 9 分类
let newRow = null
if (item.link) {
if(item.link.type == 2){
// 父组件 更新
const urls = getCurrentPages()
const currentPath = urls[0]
const pageId = item.link.url
console.log('currentPath', currentPath.route,item.link.url)
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)
item.row = newRow
}
})
this.setData({ tabBar }, () => {
console.log('wwwwtabBar', this.data.tabBar)
})
}, },
ready() { ready() {
this.setData({ this.setData({
...@@ -86,7 +119,8 @@ Component({ ...@@ -86,7 +119,8 @@ Component({
wxService.router(`${currentClickType}`) wxService.router(`${currentClickType}`)
} }
} else if (curItemType.row) { } else if (curItemType.row) {
let rowObj = JSON.parse(curItemType.row) // let rowObj = JSON.parse(curItemType.row)
let rowObj = curItemType.row
let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj) let currentClickRow = app.globalData.commonFunc.getLinkRow(rowObj.type, rowObj)
if (rowObj.type == 1) { } if (rowObj.type == 1) { }
......
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
<block wx:for="{{tabBar.images}}" wx:key="{{index}}" wx:for-item="tab"> <block wx:for="{{tabBar.images}}" 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="{{utils.hanlerLinkNeedAuth(tab.link.url)}}" 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"
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
wx:for-item="item" wx:for-item="item"
class="nav-block" class="nav-block"
> >
<!--当前页面需要授权 且未授权-->
<view wx:if="{{item.link ? utils.hanlerLinkNeedAuth(typeOf(item.link.newPath) != undefined ? item.link.newPath : item.link.url) : utils.hanlerLinkNeedAuth(item.row.newPath ? item.row.newPath : item.row.url)}}"> <view wx:if="{{item.link ? utils.hanlerLinkNeedAuth(typeOf(item.link.newPath) != undefined ? item.link.newPath : item.link.url) : utils.hanlerLinkNeedAuth(item.row.newPath ? item.row.newPath : item.row.url)}}">
<button <button
wx:if="{{!currentHasUserInfo}}" wx:if="{{!currentHasUserInfo}}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment