From a2ba0c4546bf727ca0ec23bea7c6edf575883614 Mon Sep 17 00:00:00 2001
From: wally <18603454788@163.com>
Date: Fri, 6 Mar 2020 22:39:07 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=9D=83=E9=99=90?=
=?UTF-8?q?=E7=AD=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 10 +++++
manifest.json | 5 +++
pages.json | 15 ++++++-
pages/healthy-card/healthy-card.vue | 14 ++++++
pages/index/index.vue | 1 +
pages/sign/sign.vue | 2 +-
pages/statistics/components/health-data.vue | 48 +++++++++++++--------
pages/statistics/statistics.vue | 18 ++++----
pages/user-code/user-code.vue | 25 +++++++++++
9 files changed, 110 insertions(+), 28 deletions(-)
create mode 100644 pages/healthy-card/healthy-card.vue
create mode 100644 pages/user-code/user-code.vue
diff --git a/App.vue b/App.vue
index 02c7786..29e26ad 100644
--- a/App.vue
+++ b/App.vue
@@ -4,6 +4,16 @@ import { mapActions } from 'vuex';
export default {
async onLaunch() {
await this.login();
+ uni.getSetting({
+ success(res) {
+ if (!res.authSetting['scope.userLocation']) {
+ uni.authorize({
+ scope: 'scope.userLocation',
+ success() {},
+ });
+ }
+ },
+ });
},
methods: {
diff --git a/manifest.json b/manifest.json
index c0f4472..e81bf4b 100644
--- a/manifest.json
+++ b/manifest.json
@@ -64,6 +64,11 @@
"postcss" : true,
"minified" : true
},
+ "permission": {
+ "scope.userLocation": {
+ "desc": "你的位置信息将用于获取地理位置及地图展示"
+ }
+ },
"usingComponents" : true
},
"mp-alipay" : {
diff --git a/pages.json b/pages.json
index e19261a..75f7690 100644
--- a/pages.json
+++ b/pages.json
@@ -13,6 +13,11 @@
"navigationBarTitleText": "山大健康码"
}
},
+ {
+ "path": "pages/statistics/statistics",
+ "style": { "navigationBarTitleText": "统计" }
+ },
+
{
"path": "pages/my-signs/my-signs",
"style": { "navigationBarTitleText": "我的校园打卡" }
@@ -64,7 +69,15 @@
"navigationBarTitleText": "我的行程"
}
}
- ],
+ ,{
+ "path" : "pages/healthy-card/healthy-card",
+ "style" : {}
+ }
+ ,{
+ "path" : "pages/user-code/user-code",
+ "style" : {}
+ }
+ ],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "山大健康码",
diff --git a/pages/healthy-card/healthy-card.vue b/pages/healthy-card/healthy-card.vue
new file mode 100644
index 0000000..97fb425
--- /dev/null
+++ b/pages/healthy-card/healthy-card.vue
@@ -0,0 +1,14 @@
+
+ 扫别人的码
+
+
+
+
+
diff --git a/pages/index/index.vue b/pages/index/index.vue
index 99e3a37..2d68c41 100644
--- a/pages/index/index.vue
+++ b/pages/index/index.vue
@@ -36,6 +36,7 @@ export default {
uni.scanCode({
onlyFromCamera: true,
success: res => {
+ console.log('res: ', res);
console.log('条码类型:' + res.scanType);
console.log('条码内容:' + res.result);
},
diff --git a/pages/sign/sign.vue b/pages/sign/sign.vue
index 7d69e59..114b115 100644
--- a/pages/sign/sign.vue
+++ b/pages/sign/sign.vue
@@ -25,7 +25,7 @@ export default {
address: '图书馆',
siteId: '',
siteName: '',
- success: true,
+ success: false,
};
},
diff --git a/pages/statistics/components/health-data.vue b/pages/statistics/components/health-data.vue
index 9bbd8dc..44bf7c2 100644
--- a/pages/statistics/components/health-data.vue
+++ b/pages/statistics/components/health-data.vue
@@ -11,21 +11,9 @@
-
- 100
- 正常
-
-
- 9
- 发烧
-
-
- 10
- 其他
-
-
- 50
- 未上报
+
+ {{ item.number }}
+ {{ item.name }}
@@ -33,15 +21,41 @@
diff --git a/pages/statistics/statistics.vue b/pages/statistics/statistics.vue
index d282278..e9700e0 100644
--- a/pages/statistics/statistics.vue
+++ b/pages/statistics/statistics.vue
@@ -43,7 +43,7 @@ export default {
this.$moment(end)
.endOf('day')
.format('x') - 0;
- console.log('startTime,endTime: ', startTime, endTime);
+ console.log('startTime, endTime: ', startTime, endTime);
// 获取校园打卡的数据
this.getSchoolSignsData(startTime, endTime);
// 获取健康上报数目数据
@@ -52,12 +52,12 @@ export default {
/**
* 获取校园打卡的数据
- * @param {number} start 开始时间
- * @param {number} end 截止时间
+ * @param {number} startTime 开始时间
+ * @param {number} endTime 截止时间
*/
- getSchoolSignsData(start, end) {
+ getSchoolSignsData(startTime, endTime) {
try {
- const params = { param: { start, end } };
+ const params = { param: { startTime, endTime } };
this.getSchoolSigns(params);
} catch (error) {
console.log('getSchoolSignsData error: ', error);
@@ -66,12 +66,12 @@ export default {
/**
* 获取健康上报的数目数据
- * @param {number} start 开始时间
- * @param {number} end 截止时间
+ * @param {number} startTime 开始时间
+ * @param {number} endTime 截止时间
*/
- getSchoolSignsNumberData(start, end) {
+ getSchoolSignsNumberData(startTime, endTime) {
try {
- const params = { param: { start, end } };
+ const params = { param: { startTime, endTime } };
this.getSchoolSignsNumber(params);
} catch (error) {
console.log('getSchoolSignsNumberData error: ', error);
diff --git a/pages/user-code/user-code.vue b/pages/user-code/user-code.vue
new file mode 100644
index 0000000..c43b673
--- /dev/null
+++ b/pages/user-code/user-code.vue
@@ -0,0 +1,25 @@
+
+ 扫了别人的码 看其健康状态
+
+
+
+
+
From 91022bfd6ef20967b231bcfc55d7bb84dd39c0e4 Mon Sep 17 00:00:00 2001
From: wally <18603454788@163.com>
Date: Sat, 7 Mar 2020 16:15:08 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E5=81=A5=E5=BA=B7=E4=B8=8A=E6=8A=A5?=
=?UTF-8?q?=E6=95=B0=E7=9B=AE=E7=9A=84=E9=BB=98=E8=AE=A4=E5=80=BC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages.json | 70 +++++++++++++--------------
store/modules/statistics/mutations.js | 8 ++-
store/modules/statistics/state.js | 7 ++-
3 files changed, 46 insertions(+), 39 deletions(-)
diff --git a/pages.json b/pages.json
index 75f7690..819997a 100644
--- a/pages.json
+++ b/pages.json
@@ -41,43 +41,39 @@
"navigationBarTitleText": "基本信息填写"
}
},
- {
- "path": "pages/add-stroke/add-stroke",
- "style": {
- "navigationBarTitleText": "添加行程"
- }
- },
- {
- "path": "pages/apply-code/apply-code",
- "style": {
- "navigationBarTitleText": "申请健康码"
- }
- },
- {
- "path": "pages/statistics/statistics",
- "style": { "navigationBarTitleText": "统计" }
- },
- {
- "path": "pages/my-code/my-code",
- "style": {
- "navigationBarTitleText": "我的健康打卡"
- }
- },
- {
- "path": "pages/my-trips/my-trips",
- "style": {
- "navigationBarTitleText": "我的行程"
- }
- }
- ,{
- "path" : "pages/healthy-card/healthy-card",
- "style" : {}
- }
- ,{
- "path" : "pages/user-code/user-code",
- "style" : {}
- }
- ],
+ {
+ "path": "pages/add-stroke/add-stroke",
+ "style": {
+ "navigationBarTitleText": "添加行程"
+ }
+ },
+ {
+ "path": "pages/apply-code/apply-code",
+ "style": {
+ "navigationBarTitleText": "申请健康码"
+ }
+ },
+ {
+ "path": "pages/my-code/my-code",
+ "style": {
+ "navigationBarTitleText": "我的健康打卡"
+ }
+ },
+ {
+ "path": "pages/my-trips/my-trips",
+ "style": {
+ "navigationBarTitleText": "我的行程"
+ }
+ },
+ {
+ "path": "pages/healthy-card/healthy-card",
+ "style": {}
+ },
+ {
+ "path": "pages/user-code/user-code",
+ "style": {}
+ }
+ ],
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "山大健康码",
diff --git a/store/modules/statistics/mutations.js b/store/modules/statistics/mutations.js
index dd8489d..4e42cea 100644
--- a/store/modules/statistics/mutations.js
+++ b/store/modules/statistics/mutations.js
@@ -23,7 +23,13 @@ const mutations = {
* @param {array} data
*/
setShoolSignNumber(state, data) {
- state.shoolSignNumber = data || [];
+ const arr = [
+ { name: '正常', number: '-' },
+ { name: '发烧', number: '-' },
+ { name: '其他', number: '-' },
+ { name: '未上报', number: '-' },
+ ];
+ state.shoolSignNumber = data || arr;
},
};
diff --git a/store/modules/statistics/state.js b/store/modules/statistics/state.js
index 0770464..8e546cb 100644
--- a/store/modules/statistics/state.js
+++ b/store/modules/statistics/state.js
@@ -1,7 +1,12 @@
const state = {
userSigns: [], // 用户个人打卡记录
shoolSigns: [], // 校园的打卡记录
- shoolSignNumber: [], // 健康上报数目统计
+ shoolSignNumber: [
+ { name: '正常', number: '-' },
+ { name: '发烧', number: '-' },
+ { name: '其他', number: '-' },
+ { name: '未上报', number: '-' },
+ ], // 健康上报数目统计
};
export default state;
From ecaace8ef6bc991e99b644af9f4604ba65437469 Mon Sep 17 00:00:00 2001
From: wally <18603454788@163.com>
Date: Sat, 7 Mar 2020 19:05:56 +0800
Subject: [PATCH 3/3] =?UTF-8?q?1.=E6=89=93=E5=8D=A1=202.=E7=BB=9F=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 5 +-
components/history-map/history-map.vue | 64 ++---------
components/school-map/school-map.vue | 101 ++++++++++++++++++
config/api/api.js | 3 +
config/config.user.js | 3 +-
pages.json | 7 --
pages/sign/sign.vue | 31 +++---
pages/statistics/components/date-selector.vue | 16 ++-
pages/statistics/components/location-map.vue | 37 +++++--
store/index.js | 3 +-
store/modules/site/actions.js | 53 +++++++++
store/modules/site/index.js | 5 +
store/modules/site/mutations.js | 12 +++
store/modules/site/state.js | 5 +
store/modules/statistics/actions.js | 2 +
store/modules/statistics/mutations.js | 2 +-
store/modules/statistics/state.js | 2 +-
store/modules/user/actions.js | 2 +
utils/user.js | 5 +-
19 files changed, 262 insertions(+), 96 deletions(-)
create mode 100644 components/school-map/school-map.vue
create mode 100644 store/modules/site/actions.js
create mode 100644 store/modules/site/index.js
create mode 100644 store/modules/site/mutations.js
create mode 100644 store/modules/site/state.js
diff --git a/App.vue b/App.vue
index 29e26ad..1f730f4 100644
--- a/App.vue
+++ b/App.vue
@@ -3,7 +3,6 @@ import { mapActions } from 'vuex';
export default {
async onLaunch() {
- await this.login();
uni.getSetting({
success(res) {
if (!res.authSetting['scope.userLocation']) {
@@ -14,10 +13,14 @@ export default {
}
},
});
+
+ await this.login();
+ this.getSites();
},
methods: {
...mapActions('user', ['login']),
+ ...mapActions('site', ['getSites']),
},
};
diff --git a/components/history-map/history-map.vue b/components/history-map/history-map.vue
index 00bcadc..6c635bd 100644
--- a/components/history-map/history-map.vue
+++ b/components/history-map/history-map.vue
@@ -2,7 +2,7 @@