const getters = { getBluetoothLinkStatus() { return wx.getStorageSync("ble_link_status") }, getDeviceSn() { return wx.getStorageSync('device_sn') }, getDeviceId() { return wx.getStorageSync('device_id') }, getServiceId() { return wx.getStorageSync('service_id') }, getCharacteristicWriteId(){ return wx.getStorageSync('characteristic_write_id') }, getCharacteristicNotifyId(){ return wx.getStorageSync('characteristic_notify_id') }, getToyItem() { return wx.getStorageSync('toy_item') }, getToySn() { return wx.getStorageSync('toy_sn') }, getCurrentToyId(){ return wx.getStorageSync('current_toy_id') }, } const setters = { clearDeviceToy() { wx.removeStorageSync('device_id') wx.removeStorageSync('device_sn') wx.removeStorageSync('service_id') wx.removeStorageSync('is_new') wx.removeStorageSync('characteristic_write_id') wx.removeStorageSync('characteristic_notify_id') wx.setStorageSync('current_toy_id', '00') }, setBluetoothLinkStatus($bool) { wx.setStorageSync("ble_link_status", $bool) }, setDeviceSn(deviceSn) { wx.setStorageSync('device_sn', deviceSn) }, setDeviceId(deviceId) { wx.setStorageSync('device_id', deviceId) }, setServiceId(serviceId) { wx.setStorageSync('service_id', serviceId) }, setCharacteristicWriteId(characteristicId){ wx.setStorageSync('characteristic_write_id', characteristicId) }, setCharacteristicNotifyId(characteristicId){ wx.setStorageSync('characteristic_notify_id', characteristicId) }, setToyItem(toy_item) { wx.setStorageSync('toy_item', toy_item) }, setToySn(toy_sn) { wx.setStorageSync('toy_sn', toy_sn) }, setCurrentToyId(currentToyId){ wx.setStorageSync('current_toy_id', currentToyId) }, } export default { getters, setters }