flat: 添加定位

This commit is contained in:
Apcallover
2024-06-05 14:30:33 +08:00
parent f3eef9f396
commit 21835e52c1
7 changed files with 867 additions and 773 deletions

View File

@@ -1,18 +1,20 @@
const getters = {
language: state => state.common.language,
website: state => state.common.website,
userInfo: state => state.user.userInfo,
userChecked:state=>state.user.userChecked,
area: state => state.area,
news: state=> state.news,
auth: state => state.auth,
authPass: (state,getters) => getters.auth.laborState && getters.auth.realNameState && getters.auth.bankCardState && getters.auth.insureState,
authInfo: state => state.auth.authInfo,
face: state => state.face,
realName: state => state.authentication.realName,
bankCard: state => state.authentication.bankCard,
autograph: state => state.authentication.autograph,
sendTimes:state => state.user.sendTimes,//接收短信的次数
}
export default getters
const getters = {
language: state => state.common.language,
website: state => state.common.website,
userInfo: state => state.user.userInfo,
userChecked: state => state.user.userChecked,
area: state => state.area,
news: state => state.news,
auth: state => state.auth,
authPass: (state, getters) => getters.auth.laborState && getters.auth.realNameState && getters.auth
.bankCardState && getters.auth.insureState,
authInfo: state => state.auth.authInfo,
face: state => state.face,
realName: state => state.authentication.realName,
bankCard: state => state.authentication.bankCard,
autograph: state => state.authentication.autograph,
sendTimes: state => state.user.sendTimes, //接收短信的次数
userLocation: state => state.user.userLocation, //用户位置
}
export default getters

View File

@@ -64,8 +64,36 @@ const user = {
seeEnterprise: getStore({ //用户发送短信次数
name: 'enterprise'
}) || 0, // 0 个体招工 企业招工
userLocation: null
},
actions: {
getUserLocation({
commit,
dispatch
}) {
console.log('getUserLocation null1')
commit('setLocation', {
latitude: 31.133980,
longitude: 104.404419,
})
// uni.getLocation({
// type: 'gcj02',
// success: function(res) {
// const {
// longitude,
// latitude
// } = res
// commit('setLocation', {
// longitude,
// latitude
// })
// },
// fail: function(err) {
// commit('setLocation', null)
// },
// complete: function(e) {}
// })
},
//用户点击radio按钮
UserCheckedBtn({
commit
@@ -186,6 +214,9 @@ const user = {
},
},
mutations: {
setLocation(state, val) {
state.userLocation = val
},
setEnterprise(state, val) { // 0 个体招工 企业招工
state.seeEnterprise = val;
setStore({