ソースを参照

步数统计图

wgl 4 年 前
コミット
cea39b6276

+ 9 - 0
src/projects/pension/apis/Master/health.js

@@ -45,3 +45,12 @@ export function getLbsList(params) {
 		method: 'post',
 	})
 }
+
+//获取步数统计数据
+export function geStepList() {
+	return request({
+		url: '/mobile/watchApi/getStepData',
+		data: Qs.stringify({}),
+		method: 'post',
+	})
+}

+ 40 - 0
src/projects/pension/apis/Master/relatives.js

@@ -32,3 +32,43 @@ export function delRelation(popedomId) {
 		method: 'post',
 	})
 }
+
+//获取联系人列表
+export function getPhoneNumberList(params) {
+	return request({
+		url: '/mobile/phoneBookApi/phoneList',
+		data: Qs.stringify(params),
+		method: 'post',
+	})
+}
+
+//获取联系人详情
+export function getPhoneNumberInfo(bookId) {
+	return request({
+		url: '/mobile/phoneBookApi/findByBookId',
+		data: Qs.stringify({
+			bookId: bookId
+		}),
+		method: 'post',
+	})
+}
+
+//新增修改联系人
+export function updatePhoneNumber(params) {
+	return request({
+		url: '/mobile/phoneBookApi/updateBook',
+		data: Qs.stringify(params),
+		method: 'post',
+	})
+}
+
+//删除联系人
+export function delPhoneNumber(bookId) {
+	return request({
+		url: '/mobile/phoneBookApi/deleteBook',
+		data: Qs.stringify({
+			bookId: bookId
+		}),
+		method: 'post',
+	})
+}

+ 1 - 1
src/projects/pension/views/Master/Health/Archives.vue

@@ -41,7 +41,7 @@
 					</div>
 				</li>
 				<li class="mui-table-view-cell mui-col-xs-4">
-					<div class="vongi-color-block block-yellowe" @click="goToInfo({name:'MasterHealthChart',query:{type:'step',title:'运动'}})">
+					<div class="vongi-color-block block-yellowe" @click="goToInfo({name:'MasterHealthChartStep',query:{type:'step',title:'运动步数'}})">
 						<span class="vongi-color-unit">步</span>
 						<div class="mui-h1" v-text="healthData.step?healthData.step:'暂无'"></div>
 						<div class="mui-media-body">运动</div>

+ 15 - 23
src/projects/pension/views/Master/Health/ChartStep.vue

@@ -26,7 +26,7 @@
 		mapMutations
 	} from 'vuex'
 	import echarts from 'echarts/lib/echarts'
-	import 'echarts/lib/chart/line'
+	import 'echarts/lib/chart/bar'
 	import 'echarts/lib/component/legend'
 	import 'echarts/lib/component/title'
 	import 'echarts/lib/component/tooltip'
@@ -44,23 +44,19 @@
 
 				pageTitle: this.$route.query.title,
 
-				listForm: {
-					names: this.$route.query.type,
-				},
-
 				typeList: '',
 
 				chartsList: [],
 			}
 		},
 		created() {
-			this.typeList = this.$route.query.type.split(',');
+
 		},
 		methods: {
 			//获取图表数据
 			getChartList() {
 				this.isLoading = true;
-				API_Health.getChartList(this.listForm).then(response => {
+				API_Health.geStepList().then(response => {
 					this.isLoading = false;
 					this.chartsList = response;
 
@@ -75,23 +71,19 @@
 				var legendData = [];
 				var xAxisData = [];
 				var series = [];
-				for (var i = 0; i < this.typeList.length; i++) {
-					var seriesData = [];
-					legendData.push(this.chartsList[this.typeList[i]].name);
-					var list = this.chartsList[this.typeList[i]].list;
-					for (var j = 0; j < list.length; j++) {
-						if (i == 0) {
-							xAxisData.push(list[j].recordTime);
-						}
-						seriesData.push(list[j].value);
-					}
-					series.push({
-						name: this.chartsList[this.typeList[i]].name,
-						type: 'line',
-						stack: '',
-						data: seriesData
-					});
+				var seriesData = [];
+				legendData.push('运动步数');
+				var list = this.chartsList;
+				for (var j = 0; j < list.length; j++) {
+					xAxisData.push(list[j].recordTime);
+					seriesData.push(list[j].value);
 				}
+				series.push({
+					name: '运动步数',
+					type: 'bar',
+					stack: '',
+					data: seriesData
+				});
 				this.echarts(legendData, xAxisData, series);
 			},
 			//显示图表