tplus-pos
Version:
pos module
52 lines (43 loc) • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _mutantsMicrofx = require('mutants-microfx');
var _pageStores = require('../pageStores');
var pageLocalStore = {
//props
cache: ['withOutVoucher'],
//基本方法
getKey: function getKey(key, mode) {
return 'posTouch_' + key + '_' + (mode || _pageStores.voucherStateStore.mode);
},
isExist: function isExist(key) {
return !!~this.cache.indexOf(key);
},
//缓存方法
get: function get(key) {
if (!this.isExist(key)) return;
return _mutantsMicrofx.localStore.get(this.getKey(key));
},
set: function set(key, value) {
if (!this.isExist(key)) return;
return _mutantsMicrofx.localStore.set(this.getKey(key), value);
},
remove: function remove(key, mode) {
if (!this.isExist(key)) return;
return _mutantsMicrofx.localStore.remove(this.getKey(key, mode));
},
//登出系统清除数据
logout: function logout() {},
//退出练习页面清除缓存
leavePracticePage: function leavePracticePage() {
//清除练习挂单数据
this.remove('withOutVoucher', 'practice');
},
//交班
shift: function shift() {
this.remove('withOutVoucher', 'formal');
}
};
exports.default = pageLocalStore;
//# sourceMappingURL=index.js.map