Commit 5c35035a by 程默

底部栏

parent cf08618e
......@@ -105,7 +105,6 @@
<apply-sucess-entry></apply-sucess-entry>
</div>
<!-- 底部栏 -->
{{active}}
<custom-tab-bar class="custom-tab-bar" :selected="active"></custom-tab-bar>
</div>
</template>
......@@ -382,7 +381,7 @@ export default {
})
},
scrolls(el){
// this.setFooterShow(el);
this.setFooterShow(el);
if (this.pageData) {
for (let i = 0; i < this.pageData.length; i++) {
const element = this.pageData[i]
......
const app = getApp();
Component({
properties:{
selected:{
type:Number,
default:-1
properties: {
selected: {
type: Number,
default: -1
}
},
data: {
// selected: -1,
color: "#7A7E83",
selectedColor: "#3cc51f",
list: [
......@@ -33,8 +33,7 @@ Component({
};
}
this.setData({
mmm: Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1),
selected:this.data.active
mmm: Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1)
});
},
attached() {
......@@ -54,16 +53,14 @@ Component({
list: app.globalData.footerVal.componentData.list,
mm: mm
});
console.log(this.data.list,1111111132333)
} else {
app.footerCallBack = function(params) {
params.componentData.selectIconColor = app.globalData.footerVal.componentData.selectIconBackground == 1 ? 'val(--main-color)':params.componentData.selectIconColor
app.footerCallBack = function (params) {
params.componentData.selectIconColor = app.globalData.footerVal.componentData.selectIconBackground == 1 ? 'val(--main-color)' : params.componentData.selectIconColor
that.setData({
componentData: params.componentData,
list: params.componentData.list
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&&params.componentData['styleSelectionNum']==1)
});
let mm =
Math.ceil(params.componentData.list.length / 2 - 1) ==
that.data.selected &&
......@@ -78,19 +75,13 @@ Component({
},
switchTab(e) {
const { index } = e.currentTarget.dataset;
let routes = getCurrentPages();
let currentPage = routes[routes.length - 1].route;
// 当前仅有首页使用
if (currentPage=='pages/home/main') return
app.$themeToLink(this.data.list[index]["link"], 1);
},
toPage(data, index) {
// 跳转
if (data.link == "/") {
wx.switchTab({
url: "/pages/home/main"
});
} else {
wx.switchTab({
url: `/pages/tabBar${index}/main`
});
}
}
}
});
{
"component": true
"component": true,
"usingComponents": {}
}
\ No newline at end of file
......@@ -13,7 +13,6 @@
data-index="{{index}}"
bindtap="switchTab"
>
<!-- {{index}}{{selected}}--{{Math.ceil(5/2-1)}}--{{mm}} -->
<!-- &&componentData['styleSelectionNum']==1 -->
<!-- 图标 -->
<view class="item {{index == selected ? 'current' : ''}}">
......
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