|
|
|
/**
|
|
|
|
* Created by goto9 on 2019/5/8.
|
|
|
|
*/
|
|
|
|
import util from './util';
|
|
|
|
import App from './api';
|
|
|
|
const {regeneratorRuntime} = global
|
|
|
|
class reddot{
|
|
|
|
menus=[
|
|
|
|
{
|
|
|
|
"pagePath": "pages/reserve/index",
|
|
|
|
"text": "订座",
|
|
|
|
"iconPath": "pages/image/tabicon1.png",
|
|
|
|
"selectedIconPath": "pages/image/tabicon1.active.png"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pagePath": "pages/me/follow",
|
|
|
|
"text": "关注",
|
|
|
|
"iconPath": "pages/image/follow.png",
|
|
|
|
"selectedIconPath": "pages/image/follow.active.png"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pagePath": "pages/customer/list",
|
|
|
|
"text": "日程",
|
|
|
|
"iconPath": "pages/image/tabicon3.png",
|
|
|
|
"selectedIconPath": "pages/image/tabicon3.active.png"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"pagePath": "pages/me/index",
|
|
|
|
"text": "我的",
|
|
|
|
"iconPath": "pages/image/tabicon4.png",
|
|
|
|
"selectedIconPath": "pages/image/tabicon4.active.png"
|
|
|
|
}
|
|
|
|
];
|
|
|
|
init(){
|
|
|
|
console.log('reddot....',this.menus)
|
|
|
|
this.setRedDot()
|
|
|
|
this.clrRedDot()
|
|
|
|
}
|
|
|
|
setRedDot(){
|
|
|
|
wx.showTabBarRedDot({
|
|
|
|
index:1
|
|
|
|
})
|
|
|
|
}
|
|
|
|
clrRedDot(){
|
|
|
|
let pages=getCurrentPages();
|
|
|
|
let route=pages[0].route;
|
|
|
|
console.log('reddot....',route);
|
|
|
|
this.menus.forEach((m,i)=>{
|
|
|
|
if(m.pagePath==route){
|
|
|
|
wx.hideTabBarRedDot({
|
|
|
|
index:i
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports =new reddot() |
|
|
\ No newline at end of file |
...
|
...
|
|