完善定位功能

This commit is contained in:
2025-05-02 14:41:47 +08:00
parent 05aaed3b16
commit c7b6aacafb
268 changed files with 8649 additions and 3000 deletions

View File

@ -47,7 +47,11 @@ const mutations = {
SETCONFIG(state, data) {
state.config = Object.assign(state.config, data)
Cache.set(CONFIG, state.config);
}
},
SETSYSTEMINFO(state, data) {
state.sysInfo = data
},
};
const actions = {
@ -82,6 +86,34 @@ const actions = {
})
})
},
getSystemInfo({
state,
commit
}) {
uni.getSystemInfo({
success: res => {
let {
statusBarHeight,
platform,
} = res;
let navHeight;
if (platform == 'ios' || platform == 'devtools') {
navHeight = statusBarHeight + 44;
} else {
navHeight = statusBarHeight + 48;
}
commit('SETSYSTEMINFO', {
...res,
navHeight,
})
console.log(state)
},
fail(err) {
console.log(err);
}
});
},
};
export default {