zhangsl 3 年之前
父節點
當前提交
aedf9668a8

+ 3 - 1
App.vue

@@ -15,11 +15,13 @@
 
 <style lang="scss">
 	/* uView */
-	@import "@/uni_modules/uview-ui/index.scss";
+	@import '@/uni_modules/uview-ui/index.scss';
 	/*每个页面公共css */
 	@import '@/uni_modules/uni-scss/index.scss';
 	/* #ifndef APP-NVUE */
 	@import '@/static/customicons.css';
+	// 引入图标
+	// @import './static/tab-icons/iconfont.css';
 	// 设置整个项目的背景色
 	page {
 		background-color: #f1f3f5;

+ 27 - 1
components/area-chart/area-chart.vue

@@ -2,7 +2,13 @@
 	<view class="chart-container">
 		<view class="chart-name">
 			<text class="chart-name-text">单科成绩走向图</text>
+			<!-- 选择器 -->
+			<view class="chart-name-btn">
+				<u-picker :show="show" :columns="subject" ref="uPicker" @confirm="confirm" @change="changeHandler"></u-picker>
+				<u-button class="btn" @click="show = true" size="small" shape="circle">科目</u-button>
+			</view>
 		</view>
+		<!-- 图表 -->
 		<view class="charts-box">
 			<qiun-data-charts type="area" :chartData="chartData" :loadingType="4" background="none" />
 		</view>
@@ -14,6 +20,12 @@
 		name: "area-chart",
 		data() {
 			return {
+				
+				show: false,
+				subject:[
+					['语文','数学','英语','体育','思品','科学']
+				],
+				
 				chartData: {
 					categories: [
 						"测验1",
@@ -59,6 +71,13 @@
 					],
 				},
 			};
+		},
+		methods:{
+			confirm(e){
+				console.log('confirm',e)
+				uni.$showMsg('切换完成')
+				this.show = false
+			}
 		}
 		
 	}
@@ -74,7 +93,7 @@
 		justify-content: center;
 		flex-direction: column;
 		background-color: #FFFFFF;
-		box-shadow: 0 4px 8px rgba(0,0,0,0.1);
+		box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 
 		.chart-name {
 			width: 100%;
@@ -83,10 +102,17 @@
 			margin-top: 8px;
 			font-weight: bold;
 			color: #3B4144;
+			display: flex;
+			justify-content: space-between;
 
 			.chart-name-text {
 				font-size: 13px;
 			}
+			.chart-name-btn{
+				width: 50px;
+				font-size: 13px;
+				margin:-4px 30px 0 0;
+			}
 		}
 
 		/* 请根据需求修改图表容器尺寸,如果父容器没有高度图表则会显示异常 */

+ 1 - 1
components/bar-chart/bar-chart.vue

@@ -65,7 +65,7 @@
 		justify-content: center;
 		flex-direction: column;
 		background-color: #FFFFFF;
-		box-shadow: 0 4px 8px rgba(0,0,0,0.1);
+		box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 
 		.chart-name {
 			width: 100%;

+ 1 - 1
components/column-chart/column-chart.vue

@@ -62,7 +62,7 @@
 		justify-content: center;
 		flex-direction: column;
 		background-color: #FFFFFF;
-		box-shadow: 0 4px 8px rgba(0,0,0,0.1);
+		box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 	
 		.chart-name {
 			width: 100%;

+ 1 - 1
components/line-chart/line-chart.vue

@@ -69,7 +69,7 @@
 		justify-content: center;
 		flex-direction: column;
 		background-color: #FFFFFF;
-		box-shadow: 0 4px 8px rgba(0,0,0,0.1);
+		box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 
 		.chart-name {
 			width: 100%;

+ 0 - 2
components/mainline-chart/mainline-chart.vue

@@ -1,9 +1,7 @@
 <template>
-	<view>
 		<view class="charts-box">
 			<qiun-data-charts class="chart" type="mainline" :chartData="chartData" :loadingType="4" background="none" />
 		</view>
-	</view>
 </template>
 
 <script>

+ 66 - 0
components/mainradar-chart/mainradar-chart.vue

@@ -0,0 +1,66 @@
+<template>
+	<view class="charts-box">
+		<qiun-data-charts type="mainradar" :chartData="chartData" :loadingType="4" background="none" />
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "mainradar-chart",
+		data() {
+			return {
+				chartData: {
+					categories: ["语文",
+						"数学",
+						"英语",
+						"科学",
+						"体育",
+						"思品"
+					],
+					series: [{
+							"name": "开学考试",
+							"data": [
+								90,
+								100,
+								77,
+								88,
+								95,
+								85
+							]
+						},
+						{
+							"name": "期中考试",
+							"data": [
+								93,
+								80,
+								99,
+								76,
+								88,
+								100
+							]
+						},
+						{
+							"name": "期末考试",
+							"data": [
+								82,
+								90,
+								65,
+								99,
+								70,
+								92
+							]
+						}
+					],
+				},
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+.charts-box{
+  width: 100%;
+  height:300px;
+	margin-top: -30px;
+}
+</style>

+ 2 - 3
components/mini-login/mini-login.vue

@@ -53,8 +53,7 @@
 					js_code: res.code
 				}
 				//传入后台换取token
-				const loginResult = await uni.$http.post('https://test.teammodel.cn/aclassone/get-miniapp-userinfo',
-					query)
+				const loginResult = await uni.$http.post('https://test.teammodel.cn/aclassone/get-miniapp-userinfo', query)
 				if (loginResult.statusCode !== 200) return uni.$showMsg('登录失败!')
 				uni.$showMsg('登录成功')
 				//更新vuex中token
@@ -76,7 +75,7 @@
 						// const parentDetailData = await uni.$http.post('',numData.phoneNumber)
 						// this.updateParentDetail(parentDetailData)
 						await uni.navigateTo({
-							url: '/pages/guide/guide'
+							url: '/subpkg/guide/guide'
 						})
 					}
 				}

+ 45 - 62
components/mini-userinfo/mini-userinfo.vue

@@ -1,48 +1,43 @@
 <template>
 	<view class="userinfo-container">
-			<!-- 家长信息头部 -->
-			<view class="userinfo-topinfo">
-				<image class="parent-avatar" :src="parentinfo.avatarUrl"></image>
-				<view class="parent-name">
-					<text class="name">{{parentinfo.nickName}}</text>
-					<text class="detail">{{childreninfo.nickName + '家长'}}</text>
-				</view>
-			</view>
+			
 			<!-- 面板区域 -->
-			<view class="box-cart">
-				<view class="cart-big">
+			<view class="box-cart" >
+				<view class="cart-big" @click="updateChildrenInfo">
 					<image class="cart-icon" src="/static/my-icons/boy-my.png" mode="aspectFill"></image>
 					<text class="cart-text">我的孩子</text>
 				</view>
 				
 				<view class="cart-small">
-					<view class="cart-item">
+					<view class="cart-item" @click="show = true">
 						<image class="cart-icon-sim" src="/static/my-icons/childrenmessage.png"></image>
-						<text class="cart-text-sim">信息管理</text>
+						<text class="cart-text-sim">学习打卡</text>
 					</view>
-					<view class="cart-item">
+					
+					<view class="cart-item" @click="chooseChildren">
 						<image class="cart-icon-sim" src="/static/my-icons/mychildren.png" mode="aspectFill"></image>
 						<text class="cart-text-sim">孩子管理</text>
 					</view>
+					
 				</view>
 			</view>
 			
 			<!-- 用户功能 -->
 			<view class="com-item">
-				<view class="com-wrap">
+				<view class="com-box">
 					<view class="cell">
 						<view class="cell-left">
-							<image class="cell-icon" src="/static/my-icons/dailyclock.png" mode="aspectFill"></image>
-							<view class="cell-text">学习打卡</view>
+							<image class="cell-icon" src="/static/my-icons/details.png" mode="aspectFill"></image>
+							<view class="cell-text">个人信息</view>
 						</view>
 					</view>
 					<view class="cell">
 						<view class="cell-left">
-							<image class="cell-icon" src="/static/my-icons/details.png" mode="aspectFill"></image>
-							<view class="cell-text">个人信息</view>
+							<image class="cell-icon" src="/static/my-icons/dailyclock.png" mode="aspectFill"></image>
+							<view class="cell-text">我的消息</view>
 						</view>
 					</view>
-					<view class="cell" @click="logout()">
+					<view class="cell" @click="logout">
 						<view class="cell-left">
 							<image class="cell-icon" src="/static/my-icons/setting.png" mode="aspectFill"></image>
 							<view class="cell-text">退出登录</view>
@@ -62,6 +57,8 @@
 					</view>
 				</view>
 			</view>
+			<!-- 日历组件 -->
+			<u-calendar :show="show" mode="single" @confirm="confirm"></u-calendar>
 			
 	</view>
 </template>
@@ -71,7 +68,7 @@
 	
 	export default {
 		computed:{
-			...mapState('m_parent',['parentinfo']),
+			...mapState('m_parent',['parentinfo','parentdetail']),
 			...mapState('m_children',['childreninfo'])
 		},
 		name: 'mini-userinfo',
@@ -79,6 +76,8 @@
 		data() {
 			return {
 				
+				show: false,
+				
 				serverList: [{
 						title: '客服中心',
 						icon: '/static/my-icons/service.png',
@@ -100,7 +99,14 @@
 		methods:{
 			...mapMutations('m_parent',['updateParentDetail','updateToken']),
 			...mapMutations('m_children',['updateChildrenInfo']),
+			//日历事件
+			confirm(e){
+				console.log('confirm',e)
+				uni.$showMsg('打卡成功!')
+				this.show = false
+			},
 			
+			//退出登录
 			async logout(){
 				const [err,succ] = await uni.showModal({
 					title: '提示',
@@ -112,10 +118,23 @@
 					this.updateParentDetail({})
 					this.updateToken('')
 					uni.navigateTo({
-						url:'/pages/login/login'
+						url:'/subpkg/login/login'
 					})
 				}
+			},
+			//切换孩子
+			chooseChildren(){
+				// if(parentdetail.childrenList.length == 1)
+				// return uni.showMsg('您只有一个孩子,不能切换')
+				uni.navigateTo({
+					url: '/subpkg/guide/guide'
+				})
+			},
+			//修改孩子信息
+			updateChildrenInfo(e){
+				console.log(e);
 			}
+			
 		}
 	}
 </script>
@@ -123,40 +142,7 @@
 <style lang="scss">
 .userinfo-container{
 		height: 100%;
-		.userinfo-topinfo{
-			height: 400rpx;
-			background: linear-gradient(#ff5959, #f1f3f5);
-			display: flex;
-			justify-content: flex-start;
-			align-items: center;
-		}
-		.parent-avatar{
-			margin-top: 10px;
-			margin-left: 20px;
-			width: 60px;
-			height: 60px;
-			border-radius: 35px;
-			border: 3px solid #FFFFFF;
-			box-shadow: 0 5px 10px rgba(0,0,0,0.2);
-		}
-		.parent-name{
-			margin-top: 10px;
-			margin-left: 10px;
-			display: flex;
-			flex-direction: column;
-			font-weight: bold;
-			
-			.name{
-				color: #6b778d;
-				font-size: 13px;
-				margin: 2px 0px 0px 5px;
-			}
-			.detail{
-				color: #3B4144;
-				font-weight: bold;
-				margin: 5px 0px 0px 5px;
-			}
-		}
+		
 		// 面板区域
 		.box-cart{
 			margin: -100rpx 20rpx 20rpx 20rpx;
@@ -167,6 +153,7 @@
 			
 			.cart-big{
 				border-radius: 15rpx;
+				width: 90px;
 				overflow: hidden;
 				margin: 10px 0 10px 0;
 				display: flex;
@@ -174,7 +161,7 @@
 				justify-content: center;
 				align-items: center;
 				background-color: #FFFFFF;
-				box-shadow: 0 5px 5px rgba(0,0,0,0.1);
+				box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 				
 				.cart-icon{
 					width: 60px;
@@ -196,7 +183,7 @@
 				
 				.cart-item{
 					background-color: #FFFFFF;
-					box-shadow: 0 5px 5px rgba(0,0,0,0.1);
+					box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 					display: flex;
 					flex-direction: row;
 					align-items: center;
@@ -219,14 +206,10 @@
 		}
 		// 功能列表
 		.com-item {
-				margin-left: 20rpx;
-				margin-right: 20rpx;
 				margin-top: 20rpx;
-				box-shadow: 0 5px 5px rgba(0,0,0,0.1);
-				border-radius: 25rpx;
+				box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 		
 				.com-box {
-					border-radius: 25rpx;
 					overflow: hidden;
 				}
 			}

+ 29 - 1
components/radar-chart/radar-chart.vue

@@ -2,7 +2,14 @@
 	<view class="chart-container">
 		<view class="chart-name">
 			<text class="chart-name-text">单科能力</text>
+			<!-- 选择器 -->
+			<view class="chart-name-btn">
+				<u-picker :show="show" :columns="subject" ref="uPicker" @confirm="confirm" @change="changeHandler"></u-picker>
+				<u-button class="btn" @click="show = true" size="small" shape="circle">科目</u-button>
+			</view>
 		</view>
+		
+		<!-- 图表 -->
 		<view class="charts-box">
 			<qiun-data-charts type="radar" :chartData="chartData" :loadingType="4" />
 		</view>
@@ -14,6 +21,12 @@
 		name: "radar-chart",
 		data() {
 			return {
+				
+				show: false,
+				subject:[
+					['语文','数学','英语','体育','思品','科学']
+				],
+				
 				chartData: {
 					categories: [
 						"数学",
@@ -48,6 +61,13 @@
 					],
 				},
 			};
+		},
+		methods:{
+			confirm(e){
+				console.log('confirm',e)
+				uni.$showMsg('切换完成')
+				this.show = false
+			}
 		}
 	}
 </script>
@@ -63,7 +83,7 @@
 		justify-content: center;
 		flex-direction: column;
 		background-color: #FFFFFF;
-		box-shadow: 0 4px 8px rgba(0,0,0,0.1);
+		box-shadow: 0 2px 4px rgba(0,0,0,0.1);
 
 		.chart-name {
 			width: 100%;
@@ -72,9 +92,17 @@
 			margin-top: 8px;
 			font-weight: bold;
 			color: #3B4144;
+			display: flex;
+			justify-content: space-between;
 
 			.chart-name-text {
 				font-size: 13px;
+				margin-top: 5px;
+			}
+			.chart-name-btn{
+				width: 50px;
+				font-size: 13px;
+				margin:0 33px 0 0;
 			}
 		}
 

+ 107 - 0
components/top-box/top-box.vue

@@ -0,0 +1,107 @@
+<template>
+	<view>
+		<!-- 头部信息 -->
+		<view class="home-topinfo">
+			<image class="children-avatar" :src="childreninfo.avatar" @click="showChildrenList"></image>
+			<view class="children-name">
+				<text class="name">{{childreninfo.name}}</text>
+				<text class="detail">{{childreninfo.className}}</text>
+			</view>
+		</view>
+		<!-- 切换孩子 -->
+		<view class="list-box" v-show="show">
+			<view class="children-item" v-for="(item,index) in parentdetail.childrenList" :key="index" @click="switchChildren(item)">
+				<image class="children-avatar-item" :src="item.avatar"></image>
+			</view>
+		</view>
+		
+	</view>
+</template>
+
+<script>
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex'
+	
+	export default {
+		name: "top-box",
+		data() {
+			return {
+				show: false,
+			};
+		},
+		computed: {
+			...mapState('m_children', ['childreninfo']),
+			...mapState('m_parent',['parentdetail'])
+		},
+		methods: {
+			...mapMutations('m_children',['updateChildrenInfo']),
+			
+			showChildrenList(e){
+				console.log('chooseChildren' + e)
+				this.show = true
+			},
+			switchChildren(item){
+				console.log(item);
+				this.updateChildrenInfo(item)
+				this.show = false
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.home-topinfo {
+		height: 400rpx;
+		background: linear-gradient(#0080ff, #f1f3f5);
+		display: flex;
+		justify-content: flex-start;
+		align-items: center;
+
+		.children-avatar {
+			margin-top: 11px;
+			margin-left: 20px;
+			width: 48px;
+			height: 48px;
+			border-radius: 25px;
+			border: 2px solid #FFFFFF;
+			box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+
+		}
+
+		.children-name {
+			margin-top: 12px;
+			margin-left: 10px;
+			display: flex;
+			flex-direction: column;
+
+			.name {
+				color: #6b778d;
+				font-size: 15px;
+				margin: 2px 0px 0px 5px;
+				font-weight: bold;
+			}
+
+			.detail {
+				color: #3B4144;
+				font-weight: bold;
+				margin: 5px 0px 0px 5px;
+			}
+		}
+	}
+	.list-box{
+		margin: -120rpx 20px 60px 15px;
+		display: flex;
+		flex-wrap: wrap;
+		.children-item{
+			margin: 0px 5px 0 5px;
+			.children-avatar-item{
+				width: 48px;
+				height: 48px;
+				border-radius: 25px;
+				border: 2px solid #FFFFFF;
+			}
+		}
+	}
+</style>

+ 11 - 9
information/parent.js

@@ -8,15 +8,17 @@ export default {
 
 		token: uni.getStorageSync('token') || '',//openid和session_key
 
-		parentinfo: {
-			avatarUrl: "https://thirdwx.qlogo.cn/mmopen/vi_32/P79Xu1vuLVV1VykYd37lYsjXJxdBuibMlQRz9qSSzFmjEEf80ibISEtmUoxGQvyJ9QYBIicXYca2mX2qOEVBhuOdw/132",
-			city: "",
-			country: "",
-			gender: 0,
-			language: "zh_CN",
-			nickName: "荒川",
-			province: ""
-		},
+		parentinfo: JSON.parse(uni.getStorageSync('parentinfo') || '{}'),
+
+		// {
+		// 	avatarUrl: "https://thirdwx.qlogo.cn/mmopen/vi_32/P79Xu1vuLVV1VykYd37lYsjXJxdBuibMlQRz9qSSzFmjEEf80ibISEtmUoxGQvyJ9QYBIicXYca2mX2qOEVBhuOdw/132",
+		// 	city: "",
+		// 	country: "",
+		// 	gender: 0,
+		// 	language: "zh_CN",
+		// 	nickName: "荒川",
+		// 	province: ""
+		// }
 
 		parentdetail: {
 			phoneNumber: '17882237075',

+ 42 - 40
pages.json

@@ -1,51 +1,53 @@
 {
 	"pages": [{
-			"path": "pages/home/home",
-			"style": {
-				// "navigationBarTitleText": "",
-				"enablePullDownRefresh": false,
-				"navigationStyle": "custom"
-			}
-
-		}, {
-			"path": "pages/grade/grade",
-			"style": {
-				"enablePullDownRefresh": false,
-				"navigationStyle": "custom"
-			}
+		"path": "pages/home/home",
+		"style": {
+			// "navigationBarTitleText": "",
+			"enablePullDownRefresh": false,
+			"navigationStyle": "custom"
+		}
 
-		}, {
-			"path": "pages/approval/approval",
-			"style": {
-				"enablePullDownRefresh": false
-			}
+	}, {
+		"path": "pages/grade/grade",
+		"style": {
+			"enablePullDownRefresh": false,
+			"navigationStyle": "custom"
+		}
 
-		}, {
-			"path": "pages/my/my",
-			"style": {
-				"enablePullDownRefresh": false,
-				"navigationStyle": "custom"
-			}
+	}, {
+		"path": "pages/approval/approval",
+		"style": {
+			"enablePullDownRefresh": false
+		}
 
-		},
-		{
-			"path": "pages/login/login",
-			"style": {
-				"navigationBarTitleText": "",
-				"enablePullDownRefresh": false,
-				"navigationStyle": "custom"
-			}
+	}, {
+		"path": "pages/my/my",
+		"style": {
+			"enablePullDownRefresh": false,
+			"navigationStyle": "custom"
+		}
+	}],
+	"subPackages": [{
+		"root": "subpkg",
+		"pages": [{
+				"path": "login/login",
+				"style": {
+					"navigationBarTitleText": "",
+					"enablePullDownRefresh": false,
+					"navigationStyle":"custom"
+				}
 
-		},
-		{
-			"path": "pages/guide/guide",
-			"style": {
-				"navigationBarTitleText": "",
-				"enablePullDownRefresh": false
+			},
+			{
+				"path": "guide/guide",
+				"style": {
+					"navigationBarTitleText": "",
+					"enablePullDownRefresh": false
+				}
 			}
+		]
+	}],
 
-		}
-	],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "家长端",

+ 67 - 14
pages/approval/approval.vue

@@ -1,22 +1,75 @@
 <template>
-	<view class="content">
-		
-	</view>
+  <view class="u-page">
+    <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>
-	export default {
-		data() {
-			return {
-			};
-		},
-
-		methods:{
-			
-		}
-	}
+<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">
+    .album {
+        @include flex;
+        align-items: flex-start;
 
+        &__avatar {
+             background-color: $u-bg-color;
+             padding: 5px;
+             border-radius: 3px;
+         }
+    
+        &__content {
+             margin-left: 10px;
+             flex: 1;
+         }
+    }
 </style>

+ 2 - 47
pages/grade/grade.vue

@@ -1,14 +1,7 @@
 <template>
 	<view class="chart-list-container">
-		<view>
-			<view class="home-topinfo">
-				<image class="children-avatar" src="../../static/girl.png"></image>
-				<view class="children-name">
-					<text class="name">张小伟</text>
-					<text class="detail">成绩分析</text>
-				</view>
-			</view>
-		</view>
+		
+		<top-box></top-box>
 		
 		<view class="chart-card">
 			<line-chart></line-chart>
@@ -52,48 +45,10 @@
 	.chart-list-container{
 		height: 100%;
 		.home-topinfo{
-			height: 400rpx;
 			background: linear-gradient(#FFC600, #f1f3f5);
-			display: flex;
-			justify-content: flex-start;
-			align-items: center;
-		}
-		.children-avatar{
-			margin-top: 10px;
-			margin-left: 20px;
-			width: 48px;
-			height: 48px;
-			border-radius: 25px;
-			border: 2px solid #FFFFFF;
-			box-shadow: 0 5px 10px rgba(0,0,0,0.2);
-		}
-		.children-name{
-			margin-top: 12px;
-			margin-left: 10px;
-			display: flex;
-			flex-direction: column;
-			.name{
-				color: #6b778d;
-				font-size: 13px;
-				margin: 2px 0px 0px 5px;
-			}
-			.detail{
-				color: #3B4144;
-				font-weight: bold;
-				margin: 5px 0px 0px 5px;
-			}
 		}
 	}
 	.chart-card{
 		margin: -60px 7px 7px 7px;
-		
-		// .radar-box{
-		// 	display: flex;
-		// 	align-items: center;
-		// 	.radar-box-taps{
-		// 		width: 10px;
-		// 		background-color: #000000;
-		// 	}
-		// }
 	}
 </style>

+ 12 - 54
pages/home/home.vue

@@ -1,23 +1,15 @@
 <template>
 	<view class="home-container">
 		<!-- 头部区域 -->
-		<view class="home-topinfo">
-			<image class="children-avatar" src="../../static/boy.png"></image>
-			<view class="children-name">
-				<text class="name">张小伟</text>
-				<text class="detail">学习近况</text>
-			</view>
-		</view>
+		<top-box></top-box>
 		<mainline-chart class="main-chart"></mainline-chart>
 		
-		<!-- 步骤条区域 -->
-		<!-- <view class="steps-box">
-			<uni-steps :options="stepsValue" direction="column" :active="active"></uni-steps>
-		</view> -->
+		
 		<!-- 滚动条 -->
 		<view class="notice">
 			<u-notice-bar :text="notification" mode="closable" bgColor="#6495ED" color="#FFFFFF"></u-notice-bar>
 		</view>
+		
 		<!-- 成绩表单 -->
 		<view class="table-card">
 			<view class="table-name">
@@ -26,6 +18,7 @@
 			<z-table class="table" :tableData="tableData" :columns="columns" stickSide="true" showBottomSum="true"></z-table>
 		</view>
 		
+		
 		<!-- 卡片区域 -->
 		<view class="home-card">
 			<view class="card-edit">
@@ -40,6 +33,8 @@
 		<view class="chart-card">
 			<bar-chart class="home-bar-chart"></bar-chart>
 		</view>
+		
+		<mainradar-chart></mainradar-chart>
 
 		
 
@@ -48,9 +43,8 @@
 </template>
 
 <script>
-	import {
-		mapState
-	} from 'vuex';
+	import {mapState} from 'vuex'
+	
 	export default {
 		data() {
 			return {
@@ -123,17 +117,19 @@
 		},
 		
 		computed:{
-			...mapState('m_parent', ['token'])
+			...mapState('m_parent', ['token']),
+			...mapState('m_children',['childreninfo'])
 		},
 
 	
 		onLoad() {
 			if(!this.token){
 				uni.reLaunch({
-					url:'/pages/login/login'
+					url:'/subpkg/login/login'
 				})
 			}
 		},
+		
 		methods: {
 			
 			//提交计划
@@ -148,44 +144,6 @@
 	.home-container {
 		height: 100%;
 
-		.home-topinfo {
-			height: 400rpx;
-			background: linear-gradient(#0080ff, #f1f3f5);
-			display: flex;
-			justify-content: flex-start;
-			align-items: center;
-
-			.children-avatar {
-				margin-top: 10px;
-				margin-left: 20px;
-				width: 48px;
-				height: 48px;
-				border-radius: 25px;
-				border: 2px solid #FFFFFF;
-				box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
-
-			}
-
-			.children-name {
-				margin-top: 12px;
-				margin-left: 10px;
-				display: flex;
-				flex-direction: column;
-
-				.name {
-					color: #808599;
-					font-size: 13px;
-					margin: 2px 0px 0px 5px;
-					font-weight: bold;
-				}
-
-				.detail {
-					color: #3B4144;
-					font-weight: bold;
-					margin: 5px 0px 0px 5px;
-				}
-			}
-		}
 		.main-chart{
 			width: 100%;
 			margin-top: -30px;

+ 129 - 27
pages/my/my.vue

@@ -1,32 +1,134 @@
-<template>
-	<view class="my-container">
-		<mini-userinfo v-if="parentdetail"></mini-userinfo>
-	</view>
-</template>
-
+<template>
+	<view class="my-container">
+		<!-- 家长信息头部 -->
+		<view class="userinfo-topinfo">
+			<image class="parent-avatar" :src="parentinfo.avatarUrl" @click="getUserInfo"></image>
+			<view class="parent-name" @click="getUserInfo">
+				<text class="name">{{parentinfo.nickName}}</text>
+				<text class="detail">{{childreninfo.name + '家长'}}</text>
+			</view>
+		</view>
+		<!-- 功能组件 -->
+		<mini-userinfo v-if="parentdetail"></mini-userinfo>
+	</view>
+</template>
+
 <script>
-	import {mapState} from 'vuex'
-	
+	import {
+		mapState,
+		mapMutations
+	} from 'vuex'
+
 	export default {
-		computed:{
-			...mapState('m_parent',['token','parentdetail'])
+		computed: {
+			...mapState('m_parent', ['token', 'parentdetail', 'parentinfo']),
+			...mapState('m_children', ['childreninfo'])
 		},
-		
-		data() {
-			return {
-				
-			};
+
+		data() {
+			return {
+
+			};
 		},
-		methods:{
-			
-			
-		},
-	}
-</script>
-
-<style lang="scss">
-page,
-	.my-container{
-		height: 100%;
-}
+		onLoad() {},
+		methods: {
+			...mapMutations('m_parent', ['updateParentInfo']),
+
+			getUserInfo(e) {
+				if (!uni.getStorageSync('parentinfo')) {
+					uni.getUserProfile({
+						desc: '获取您的昵称,头像,地区信息',
+						success: infoRes => {
+							if (infoRes.errMsg === 'getUserProfile:ok') {
+								this.updateParentInfo(infoRes.userInfo)
+							} else {
+								uni.$showMsg('获取不到您的基本信息!')
+							}
+						},
+						fail: err => {
+							console.log('getUserInfo-error', JSON.stringify(err))
+						}
+					});
+				}
+			},
+
+
+		}
+	}
+</script>
+
+<style lang="scss">
+	page,
+	.my-container {
+		height: 100%;
+
+		.userinfo-topinfo {
+			height: 400rpx;
+			background: linear-gradient(#ff5959, #f1f3f5);
+			display: flex;
+			justify-content: flex-start;
+			align-items: center;
+
+			.parent-avatar {
+				margin-top: 11px;
+				margin-left: 20px;
+				width: 60px;
+				height: 60px;
+				border-radius: 35px;
+				border: 3px solid #FFFFFF;
+				box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+			}
+
+			.parent-name {
+				margin-top: 10px;
+				margin-left: 10px;
+				display: flex;
+				flex-direction: column;
+				font-weight: bold;
+
+				.name {
+					color: #6b778d;
+					font-size: 14px;
+					margin: 2px 0px 0px 5px;
+				}
+
+				.detail {
+					color: #3B4144;
+					font-weight: bold;
+					margin: 5px 0px 0px 5px;
+				}
+			}
+
+			.parent-avatar {
+				margin-top: 11px;
+				margin-left: 20px;
+				width: 60px;
+				height: 60px;
+				border-radius: 35px;
+				border: 3px solid #FFFFFF;
+				box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+			}
+
+			.parent-name {
+				margin-top: 10px;
+				margin-left: 10px;
+				display: flex;
+				flex-direction: column;
+				font-weight: bold;
+
+				.name {
+					color: #6b778d;
+					font-size: 14px;
+					margin: 2px 0px 0px 5px;
+				}
+
+				.detail {
+					color: #3B4144;
+					font-weight: bold;
+					margin: 5px 0px 0px 5px;
+				}
+			}
+		}
+
+	}
 </style>

二進制
static/my-icons/boy-my.png


二進制
static/my-icons/girl-my.png


+ 1 - 0
pages/guide/guide.vue

@@ -37,6 +37,7 @@
 		},
 		methods:{
 			...mapMutations('m_children',['updateChildrenInfo']),
+			
 			// async getParentDetail(){
 			// 	const res = await uni.$http.post('',);
 			// }

pages/login/login.vue → subpkg/login/login.vue


+ 84 - 14
uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js

@@ -52,14 +52,12 @@ const formatDateTime = (timeStamp, returnType) => {
 const cfu = {
 	//demotype为自定义图表类型,一般不需要自定义图表类型,只需要改根节点上对应的类型即可
 	"type": ["pie", "ring", "rose", "word", "funnel", "map", "arcbar", "line", "column", "bar", "area", "radar",
-		"gauge", "candle", "mix", "tline", "tarea", "scatter", "bubble", "demotype","mainline"
-	],
+		"gauge", "candle", "mix", "tline", "tarea", "scatter", "bubble", "demotype", "mainline","mainradar"],
 	"range": ["饼状图", "圆环图", "玫瑰图", "词云图", "漏斗图", "地图", "圆弧进度条", "折线图", "柱状图", "条状图", "区域图", "雷达图", "仪表盘", "K线图",
-		"混合图", "时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型", "首页趋势图"
-	],
+		"混合图", "时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型", "首页趋势图", "首页雷达图"],
 	//增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype"
 	//自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories
-	"categories": ["line", "column", "bar", "area", "radar", "gauge", "candle", "mix", "demotype", "mainline"],
+	"categories": ["line", "column", "bar", "area", "radar", "gauge", "candle", "mix", "demotype", "mainline", "mainradar"],
 	//instance为实例变量承载属性,不要删除
 	"instance": {},
 	//option为opts及eopts承载属性,不要删除
@@ -1054,15 +1052,7 @@ const cfu = {
 		"timing": "easeOut",
 		"duration": 1000,
 		"color": [
-			"#6495ed",
-			"#91CB74",
-			"#FAC858",
-			"#EE6666",
-			"#73C0DE",
-			"#3CA272",
-			"#FC8452",
-			"#9A60B4",
-			"#ea7ccc"
+			"#6495ed"
 		],
 		"padding": [
 			0,
@@ -1164,6 +1154,86 @@ const cfu = {
 				"data": []
 			}
 		}
+	},
+	"mainradar":{
+	    "type": "radar",
+	    "canvasId": "",
+	    "canvas2d": false,
+	    "background": "none",
+	    "animation": true,
+	    "timing": "easeOut",
+	    "duration": 1000,
+	    "color": [
+	        "#0052d4",
+	        "#ff5959",
+	        "#f9b248"
+	    ],
+	    "padding": [
+	        5,
+	        5,
+	        5,
+	        5
+	    ],
+	    "rotate": false,
+	    "errorReload": true,
+	    "fontSize": 13,
+	    "fontColor": "#666666",
+	    "enableScroll": false,
+	    "touchMoveLimit": 60,
+	    "enableMarkLine": false,
+	    "dataLabel": false,
+	    "dataPointShape": false,
+	    "dataPointShapeType": "solid",
+	    "tapLegend": true,
+	    "legend": {
+	        "show": false,
+	        "position": "right",
+	        "float": "center",
+	        "padding": 5,
+	        "margin": 5,
+	        "backgroundColor": "rgba(0,0,0,0)",
+	        "borderColor": "rgba(0,0,0,0)",
+	        "borderWidth": 0,
+	        "fontSize": 13,
+	        "fontColor": "#666666",
+	        "lineHeight": 25,
+	        "hiddenColor": "#CECECE",
+	        "itemGap": 10
+	    },
+	    "extra": {
+	        "radar": {
+	            "gridType": "radar",
+	            "gridColor": "#CCCCCC",
+	            "gridCount": 1,
+	            "labelColor": "#f1f3f5",
+	            "opacity": 0.2,
+	            "border": true,
+	            "borderWidth": 2,
+	            "max": 100
+	        },
+	        "tooltip": {
+	            "showBox": true,
+	            "showArrow": true,
+	            "showCategory": false,
+	            "borderWidth": 0,
+	            "borderRadius": 5,
+	            "borderColor": "#000000",
+	            "borderOpacity": 0.5,
+	            "bgColor": "#000000",
+	            "bgOpacity": 0.5,
+	            "gridType": "solid",
+	            "dashLength": 4,
+	            "gridColor": "#CCCCCC",
+	            "fontColor": "#FFFFFF",
+	            "splitLine": false,
+	            "horizentalLine": false,
+	            "xAxisLabel": false,
+	            "yAxisLabel": false,
+	            "labelBgColor": "#FFFFFF",
+	            "labelBgOpacity": 0.5,
+	            "labelFontColor": "#666666"
+	        }
+	    }
 	}
 }