浏览代码

优化统计

吴洪双 5 年之前
父节点
当前提交
064d556642

+ 2 - 2
configs/env.js

@@ -9,8 +9,8 @@ let configs = {
 if (process.env.NODE_ENV === 'development') {
 if (process.env.NODE_ENV === 'development') {
 	// 测试环境
 	// 测试环境
 	configs = Object.assign(configs, {
 	configs = Object.assign(configs, {
-		baseUrl: 'https://app.sunzee.com.cn/ShenzeeServer',
-		// baseUrl: 'http://127.0.0.1:8090',
+		// baseUrl: 'https://app.sunzee.com.cn/ShenzeeServer',
+		baseUrl: 'http://127.0.0.1:8090',
 	});
 	});
 }
 }
 
 

+ 2 - 1
pages/Charts/elseStatistics.vue

@@ -1,5 +1,6 @@
 <!-- 单一统计图表 -->
 <!-- 单一统计图表 -->
 <template>
 <template>
+	<view>
 		<mainStatistics :pname="pnameData" :equipmentId="equipmentIdData" :adminId="adminIdData"></mainStatistics>
 		<mainStatistics :pname="pnameData" :equipmentId="equipmentIdData" :adminId="adminIdData"></mainStatistics>
 	</view>
 	</view>
 </template>
 </template>
@@ -46,4 +47,4 @@
 	}
 	}
 </script>
 </script>
 <style>
 <style>
-</style>
+</style>

+ 1 - 1
pages/Charts/equipmentStatistics.vue

@@ -246,10 +246,10 @@
 		name: 'equipmentStatistics',
 		name: 'equipmentStatistics',
 		props: {
 		props: {
 			adminId: '',
 			adminId: '',
+			pname: '',
 		},
 		},
 		data() {
 		data() {
 			return {
 			return {
-				pname: '',
 				cWidth: '',
 				cWidth: '',
 				cHeight: '',
 				cHeight: '',
 				pixelRatio: 1,
 				pixelRatio: 1,

+ 6 - 6
pages/User/equipmentSratisticsList.vue

@@ -9,7 +9,7 @@
 		</uni-collapse>	
 		</uni-collapse>	
 	</view>
 	</view>
 	<view v-else>
 	<view v-else>
-		<equipmentStatistics v-if="merchantList[0].id" :adminId="adminId" style="padding: 20upx;"></equipmentStatistics>
+		<equipmentStatistics v-if="firstMerchantAdminId" :adminId="firstMerchantAdminId" style="padding: 20upx;"></equipmentStatistics>
 		<view v-else style="text-align: center;">暂无数据</view>
 		<view v-else style="text-align: center;">暂无数据</view>
 	</view>
 	</view>
 </template>
 </template>
@@ -31,7 +31,6 @@
 		data() {
 		data() {
 			return {
 			return {
 				globalUser:{},
 				globalUser:{},
-				adminId: '',
 				merchantList:[{equipmentList:[]}],
 				merchantList:[{equipmentList:[]}],
 				extraIcon: {
 				extraIcon: {
 					color: '#4cd964',
 					color: '#4cd964',
@@ -42,9 +41,10 @@
 		},
 		},
 		computed: {
 		computed: {
 			...mapState(['loginUser']),
 			...mapState(['loginUser']),
-			adminIdData:{
+			firstMerchantAdminId:{
 				get(){
 				get(){
-					return this.adminId;
+					console.log('firstMerchantAdminId',this.merchantList[0].id)
+					return this.merchantList[0].id;
 				}
 				}
 			},
 			},
 			merchantListSize:{
 			merchantListSize:{
@@ -56,7 +56,6 @@
 		},
 		},
 		onShow(state){
 		onShow(state){
 			this.globalUser = uni.getStorageSync("globalUser");
 			this.globalUser = uni.getStorageSync("globalUser");
-			this.adminId = this.globalUser.id;
 			this.init();
 			this.init();
 		},
 		},
 		onLoad(state){
 		onLoad(state){
@@ -84,8 +83,9 @@
 				// console.log('getEquipmentListData')
 				// console.log('getEquipmentListData')
 				this.getEquipmentListByUser(this.globalUser)
 				this.getEquipmentListByUser(this.globalUser)
 				.then(data => {
 				.then(data => {
+					debugger
 					this.merchantList = data;
 					this.merchantList = data;
-					// console.log('merchantList2',this.merchantList.length)
+					console.log('getEquipmentListData',this.merchantList)
 					uni.stopPullDownRefresh();
 					uni.stopPullDownRefresh();
 				}
 				}
 				, _ => void uni.stopPullDownRefresh());
 				, _ => void uni.stopPullDownRefresh());

+ 1 - 1
pages/User/merchantList.vue

@@ -2,7 +2,7 @@
 <template>
 <template>
 	<view class="">
 	<view class="">
 		<view v-if="id!=1">
 		<view v-if="id!=1">
-			<view v-if="merchantList[0].equipmentList.length>1">
+			<view v-if="merchantList[0].equipmentList.length>0">
 				<uni-collapse :accordion="true">
 				<uni-collapse :accordion="true">
 					<uni-list>
 					<uni-list>
 						<uni-list-item :title="$t('merchantList.total')" @click="openByAdmin(merchantList[0].name,merchantList[0].id)" />
 						<uni-list-item :title="$t('merchantList.total')" @click="openByAdmin(merchantList[0].name,merchantList[0].id)" />