Commit 4fe74fa2 by 程智春

底部栏样式

parent 4ac35289
const app = getApp(); const app = getApp();
console.log(app, "apppppppppp"); console.log(app, "apppppppppp");
...@@ -65,7 +66,34 @@ Component({ ...@@ -65,7 +66,34 @@ Component({
], ],
mm:false, mm:false,
componentData: {}, componentData: {},
show: true show: true,
mmm : false,
mainColor : ''
},
ready(){
if (app.themeColor['--main-color'] != '#ffffff') {
this.setData({
mainColor: app.themeColor['--main-color']
})
} else {
app.themeColorCallBack = (res) => {
this.setData({
mainColor: res['--main-color']
})
}
}
console.log(this.data.themeColor,'themeColor')
if (typeof this.getTabBar === "function" && this.getTabBar()) {
this.getTabBar().setData({
selected: 1
});
}
this.setData({
mmm: Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1)
})
console.log(Math.ceil(app.globalData.footerVal.componentData.list.length / 2 - 1), this.data.selected)
console.log(this.data.mmm,'ready')
}, },
attached() { attached() {
let that = this; let that = this;
...@@ -78,6 +106,7 @@ Component({ ...@@ -78,6 +106,7 @@ Component({
list: app.globalData.footerVal.componentData.list, list: app.globalData.footerVal.componentData.list,
mm:mm mm:mm
}); });
console.log('777777',Math.ceil(this.data.list.length/2-1),this.data.selected,this.data.componentData['styleSelectionNum']) console.log('777777',Math.ceil(this.data.list.length/2-1),this.data.selected,this.data.componentData['styleSelectionNum'])
} else { } else {
console.log(73333381) console.log(73333381)
......
<!--miniprogram/custom-tab-bar/index.wxml--> <!--miniprogram/custom-tab-bar/index.wxml-->
<view class="tab-bar {{show?'':'hide'}}"> <view class="tab-bar {{show?'':'hide'}}" style="--main-color : {{mainColor}}">
<!-- <view class="antt ant-daipinglun"></view> --> <!-- <view class="antt ant-daipinglun"></view> -->
<!-- <view class="iconfont icon-fenzhi">3</view> --> <!-- <view class="iconfont icon-fenzhi">3</view> -->
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<view <view
wx:for="{{list}}" wx:for="{{list}}"
wx:key="index" wx:key="index"
class="tab-bar-item {{(Math.ceil(list.length/2-1)==selected&&componentData['styleSelectionNum']==1)?isItem:''}}" class="tab-bar-item {{(mmm==index&&componentData['styleSelectionNum']==1)?'isItem':''}}"
data-path="{{item.link}}" data-path="{{item.link}}"
data-index="{{index}}" data-index="{{index}}"
bindtap="switchTab" bindtap="switchTab"
......
...@@ -1411,6 +1411,16 @@ ...@@ -1411,6 +1411,16 @@
.isItem { .isItem {
transform: translateY(-30%) transform: translateY(-30%)
} }
.isItem .antt{
width:50px;
height: 50px;
background: var(--main-color);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
border: 8rpx solid #fff;
}
.icons { .icons {
width: 50px; width: 50px;
height: 50px; height: 50px;
......
...@@ -168,6 +168,7 @@ export default { ...@@ -168,6 +168,7 @@ export default {
themeColor["--main-color"] = val.themeColor.mainColor; themeColor["--main-color"] = val.themeColor.mainColor;
themeColor["--minor-color"] = val.themeColor.minorColor; themeColor["--minor-color"] = val.themeColor.minorColor;
mpApp.themeColorCallBack(themeColor); mpApp.themeColorCallBack(themeColor);
mpApp.themeColor = themeColor
// //
console.log(this.mpApp, "mmmmm74", themeColor); console.log(this.mpApp, "mmmmm74", themeColor);
} }
......
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