官方文档
https://developers.weixin.qq.com/miniprogram/dev/api/wx.setNavigationBarColor.html
wx.setNavigationBarColor({
frontColor: '#ffffff',
backgroundColor: '#ff0000',
})
颜色一定要是16进制,不能使用rgb,rgba,16进制简写‘#fff’!
或者在当前页面的json进行修改
{
"navigationBarTitleText": "我的",
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#5882F5",
"navigationBarTextStyle": "white"
}