Commit 5c35035a by 程默

底部栏

parent cf08618e
...@@ -105,7 +105,6 @@ ...@@ -105,7 +105,6 @@
<apply-sucess-entry></apply-sucess-entry> <apply-sucess-entry></apply-sucess-entry>
</div> </div>
<!-- 底部栏 --> <!-- 底部栏 -->
{{active}}
<custom-tab-bar class="custom-tab-bar" :selected="active"></custom-tab-bar> <custom-tab-bar class="custom-tab-bar" :selected="active"></custom-tab-bar>
</div> </div>
</template> </template>
...@@ -382,7 +381,7 @@ export default { ...@@ -382,7 +381,7 @@ export default {
}) })
}, },
scrolls(el){ scrolls(el){
// this.setFooterShow(el); this.setFooterShow(el);
if (this.pageData) { if (this.pageData) {
for (let i = 0; i < this.pageData.length; i++) { for (let i = 0; i < this.pageData.length; i++) {
const element = this.pageData[i] const element = this.pageData[i]
......
const app = getApp(); const app = getApp();
Component({ Component({
properties:{ properties: {
selected:{ selected: {
type:Number, type: Number,
default:-1 default: -1
} }
}, },
data: { data: {
// selected: -1,
color: "#7A7E83", color: "#7A7E83",
selectedColor: "#3cc51f", selectedColor: "#3cc51f",
list: [ list: [
...@@ -33,8 +33,7 @@ Component({ ...@@ -33,8 +33,7 @@ Component({
}; };
} }
this.setData({ this.setData({
mmm: Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1), mmm: Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1)
selected:this.data.active
}); });
}, },
attached() { attached() {
...@@ -46,7 +45,7 @@ Component({ ...@@ -46,7 +45,7 @@ Component({
if (app.globalData.footerVal) { if (app.globalData.footerVal) {
let mm = let mm =
Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1) == Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1) ==
that.data.selected && that.data.selected &&
app.globalData.footerVal.componentData["styleSelectionNum"] == 1; app.globalData.footerVal.componentData["styleSelectionNum"] == 1;
that.setData({ that.setData({
...@@ -54,19 +53,17 @@ Component({ ...@@ -54,19 +53,17 @@ Component({
list: app.globalData.footerVal.componentData.list, list: app.globalData.footerVal.componentData.list,
mm: mm mm: mm
}); });
console.log(this.data.list,1111111132333)
} else { } else {
app.footerCallBack = function(params) { app.footerCallBack = function (params) {
params.componentData.selectIconColor = app.globalData.footerVal.componentData.selectIconBackground == 1 ? 'val(--main-color)':params.componentData.selectIconColor params.componentData.selectIconColor = app.globalData.footerVal.componentData.selectIconBackground == 1 ? 'val(--main-color)' : params.componentData.selectIconColor
that.setData({ that.setData({
componentData: params.componentData, componentData: params.componentData,
list: params.componentData.list list: params.componentData.list
// mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&&params.componentData['styleSelectionNum']==1) // mm:(Math.ceil(params.componentData.list.length/2-1)==that.data.selected&&params.componentData['styleSelectionNum']==1)
}); });
let mm = let mm =
Math.ceil(params.componentData.list.length / 2 - 1) == Math.ceil(params.componentData.list.length / 2 - 1) ==
that.data.selected && that.data.selected &&
params.componentData["styleSelectionNum"] == 1; params.componentData["styleSelectionNum"] == 1;
}; };
} }
...@@ -78,19 +75,13 @@ Component({ ...@@ -78,19 +75,13 @@ Component({
}, },
switchTab(e) { switchTab(e) {
const { index } = e.currentTarget.dataset; 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); 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 @@ ...@@ -13,7 +13,6 @@
data-index="{{index}}" data-index="{{index}}"
bindtap="switchTab" bindtap="switchTab"
> >
<!-- {{index}}{{selected}}--{{Math.ceil(5/2-1)}}--{{mm}} -->
<!-- &&componentData['styleSelectionNum']==1 --> <!-- &&componentData['styleSelectionNum']==1 -->
<!-- 图标 --> <!-- 图标 -->
<view class="item {{index == selected ? 'current' : ''}}"> <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