const setters = { clearDeviceToy() { wx.removeStorageSync('deviceId') wx.removeStorageSync('deviceSn') wx.removeStorageSync('serviceId') wx.removeStorageSync('is_new') // wx.removeStorageSync('characteristicId') }, //setter模块 // 游戏状态: 0未开始 1游戏中 3游戏结束 setGameStatus(status) { wx.setStorageSync('game_status', status) }, setToyItem(toy_item) { wx.setStorageSync('toy_item', toy_item) }, setToySn(toy_sn) { wx.setStorageSync('toy_sn', toy_sn) }, removeToyHex() { wx.removeStorageSync('toy_hex') }, // 游戏模式: 1次数 2时间 setMode(mode) { wx.setStorageSync('mode', mode) }, setGameRecordId(param) { wx.setStorageSync('game_record_id', param) }, // 游玩类型的时间30分钟或10分钟 setOverPlayTime(param) { wx.setStorageSync('over_play_time', param) }, setPlayTime(param) { wx.setStorageSync('play_time', param) }, setPlayedTime(param) { wx.setStorageSync('played_time', param) }, // 记录推到后台得时间 setHideStatus($param) { wx.setStorageSync('hide_status', $param) }, // 记录推到后台得时间 setHideTime($param) { wx.setStorageSync('hide_time', $param) }, //记录游戏数据 setGameAttMedDatas($param) { wx.setStorageSync('game_data', $param) }, // setIsNew($param) { // wx.setStorageSync('is_new', $param) // }, // 脑机LED灯 setLED(bool) { wx.setStorageSync('led_status', bool) }, setGameCloseStatus(status) { wx.setStorageSync('game_close_status', status) }, } const getters = { getGameStatus() { return wx.getStorageSync('game_status') }, getToyItem() { return wx.getStorageSync('toy_item') }, getToySn() { return wx.getStorageSync('toy_sn') }, getMode() { return wx.getStorageSync('mode') }, getGameRecordId() { return wx.getStorageSync('game_record_id') }, // 游玩类型的时间30分钟或10分钟 getOverPlayTime() { return wx.getStorageSync('over_play_time') }, //该局游戏剩余可以游玩的时间 getPlayTime() { return wx.getStorageSync('play_time') }, //完了多长时间 getPlayedTime() { return wx.getStorageSync('played_time') }, // 获取一开始隐藏的时间 getHideStatus() { return wx.getStorageSync('hide_status') }, // 获取一开始隐藏的时间 getHideTime() { return wx.getStorageSync('hide_time') }, //记录游戏数据 getGameAttMedDatas() { return wx.getStorageSync('game_data') }, // //记录游戏数据 // getIsNew() { // return wx.getStorageSync('is_new') // }, // 脑机LED灯 getLED() { return wx.getStorageSync('led_status') }, getGameCloseStatus() { return wx.getStorageSync('game_close_status') }, } const remover = { rmGameAttMedDatas() { wx.removeStorageSync('game_data') }, rmHideTime() { wx.removeStorageSync('hide_time') }, rmHideStatus() { wx.removeStorageSync('hide_status') } } export default { setters, getters, remover }