25 changed files with 385 additions and 121 deletions
@ -0,0 +1,101 @@ |
|||||
|
<template> |
||||
|
<map |
||||
|
:latitude="latitude" |
||||
|
:longitude="longitude" |
||||
|
:markers="covers" |
||||
|
:polygons="polygons" |
||||
|
:polyline="polyline" |
||||
|
id="map" |
||||
|
ref="map" |
||||
|
show-location="true" |
||||
|
style="width: 100%; height: 1000rpx;" |
||||
|
/> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return { |
||||
|
latitude: 37.87059, |
||||
|
longitude: 112.55067, |
||||
|
covers: [ |
||||
|
{ |
||||
|
latitude: 37.87059, |
||||
|
longitude: 112.55067, |
||||
|
iconPath: '../../static/location.png', |
||||
|
callout: { |
||||
|
content: 'test', |
||||
|
color: '#fff', |
||||
|
padding: 4, |
||||
|
bgColor: '#0A97C6', |
||||
|
borderRadius: 2, |
||||
|
textAlign: 'center', |
||||
|
}, |
||||
|
}, |
||||
|
{ |
||||
|
latitude: 37.87, |
||||
|
longitude: 112.5506, |
||||
|
iconPath: '../../static/location.png', |
||||
|
}, |
||||
|
{ |
||||
|
latitude: 37.8701, |
||||
|
longitude: 112.55, |
||||
|
iconPath: '../../static/location.png', |
||||
|
}, |
||||
|
{ |
||||
|
latitude: 37.86, |
||||
|
longitude: 112.5496, |
||||
|
iconPath: '../../static/location.png', |
||||
|
}, |
||||
|
], |
||||
|
polyline: [ |
||||
|
{ |
||||
|
points: [ |
||||
|
{ latitude: 37.87059, longitude: 112.55067 }, |
||||
|
{ latitude: 37.87, longitude: 112.5506 }, |
||||
|
{ latitude: 37.8701, longitude: 112.55 }, |
||||
|
{ latitude: 37.86, longitude: 112.5496 }, |
||||
|
], |
||||
|
arrowLine: true, |
||||
|
dottedLine: true, |
||||
|
borderColor: '#cccccc', |
||||
|
}, |
||||
|
], |
||||
|
polygons: [ |
||||
|
{ |
||||
|
points: [ |
||||
|
{ latitude: 37.87059, longitude: 112.55067 }, |
||||
|
{ latitude: 37.87, longitude: 112.5506 }, |
||||
|
{ latitude: 37.8701, longitude: 112.55 }, |
||||
|
{ latitude: 37.86, longitude: 112.5496 }, |
||||
|
], |
||||
|
strokeWidth: 0, |
||||
|
strokeColor: '#00000000', |
||||
|
fillColor: '#cce6ff88', |
||||
|
zIndex: 0, |
||||
|
}, |
||||
|
], |
||||
|
}; |
||||
|
}, |
||||
|
|
||||
|
onLoad() { |
||||
|
this.getLocation(); |
||||
|
}, |
||||
|
|
||||
|
methods: { |
||||
|
// 获取当前的地址位置 |
||||
|
// 注意用国测局的数据 map只支持gcj02 |
||||
|
getLocation() { |
||||
|
uni.getLocation({ |
||||
|
type: 'gcj02', |
||||
|
success: res => { |
||||
|
this.longitude = res.longitude; |
||||
|
this.latitude = res.latitude; |
||||
|
console.log('当前位置的经度:' + res.longitude); |
||||
|
console.log('当前位置的纬度:' + res.latitude); |
||||
|
}, |
||||
|
}); |
||||
|
}, |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
@ -0,0 +1,14 @@ |
|||||
|
<template> |
||||
|
<view>扫别人的码</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
export default { |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
</style> |
@ -0,0 +1,25 @@ |
|||||
|
<template> |
||||
|
<view>扫了别人的码 看其健康状态</view> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { formatQuery } from 'utils/util'; |
||||
|
|
||||
|
export default { |
||||
|
data() { |
||||
|
return {}; |
||||
|
}, |
||||
|
|
||||
|
onLoad(options) { |
||||
|
try { |
||||
|
const query = formatQuery(decodeURIComponent(options.scene)); |
||||
|
console.log('query: ', query); |
||||
|
} catch (error) { |
||||
|
console.log('error: ', error); |
||||
|
} |
||||
|
}, |
||||
|
}; |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss"> |
||||
|
</style> |
@ -1,11 +1,12 @@ |
|||||
import Vue from 'vue'; |
import Vue from 'vue'; |
||||
import Vuex from 'vuex'; |
import Vuex from 'vuex'; |
||||
import user from './modules/user/index'; |
import user from './modules/user/index'; |
||||
|
import site from './modules/site/index'; |
||||
import statistics from './modules/statistics/index'; |
import statistics from './modules/statistics/index'; |
||||
|
|
||||
Vue.use(Vuex); |
Vue.use(Vuex); |
||||
const store = new Vuex.Store({ |
const store = new Vuex.Store({ |
||||
modules: { user, statistics }, |
modules: { user, site, statistics }, |
||||
}); |
}); |
||||
|
|
||||
export default store; |
export default store; |
||||
|
@ -0,0 +1,53 @@ |
|||||
|
import { http } from 'plugins/request/index'; |
||||
|
import { showLoading, hideLoading, showToast, showModal } from 'utils/ui'; |
||||
|
import { SITES_INFO, SCAN_SIGN } from 'api/api'; |
||||
|
|
||||
|
const actions = { |
||||
|
/** |
||||
|
* 获取所有场所信息 |
||||
|
* @param {*} commit |
||||
|
*/ |
||||
|
getSites({ commit }) { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
showLoading(); |
||||
|
http |
||||
|
.post(SITES_INFO) |
||||
|
.then(res => { |
||||
|
hideLoading(); |
||||
|
const { data } = res.data; |
||||
|
commit('setSites', data); |
||||
|
resolve(data); |
||||
|
}) |
||||
|
.catch(data => { |
||||
|
hideLoading(); |
||||
|
showToast(data.msg || '获取场所信息失败'); |
||||
|
reject(data); |
||||
|
}); |
||||
|
}); |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 扫码打卡 提交打卡记录 |
||||
|
* @param {*} commit |
||||
|
* @param {object} params 提交服务端的数据 |
||||
|
*/ |
||||
|
sign({ commit }, params) { |
||||
|
return new Promise((resolve, reject) => { |
||||
|
showLoading(); |
||||
|
http |
||||
|
.post(SCAN_SIGN, params) |
||||
|
.then(res => { |
||||
|
hideLoading(); |
||||
|
const { data } = res.data; |
||||
|
resolve(data); |
||||
|
}) |
||||
|
.catch(data => { |
||||
|
hideLoading(); |
||||
|
showToast(data.msg || '打卡失败'); |
||||
|
reject(data); |
||||
|
}); |
||||
|
}); |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
export default actions; |
@ -0,0 +1,5 @@ |
|||||
|
import state from './state'; |
||||
|
import mutations from './mutations'; |
||||
|
import actions from './actions.js'; |
||||
|
|
||||
|
export default { namespaced: true, state, actions, mutations }; |
@ -0,0 +1,12 @@ |
|||||
|
const mutations = { |
||||
|
/** |
||||
|
* 设置所有的场所值 |
||||
|
* @param {object} state |
||||
|
* @param {array} data |
||||
|
*/ |
||||
|
setSites(state, data) { |
||||
|
state.sites = data || []; |
||||
|
}, |
||||
|
}; |
||||
|
|
||||
|
export default mutations; |
@ -0,0 +1,5 @@ |
|||||
|
const state = { |
||||
|
sites: [], // 所有的场所信息
|
||||
|
}; |
||||
|
|
||||
|
export default state; |
@ -1,7 +1,12 @@ |
|||||
const state = { |
const state = { |
||||
userSigns: [], // 用户个人打卡记录
|
userSigns: [], // 用户个人打卡记录
|
||||
shoolSigns: [], // 校园的打卡记录
|
schoolSigns: [], // 校园的打卡记录
|
||||
shoolSignNumber: [], // 健康上报数目统计
|
shoolSignNumber: [ |
||||
|
{ name: '正常', number: '-' }, |
||||
|
{ name: '发烧', number: '-' }, |
||||
|
{ name: '其他', number: '-' }, |
||||
|
{ name: '未上报', number: '-' }, |
||||
|
], // 健康上报数目统计
|
||||
}; |
}; |
||||
|
|
||||
export default state; |
export default state; |
||||
|
Loading…
Reference in new issue