Showing
4 changed files
with
63 additions
and
2 deletions
| @@ -95,7 +95,7 @@ | @@ -95,7 +95,7 @@ | ||
| 95 | }, | 95 | }, |
| 96 | { | 96 | { |
| 97 | "pagePath": "pages/me/follow", | 97 | "pagePath": "pages/me/follow", |
| 98 | - "text": "收藏", | 98 | + "text": "关注", |
| 99 | "iconPath": "pages/image/follow.png", | 99 | "iconPath": "pages/image/follow.png", |
| 100 | "selectedIconPath": "pages/image/follow.active.png" | 100 | "selectedIconPath": "pages/image/follow.active.png" |
| 101 | }, | 101 | }, |
| @@ -3,7 +3,7 @@ import util from '../../utils/util'; | @@ -3,7 +3,7 @@ import util from '../../utils/util'; | ||
| 3 | import App from '../../utils/api'; | 3 | import App from '../../utils/api'; |
| 4 | const {regeneratorRuntime} = global | 4 | const {regeneratorRuntime} = global |
| 5 | import PubSub from '../../utils/PubSub' | 5 | import PubSub from '../../utils/PubSub' |
| 6 | -console.log(PubSub) | 6 | +import reddot from '../../utils/reddot'; |
| 7 | Page({ | 7 | Page({ |
| 8 | 8 | ||
| 9 | /** | 9 | /** |
| @@ -25,6 +25,7 @@ Page({ | @@ -25,6 +25,7 @@ Page({ | ||
| 25 | this.formatSellers(data); | 25 | this.formatSellers(data); |
| 26 | } | 26 | } |
| 27 | ) | 27 | ) |
| 28 | + reddot.init() | ||
| 28 | }, | 29 | }, |
| 29 | formatSellers(data){ | 30 | formatSellers(data){ |
| 30 | let sellers=[]; | 31 | let sellers=[]; |
| @@ -3,6 +3,7 @@ var mta = require('mta-wechat-analysis') | @@ -3,6 +3,7 @@ var mta = require('mta-wechat-analysis') | ||
| 3 | import util from '../../utils/util'; | 3 | import util from '../../utils/util'; |
| 4 | import App from '../../utils/api'; | 4 | import App from '../../utils/api'; |
| 5 | import DA from './data'; | 5 | import DA from './data'; |
| 6 | +import reddot from '../../utils/reddot'; | ||
| 6 | const {regeneratorRuntime} = global | 7 | const {regeneratorRuntime} = global |
| 7 | const mapScale=16//18; | 8 | const mapScale=16//18; |
| 8 | const transverseViewHeight=202; | 9 | const transverseViewHeight=202; |
| @@ -70,6 +71,7 @@ Page({ | @@ -70,6 +71,7 @@ Page({ | ||
| 70 | "statReachBottom": true, | 71 | "statReachBottom": true, |
| 71 | "lauchOpts": options, //渠道分析 | 72 | "lauchOpts": options, //渠道分析 |
| 72 | }); | 73 | }); |
| 74 | + reddot.init() | ||
| 73 | }, | 75 | }, |
| 74 | 76 | ||
| 75 | /** | 77 | /** |
utils/reddot.js
0 → 100644
| 1 | +/** | ||
| 2 | + * Created by goto9 on 2019/5/8. | ||
| 3 | + */ | ||
| 4 | +import util from './util'; | ||
| 5 | +import App from './api'; | ||
| 6 | +const {regeneratorRuntime} = global | ||
| 7 | +class reddot{ | ||
| 8 | + menus=[ | ||
| 9 | + { | ||
| 10 | + "pagePath": "pages/reserve/index", | ||
| 11 | + "text": "订座", | ||
| 12 | + "iconPath": "pages/image/tabicon1.png", | ||
| 13 | + "selectedIconPath": "pages/image/tabicon1.active.png" | ||
| 14 | + }, | ||
| 15 | + { | ||
| 16 | + "pagePath": "pages/me/follow", | ||
| 17 | + "text": "关注", | ||
| 18 | + "iconPath": "pages/image/follow.png", | ||
| 19 | + "selectedIconPath": "pages/image/follow.active.png" | ||
| 20 | + }, | ||
| 21 | + { | ||
| 22 | + "pagePath": "pages/customer/list", | ||
| 23 | + "text": "日程", | ||
| 24 | + "iconPath": "pages/image/tabicon3.png", | ||
| 25 | + "selectedIconPath": "pages/image/tabicon3.active.png" | ||
| 26 | + }, | ||
| 27 | + { | ||
| 28 | + "pagePath": "pages/me/index", | ||
| 29 | + "text": "我的", | ||
| 30 | + "iconPath": "pages/image/tabicon4.png", | ||
| 31 | + "selectedIconPath": "pages/image/tabicon4.active.png" | ||
| 32 | + } | ||
| 33 | + ]; | ||
| 34 | + init(){ | ||
| 35 | + console.log('reddot....',this.menus) | ||
| 36 | + this.setRedDot() | ||
| 37 | + this.clrRedDot() | ||
| 38 | + } | ||
| 39 | + setRedDot(){ | ||
| 40 | + wx.showTabBarRedDot({ | ||
| 41 | + index:1 | ||
| 42 | + }) | ||
| 43 | + } | ||
| 44 | + clrRedDot(){ | ||
| 45 | + let pages=getCurrentPages(); | ||
| 46 | + let route=pages[0].route; | ||
| 47 | + console.log('reddot....',route); | ||
| 48 | + this.menus.forEach((m,i)=>{ | ||
| 49 | + if(m.pagePath==route){ | ||
| 50 | + wx.hideTabBarRedDot({ | ||
| 51 | + index:i | ||
| 52 | + }) | ||
| 53 | + } | ||
| 54 | + }) | ||
| 55 | + } | ||
| 56 | +} | ||
| 57 | + | ||
| 58 | +module.exports =new reddot() |
-
Please register or login to post a comment