Jelajahi Sumber

成绩图表获取数据方法编写,组件更新数据方法编写,解决图表抖动bug,完善项目结构与规划数据流

KELECHUAN 3 tahun lalu
induk
melakukan
b01c88e3db
39 mengubah file dengan 1140 tambahan dan 354 penghapusan
  1. 30 12
      components/area-mini-chart/area-mini-chart.vue
  2. 14 10
      components/bar-mini-chart/bar-mini-chart.vue
  3. 16 10
      components/column-mini-chart/column-mini-chart.vue
  4. 16 11
      components/line-mini-chart/line-mini-chart.vue
  5. 34 29
      components/mainline-mini-chart/mainline-mini-chart.vue
  6. 16 12
      components/radar-mini-chart/radar-mini-chart.vue
  7. 2 5
      components/z-table/z-table.vue
  8. 70 6
      gradepkg/arcbar-chart/arcbar-chart.vue
  9. 58 15
      gradepkg/area-chart/area-chart.vue
  10. 57 5
      gradepkg/bar-chart/bar-chart.vue
  11. 55 2
      gradepkg/column-chart/column-chart.vue
  12. 62 6
      gradepkg/line-chart/line-chart.vue
  13. 56 3
      gradepkg/mainradar-chart/mainradar-chart.vue
  14. 66 2
      gradepkg/radar-chart/radar-chart.vue
  15. 117 4
      gradepkg/rose-chart/rose-chart.vue
  16. 2 0
      information/parent.js
  17. 19 21
      pages.json
  18. 0 87
      pages/approval/approval.vue
  19. 74 38
      pages/grade/grade.vue
  20. 40 18
      pages/home/home.vue
  21. 1 1
      pages/my/my.vue
  22. 63 0
      pages/subscribe/subscribe.vue
  23. 11 0
      uni_modules/uview-ui/changelog.md
  24. 4 0
      uni_modules/uview-ui/components/u-avatar/u-avatar.vue
  25. 4 0
      uni_modules/uview-ui/components/u-form-item/props.js
  26. 1 0
      uni_modules/uview-ui/components/u-form-item/u-form-item.vue
  27. 7 7
      uni_modules/uview-ui/components/u-form/u-form.vue
  28. 1 1
      uni_modules/uview-ui/components/u-picker/u-picker.vue
  29. 4 0
      uni_modules/uview-ui/components/u-search/props.js
  30. 2 1
      uni_modules/uview-ui/components/u-search/u-search.vue
  31. 2 2
      uni_modules/uview-ui/components/u-switch/props.js
  32. 4 4
      uni_modules/uview-ui/components/u-switch/u-switch.vue
  33. 1 1
      uni_modules/uview-ui/components/u-text/value.js
  34. 2 2
      uni_modules/uview-ui/libs/config/config.js
  35. 2 1
      uni_modules/uview-ui/libs/config/props/formItem.js
  36. 1 0
      uni_modules/uview-ui/libs/config/props/search.js
  37. 167 0
      uni_modules/uview-ui/libs/function/digit.js
  38. 53 36
      uni_modules/uview-ui/libs/function/index.js
  39. 6 2
      uni_modules/uview-ui/package.json

+ 30 - 12
components/area-mini-chart/area-mini-chart.vue

@@ -16,10 +16,33 @@
 	export default {
 		name: "area-mini-chart",
 		//定义props属性,用来接收外界传递到当前组件的数据
-		props: {
-			miniChartData: {
-				type: Object,
-				default: {
+		props: {},
+		data() {
+			return {
+				chartData: {},
+				queryObj: {}
+			};
+		},
+		methods: {
+			//获取图表数据
+			// async getChartData(){
+			//  this.queryObj = {
+			//	query: 'area',
+			//	tmdid: this.childreninfo.tmdid,
+			//	semester: this.semester
+			//}
+			// 	//发起请求
+			// 	const {data:res} = await uni.$http.post('https://',this.queryObj)
+			//  
+			// 	//判断请求获取结果
+			// 	if(res.meta.status !== 200) return uni.$showMsg()
+			// 	//为数据赋值:通过展开运算符的形式进行,新旧数据的拼接
+			// 	this.chartData = {categories:[...res.test],series[...res.object,...res.class,...res.grade]}
+			// },
+
+			//获取图表数据
+			getChartData() {
+				this.chartData = {
 					categories: [
 						"测验1",
 						"测验2",
@@ -66,14 +89,9 @@
 
 			}
 		},
-		data() {
-			return {
-				chartData: this.miniChartData
-
-			};
-		},
-		methods: {
-
+		//创建组件生命周期函数
+		created() {
+			this.getChartData()
 		}
 	}
 </script>

+ 14 - 10
components/bar-mini-chart/bar-mini-chart.vue

@@ -15,10 +15,16 @@
 <script>
 	export default {
 		name: "bar-mini-chart",
-		props: {
-			miniChartData: {
-				type: Object,
-				default: {
+		props: {},
+		data() {
+			return {
+				chartData: {},
+				queryObj: {}
+			};
+		},
+		methods:{
+			getChartData(){
+				this.chartData = {
 					categories: [
 						"数学",
 						"语文",
@@ -50,15 +56,13 @@
 							]
 						}
 					],
-
 				}
+				
 			}
 		},
-		data() {
-			return {
-				chartData: this.miniChartData
-
-			};
+		//创建组件生命周期函数
+		created(){
+			this.getChartData()
 		}
 	}
 </script>

+ 16 - 10
components/column-mini-chart/column-mini-chart.vue

@@ -21,10 +21,16 @@
 <script>
 	export default {
 		name:"column-mini-chart",
-		props:{
-			miniChartData: {
-				type: Object,
-				default: {
+		props:{},
+		data() {
+			return {
+				chartData: {},
+				queryObj: {}
+			};
+		},
+		methods:{
+			getChartData(){
+				this.chartData = {
 					categories: [
 						"数学",
 						"语文",
@@ -56,14 +62,14 @@
 							]
 						}
 					],
-					
 				}
+				
+				
 			}
-		},
-		data() {
-			return {
-				chartData: this.miniChartData	
-			};
+		},
+		//创建组件生命周期函数
+		created(){
+			this.getChartData()
 		}
 	}
 </script>

+ 16 - 11
components/line-mini-chart/line-mini-chart.vue

@@ -21,10 +21,16 @@
 <script>
 	export default {
 		name:"line-mini-chart",
-		props:{
-			miniChartData: {
-				type: Object,
-				default: {
+		props:{},
+		data() {
+			return {
+				chartData: {},
+				queryObj: {}
+			};
+		},
+		methods:{
+			getChartData(){
+				this.chartData = {
 					categories: [
 						"测验1",
 						"测验2",
@@ -63,15 +69,14 @@
 							]
 						}
 					],
-					
 				}
+				
+				
 			}
-		},
-		data() {
-			return {
-				chartData: this.miniChartData
-				
-			};
+		},
+		//创建组件生命周期函数
+		created(){
+			this.getChartData()
 		}
 	}
 </script>

+ 34 - 29
components/mainline-mini-chart/mainline-mini-chart.vue

@@ -14,38 +14,43 @@
 <script>
 	export default {
 		name:"mainline-mini-chart",
-		props: {
-			miniChartData: {
-				type: Object,
-				default: {
-					categories: [
-						"开学考试",
-						"第一月考",
-						"第二月考",
-						"期中考试",
-						"第三月考",
-						"期末考试"
-					],
-					series: [{
-						"name": "总成绩",
-						"data": [
-							555,
-							577,
-							540,
-							588,
-							563,
-							594
-						]
-					}],
-					
-				}
-			}
-		},
+		props: {},
 		data() {
-			return {		
-				chartData: this.miniChartData
+			return {	
+				chartData: {},
+				queryObj: {}
 
 			};
+		},
+		methods:{
+			getChartData(){
+				this.chartData = {
+					categories: [
+						"开学考试",
+						"第一月考",
+						"第二月考",
+						"期中考试",
+						"第三月考",
+						"期末考试"
+					],
+					series: [{
+						"name": "总成绩",
+						"data": [
+							555,
+							577,
+							540,
+							588,
+							563,
+							594
+						]
+					}],
+				}
+				
+			}
+		},
+		//创建组件生命周期函数
+		created(){
+			this.getChartData()
 		}
 	}
 </script>

+ 16 - 12
components/radar-mini-chart/radar-mini-chart.vue

@@ -20,10 +20,16 @@
 <script>
 	export default {
 		name:"radar-mini-chart",
-		props:{
-			miniChartData:{
-				type: Object,
-				default: {
+		props:{},
+		data() {
+			return {
+				chartData: {},
+				queryObj: {}
+			};
+		},
+		methods:{
+			getChartData(){
+				this.chartData = {
 					categories: ["语文",
 						"数学",
 						"英语",
@@ -65,16 +71,14 @@
 							]
 						}
 					],
-					
-					
 				}
+				
+				
 			}
-		},
-		data() {
-			return {
-				chartData: this.miniChartData
-				
-			};
+		},
+		//创建组件生命周期函数
+		created(){
+			this.getChartData()
 		}
 	}
 </script>

+ 2 - 5
components/z-table/z-table.vue

@@ -554,7 +554,6 @@
 			.z-table-container-col {
 				@include ellipsis();
 				display: flex;
-				padding-left: 18px;
 				height: 64rpx;
 				line-height: 64rpx;
 				box-sizing: border-box;
@@ -598,17 +597,15 @@
 			}
 
 			.z-table-bottom-col {
-				display: inline-flex;
 				align-items: center;
 				text-align: center;
-				padding: 16rpx;
 				box-sizing: border-box;
+				padding: 16rpx;
 			}
 
 			.z-table-bottom-text {
 				line-height: 100%;
 				box-sizing: border-box;
-				margin-left: 18rpx;
 			}
 
 			.z-table-bottom-text-title {
@@ -772,7 +769,7 @@
 			display: flex;
 			width: 100%;
 			flex: 1;
-			justify-content: flex-start;
+			justify-content: center;
 			align-content: center;
 			
 			&.text-center {

+ 70 - 6
gradepkg/arcbar-chart/arcbar-chart.vue

@@ -1,5 +1,14 @@
 <template>
 	<view class="page-box">
+		
+		<view class="children-box">
+			<image class="children-avatar" :src="childreninfo.avatar"></image>
+			<view class="children-msg">
+				<view class="children-name">{{childreninfo.name}}</view>
+				<view class="children-class">{{childreninfo.class}}</view>
+			</view>
+		</view>
+		
 		<view class="icon-box">
 			<view class="t-icon t-icon-xuexirenwu"></view>
 			<view class="t-icon t-icon-ceshi"></view>
@@ -28,30 +37,45 @@
 				<view class="item-text">{{chartData.series[0].name}}</view>
 				<view class="item-number">{{chartData.series[0].data/0.01}}%</view>
 				<view style="display: flex;align-items: center;">
-					<view class="t-icon t-icon-jiangbei-6"></view>
-					<view class="icon-text-item">继续加油!</view>
+					<view v-if="chartData.series[0].data<0.4" class="t-icon t-icon-jiangbei-20"></view>
+					<view v-if="chartData.series[0].data>=0.4 && chartData.series[0].data<0.7" class="t-icon t-icon-jiangbei-19"></view>
+					<view v-if="chartData.series[0].data>=0.7" class="t-icon t-icon-jiangbei-18"></view>
+					<view v-if="chartData.series[0].data<0.4" class="icon-text-item">要加把劲!</view>
+					<view v-if="chartData.series[0].data>=0.4 && chartData.series[0].data<0.7" class="icon-text-item">再接再厉!</view>
+					<view v-if="chartData.series[0].data>=0.7" class="icon-text-item">非常优秀!</view>
 				</view>
 			</view>
+			
 			<view class="data-box-item" v-bind:style="{background: chartData.series[1].color}">
 				<view class="item-text">{{chartData.series[1].name}}</view>
 				<view class="item-number">{{chartData.series[1].data/0.01}}%</view>
 				<view style="display: flex;align-items: center;">
-					<view class="t-icon t-icon-jiangbei-6"></view>
-					<view class="icon-text-item">继续加油!</view>
+					<view v-if="chartData.series[1].data<0.4" class="t-icon t-icon-jiangbei-20"></view>
+					<view v-if="chartData.series[1].data>=0.4 && chartData.series[1].data<0.7" class="t-icon t-icon-jiangbei-19"></view>
+					<view v-if="chartData.series[1].data>=0.7" class="t-icon t-icon-jiangbei-18"></view>
+					<view v-if="chartData.series[1].data<0.4" class="icon-text-item">要加把劲!</view>
+					<view v-if="chartData.series[1].data>=0.4 && chartData.series[1].data<0.7" class="icon-text-item">再接再厉!</view>
+					<view v-if="chartData.series[1].data>=0.7" class="icon-text-item">非常优秀!</view>
 				</view>
 			</view>
+			
 		</view>
 	</view>
 </template>
 
 <script>
+	import {mapState} from 'vuex'
+	
 	export default {
+		computed:{
+			...mapState('m_children',['childreninfo','semester'])
+		},
 		data() {
 			return {
 				chartData: {
 					series: [{
 							"name": "超过年级中:",
-							"data": 0.84,
+							"data": 0.6,
 							"color": "#0052d4"
 						},
 						{
@@ -61,6 +85,9 @@
 						}
 					],
 				},
+				//查询参数
+				queryObj: {},
+				
 			};
 		},
 		methods:{
@@ -70,6 +97,13 @@
 					url: '/pages/grade/grade'
 				})
 			},
+			//获取表格数据
+			// async getChartData(){
+				
+			// },
+		},
+		onLoad(){
+			// this.getChartData()
 		}
 	}
 </script>
@@ -78,11 +112,41 @@
 	.page-box{
 		height: 600rpx;
 		background: linear-gradient(#419eea, #f1f3f5);
+		.children-box{
+			display: flex;
+			align-items: center;
+			.children-avatar{
+				margin-top: 150rpx;
+				margin-left: 40rpx;
+				width: 96rpx;
+				height: 96rpx;
+				border-radius: 50rpx;
+				border: 4rpx solid #FFFFFF;
+				box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
+			}
+			.children-msg{
+				margin-top: 150rpx;
+				margin-left: 30rpx;
+				
+				.children-name{
+					color: #3B4144;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-bottom: 10rpx;
+				}
+				.children-class{
+					color: #696969;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-top: 10rpx;
+				}
+			}
+		}
 		.icon-box{
 			display: flex;
 			justify-content: space-between;
 			margin: 0 80rpx 20rpx 80rpx;
-			padding-top: 200rpx;
+			padding-top: 60rpx;
 			.icon-text{
 				font-weight: bold;
 				font-size: 26rpx;

+ 58 - 15
gradepkg/area-chart/area-chart.vue

@@ -1,5 +1,14 @@
 <template>
 	<view class="page-box">
+		
+		<view class="children-box">
+			<image class="children-avatar" :src="childreninfo.avatar"></image>
+			<view class="children-msg">
+				<view class="children-name">{{childreninfo.name}}</view>
+				<view class="children-class">{{childreninfo.class}}</view>
+			</view>
+		</view>
+		
 		<view class="icon-box">
 			<view class="t-icon t-icon-chengji1"></view>
 			
@@ -18,10 +27,10 @@
 		<view class="chart-container">
 			<view class="chart-name">
 				<view class="t-icon t-icon-buoumao-zhongdianse"></view>
-				<text class="chart-name-text">单科成绩走向图</text>
+				<text class="chart-name-text">单科成绩对比</text>
 				<!-- 选择器 -->
 				<view class="chart-name-btn">
-					<u-picker :show="show" :columns="subject" ref="uPicker" @confirm="selectSubject" @cancel="selectCancel">
+					<u-picker :show="show" :columns="subject" ref="uPicker" @confirm="selectSubject" @cancel="selectCancel" :closeOnClickOverlay="true">
 					</u-picker>
 				</view>
 			</view>
@@ -34,20 +43,20 @@
 </template>
 
 <script>
+	import {mapState} from 'vuex'
+	
 	export default {
+		computed:{
+			...mapState('m_children',['childreninfo','semester'])
+		},
+		
 		data() {
 			return {
 
 				show: false,
-				//是否正在加载
-				isLoading: false,
 				subject: [
 					['语文', '数学', '英语', '体育', '思品', '科学']
 				],
-				//请求参数对象
-				queryObj: {
-					
-				},
 
 				chartData: {
 					categories: [
@@ -93,29 +102,33 @@
 						}
 					],
 				},
-
+				//查询参数
+				queryObj: {},
 
 			};
 		},
 		onLoad(){
-			// this.getChartData();
+			// this.getChartData()
 		},
 		methods: {
 			
 			//获取图表数据
 			// async getChartData(){
-			// 	//打开节流阀
-			// 	this.isLoading = true
+			//  this.queryObj = {
+			//	query: 'tableData',
+			//	tmdid: this.childreninfo.tmdid,
+			//	semester: this.semester
+			//}
 			// 	//发起请求
 			// 	const {data:res} = await uni.$http.post('https://',this.queryObj)
-			// 	//关闭节流阀
-			// 	this.isLoading = false
+			//  
 			// 	//判断请求获取结果
 			// 	if(res.meta.status !== 200) return uni.$showMsg()
 			// 	//为数据赋值:通过展开运算符的形式进行,新旧数据的拼接
 			// 	this.chartData = {categories:[...res.test],series[...res.object,...res.class,...res.grade]}
 			// },
 			
+			//选择科目
 			selectSubject(e) {
 				console.log('selectSubject', e)
 				// this.queryObj = e.value[0]
@@ -142,11 +155,41 @@
 	.page-box{
 		height: 600rpx;
 		background: linear-gradient(#ff6187, #f1f3f5);
+		.children-box{
+			display: flex;
+			align-items: center;
+			.children-avatar{
+				margin-top: 150rpx;
+				margin-left: 40rpx;
+				width: 96rpx;
+				height: 96rpx;
+				border-radius: 50rpx;
+				border: 4rpx solid #FFFFFF;
+				box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
+			}
+			.children-msg{
+				margin-top: 150rpx;
+				margin-left: 30rpx;
+				
+				.children-name{
+					color: #3B4144;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-bottom: 10rpx;
+				}
+				.children-class{
+					color: #696969;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-top: 10rpx;
+				}
+			}
+		}
 		.icon-box{
 			display: flex;
 			justify-content: space-between;
 			margin: 0 80rpx 20rpx 80rpx;
-			padding-top: 200rpx;
+			padding-top: 60rpx;
 			.icon-text{
 				font-weight: bold;
 				font-size: 26rpx;

+ 57 - 5
gradepkg/bar-chart/bar-chart.vue

@@ -1,5 +1,14 @@
 <template>
 	<view class="page-box">
+		
+		<view class="children-box">
+			<image class="children-avatar" :src="childreninfo.avatar"></image>
+			<view class="children-msg">
+				<view class="children-name">{{childreninfo.name}}</view>
+				<view class="children-class">{{childreninfo.class}}</view>
+			</view>
+		</view>
+		
 		<view class="icon-box">
 			<view class="t-icon t-icon-xuexirenwu"></view>
 
@@ -34,7 +43,13 @@
 </template>
 
 <script>
+	import {mapState} from 'vuex'
+	
 	export default {
+		computed:{
+			...mapState('m_children',['childreninfo','semester'])
+		},
+		
 		data() {
 			return {
 				target: false,
@@ -72,7 +87,8 @@
 						}
 					],
 				},
-
+				//查询参数
+				queryObj: {},
 
 			};
 		},
@@ -86,6 +102,13 @@
 					url: '/pages/grade/grade'
 				})
 			},
+			//获取表格数据
+			// async getChartData(){
+				
+			// },
+		},
+		onLoad(){
+			// this.getChartData()
 		}
 	}
 </script>
@@ -95,13 +118,42 @@
 		height: 600rpx;
 		background: linear-gradient(#5fb7ff, #f1f3f5);
 
-		.icon-box {
+		.children-box{
+			display: flex;
+			align-items: center;
+			.children-avatar{
+				margin-top: 150rpx;
+				margin-left: 40rpx;
+				width: 96rpx;
+				height: 96rpx;
+				border-radius: 50rpx;
+				border: 4rpx solid #FFFFFF;
+				box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
+			}
+			.children-msg{
+				margin-top: 150rpx;
+				margin-left: 30rpx;
+				
+				.children-name{
+					color: #3B4144;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-bottom: 10rpx;
+				}
+				.children-class{
+					color: #696969;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-top: 10rpx;
+				}
+			}
+		}
+		.icon-box{
 			display: flex;
 			justify-content: space-between;
 			margin: 0 80rpx 20rpx 80rpx;
-			padding-top: 200rpx;
-
-			.icon-text {
+			padding-top: 60rpx;
+			.icon-text{
 				font-weight: bold;
 				font-size: 26rpx;
 				color: #3B4144;

+ 55 - 2
gradepkg/column-chart/column-chart.vue

@@ -1,5 +1,14 @@
 <template>
 	<view class="page-box">
+		
+		<view class="children-box">
+			<image class="children-avatar" :src="childreninfo.avatar"></image>
+			<view class="children-msg">
+				<view class="children-name">{{childreninfo.name}}</view>
+				<view class="children-class">{{childreninfo.class}}</view>
+			</view>
+		</view>
+		
 		<view class="icon-box">
 			<view class="t-icon t-icon-xuexirenwu"></view>
 			<view class="t-icon t-icon-ceshi"></view>
@@ -25,7 +34,13 @@
 </template>
 
 <script>
+	import {mapState} from 'vuex'
+	
 	export default {
+		computed:{
+			...mapState('m_children',['childreninfo','semester'])
+		},
+		
 		data() {
 			return {
 				chartData: {
@@ -61,7 +76,8 @@
 						}
 					],
 				},
-
+				//查询参数
+				queryObj: {},
 
 			};
 		},
@@ -72,6 +88,13 @@
 					url: '/pages/grade/grade'
 				})
 			},
+			//获取表格数据
+			// async getChartData(){
+				
+			// },
+		},
+		onLoad(){
+			// this.getChartData()
 		}
 	}
 </script>
@@ -80,11 +103,41 @@
 	.page-box{
 		height: 600rpx;
 		background: linear-gradient(#f9cd98, #f1f3f5);
+		.children-box{
+			display: flex;
+			align-items: center;
+			.children-avatar{
+				margin-top: 150rpx;
+				margin-left: 40rpx;
+				width: 96rpx;
+				height: 96rpx;
+				border-radius: 50rpx;
+				border: 4rpx solid #FFFFFF;
+				box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
+			}
+			.children-msg{
+				margin-top: 150rpx;
+				margin-left: 30rpx;
+				
+				.children-name{
+					color: #3B4144;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-bottom: 10rpx;
+				}
+				.children-class{
+					color: #696969;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-top: 10rpx;
+				}
+			}
+		}
 		.icon-box{
 			display: flex;
 			justify-content: space-between;
 			margin: 0 80rpx 20rpx 80rpx;
-			padding-top: 200rpx;
+			padding-top: 60rpx;
 			.icon-text{
 				font-weight: bold;
 				font-size: 26rpx;

+ 62 - 6
gradepkg/line-chart/line-chart.vue

@@ -1,5 +1,14 @@
 <template>
 	<view class="page-box">
+		
+		<view class="children-box">
+			<image class="children-avatar" :src="childreninfo.avatar"></image>
+			<view class="children-msg">
+				<view class="children-name">{{childreninfo.name}}</view>
+				<view class="children-class">{{childreninfo.class}}</view>
+			</view>
+		</view>
+		
 		<view class="icon-box">
 			<view class="t-icon t-icon-xuexirenwu"></view>
 			<view class="t-icon t-icon-ceshi"></view>
@@ -24,8 +33,14 @@
 	</view>
 </template>
 
-<script>
-	export default {
+<script>
+	import {mapState} from 'vuex'
+	
+	export default {
+		computed:{
+			...mapState('m_children',['childreninfo','semester'])
+		},
+		
 		data() {
 			return {
 				chartData: {
@@ -67,8 +82,11 @@
 							]
 						}
 					],
-				},
-			};
+				},
+				//查询参数
+				queryObj: {},
+				
+			}
 		},
 		methods:{
 			//返回成绩页面
@@ -77,8 +95,14 @@
 					url: '/pages/grade/grade'
 				})
 			},
+			//获取表格数据
+			// async getChartData(){
+				
+			// },
 		},
-		
+		onLoad(){
+			// this.getChartData()
+		}
 	}
 </script>
 
@@ -86,17 +110,49 @@
 	.page-box{
 		height: 600rpx;
 		background: linear-gradient(#5fb7ff, #f1f3f5);
+		
+		.children-box{
+			display: flex;
+			align-items: center;
+			.children-avatar{
+				margin-top: 150rpx;
+				margin-left: 40rpx;
+				width: 96rpx;
+				height: 96rpx;
+				border-radius: 50rpx;
+				border: 4rpx solid #FFFFFF;
+				box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
+			}
+			.children-msg{
+				margin-top: 150rpx;
+				margin-left: 30rpx;
+				
+				.children-name{
+					color: #3B4144;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-bottom: 10rpx;
+				}
+				.children-class{
+					color: #696969;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-top: 10rpx;
+				}
+			}
+		}
 		.icon-box{
 			display: flex;
 			justify-content: space-between;
 			margin: 0 80rpx 20rpx 80rpx;
-			padding-top: 200rpx;
+			padding-top: 60rpx;
 			.icon-text{
 				font-weight: bold;
 				font-size: 26rpx;
 				color: #3B4144;
 			}
 		}
+		
 		.chart-container {
 			margin: 0 20rpx;
 			padding: 0rpx 10rpx 0rpx 0rpx;

+ 56 - 3
gradepkg/mainradar-chart/mainradar-chart.vue

@@ -1,5 +1,14 @@
 <template>
 	<view class="page-box">
+		
+		<view class="children-box">
+			<image class="children-avatar" :src="childreninfo.avatar"></image>
+			<view class="children-msg">
+				<view class="children-name">{{childreninfo.name}}</view>
+				<view class="children-class">{{childreninfo.class}}</view>
+			</view>
+		</view>
+		
 		<view class="icon-box">
 			<view class="t-icon t-icon-xuexirenwu"></view>
 			<view class="t-icon t-icon-ceshi"></view>
@@ -15,7 +24,7 @@
 		<view class="chart-container">
 			<view class="chart-name">
 				<view class="t-icon t-icon-buoumao-zhongdianse"></view>
-				<text class="chart-name-text">成绩雷达</text>
+				<text class="chart-name-text">成绩雷达</text>
 			</view>
 			<!-- 图表 -->
 			<view class="charts-box">
@@ -26,7 +35,13 @@
 </template>
 
 <script>
+	import {mapState} from 'vuex'
+	
 	export default {
+		computed:{
+			...mapState('m_children',['childreninfo','semester'])
+		},
+		
 		data() {
 			return {
 				chartData: {
@@ -72,7 +87,8 @@
 						}
 					],
 				},
-
+				//查询参数
+				queryObj: {},
 
 			};
 		},
@@ -83,6 +99,13 @@
 					url: '/pages/grade/grade'
 				})
 			},
+			//获取表格数据
+			// async getChartData(){
+				
+			// },
+		},
+		onLoad(){
+			// this.getChartData()
 		}
 	}
 </script>
@@ -91,11 +114,41 @@
 	.page-box{
 		height: 600rpx;
 		background: linear-gradient(#ff6187, #f1f3f5);
+		.children-box{
+			display: flex;
+			align-items: center;
+			.children-avatar{
+				margin-top: 150rpx;
+				margin-left: 40rpx;
+				width: 96rpx;
+				height: 96rpx;
+				border-radius: 50rpx;
+				border: 4rpx solid #FFFFFF;
+				box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
+			}
+			.children-msg{
+				margin-top: 150rpx;
+				margin-left: 30rpx;
+				
+				.children-name{
+					color: #3B4144;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-bottom: 10rpx;
+				}
+				.children-class{
+					color: #696969;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-top: 10rpx;
+				}
+			}
+		}
 		.icon-box{
 			display: flex;
 			justify-content: space-between;
 			margin: 0 80rpx 20rpx 80rpx;
-			padding-top: 200rpx;
+			padding-top: 60rpx;
 			.icon-text{
 				font-weight: bold;
 				font-size: 26rpx;

+ 66 - 2
gradepkg/radar-chart/radar-chart.vue

@@ -1,5 +1,14 @@
 <template>
 	<view class="page-box">
+		
+		<view class="children-box">
+			<image class="children-avatar" :src="childreninfo.avatar"></image>
+			<view class="children-msg">
+				<view class="children-name">{{childreninfo.name}}</view>
+				<view class="children-class">{{childreninfo.class}}</view>
+			</view>
+		</view>
+		
 		<view class="icon-box">
 			<view class="t-icon t-icon-xuexirenwu"></view>
 			<view class="t-icon t-icon-ceshi"></view>
@@ -32,7 +41,13 @@
 </template>
 
 <script>
+	import {mapState} from 'vuex'
+	
 	export default {
+		computed:{
+			...mapState('m_children',['childreninfo','semester'])
+		},
+		
 		data() {
 			return {
 				show: false,
@@ -70,10 +85,22 @@
 								91,
 								81
 							]
+						},
+						{
+							"name": "年级平均",
+							"data": [
+								77,
+								78,
+								73,
+								80,
+								86,
+								82
+							]
 						}
 					],
 				},
-
+				//查询参数
+				queryObj: {},
 
 			};
 		},
@@ -89,6 +116,13 @@
 					url: '/pages/grade/grade'
 				})
 			},
+			//获取表格数据
+			// async getChartData(){
+				
+			// },
+		},
+		onLoad(){
+			// this.getChartData()
 		}
 	}
 </script>
@@ -97,11 +131,41 @@
 	.page-box{
 		height: 600rpx;
 		background: linear-gradient(#c1cbf7, #f1f3f5);
+		.children-box{
+			display: flex;
+			align-items: center;
+			.children-avatar{
+				margin-top: 150rpx;
+				margin-left: 40rpx;
+				width: 96rpx;
+				height: 96rpx;
+				border-radius: 50rpx;
+				border: 4rpx solid #FFFFFF;
+				box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
+			}
+			.children-msg{
+				margin-top: 150rpx;
+				margin-left: 30rpx;
+				
+				.children-name{
+					color: #3B4144;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-bottom: 10rpx;
+				}
+				.children-class{
+					color: #696969;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-top: 10rpx;
+				}
+			}
+		}
 		.icon-box{
 			display: flex;
 			justify-content: space-between;
 			margin: 0 80rpx 20rpx 80rpx;
-			padding-top: 200rpx;
+			padding-top: 60rpx;
 			.icon-text{
 				font-weight: bold;
 				font-size: 26rpx;

+ 117 - 4
gradepkg/rose-chart/rose-chart.vue

@@ -1,5 +1,14 @@
 <template>
 	<view class="page-box">
+		
+		<view class="children-box">
+			<image class="children-avatar" :src="childreninfo.avatar"></image>
+			<view class="children-msg">
+				<view class="children-name">{{childreninfo.name}}</view>
+				<view class="children-class">{{childreninfo.class}}</view>
+			</view>
+		</view>
+		
 		<view class="icon-box">
 			<view class="t-icon t-icon-xuexirenwu"></view>
 			<view class="t-icon t-icon-ceshi"></view>
@@ -19,15 +28,41 @@
 			</view>
 
 			<view class="charts-box">
-				<qiun-data-charts type="rose" :chartData="chartData" :loadingType="4" background="none"
-					:tapLegend="true" />
+				<qiun-data-charts type="rose" :chartData="chartData" :loadingType="4" :tapLegend="true" />
 			</view>
 		</view>
+		
+		<!-- 数据分析模块 -->
+		<!-- <view class="data-box">
+			<view class="data-box-item" v-bind:style="{background: chartData.series[0].color}">
+				<view class="item-text">{{chartData.series[0].name}}</view>
+				<view class="item-number">{{chartData.series[0].data/0.01}}%</view>
+				<view style="display: flex;align-items: center;">
+					<view class="t-icon t-icon-jiangbei-6"></view>
+					<view class="icon-text-item">继续加油!</view>
+				</view>
+			</view>
+			<view class="data-box-item" v-bind:style="{background: chartData.series[1].color}">
+				<view class="item-text">{{chartData.series[1].name}}</view>
+				<view class="item-number">{{chartData.series[1].data/0.01}}%</view>
+				<view style="display: flex;align-items: center;">
+					<view class="t-icon t-icon-jiangbei-6"></view>
+					<view class="icon-text-item">继续加油!</view>
+				</view>
+			</view>
+		</view> -->
+		
 	</view>
 </template>
 
 <script>
+	import {mapState} from 'vuex'
+	
 	export default {
+		computed:{
+			...mapState('m_children',['childreninfo','semester'])
+		},
+		
 		data() {
 			return {
 				chartData: {
@@ -59,7 +94,8 @@
 						]
 					}]
 				},
-
+				//查询参数
+				queryObj: {},
 
 			};
 		},
@@ -70,6 +106,13 @@
 					url: '/pages/grade/grade'
 				})
 			},
+			//获取表格数据
+			// async getChartData(){
+				
+			// },
+		},
+		onLoad(){
+			// this.getChartData()
 		}
 	}
 </script>
@@ -78,11 +121,41 @@
 	.page-box{
 		height: 600rpx;
 		background: linear-gradient(#f97f41, #f1f3f5);
+		.children-box{
+			display: flex;
+			align-items: center;
+			.children-avatar{
+				margin-top: 150rpx;
+				margin-left: 40rpx;
+				width: 96rpx;
+				height: 96rpx;
+				border-radius: 50rpx;
+				border: 4rpx solid #FFFFFF;
+				box-shadow: 0 10rpx 20rpx rgba(0, 0, 0, 0.2);
+			}
+			.children-msg{
+				margin-top: 150rpx;
+				margin-left: 30rpx;
+				
+				.children-name{
+					color: #3B4144;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-bottom: 10rpx;
+				}
+				.children-class{
+					color: #696969;
+					font-size: 32rpx;
+					font-weight: bold;
+					margin-top: 10rpx;
+				}
+			}
+		}
 		.icon-box{
 			display: flex;
 			justify-content: space-between;
 			margin: 0 80rpx 20rpx 80rpx;
-			padding-top: 200rpx;
+			padding-top: 60rpx;
 			.icon-text{
 				font-weight: bold;
 				font-size: 26rpx;
@@ -120,5 +193,45 @@
 				height: 550rpx;
 			}
 		}
+		// .data-box{
+		// 	display: flex;
+		// 	flex-direction: row;
+		// 	align-items: center;
+		// 	flex-wrap: wrap;
+		// 	justify-content: space-between;
+		// 	margin: 20rpx;
+		// 	.data-box-item{
+		// 		display: flex;
+		// 		flex-direction: column;
+		// 		background-color: #FFFFFF;
+		// 		border-radius: 15rpx;
+		// 		width: 340rpx;
+		// 		box-shadow: 0 4rpx 8rpx rgba(0,0,0,0.1);
+		// 		.item-text{
+		// 			font-size: 30rpx;
+		// 			font-weight: bold;
+		// 			color: #FFFFFF;
+		// 			margin: 30rpx 0 0 30rpx;
+		// 		}
+		// 		.t-icon{
+		// 			margin-bottom: 30rpx;
+		// 			margin-left: 20rpx;
+		// 			width: 100rpx;
+		// 			height: 100rpx;
+		// 		}
+		// 		.item-number{
+		// 			font-size: 80rpx;
+		// 			margin-left: 30rpx;
+		// 			color: #FFFFFF;
+		// 			font-weight: bold;
+		// 		}
+		// 	}
+		// }
 	}
+	// .icon-text-item{
+	// 	font-size: 30rpx;
+	// 	font-weight: bold;
+	// 	color: #FFFFFF;
+	// 	margin-left: 10rpx;
+	// }
 </style>

+ 2 - 0
information/parent.js

@@ -27,11 +27,13 @@ export default {
 				avatar: '/static/default-icons/boy.png',
 				name: '张三',
 				classid: '0301',
+				class: '三年级一班',
 				tmdid: 'tmdid01'
 			}, {
 				avatar: '/static/default-icons/girl.png',
 				name: '张梅',
 				classid: '0504',
+				class: '五年级四班',
 				tmdid: 'tmdid03'
 			},
 			]

+ 19 - 21
pages.json

@@ -23,7 +23,7 @@
 			}
 
 		}, {
-			"path": "pages/approval/approval",
+			"path": "pages/subscribe/subscribe",
 			"style": {
 				"enablePullDownRefresh": false,
 				"navigationStyle": "custom"
@@ -57,17 +57,15 @@
 					"navigationStyle": "custom",
 					"disableScroll": true
 				}
+			}, {
+				"path": "children/children",
+				"style": {
+					"navigationBarTitleText": "",
+					"enablePullDownRefresh": false
+				}
+
 			}
-		    ,{
-                    "path" : "children/children",
-                    "style" :                                                                                    
-                {
-                    "navigationBarTitleText": "",
-                    "enablePullDownRefresh": false
-                }
-                
-                }
-            ]
+		]
 	}, {
 		"root": "gradepkg",
 		"pages": [{
@@ -76,7 +74,7 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false,
 				//"navigationBarBackgroundColor":"#f97f41"
-				"navigationStyle":"custom"
+				"navigationStyle": "custom"
 			}
 		}, {
 			"path": "radar-chart/radar-chart",
@@ -84,7 +82,7 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false,
 				//"navigationBarBackgroundColor":"#c1cbf7"
-				"navigationStyle":"custom"
+				"navigationStyle": "custom"
 			}
 
 		}, {
@@ -93,7 +91,7 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false,
 				//"navigationBarBackgroundColor":"#5fb7ff"
-				"navigationStyle":"custom"
+				"navigationStyle": "custom"
 			}
 
 		}, {
@@ -102,7 +100,7 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false,
 				// "navigationBarBackgroundColor":"#ff6187"
-				"navigationStyle":"custom"
+				"navigationStyle": "custom"
 			}
 
 		}, {
@@ -111,7 +109,7 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false,
 				//"navigationBarBackgroundColor":"#f9cd98"
-				"navigationStyle":"custom"
+				"navigationStyle": "custom"
 			}
 
 		}, {
@@ -120,7 +118,7 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false,
 				// "navigationBarBackgroundColor":"#419eea"
-				"navigationStyle":"custom"
+				"navigationStyle": "custom"
 			}
 
 		}, {
@@ -129,7 +127,7 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false,
 				// "navigationBarBackgroundColor":"#5fb7ff"
-				"navigationStyle":"custom"
+				"navigationStyle": "custom"
 			}
 
 		}, {
@@ -138,7 +136,7 @@
 				"navigationBarTitleText": "",
 				"enablePullDownRefresh": false,
 				//"navigationBarBackgroundColor":"#ff6187"
-				"navigationStyle":"custom"
+				"navigationStyle": "custom"
 			}
 
 		}]
@@ -211,10 +209,10 @@
 				"text": "成绩"
 			},
 			{
-				"pagePath": "pages/approval/approval",
+				"pagePath": "pages/subscribe/subscribe",
 				"iconPath": "static/tab-icons/approval.png",
 				"selectedIconPath": "static/tab-icons/approval.png",
-				"text": "审批"
+				"text": "订阅"
 			},
 			{
 				"pagePath": "pages/my/my",

+ 0 - 87
pages/approval/approval.vue

@@ -1,87 +0,0 @@
-<template>
-  <!-- <view class="container">
-		<top-box></top-box>
-    <view class="u-demo-block">
-      <text class="u-demo-block__title"></text>
-      <view class="u-demo-block__content">
-        <view class="album">
-          <view class="album__avatar">
-            <image
-              :src="parentinfo.avatarUrl"
-              mode=""
-              style="width: 32px;height: 32px;"
-            ></image>
-          </view>
-          <view class="album__content">
-            <u--text
-              text="XXX"
-              type="primary"
-              bold
-              size="17"
-            ></u--text>
-            <u--text
-              margin="0 0 8px 0"
-              text="孩子的校园生活与成长记录"
-            ></u--text>
-            <u-album :urls="urls2"></u-album>
-          </view>
-        </view>
-      </view>
-    </view>
-  </view> -->
-</template>
-
-<script>
-	import {mapState} from 'vuex'
-    export default {
-        data() {
-            return {
-                // albumWidth: 0,
-                // urls2: [
-                //     'https://cdn.uviewui.com/uview/album/1.jpg',
-                //     'https://cdn.uviewui.com/uview/album/2.jpg',
-                //     'https://cdn.uviewui.com/uview/album/3.jpg',
-                //     'https://cdn.uviewui.com/uview/album/4.jpg',
-                //     'https://cdn.uviewui.com/uview/album/5.jpg',
-                //     'https://cdn.uviewui.com/uview/album/6.jpg',
-                //     'https://cdn.uviewui.com/uview/album/7.jpg',
-                //     'https://cdn.uviewui.com/uview/album/8.jpg',
-                //     'https://cdn.uviewui.com/uview/album/9.jpg',
-                //     'https://cdn.uviewui.com/uview/album/10.jpg',
-                // ],
-            }
-        },
-				computed:{
-					...mapState('m_parent',['parentinfo'])
-				}
-    }
-</script>
-
-<style lang="scss">
-	// .container{
-	// 	height: 100%;
-	// 	.home-topinfo{
-	// 		background: linear-gradient(#ff5959, #f1f3f5);
-	// 	}
-	// 	.u-demo-block{
-	// 		margin-left: 34rpx;
-	// 		margin-top: -30rpx;
-	// 	}
-	// 	.album {
- //        @include flex;
- //        align-items: flex-start;
-
- //        &__avatar {
- //             background-color: $u-bg-color;
- //             padding: 10rpx;
- //             border-radius: 6rpx;
- //         }
-    
- //        &__content {
- //             margin-left: 20rpx;
- //             flex: 1;
- //         }
- //    }
-	// }
-    
-</style>

+ 74 - 38
pages/grade/grade.vue

@@ -73,76 +73,113 @@
 </template>
 
 <script>
+	import {
+		mapState
+	} from 'vuex'
+	
 	export default {
+		computed:{
+			...mapState('m_children',['childreninfo','semester'])
+		},
 		data() {
 			return {
 				tableData: [
 				{
-					'name':'数学',
-					'open':83,
-					'mid':95,
-					'final':96
+					'科目':'数学',
+					'开学':83,
+					'期中':95,
+					'期末':96,
+					'毕业':96,
+					'升学':96
 				},
 				{
-					'name':'语文',
-					'open':93,
-					'mid':90,
-					'final':96
+					'科目':'语文',
+					'开学':93,
+					'期中':90,
+					'期末':96,
+					'毕业':96,
+					'升学':96
 				},
 				{
-					'name':'英语',
-					'open':99,
-					'mid':82,
-					'final':96
+					'科目':'英语',
+					'开学':99,
+					'期中':82,
+					'期末':96,
+					'毕业':96,
+					'升学':96
 				},
 				{
-					'name':'体育',
-					'open':99,
-					'mid':97,
-					'final':96
+					'科目':'体育',
+					'开学':99,
+					'期中':97,
+					'期末':96,
+					'毕业':96,
+					'升学':96
 				},
 				{
-					'name':'科学',
-					'open':99,
-					'mid':92,
-					'final':96
+					'科目':'科学',
+					'开学':99,
+					'期中':92,
+					'期末':96,
+					'毕业':96,
+					'升学':96
 				},
 				{
-					'name':'思品',
-					'open':99,
-					'mid':94,
-					'final':96
+					'科目':'思品',
+					'开学':99,
+					'期中':94,
+					'期末':96,
+					'毕业':96,
+					'升学':96
 				}
 				],
 				columns: [
 					{
 						'title':'科目',
-						'key':'name',
+						'key':'科目',
 					},
 					{
 						'title':'开学',
-						'key':'open',
+						'key':'开学',
 					},
 					{
 						'title':'期中',
-						'key':'mid',
+						'key':'期中',
 					},
 					{
 						'title':'期末',
-						'key':'final',
+						'key':'期末',
+					},
+					{
+						'title':'毕业',
+						'key':'毕业',
+					},
+					{
+						'title':'升学',
+						'key':'升学',
 					}
-				]
+				],
+				//查询参数
+				queryObj: {},
 				
 				
 			}
-		},
-		mounted() {
-
 		},
 		methods: {
-			open(e) {
-				console.log(e);
-			},
+			
+			//获取表格数据
+			// async getTableData(){
+			// 	this.queryObj = {
+			// 		query: 'tableData',
+			// 		tmdid: this.childreninfo.tmdid,
+			// 		semester: this.semester
+			// 	}
+			// 	const {data:res} = await uni.$http.get('',this.queryObj)
+			// 	if(res.meta.status !== 200) return uni.$showMsg()
+			// 	this.tableData = [...res.test]
+			// 	this.columns = [...res.column]
+			// },
+			
 			//导航柱状图页面
 			navColumnChart(e) {
 				console.log(e);
@@ -186,8 +223,7 @@
 				})
 			},
 			//导航到条状图页
-			navBarChart(e) {
-				console.log(e);
+			navBarChart() {
 				uni.navigateTo({
 					url: "/gradepkg/bar-chart/bar-chart"
 				})
@@ -202,7 +238,7 @@
 
 		},
 		onLoad() {
-
+			// this.getTableData()
 		}
 	}
 </script>

+ 40 - 18
pages/home/home.vue

@@ -10,33 +10,52 @@
 		<!-- 孩子全方位展示 -->
 		<view class="title">德</view>
 		<view class="card">
-			<view class="t-icon t-icon-a-aixinxihuan"></view>
-			<view class="card-title">今日表现</view>
+			<view style="display: flex; justify-content: flex-start; width: 100%;">
+				<view class="t-icon t-icon-a-aixinxihuan"></view>
+				<view class="card-title">今日表现</view>
+			</view>
 		</view>
+		
 		<view class="title">智</view>
 		<view class="card">
-			<view class="t-icon t-icon-a-dengpaodengzhuyichuangzao"></view>
-			<view class="card-title">今日表现</view>
+			
+			<view style="display: flex; justify-content: flex-start; width: 100%;">
+				<view class="t-icon t-icon-a-dengpaodengzhuyichuangzao"></view>
+				<view class="card-title">今日表现</view>
+			</view>
+			
+			<view class="card-content">
+				<view>课程清单</view>
+				<view>任务清单</view>
+				<view>任务完成率</view>
+			</view>
+
 		</view>
+		
 		<view class="title">体</view>
 		<view class="card">
-			<view class="t-icon t-icon-a-jiangbeiyingjiashenglizhechengjiu"></view>
-			<view class="card-title">今日表现</view>
+			<view style="display: flex; justify-content: flex-start; width: 100%;">
+				<view class="t-icon t-icon-a-jiangbeiyingjiashenglizhechengjiu"></view>
+				<view class="card-title">今日表现</view>
+			</view>
 		</view>
+		
 		<view class="title">美</view>
 		<view class="card">
-			<view class="t-icon t-icon-a-sebansetiaosekayanse"></view>
-			<view class="card-title">今日表现</view>
+			<view style="display: flex; justify-content: flex-start; width: 100%;">
+				<view class="t-icon t-icon-a-sebansetiaosekayanse"></view>
+				<view class="card-title">今日表现</view>
+			</view>
 		</view>
+		
 		<view class="title">劳</view>
 		<view class="card">
-			<view class="t-icon t-icon-a-guangpanguangdie"></view>
-			<view class="card-title">今日表现</view>
+			<view style="display: flex; justify-content: flex-start; width: 100%;">
+				<view class="t-icon t-icon-a-guangpanguangdie"></view>
+				<view class="card-title">今日表现</view>
+			</view>
 		</view>
 		
-		
-		
-		
 	</view>
 </template>
 
@@ -47,11 +66,7 @@
 		data() {
 			return {
 				notification: '这里是滚动条的内容,显示重要通知等等消息',
-				
-				
-				
-				
-				
+					
 			}
 		},
 		
@@ -93,11 +108,18 @@
 			background-color: #FFFFFF;
 			box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.05);
 			display: flex;
+			flex-direction: column;
 			align-items: center;
 			
 			.card-title{
 				margin-left: 20rpx;
 				font-size: 26rpx;
+				font-weight: bold;
+				
+			}
+			.card-content{
+				display: flex;
+				flex-direction: column;
 			}
 		}
 	}

+ 1 - 1
pages/my/my.vue

@@ -128,7 +128,7 @@
 				if(succ && succ.confirm)
 				{
 					this.updateChildrenInfo()
-					this.updateChildrenSemester(请选择学年)
+					this.updateChildrenSemester('选择学年')
 					// this.updateParentDetail()
 					this.updateParentInfo()
 					this.updateToken()

+ 63 - 0
pages/subscribe/subscribe.vue

@@ -0,0 +1,63 @@
+<template>
+	<view class="container">
+
+		<!-- <u-steps :current="testList.length -1 " direction="column" activeIcon="checkmark" inactiveIcon="arrow-right">
+			<view class="steps-card">
+				<u-steps-item v-for="(item,index) in testList" :key="index" :title="item.title" :desc="item.desc"></u-steps-item>
+			</view>
+		</u-steps> -->
+
+	</view>
+</template>
+
+<script>
+	import {
+		mapState
+	} from 'vuex'
+	export default {
+		data() {
+			return {
+				// testList: [
+				// 	{
+				// 		'title': '开学考试',
+				// 		'desc': '9.1',
+				// 	},
+				// 	{
+				// 		'title': '期中考试',
+				// 		'desc': '10.1',
+				// 	},
+				// 	{
+				// 		'title': '期末考试',
+				// 		'desc': '12.1',
+				// 	},
+				// 	{
+				// 		'title': '毕业考试',
+				// 		'desc': '12.30',
+				// 	},
+				// 	{
+				// 		'title': '升学考试',
+				// 		'desc': '3.1',
+				// 	}
+				// ]
+			}
+		},
+		computed: {
+			...mapState('m_parent', ['parentinfo'])
+		}
+	}
+</script>
+
+<style lang="scss">
+	.container {
+		height: 400rpx;
+		background: linear-gradient(#ff5959, #f1f3f5);
+		display: flex;
+
+		// .steps-card{
+		// 	background-color: #FFFFFF;
+		// 	margin: 20rpx;
+		// 	padding: 10rpx;
+		// 	border-radius: 15rpx;
+		// }
+	}
+</style>

+ 11 - 0
uni_modules/uview-ui/changelog.md

@@ -1,3 +1,14 @@
+## 2.0.28(2022-02-22)
+# uView2.0重磅发布,利剑出鞘,一统江湖
+
+1. search组件新增searchIconSize属性
+2. 兼容Safari/Webkit中传入时间格式如2022-02-17 12:00:56
+3. 修复text value.js 判断日期出format错误问题
+4. priceFormat格式化金额出现精度错误
+5. priceFormat在部分情况下出现精度损失问题
+6. 优化表单rules提示
+7. 修复avatar组件src为空时,展示状态不对
+8. 其他修复
 ## 2.0.27(2022-01-28)
 # uView2.0重磅发布,利剑出鞘,一统江湖
 

+ 4 - 0
uni_modules/uview-ui/components/u-avatar/u-avatar.vue

@@ -103,6 +103,10 @@
 				immediate: true,
 				handler(newVal) {
 					this.avatarUrl = newVal
+					// 如果没有传src,则主动触发error事件,用于显示默认的头像,否则src为''空字符等的时候,会无内容展示
+					if(!newVal) {
+						this.errorHandler()
+					}
 				}
 			}
 		},

+ 4 - 0
uni_modules/uview-ui/components/u-form-item/props.js

@@ -34,6 +34,10 @@ export default {
         required: {
             type: Boolean,
             default: uni.$u.props.formItem.required
+        },
+        leftIconStyle: {
+            type: [String, Object],
+            default: uni.$u.props.formItem.leftIconStyle,
         }
     }
 }

+ 1 - 0
uni_modules/uview-ui/components/u-form-item/u-form-item.vue

@@ -86,6 +86,7 @@
 	 * @property {String | Number}	labelWidth		label的宽度,单位px
 	 * @property {String}			rightIcon		右侧图标
 	 * @property {String}			leftIcon		左侧图标
+	 * @property {String | Object} leftIconStyle 左侧图标的样式
 	 * @property {Boolean}			required		是否显示左边的必填星号,只作显示用,具体校验必填的逻辑,请在rules中配置 (默认 false )
 	 *
 	 * @example <u-form-item label="姓名" prop="userInfo.name" borderBottom ref="item1"></u-form-item>

+ 7 - 7
uni_modules/uview-ui/components/u-form/u-form.vue

@@ -122,12 +122,7 @@
 				});
 			},
 			// 对部分表单字段进行校验
-			async validateField(value, callback, event = null) {
-				// 开发环境才提示,生产环境不会提示
-				if (process.env.NODE_ENV === 'development' && Object.keys(this.formRules).length === 0) {
-					uni.$u.error('未设置rules,请看文档说明!如果已经设置,请刷新页面。');
-					return;
-				}
+			async validateField(value, callback, event = null) {
 				// $nextTick是必须的,否则model的变更,可能会延后于此方法的执行
 				this.$nextTick(() => {
 					// 校验错误信息,返回给回调方法,用于存放所有form-item的错误信息
@@ -186,7 +181,12 @@
 				});
 			},
 			// 校验全部数据
-			validate(callback) {
+			validate(callback) {
+				// 开发环境才提示,生产环境不会提示
+				if (process.env.NODE_ENV === 'development' && Object.keys(this.formRules).length === 0) {
+					uni.$u.error('未设置rules,请看文档说明!如果已经设置,请刷新页面。');
+					return;
+				}
 				return new Promise((resolve, reject) => {
 					// $nextTick是必须的,否则model的变更,可能会延后于validate方法
 					this.$nextTick(() => {

+ 1 - 1
uni_modules/uview-ui/components/u-picker/u-picker.vue

@@ -121,7 +121,7 @@ export default {
 		// 关闭选择器
 		closeHandler() {
 			if (this.closeOnClickOverlay) {
-				this.$emit('close')
+				this.$emit('cancel')
 			}
 		},
 		// 点击工具栏的取消按钮

+ 4 - 0
uni_modules/uview-ui/components/u-search/props.js

@@ -80,6 +80,10 @@ export default {
             type: String,
             default: uni.$u.props.search.searchIcon
         },
+        searchIconSize: {
+            type: [Number, String],
+            default: uni.$u.props.search.searchIconSize
+        },
         // 组件与其他上下左右元素之间的距离,带单位的字符串形式,如"30px"、"30px 20px"等写法
         margin: {
             type: String,

+ 2 - 1
uni_modules/uview-ui/components/u-search/u-search.vue

@@ -22,7 +22,7 @@
 			<view class="u-search__content__icon">
 				<u-icon
 					@tap="clickIcon"
-				    :size="22"
+				    :size="searchIconSize"
 				    :name="searchIcon"
 				    :color="searchIconColor ? searchIconColor : color"
 				></u-icon>
@@ -91,6 +91,7 @@
 	 * @property {Boolean}			disabled			是否启用输入框(默认 false )
 	 * @property {String}			borderColor			边框颜色,配置了颜色,才会有边框 (默认 'transparent' )
 	 * @property {String}			searchIconColor		搜索图标的颜色,默认同输入框字体颜色 (默认 '#909399' )
+	 * @property {Number | String}	searchIconSize 搜索图标的字体,默认26
 	 * @property {String}			color				输入框字体颜色(默认 '#606266' )
 	 * @property {String}			placeholderColor	placeholder的颜色(默认 '#909399' )
 	 * @property {String}			searchIcon			输入框左边的图标,可以为uView图标名称或图片路径  (默认 'search' )

+ 2 - 2
uni_modules/uview-ui/components/u-switch/props.js

@@ -30,12 +30,12 @@ export default {
             type: [Boolean, String, Number],
             default: uni.$u.props.switch.value
         },
-        // 打开选择器时的值
+        // switch打开时的值
         activeValue: {
             type: [String, Number, Boolean],
             default: uni.$u.props.switch.activeValue
         },
-        // 关闭选择器时的值
+        // switch关闭时的值
         inactiveValue: {
             type: [String, Number, Boolean],
             default: uni.$u.props.switch.inactiveValue

+ 4 - 4
uni_modules/uview-ui/components/u-switch/u-switch.vue

@@ -33,7 +33,7 @@
 	 * switch 开关选择器
 	 * @description 选择开关一般用于只有两个选择,且只能选其一的场景。
 	 * @tutorial https://www.uviewui.com/components/switch.html
-	 * @property {Boolean}						loading			是否处于加载中(默认 false ) 
+	 * @property {Boolean}						loading			是否处于加载中(默认 false )
 	 * @property {Boolean}						disabled		是否禁用(默认 false )
 	 * @property {String | Number}				size			开关尺寸,单位px (默认 25 )
 	 * @property {String}						activeColor		打开时的背景色 (默认 '#2979ff' )
@@ -44,7 +44,7 @@
 	 * @property {Boolean}						asyncChange		是否开启异步变更,开启后需要手动控制输入值 (默认 false )
 	 * @property {String | Number}				space			圆点与外边框的距离 (默认 0 )
 	 * @property {Object}						customStyle		定义需要用到的外部样式
-	 * 
+	 *
 	 * @event {Function} change 在switch打开或关闭时触发
 	 * @example <u-switch v-model="checked" active-color="red" inactive-color="#eee"></u-switch>
 	 */
@@ -56,7 +56,7 @@
 				immediate: true,
 				handler(n) {
 					if(n !== this.inactiveValue && n !== this.activeValue) {
-						uni.$u.error('v-mode绑定的值必须为inactiveValue、activeValue二者之一')
+						uni.$u.error('v-model绑定的值必须为inactiveValue、activeValue二者之一')
 					}
 				}
 			}
@@ -76,7 +76,7 @@
 				// 如果自定义了“非激活”演示,name边框颜色设置为透明(跟非激活颜色一致)
 				// 这里不能简单的设置为非激活的颜色,否则打开状态时,会有边框,所以需要透明
 				if(this.customInactiveColor) {
-					style.borderColor = 'rgba(0, 0, 0, 0)' 
+					style.borderColor = 'rgba(0, 0, 0, 0)'
 				}
 				style.backgroundColor = this.value === this.activeValue ? this.activeColor : this.inactiveColor
 				return style;

+ 1 - 1
uni_modules/uview-ui/components/u-text/value.js

@@ -28,7 +28,7 @@ export default {
                 if (uni.$u.test.func(format)) {
                     // 如果用户传入的是函数,使用函数格式化
                     return format(text)
-                } if (this.formart) {
+                } if (format) {
                     // 如果format非正则,非函数,则使用默认的时间格式化方法进行操作
                     return uni.$u.timeFormat(text, format)
                 }

+ 2 - 2
uni_modules/uview-ui/libs/config/config.js

@@ -1,5 +1,5 @@
-// 此版本发布于2022-01-28
-const version = '2.0.27'
+// 此版本发布于2022-02-22
+const version = '2.0.28'
 
 // 开发环境才提示,生产环境不会提示
 if (process.env.NODE_ENV === 'development') {

+ 2 - 1
uni_modules/uview-ui/libs/config/props/formItem.js

@@ -16,6 +16,7 @@ export default {
         labelWidth: '',
         rightIcon: '',
         leftIcon: '',
-        required: false
+        required: false,
+        leftIconStyle: '',
     }
 }

+ 1 - 0
uni_modules/uview-ui/libs/config/props/search.js

@@ -23,6 +23,7 @@ export default {
         disabled: false,
         borderColor: 'transparent',
         searchIconColor: '#909399',
+        searchIconSize: 22,
         color: '#606266',
         placeholderColor: '#909399',
         searchIcon: 'search',

+ 167 - 0
uni_modules/uview-ui/libs/function/digit.js

@@ -0,0 +1,167 @@
+let _boundaryCheckingState = true; // 是否进行越界检查的全局开关
+
+/**
+ * 把错误的数据转正
+ * @private
+ * @example strip(0.09999999999999998)=0.1
+ */
+function strip(num, precision = 15) {
+  return +parseFloat(Number(num).toPrecision(precision));
+}
+
+/**
+ * Return digits length of a number
+ * @private
+ * @param {*number} num Input number
+ */
+function digitLength(num) {
+  // Get digit length of e
+  const eSplit = num.toString().split(/[eE]/);
+  const len = (eSplit[0].split('.')[1] || '').length - +(eSplit[1] || 0);
+  return len > 0 ? len : 0;
+}
+
+/**
+ * 把小数转成整数,如果是小数则放大成整数
+ * @private
+ * @param {*number} num 输入数
+ */
+function float2Fixed(num) {
+  if (num.toString().indexOf('e') === -1) {
+    return Number(num.toString().replace('.', ''));
+  }
+  const dLen = digitLength(num);
+  return dLen > 0 ? strip(Number(num) * Math.pow(10, dLen)) : Number(num);
+}
+
+/**
+ * 检测数字是否越界,如果越界给出提示
+ * @private
+ * @param {*number} num 输入数
+ */
+function checkBoundary(num) {
+  if (_boundaryCheckingState) {
+    if (num > Number.MAX_SAFE_INTEGER || num < Number.MIN_SAFE_INTEGER) {
+      console.warn(`${num} 超出了精度限制,结果可能不正确`);
+    }
+  }
+}
+
+/**
+ * 把递归操作扁平迭代化
+ * @param {number[]} arr 要操作的数字数组
+ * @param {function} operation 迭代操作
+ * @private
+ */
+function iteratorOperation(arr, operation) {
+  const [num1, num2, ...others] = arr;
+  let res = operation(num1, num2);
+
+  others.forEach((num) => {
+    res = operation(res, num);
+  });
+
+  return res;
+}
+
+/**
+ * 高精度乘法
+ * @export
+ */
+export function times(...nums) {
+  if (nums.length > 2) {
+    return iteratorOperation(nums, times);
+  }
+
+  const [num1, num2] = nums;
+  const num1Changed = float2Fixed(num1);
+  const num2Changed = float2Fixed(num2);
+  const baseNum = digitLength(num1) + digitLength(num2);
+  const leftValue = num1Changed * num2Changed;
+
+  checkBoundary(leftValue);
+
+  return leftValue / Math.pow(10, baseNum);
+}
+
+/**
+ * 高精度加法
+ * @export
+ */
+export function plus(...nums) {
+  if (nums.length > 2) {
+    return iteratorOperation(nums, plus);
+  }
+
+  const [num1, num2] = nums;
+  // 取最大的小数位
+  const baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
+  // 把小数都转为整数然后再计算
+  return (times(num1, baseNum) + times(num2, baseNum)) / baseNum;
+}
+
+/**
+ * 高精度减法
+ * @export
+ */
+export function minus(...nums) {
+  if (nums.length > 2) {
+    return iteratorOperation(nums, minus);
+  }
+
+  const [num1, num2] = nums;
+  const baseNum = Math.pow(10, Math.max(digitLength(num1), digitLength(num2)));
+  return (times(num1, baseNum) - times(num2, baseNum)) / baseNum;
+}
+
+/**
+ * 高精度除法
+ * @export
+ */
+export function divide(...nums) {
+  if (nums.length > 2) {
+    return iteratorOperation(nums, divide);
+  }
+
+  const [num1, num2] = nums;
+  const num1Changed = float2Fixed(num1);
+  const num2Changed = float2Fixed(num2);
+  checkBoundary(num1Changed);
+  checkBoundary(num2Changed);
+  // 重要,这里必须用strip进行修正
+  return times(num1Changed / num2Changed, strip(Math.pow(10, digitLength(num2) - digitLength(num1))));
+}
+
+/**
+ * 四舍五入
+ * @export
+ */
+export function round(num, ratio) {
+  const base = Math.pow(10, ratio);
+  let result = divide(Math.round(Math.abs(times(num, base))), base);
+  if (num < 0 && result !== 0) {
+    result = times(result, -1);
+  }
+  // 位数不足则补0
+  return result;
+}
+
+/**
+ * 是否进行边界检查,默认开启
+ * @param flag 标记开关,true 为开启,false 为关闭,默认为 true
+ * @export
+ */
+export function enableBoundaryChecking(flag = true) {
+  _boundaryCheckingState = flag;
+}
+
+
+export default {
+  times,
+  plus,
+  minus,
+  divide,
+  round,
+  enableBoundaryChecking,
+};
+

+ 53 - 36
uni_modules/uview-ui/libs/function/index.js

@@ -1,5 +1,5 @@
 import test from './test.js'
-
+import { round } from './digit.js'
 /**
  * @description 如果value小于min,取min;如果value大于max,取max
  * @param {number} min 
@@ -278,29 +278,50 @@ if (!String.prototype.padStart) {
  * @param {String} fmt 格式化规则 yyyy:mm:dd|yyyy:mm|yyyy年mm月dd日|yyyy年mm月dd日 hh时MM分等,可自定义组合 默认yyyy-mm-dd
  * @returns {string} 返回格式化后的字符串
  */
-function timeFormat(dateTime = null, fmt = 'yyyy-mm-dd') {
-	// 如果为null,则格式化当前时间
-	if (!dateTime) dateTime = Number(new Date())
-	// 如果dateTime长度为10或者13,则为秒和毫秒的时间戳,如果超过13位,则为其他的时间格式
-	if (dateTime.toString().length == 10) dateTime *= 1000
-	const date = new Date(dateTime)
-	let ret
-	const opt = {
-		'y+': date.getFullYear().toString(), // 年
-		'm+': (date.getMonth() + 1).toString(), // 月
-		'd+': date.getDate().toString(), // 日
-		'h+': date.getHours().toString(), // 时
-		'M+': date.getMinutes().toString(), // 分
-		's+': date.getSeconds().toString() // 秒
+ function timeFormat(dateTime = null, formatStr = 'yyyy-mm-dd') {
+  let date
+	// 若传入时间为假值,则取当前时间
+  if (!dateTime) {
+    date = new Date()
+  }
+  // 若为unix秒时间戳,则转为毫秒时间戳(逻辑有点奇怪,但不敢改,以保证历史兼容)
+  else if (/^\d{10}$/.test(dateTime?.toString().trim())) {
+    date = new Date(dateTime * 1000)
+  }
+  // 若用户传入字符串格式时间戳,new Date无法解析,需做兼容
+  else if (typeof dateTime === 'string' && /^\d+$/.test(dateTime.trim())) {
+    date = new Date(Number(dateTime))
+  }
+  // 其他都认为符合 RFC 2822 规范
+  else {
+    // 处理平台性差异,在Safari/Webkit中,new Date仅支持/作为分割符的字符串时间
+    date = new Date(
+      typeof dateTime === 'string'
+        ? dateTime.replace(/-/g, '/')
+        : dateTime
+    )
+  }
+
+	const timeSource = {
+		'y': date.getFullYear().toString(), // 年
+		'm': (date.getMonth() + 1).toString().padStart(2, '0'), // 月
+		'd': date.getDate().toString().padStart(2, '0'), // 日
+		'h': date.getHours().toString().padStart(2, '0'), // 时
+		'M': date.getMinutes().toString().padStart(2, '0'), // 分
+		's': date.getSeconds().toString().padStart(2, '0') // 秒
 		// 有其他格式化字符需求可以继续添加,必须转化成字符串
 	}
-	for (const k in opt) {
-		ret = new RegExp(`(${k})`).exec(fmt)
-		if (ret) {
-			fmt = fmt.replace(ret[1], (ret[1].length == 1) ? (opt[k]) : (opt[k].padStart(ret[1].length, '0')))
-		}
-	}
-	return fmt
+
+  for (const key in timeSource) {
+    const [ret] = new RegExp(`${key}+`).exec(formatStr) || []
+    if (ret) {
+      // 年可能只需展示两位
+      const beginIndex = key === 'y' && ret.length === 2 ? 2 : 0
+      formatStr = formatStr.replace(ret, timeSource[key].slice(beginIndex))
+    }
+  }
+
+  return formatStr
 }
 
 /**
@@ -490,12 +511,8 @@ function priceFormat(number, decimals = 0, decimalPoint = '.', thousandsSeparato
 	const sep = (typeof thousandsSeparator === 'undefined') ? ',' : thousandsSeparator
 	const dec = (typeof decimalPoint === 'undefined') ? '.' : decimalPoint
 	let s = ''
-	const toFixedFix = function(n, prec) {
-		const k = 10 ** prec
-		return `${Math.ceil(parseInt(n * k)) / k}`
-	}
 
-	s = (prec ? toFixedFix(n, prec) : `${Math.round(n)}`).split('.')
+	s = (prec ? round(n, prec) + '' : `${Math.round(n)}`).split('.')
 	const re = /(-?\d+)(\d{3})/
 	while (re.test(s[0])) {
 		s[0] = s[0].replace(re, `$1${sep}$2`)
@@ -632,27 +649,27 @@ function pages() {
 	const pages = getCurrentPages()
 	return pages
 }
-
+
 /**
  * @description 修改uView内置属性值
  * @param {object} props 修改内置props属性
  * @param {object} config 修改内置config属性
- * @param {object} color 修改内置color属性
+ * @param {object} color 修改内置color属性
  * @param {object} zIndex 修改内置zIndex属性
  */
 function setConfig({
 	props = {},
-	config = {},
-	color = {},
+	config = {},
+	color = {},
 	zIndex = {}
 }) {
 	const {
-		deepMerge,
+		deepMerge,
 	} = uni.$u
 	uni.$u.config = deepMerge(uni.$u.config, config)
-	uni.$u.props = deepMerge(uni.$u.props, props)
-	uni.$u.color = deepMerge(uni.$u.color, color)
-	uni.$u.zIndex = deepMerge(uni.$u.zIndex, zIndex)
+	uni.$u.props = deepMerge(uni.$u.props, props)
+	uni.$u.color = deepMerge(uni.$u.color, color)
+	uni.$u.zIndex = deepMerge(uni.$u.zIndex, zIndex)
 }
 
 export default {
@@ -685,4 +702,4 @@ export default {
 	page,
 	pages,
 	setConfig
-}
+}

+ 6 - 2
uni_modules/uview-ui/package.json

@@ -2,12 +2,16 @@
 	"id": "uview-ui",
 	"name": "uview-ui",
 	"displayName": "uView2.0重磅发布,利剑出鞘,一统江湖",
-	"version": "2.0.27",
+	"version": "2.0.28",
 	"description": "uView UI已完美兼容nvue,全面的组件和便捷的工具会让您信手拈来,如鱼得水",
 	"keywords": [
         "uview",
+        "uview",
+        "ui",
         "ui",
-        "uni-app"
+        "uni-app",
+        "uni-app",
+        "ui"
     ],
 	"repository": "https://github.com/umicro/uView2.0",
 	"engines": {