@ -0,0 +1,65 @@
|
||||
// custom-tab-bar/index.js
|
||||
import bit64Iamges from '../iamges/bit64.js'
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
options: {
|
||||
styleIsolation: 'isolated'
|
||||
},
|
||||
properties: {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
active: null,
|
||||
tabbarList:[
|
||||
{
|
||||
name:'营地',
|
||||
path:'home',
|
||||
defaultIcon:bit64Iamges[0].iconPath,
|
||||
activeIcon:bit64Iamges[0].selectedIconPath
|
||||
},
|
||||
{
|
||||
name:'社区',
|
||||
path:'shequ',
|
||||
defaultIcon:bit64Iamges[1].iconPath,
|
||||
activeIcon:bit64Iamges[1].selectedIconPath
|
||||
},
|
||||
{
|
||||
path:'add',
|
||||
defaultIcon:bit64Iamges[2].iconPath
|
||||
},
|
||||
{
|
||||
name:'活动',
|
||||
path:'activity',
|
||||
defaultIcon:bit64Iamges[3].iconPath,
|
||||
activeIcon:bit64Iamges[3].selectedIconPath
|
||||
},
|
||||
{
|
||||
name:'我的',
|
||||
path:'mine',
|
||||
defaultIcon:bit64Iamges[4].iconPath,
|
||||
activeIcon:bit64Iamges[4].selectedIconPath
|
||||
},
|
||||
],
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
cilckSwitchTab(event) {
|
||||
let path = event.currentTarget.dataset.path.path
|
||||
// console.log(path)
|
||||
if(path == 'add') return
|
||||
wx.switchTab({
|
||||
url: `/pages/${path}/index`,
|
||||
})
|
||||
},
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
<!--custom-tab-bar/index.wxml-->
|
||||
<view class="tabbar">
|
||||
<view class="tabbar-item" wx:for="{{tabbarList}}" wx:key="index" bindtap="cilckSwitchTab" data-path="{{item}}">
|
||||
<view class="tabbar-iocn" >
|
||||
<image src="{{active == index? item.activeIcon:item.defaultIcon }}" mode="aspectFit"></image>
|
||||
</view>
|
||||
<view class="tabbar-title">{{item.name}}</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,52 @@
|
||||
/* custom-tab-bar/index.wxss */
|
||||
.tabbar {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
/* height: 115rpx; */
|
||||
background: #fff;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
display: flex;
|
||||
}
|
||||
.tabbar-item{
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.tabbar-iocn{
|
||||
height: 42rpx;
|
||||
width: 42rpx;
|
||||
margin:17rpx 0;
|
||||
}
|
||||
.tabbar-title{
|
||||
font-size: 23rpx;
|
||||
font-family: "Alibaba-PuHuiTi-Regular.otf";
|
||||
font-weight: 400;
|
||||
color: #636662;
|
||||
}
|
||||
.tabbar-iocn image{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
.tabbar-item:nth-child(3){
|
||||
flex: 0.7;
|
||||
position: relative;
|
||||
background-color: white;
|
||||
top: -30rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.tabbar-item:nth-child(3) .tabbar-iocn{
|
||||
width: 80%;
|
||||
height: 80%;
|
||||
margin: 0 ;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.tabbar-item:nth-child(3) .tabbar-iocn image{
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
}
|
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 2.8 KiB |
Before Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 1.6 KiB |
@ -1,3 +1,2 @@
|
||||
<!--pages/shequ/index.wxml-->
|
||||
<text>待开发中....</text>
|
||||
<my-tarBar activeIdx="{{activeIdx}}"></my-tarBar>
|
||||
<text>待开发中....</text>
|