Your Name 6 years ago
parent
commit
4b5befde4e
2 changed files with 9 additions and 4 deletions
  1. 3 0
      pages/index/index.js
  2. 6 4
      utils/websocket.js

+ 3 - 0
pages/index/index.js

@@ -91,6 +91,9 @@ Page({
91
     var that = this;
91
     var that = this;
92
 
92
 
93
 
93
 
94
+ 
95
+
96
+
94
 
97
 
95
     that.Getlocation();   //获取地理位置
98
     that.Getlocation();   //获取地理位置
96
 
99
 

+ 6 - 4
utils/websocket.js

@@ -221,10 +221,12 @@ wx.onSocketMessage(function (res) {
221
   switch(data.type){
221
   switch(data.type){
222
     case 'resetChatTotal':
222
     case 'resetChatTotal':
223
       if (data.data.message_exists == true){
223
       if (data.data.message_exists == true){
224
-        wx.setTabBarBadge({
225
-          index: 0,
226
-          text: '1'
227
-        })  
224
+
225
+        wx.showTabBarRedDot({
226
+            index: 2,
227
+
228
+          })
229
+
228
       }else{
230
       }else{
229
         wx.removeTabBarBadge({
231
         wx.removeTabBarBadge({
230
           index: 0,
232
           index: 0,