Ver código fonte

feat:首页数据统计

zhanghui 1 ano atrás
pai
commit
6f22fff249
3 arquivos alterados com 40 adições e 7 exclusões
  1. 2 2
      common/js/env.js
  2. 8 0
      common/js/service.js
  3. 30 5
      pages/index/manager/manager.vue

+ 2 - 2
common/js/env.js

@@ -1,8 +1,8 @@
 "use strict";
 
 // let baseUrl = `https://jje.admin.xinyuekj.com.cn`
-let baseUrl = `https://jje.admin.xinyuekj.com.cn/test-api`
-// let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
+// let baseUrl = `https://jje.admin.xinyuekj.com.cn/test-api`
+let baseUrl = `http://65i1sxopd9qp.ngrok.xiaomiqiu123.top`
 // let baseUrl = `https://jje.xinyuekj.com.cn/prod-api`
 
 

+ 8 - 0
common/js/service.js

@@ -3,6 +3,14 @@ import request from '../js/request.js';
 
 export default {
 
+    //首页统计数据查询
+    homeStatics(data) {
+        return request({
+            url: '/expand/app/homeStatics',
+            method: 'GET',
+            data: data
+        })
+    },
 
     //获取推广人员跳转小程序的链接
     getExtensionId(data) {

+ 30 - 5
pages/index/manager/manager.vue

@@ -8,7 +8,7 @@
 						<text>累计专员数量</text>
 					</view>
 					<view class="number flex-row justify-center">
-						<text>2008</text>
+						<text>{{homeStaticsData.expandUserTotal || 0}}</text>
 					</view>
 				</view>
 				<view class="flex-col gridItem leftBorder" @click="navigateToPage('/pages/todaySpecialistsList/todaySpecialistsList')">
@@ -16,7 +16,7 @@
 						<text>今日新增专员</text>
 					</view>
 					<view class="number flex-row justify-center">
-						<text>2008</text>
+						<text>{{homeStaticsData.expandUserTotalToday || 0}}</text>
 					</view>
 				</view>
 				<view class="flex-col gridItem leftBorder">
@@ -24,7 +24,7 @@
 						<text>本月任务</text>
 					</view>
 					<view class="number flex-row justify-center">
-						<text>20/800</text>
+						<text>0/0</text>
 					</view>
 				</view>
 				<view class="flex-col gridItem">
@@ -32,7 +32,7 @@
 						<text>累计异业伙伴</text>
 					</view>
 					<view class="number flex-row justify-center">
-						<text>2008</text>
+						<text>0</text>
 					</view>
 				</view>
 				<view class="flex-col gridItem leftBorder">
@@ -40,12 +40,17 @@
 						<text>累计卖券金额</text>
 					</view>
 					<view class="number flex-row justify-center">
-						<text>2008</text>
+						<text>0</text>
 					</view>
 				</view>
 			</view>
 		</view>
 
+		<view class="flex-row">
+			<text>选择角色:</text>
+			<text v-for="i in roleList">{{i.name}}</text>
+		</view>
+
 		<view class="flex-row justify-center">
 			<view class="qrView" @click="qrCodePopup">
 				<uv-qrcode ref="qrcode" size="600rpx" :value="qrcodeUrl" :options="options"></uv-qrcode>
@@ -87,11 +92,15 @@
 					foregroundImageBorderRadius:5,
 					foregroundImageSrc: '/static/logo.png'
 				},
+				homeStaticsData:{},
+				roleList:[]
 			}
 		},
 		created() {
 			console.log('接收到的高度', this.height)
 			this.userInfo = uni.getStorageSync('spreadUserInfo')
+			this.homeStatics()
+			this.getRoleList()
 		},
 		methods: {
 			formatDate() {
@@ -110,6 +119,22 @@
 				})
 			},
 
+			getRoleList(){
+				this.$api.service.getRoleList().then(res=>{
+					console.log('获取角色列表',res)
+					this.roleList = res.data.data
+				})
+			},
+
+			homeStatics(){
+				this.$api.service.homeStatics({
+					type:2
+				}).then(res=>{
+					console.log('获取首页拓客数据',res)
+					this.homeStaticsData = res.data.data
+				})
+			},
+
 		}
 	}
 </script>