Tools
def: {
tel: '132-8281-9537',
ossImg: process.oss.img,
err:''
},
listConcat(o, req, list = 'data', next = 'last_page',fn) {
fn && req[list].length > 0 && req[list].forEach(el => {
el = fn(el)
})
o.list = o.list.concat(req[list])
o.len = o.list.length
o.next = o.curr == eval(`req.${next}`) ? false : true
o.curr++
},
getStoreJson(key){
return JSON.parse(localStorage.getItem(key) || '{}')
},
getStoreVal(key) {
const def = {
'ENTRY_APP': 'webapp'
}
return localStorage.getItem(key) || (def.hasOwnProperty(key) ? def[key] : '')
},
getScrolly(){
return document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop
}