@@ -15,14 +15,34 @@ App({ | |||
}, | |||
globalData: { | |||
userInfo: null, | |||
openid: "", | |||
appid: "", | |||
sessionKey: "", | |||
suiteCode: "", | |||
customerId: "", | |||
openid: "", | |||
appid: "", | |||
sessionKey: "", | |||
suiteCode: "", | |||
customerId: "", | |||
}, | |||
// mangerUrl: 'http://test2.hhrchina.com', | |||
mangerUrl: "http://192.168.18.156", | |||
// mangerUrl: "https://www.hhrchina.com", | |||
// mangerUrlPath: "https://www.hhrchina.com", | |||
mangerUrl: "http://192.168.18.156", | |||
// mangerUrl: "https://www.hhrchina.com", | |||
// mangerUrlPath: "https://www.hhrchina.com", | |||
// 自定义显示tabbar | |||
onTabBar: function (key) { | |||
var _curPageArr = getCurrentPages(); | |||
var _curPage = _curPageArr[_curPageArr.length - 1]; | |||
var _pagePath = _curPage.__route__; | |||
if (_pagePath.indexOf('/') != 0) { | |||
_pagePath = '/' + _pagePath; | |||
} | |||
var tabBar = this.tabBarData[key]; | |||
for (var i = 0; i < tabBar.list.length; i++) { | |||
tabBar.list[i].active = false; | |||
if (tabBar.list[i].pagePath == _pagePath) { | |||
tabBar.list[i].active = true; // 根据页面地址设置当前页面状态 | |||
} | |||
} | |||
_curPage.setData({ | |||
tabBar: tabBar | |||
}); | |||
}, | |||
}) |
@@ -1,7 +1,10 @@ | |||
{ | |||
"pages":[ | |||
"pages/index/index", | |||
"pages/logs/logs" | |||
"pages/logs/logs", | |||
"pages/releaseModule/index", | |||
"pages/myModule/index", | |||
"pages/msgModule/index" | |||
], | |||
"usingComponents": { | |||
"tabBar": "/components/tabbar/tabbar" |
@@ -17,17 +17,29 @@ Component({ | |||
data: { | |||
list: [ | |||
{ | |||
text: "对话", | |||
iconPath: "/images/tabbar/tabbar_1.png", | |||
selectedIconPath: "/images/tabbar/tabbar_1.png", | |||
dot: true | |||
text: "首页", | |||
pagePath: "/pages/index/index", | |||
iconPath: "/images/tabbar/home-bar.png", | |||
selectedIconPath: "/images/tabbar/home-bar.png", | |||
}, | |||
{ | |||
text: "设置", | |||
iconPath: "/images/tabbar/tabbar_2.png", | |||
selectedIconPath: "/images/tabbar/tabbar_2.png", | |||
badge: '99+' | |||
} | |||
text: "发布需求", | |||
pagePath: "/pages/releaseModule/index", | |||
iconPath: "/images/tabbar/release-bar.png", | |||
selectedIconPath: "/images/tabbar/release-bar.png", | |||
}, | |||
{ | |||
text: "消息", | |||
pagePath: "/pages/releaseModule/index", | |||
iconPath: "/images/tabbar/msg-bar.png", | |||
selectedIconPath: "/images/tabbar/msg-bar.png", | |||
}, | |||
{ | |||
text: "我的", | |||
pagePath: "/pages/myModule/index", | |||
iconPath: "/images/tabbar/my-bar.png", | |||
selectedIconPath: "/images/tabbar/my-bar.png", | |||
}, | |||
] | |||
}, | |||
@@ -36,7 +48,10 @@ Component({ | |||
*/ | |||
methods: { | |||
tabChange(e) { | |||
console.log('tab change--aa', e) | |||
console.log('tab change', e) | |||
const url = e.detail.item.pagePath; | |||
wx.redirectTo({ url }); | |||
// wx.navigateTo({ url }) | |||
} | |||
} | |||
}) |
@@ -1,3 +1,8 @@ | |||
<view class="page"> | |||
<mp-tabbar style="position:fixed;bottom:0;width:100%;left:0;right:0;" list="{{list}}" bindchange="tabChange"></mp-tabbar> | |||
<mp-tabbar | |||
style="position:fixed;bottom:0;width:100%;left:0;right:0;" | |||
list="{{list}}" | |||
bindchange="tabChange" | |||
current="{{currentIndex}}" | |||
/> | |||
</view> |
@@ -0,0 +1,5 @@ | |||
### 目录说明 | |||
- index 首页 | |||
- releaseModule 发布需求 | |||
- msgModule 消息 | |||
- myModule 我的 |
@@ -1,6 +1,6 @@ | |||
<!--index.wxml--> | |||
<view class="container"> | |||
康慧慧V8 | |||
康慧慧V9 | |||
<tabBar currentIndex="{{currentIndex}}"></tabBar> | |||
</view> | |||
@@ -0,0 +1,9 @@ | |||
// pages/release/release.js | |||
// 获取应用实例 | |||
const app = getApp() | |||
Page({ | |||
data: { | |||
currentIndex: 2 | |||
}, | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,3 @@ | |||
<!--pages/msgPage/msgPage.wxml--> | |||
<text>pages/msgPage/msgPage.wxml</text> | |||
<tabBar currentIndex="{{currentIndex}}"></tabBar> |
@@ -0,0 +1 @@ | |||
/* pages/msgPage/msgPage.wxss */ |
@@ -0,0 +1,9 @@ | |||
// pages/release/release.js | |||
// 获取应用实例 | |||
const app = getApp() | |||
Page({ | |||
data: { | |||
currentIndex: 3 | |||
}, | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,3 @@ | |||
<!--pages/myPage/myPage.wxml--> | |||
<text>pages/myPage/myPage.wxml</text> | |||
<tabBar currentIndex="{{currentIndex}}"></tabBar> |
@@ -0,0 +1 @@ | |||
/* pages/myPage/myPage.wxss */ |
@@ -0,0 +1,9 @@ | |||
// pages/release/release.js | |||
// 获取应用实例 | |||
const app = getApp() | |||
Page({ | |||
data: { | |||
currentIndex: 1 | |||
}, | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,3 @@ | |||
<!--pages/release/release.wxml--> | |||
<text>pages/release/release.wxml</text> | |||
<tabBar currentIndex="{{currentIndex}}"></tabBar> |
@@ -0,0 +1 @@ | |||
/* pages/release/release.wxss */ |