From 5e7eb9a562a9923be53019181f00b204c5357f3a Mon Sep 17 00:00:00 2001
From: wally <18603454788@163.com>
Date: Sat, 7 Mar 2020 22:09:21 +0800
Subject: [PATCH] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=20=E4=B8=AA=E4=BA=BA?=
=?UTF-8?q?=E6=89=93=E5=8D=A1=E8=AE=B0=E5=BD=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
App.vue | 83 +++---
components/timeline/timeline.vue | 66 +++--
config/api/api.js | 3 +
pages/basic-info/basic-info.vue | 432 +++++++++++++++-------------
pages/my-signs/my-signs.vue | 96 ++++++-
pages/sign/sign.vue | 17 +-
store/modules/site/actions.js | 23 +-
store/modules/site/mutations.js | 9 +
store/modules/site/state.js | 1 +
store/modules/statistics/actions.js | 2 +-
10 files changed, 452 insertions(+), 280 deletions(-)
diff --git a/App.vue b/App.vue
index a0bfe21..81951a9 100644
--- a/App.vue
+++ b/App.vue
@@ -17,59 +17,50 @@ export default {
await this.login();
await this.getUserInfo();
- this.getSites();
},
computed: mapState('user', ['token']),
methods: {
- ...mapMutations('user', ['setUserInfo','setHealthCode']),
+ ...mapMutations('user', ['setUserInfo', 'setHealthCode']),
...mapActions('user', ['login']),
- ...mapActions('site', ['getSites']),
-
- /**
- * 查询个人信息
- */
- async getUserInfo() {
- try {
- const { token } = this;
- const params = {
- param: {
- token
- }
- };
- const res = await this.$http.post(GET_USER_INFO, params);
- const {
- success,
- code,
- msg,
- data
- } = res.data;
- if (success && code === 200) {
- this.setUserInfo(data);
- if(data.healthCodeList && data.healthCodeList.length>0){
- const oldCode = data.healthCodeList[0].healthCode;
- this.setHealthCode(oldCode)
- }
- this.success = true;
- } else {
- uni.showToast({
- title: msg || '查询个人信息成功',
- icon: 'none'
- });
- }
- } catch (error) {
- console.log('error: ', error);
- if (error.msg) {
- uni.showToast({
- title: error.msg || '查询个人信息失败',
- icon: 'none'
- });
- }
- }
- },
-
+ /**
+ * 查询个人信息
+ */
+ async getUserInfo() {
+ try {
+ const { token } = this;
+ const params = {
+ param: {
+ token,
+ },
+ };
+ const res = await this.$http.post(GET_USER_INFO, params);
+ const { success, code, msg, data } = res.data;
+ if (success && code === 200) {
+ this.setUserInfo(data);
+ if (data.healthCodeList && data.healthCodeList.length > 0) {
+ const oldCode = data.healthCodeList[0].healthCode;
+ this.setHealthCode(oldCode);
+ }
+ this.success = true;
+ } else {
+ uni.showToast({
+ title: msg || '查询个人信息成功',
+ icon: 'none',
+ });
+ }
+ } catch (error) {
+ console.log('error: ', error);
+ if (error.msg) {
+ uni.showToast({
+ title: error.msg || '查询个人信息失败',
+ icon: 'none',
+ });
+ }
+ }
+ },
},
};
diff --git a/components/timeline/timeline.vue b/components/timeline/timeline.vue
index 5e0735d..3014d25 100644
--- a/components/timeline/timeline.vue
+++ b/components/timeline/timeline.vue
@@ -1,32 +1,44 @@
-
-
- 昨天
-
-
- 22:22【广州市】快件已到达地球
-
-
-
- 这是第一次,我家的铲屎官走了这么久。久到足足有三天!!
-
-
-
-
- 06-17
-
-
- 01:30【喵星】 MX-12138 已揽收,准备发往银河系
-
-
-
-
+
+
+
+
+
+ {{ generateTime(item.time - 0) }}
+ 【 {{ item.siteName }} 】打卡
+
+
+
+
diff --git a/config/api/api.js b/config/api/api.js
index 0e001a8..ca8eb0b 100644
--- a/config/api/api.js
+++ b/config/api/api.js
@@ -28,6 +28,9 @@ export const USER_SIGNS = `${sites}/info`;
// 获取所有场景信息
export const SITES_INFO = `${sites}/siteInfo`;
+// 根据二维码的id获取场所的信息
+export const SITE = `${sites}/site`;
+
// 扫码统计
export const SCHOOL_SIGNS = `${sites}/statistics`;
diff --git a/pages/basic-info/basic-info.vue b/pages/basic-info/basic-info.vue
index afa24e3..2d4b7c5 100644
--- a/pages/basic-info/basic-info.vue
+++ b/pages/basic-info/basic-info.vue
@@ -1,209 +1,243 @@
-
-
-
-
-
+
+
+
+
+
diff --git a/pages/my-signs/my-signs.vue b/pages/my-signs/my-signs.vue
index 61f20b4..eef36d0 100644
--- a/pages/my-signs/my-signs.vue
+++ b/pages/my-signs/my-signs.vue
@@ -13,7 +13,12 @@
-
+
@@ -21,6 +26,8 @@