project init
This commit is contained in:
57
pages/foot-tab/foot-tab.js
Normal file
57
pages/foot-tab/foot-tab.js
Normal file
@@ -0,0 +1,57 @@
|
||||
// pages/component/foot-tab.js
|
||||
let aIconList = ['check-rectangle','star','notification','circle'];
|
||||
let cure = 1
|
||||
Component({
|
||||
/**
|
||||
* 组件的属性列表
|
||||
*/
|
||||
properties: {
|
||||
clickValue: {
|
||||
type: Array,
|
||||
value: aIconList
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
clickValue: cure,
|
||||
message: {dot: true}
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
setIconData(cur){
|
||||
cure = cur;
|
||||
this.setData({
|
||||
clickValue: cur
|
||||
})
|
||||
if (cur == 1){
|
||||
wx.redirectTo({
|
||||
url: '../index/index'
|
||||
})
|
||||
}
|
||||
if (cur == 2){
|
||||
wx.redirectTo({
|
||||
url: '../today/index'
|
||||
})
|
||||
}
|
||||
if (cur == 3){
|
||||
wx.redirectTo({
|
||||
url: '../message/index'
|
||||
})
|
||||
}
|
||||
if (cur == 4){
|
||||
wx.redirectTo({
|
||||
url: '../myself/index'
|
||||
})
|
||||
}
|
||||
},
|
||||
onChange(event) {
|
||||
this.setIconData(event.detail.value);
|
||||
},
|
||||
}
|
||||
})
|
||||
7
pages/foot-tab/foot-tab.json
Normal file
7
pages/foot-tab/foot-tab.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {
|
||||
"t-tab-bar": "/components/tab-bar/tab-bar",
|
||||
"t-tab-bar-item": "/components/tab-bar/tab-bar-item"
|
||||
}
|
||||
}
|
||||
7
pages/foot-tab/foot-tab.wxml
Normal file
7
pages/foot-tab/foot-tab.wxml
Normal file
@@ -0,0 +1,7 @@
|
||||
<!--pages/component/foot-tab.wxml-->
|
||||
<t-tab-bar value="{{clickValue}}" bindchange="onChange">
|
||||
<t-tab-bar-item badge-props="{{ {count: 12} }}" value="1" icon="{{iconList[0]}}">清单</t-tab-bar-item>
|
||||
<t-tab-bar-item badge-props="{{message}}" value="2" icon="{{iconList[1]}}">今日任务</t-tab-bar-item>
|
||||
<t-tab-bar-item value="3" icon="{{iconList[2]}}">消息</t-tab-bar-item>
|
||||
<t-tab-bar-item value="4" icon="{{iconList[3]}}">我的</t-tab-bar-item>
|
||||
</t-tab-bar>
|
||||
1
pages/foot-tab/foot-tab.wxss
Normal file
1
pages/foot-tab/foot-tab.wxss
Normal file
@@ -0,0 +1 @@
|
||||
/* pages/component/foot-tab.wxss */
|
||||
Reference in New Issue
Block a user