zh hace 8 meses
padre
commit
b60c84585e
Se han modificado 1 ficheros con 9 adiciones y 4 borrados
  1. 9 4
      assets/Script/social.js

+ 9 - 4
assets/Script/social.js

@@ -51,11 +51,13 @@ cc.Class({
     this.getHighestLevel()
   },
   getHighestLevel() {
-    let highLevel = wx.getStorageSync('highLevel')
+   // let highLevel = wx.getStorageSync('highLevel')
+    let highLevel =cc.sys.localStorage.getItem('highLevel')
     return highLevel
   },
   getHighestScore() {
-    let score = wx.getStorageSync('highScore')
+    //let score = wx.getStorageSync('highScore')
+    let score =cc.sys.localStorage.getItem('highScore')
     return score
   },
   // --------------- share ----------------
@@ -108,8 +110,11 @@ cc.Class({
       highScore = score
     }
     var highLevelName = this._controller.gameData.json.levelData[highLevel - 1].name
-    wx.setStorageSync('highLevel', highLevel + '')
-    wx.setStorageSync('highScore', highScore + '')
+   
+    //wx.setStorageSync('highLevel', highLevel + '')
+    //wx.setStorageSync('highScore', highScore + '')
+    cc.sys.localStorage.setItem('highLevel', highLevel + '');
+    cc.sys.localStorage.setItem('highScore', highScore + '');
     self._controller.scoreMgr.failHighScore.string = "您的最高分:" + (highScore + '')
     var kvDataList = new Array()
     kvDataList.push({