Преглед изворни кода

登录流程与引导页完善首页美化

zhangsl пре 3 година
родитељ
комит
c6c8892f0c

+ 1 - 1
App.vue

@@ -22,7 +22,7 @@
 	@import '@/static/customicons.css';
 	// 设置整个项目的背景色
 	page {
-		background-color: #fafafa;
+		background-color: #f1f3f5;
 	}
 
 	/* #endif */

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

@@ -0,0 +1,47 @@
+<template>
+	<view>
+		<view class="charts-box">
+			<qiun-data-charts type="mainline" :chartData="chartData" :loadingType="4" background="none" />
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "mainline-chart",
+		data() {
+			return {
+
+				chartData: {
+					categories: [
+						"开学考试",
+						"第一月考",
+						"第二月考",
+						"期中考试",
+						"第三月考",
+						"期末考试"
+					],
+					series: [{
+						"name": "总成绩",
+						"data": [
+							555,
+							577,
+							540,
+							588,
+							563,
+							594
+						]
+					}]
+				},
+
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+.charts-box{
+  width: 100%;
+  height:200px;
+}
+</style>

+ 92 - 67
components/mini-login/mini-login.vue

@@ -1,12 +1,12 @@
-<template>
+<template>
 	<view class="content">
 		<view class="bg"></view>
 		<view class="bg2"></view>
 		<view class="tips">
 			<text class="title">登录</text>
-			<text class="subtitle">欢迎来到摩豆家长</text>
+			<text class="subtitle">欢迎来到摩豆家长</text>
 		</view>
-		
+
 		<view class="form-box">
 			<!-- <view class="input-box">
 				<image class="left"
@@ -28,59 +28,64 @@
 			</view> -->
 			<view class="btn" @click="getUserInfo">微信一键登录</view>
 			<view class="other">
-				<text>账号密码登录</text>
-				<text @click="getUserInfo" style="color:#4169E1;">
+				<text class="other-text-left">账号密码登录</text>
+				<text class="other-text-right" @click="getUserInfo" style="color:#4169E1;">
 					忘记密码
 				</text>
 			</view>
 		</view>
-	</view>
-</template>
-
+	</view>
+</template>
+
 <script>
-	import {mapMutations, mapState} from 'vuex'
-	
-	export default {
-		name:"mini-login",
-		data() {
-			return {
-				
-			};
+	import {
+		mapMutations,
+		mapState
+	} from 'vuex'
+
+	export default {
+		name: "mini-login",
+		data() {
+			return {
+
+			};
 		},
-		computed:{
-			
+		computed: {
+
 		},
-		methods:{
-			...mapMutations('m_parent',['updateParentInfo','updateToken']),
+		methods: {
+			...mapMutations('m_parent', ['updateParentInfo', 'updateToken']),
 			//取得用户授权获取用户信息
-			getUserInfo(){	
+			getUserInfo() {
 				uni.getUserProfile({
-					desc:'获取您的昵称,头像,地区信息',
+					desc: '获取您的昵称,头像,地区信息',
 					success: infoRes => {
-						if(infoRes.errMsg === 'getUserProfile:ok'){
+						if (infoRes.errMsg === 'getUserProfile:ok') {
 							this.updateParentInfo(infoRes.userInfo)
-							
+
+							console.log('infoRes')
 							console.log(infoRes)
 							this.getToken(infoRes)
-						}else{
+						} else {
 							uni.$showMsg('授权失败')
 						}
-						},
-						fail: err => {
-							console.log('getUserInfo-error', JSON.stringify(err));
-						}
-					});
-				},
-				//调用登录接口换取token
-			async getToken(info){
+					},
+					fail: err => {
+						console.log('getUserInfo-error', JSON.stringify(err));
+					}
+
+				});
+			},
+			//调用登录接口换取token
+			async getToken(info) {
 				//调用login()拿到code用于换取token
-				const [err,res] = await uni.login().catch(err => err)
-				
-				console.log(res)
+				const [err, res] = await uni.login().catch(err => err)
 				
+				console.log('res');
+				console.log(res);
 				//判断调用是否成功
 				if (err || res.errMsg !== 'login:ok') return uni.$showMsg('登录失败!')
-				
+
 				//准备换取token参数
 				const query = {
 					code: res.code,
@@ -90,19 +95,28 @@
 					signature: info.signature
 				}
 				console.log(query)
-				
-				//传入后台换取token
-				const {data:loginResult} = await uni.$http.post('https://api-hmugo-web.itheima.net/api/public/v1/users/wxlogin',query)
-				if(loginResult.meta.status !== 200) return uni.$showMsg('登录失败!')
-				uni.$showMsg('登录成功')
+
+				//传入数据后台换取token和其他重要数据loginResult{token,parentdetail}
+				// const {
+				// 	data: loginResult
+				// } = await uni.$http.post('https://api-hmugo-web.itheima.net/api/public/v1/users/wxlogin', query)
+				// if(loginResult.meta.status !== 200) return uni.$showMsg('登录失败!')
+				// uni.$showMsg('登录成功')
+				// if (loginResult.meta.status == 200) return uni.$showMsg('登录失败!')
+				// uni.$showMsg('登录成功')
 				//更新vuex中token
-				this.updateToken(loginResult.message.token)
+				// this.updateToken(loginResult.message.token)
+				// this.updateToken('token')
+				// this.updateparentdetail()
+				uni.navigateTo({
+					url: '/pages/guide/guide'
+				})
 			}
-				
-			},
-		}
-</script>
-
+
+		},
+	}
+</script>
+
 <style lang="scss">
 	//登录页面
 	.content {
@@ -110,28 +124,28 @@
 		height: 100vh;
 		background-color: #fafafa;
 		z-index: 999;
-	
+
 		.tips {
 			padding-top: 200rpx;
 			padding-left: 80rpx;
 			display: flex;
 			flex-direction: column;
-	
+
 			.title {
 				line-height: 70rpx;
 				font-weight: bold;
 				font-size: 50rpx;
 			}
-	
+
 			.subtitle {
 				line-height: 70rpx;
 				font-size: 35rpx;
 				font-weight: bold;
 				color: #b0b0b1;
 			}
-	
+
 		}
-	
+
 		.bg {
 			position: fixed;
 			top: -250rpx;
@@ -142,7 +156,7 @@
 			background-color: #4169E1;
 			z-index: 2
 		}
-	
+
 		.bg2 {
 			position: fixed;
 			top: -150rpx;
@@ -150,15 +164,15 @@
 			width: 600rpx;
 			height: 600rpx;
 			border-radius: 100%;
-			background-color: #00baef;
+			background-color: #6495ed;
 			z-index: 1;
 		}
-	
+
 		.form-box {
 			padding-top: 250rpx;
 			padding-left: 70rpx;
 			width: 610rpx;
-	
+
 			.input-box {
 				margin: 40rpx 0;
 				display: flex;
@@ -168,26 +182,26 @@
 				background-color: #f5f5f5;
 				border-radius: 100rpx;
 				width: 100%;
-	
+
 				input {
 					flex: 1;
 					height: 100%;
 					font-size: 30rpx;
 				}
-	
+
 				.left {
 					padding: 0 30rpx;
 					width: 35rpx;
 					height: 35rpx;
 				}
-	
+
 				.right {
 					padding: 0 30rpx;
 					width: 40rpx;
 					height: 40rpx;
 				}
 			}
-	
+
 			.btn {
 				display: flex;
 				justify-content: center;
@@ -196,20 +210,31 @@
 				height: 100rpx;
 				border-radius: 100rpx;
 				color: #FFFFFF;
-				background: linear-gradient(to right, #506AE7, #ade8f9);
-				text-shadow: 1px 1px 1px rgba(255,255,255, .1);
-				box-shadow: 0 5px 10px rgba(0,0,0,0.2);
+				background: linear-gradient(to right, #506AE7, #87CEFA);
+				text-shadow: 1px 1px 1px rgba(255, 255, 255, 0.1);
+				box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
+				margin-top: 30px;
 			}
-	
+
 			.other {
 				display: flex;
 				justify-content: space-between;
-	
+
 				text {
 					line-height: 80rpx;
 					font-size: 28rpx;
 				}
+
+				.other-text-left {
+					margin-left: 2px;
+					margin-top: 10px;
+				}
+
+				.other-text-right {
+					margin-right: 2px;
+					margin-top: 10px;
+				}
 			}
 		}
-	}
+	}
 </style>

+ 16 - 11
components/mini-userinfo/mini-userinfo.vue

@@ -30,7 +30,7 @@
 			<!-- 用户功能 -->
 			<view class="com-item">
 				<view class="com-wrap">
-					<view class="cell" @click="show = true">
+					<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>
@@ -53,7 +53,7 @@
 	
 			<!-- 用户服务 -->
 			<view class="com-item">
-				<view class="com-wrap">
+				<view class="com-box">
 					<view class="cell" v-for="(item, index) in serverList" :key="index" @click="nav(item.path)">
 						<view class="cell-left">
 							<image class="cell-icon" :src="item.icon" mode="aspectFill"></image>
@@ -98,8 +98,8 @@
 			};
 		},
 		methods:{
-			...mapMutations('m_parent',['updateParentInfo','updateToken']),
-			...mapMutations('m_children',['updateChildrenInfo','updateChildrenGrade']),
+			...mapMutations('m_parent',['updateParentDetail','updateToken']),
+			...mapMutations('m_children',['updateChildrenInfo']),
 			
 			async logout(){
 				const [err,succ] = await uni.showModal({
@@ -108,10 +108,12 @@
 				}).catch(err => err)
 				if(succ && succ.confirm)
 				{
-					this.updateChildrenGrade({})
 					this.updateChildrenInfo({})
-					this.updateParentInfo({})
+					this.updateParentDetail({})
 					this.updateToken('')
+					uni.navigateTo({
+						url:'/pages/login/login'
+					})
 				}
 			}
 		}
@@ -123,7 +125,7 @@
 		height: 100%;
 		.userinfo-topinfo{
 			height: 400rpx;
-			background: linear-gradient(#ff5959, #fafafa);
+			background: linear-gradient(#ff5959, #f1f3f5);
 			display: flex;
 			justify-content: flex-start;
 			align-items: center;
@@ -164,7 +166,7 @@
 			justify-content: space-around;
 			
 			.cart-big{
-				border-radius: 25rpx;
+				border-radius: 15rpx;
 				overflow: hidden;
 				margin: 10px 0 10px 0;
 				display: flex;
@@ -175,12 +177,13 @@
 				box-shadow: 0 5px 5px rgba(0,0,0,0.1);
 				
 				.cart-icon{
-					width: 70px;
+					width: 60px;
 					height: 90px;
 					margin: 10px 10px 0px 10px;
 				}
 				.cart-text{
 					margin: 10px;
+					font-size: 15px;
 				}
 			}
 			
@@ -198,7 +201,7 @@
 					flex-direction: row;
 					align-items: center;
 					padding: 10px;
-					border-radius: 25rpx;
+					border-radius: 15rpx;
 					overflow: hidden;
 					
 					.cart-icon-sim{
@@ -208,6 +211,8 @@
 					}
 					.cart-text-sim{
 						margin: 10px;
+						font-size: 15px;
+						color: #3B4144;
 					}
 				}
 			}
@@ -220,7 +225,7 @@
 				box-shadow: 0 5px 5px rgba(0,0,0,0.1);
 				border-radius: 25rpx;
 		
-				.com-wrap {
+				.com-box {
 					border-radius: 25rpx;
 					overflow: hidden;
 				}

+ 0 - 442
components/sin-signature/sin-signature.vue

@@ -1,442 +0,0 @@
-<template>
-	<view class="signature-wrap">
-		<view class="img-wrap" @tap="showSignature()" @touchstart="touchSignature()">
-			<image :src="absPrevView" mode="scaleToFill"></image>
-		</view>
-		<view v-if="!disabled" v-show="show" class="signature-contain">
-			<view class="signature-main" style="z-index: 3000;">
-				<view class="signature-title"><text v-for="t in titles">{{t}}</text></view>
-				<canvas disable-scroll="true" class="signature" :class="cid" canvas-id="cvs" @touchstart="touchstart"
-					@touchmove="touchmove" @touchend="touchend"></canvas>
-				<view class="signature-btns">
-					<view class="btn btn-cancel cu-btn bg-main margin-tb-sm text-white" @tap="cancelSignature()">
-						<text>取</text><text>消</text>
-					</view>
-					<view class="btn btn-clear cu-btn bg-main margin-tb-sm text-white" @tap="clearSignature();">
-						<text>清</text><text>空</text>
-					</view>
-					<view class="btn btn-ok cu-btn bg-main margin-tb-sm text-white" @tap="onOK()">
-						<text>确</text><text>定</text>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	let _keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
-	var _utf8_encode = function(string) {
-		string = string.replace(/\r\n/g, "\n");
-		var utftext = "";
-		for (var n = 0; n < string.length; n++) {
-			var c = string.charCodeAt(n);
-			if (c < 128) {
-				utftext += String.fromCharCode(c);
-			} else if ((c > 127) && (c < 2048)) {
-				utftext += String.fromCharCode((c >> 6) | 192);
-				utftext += String.fromCharCode((c & 63) | 128);
-			} else {
-				utftext += String.fromCharCode((c >> 12) | 224);
-				utftext += String.fromCharCode(((c >> 6) & 63) | 128);
-				utftext += String.fromCharCode((c & 63) | 128);
-			}
-
-		}
-		return utftext;
-	}
-
-	let base64encode = function(input) {
-		var output = "";
-		var chr1, chr2, chr3, enc1, enc2, enc3, enc4;
-		var i = 0;
-		input = _utf8_encode(input);
-		while (i < input.length) {
-			chr1 = input.charCodeAt(i++);
-			chr2 = input.charCodeAt(i++);
-			chr3 = input.charCodeAt(i++);
-			enc1 = chr1 >> 2;
-			enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
-			enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
-			enc4 = chr3 & 63;
-			if (isNaN(chr2)) {
-				enc3 = enc4 = 64;
-			} else if (isNaN(chr3)) {
-				enc4 = 64;
-			}
-			output = output +
-				_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +
-				_keyStr.charAt(enc3) + _keyStr.charAt(enc4);
-		}
-		return output;
-	}
-	export default {
-		cxt: null,
-		data() {
-			return {
-				VERSION: '1.0.0',
-				cid: 'cvs',
-				show: false,
-				ctrl: null,
-				listeners: [],
-				prevView: '',
-
-				draws: [],
-				lines: [],
-				line: null,
-			};
-		},
-		props: {
-			value: {
-				default: '',
-			},
-			title: {
-				type: String,
-				default: '请签字',
-			},
-			disabled: {
-				type: Boolean,
-				default: false,
-			}
-		},
-		watch: {
-			value() {
-				this.prevView = this.value;
-			}
-		},
-		computed: {
-			titles() {
-				return this.title.split('')
-			},
-			absPrevView() {
-				var pv = this.prevView;
-				// if(pv){
-				// 	pv = this.$wrapUrl(pv)
-				// }
-				return pv;
-			}
-		},
-		mounted() {
-			this.prevView = this.value;
-			console.log('dx')
-		},
-		methods: {
-			onOK() {
-				let data = this.ctrl.getValue();
-				this.$emit('input', data);
-				this.prevView = data;
-				this.hideSignature();
-				let f = this.listeners.shift();
-				if (f) {
-					f(data);
-				}
-			},
-			touchSignature() {
-				let sig = this.prevView
-				if (!sig || !sig.length) {
-					this.showSignature()
-				}
-			},
-			showSignature() {
-				if (this.disabled)
-					return;
-				if (!this.ctrl) {
-					this.initCtrl();
-				} else if (!this.show) {
-					this.clearSignature();
-					this.show = true;
-				}
-			},
-			async getSyncSignature() {
-				this.showSignature();
-				return await new Promise(async (resolve, reject) => {
-					this.listeners.push((res) => {
-						resolve(res);
-					});
-				});
-			},
-			cancelSignature() {
-				this.listeners.map((f) => {
-					f(null);
-				})
-				this.hideSignature();
-			},
-			hideSignature() {
-				this.ctrl && this.ctrl.clear();
-				this.show = false;
-			},
-			clearSignature() {
-				this.ctrl && this.ctrl.clear();
-			},
-			async initCtrl() {
-				this.show = true;
-				let cxt = uni.createCanvasContext(this.cid, this);
-				this.cxt = cxt;
-				// cxt.clearRect(0,0,c.width,c.height);
-				this.ctrl = {
-					width: 0,
-					height: 0,
-					clear: () => {
-						this.lines = [];
-						let info = uni.createSelectorQuery().in(this).select("." + this.cid);
-						info.boundingClientRect((data) => {
-							if (data) {
-								cxt.clearRect(0, 0, data.width, data.height);
-								if (data.width && data.height) {
-									this.ctrl.width = data.width;
-									this.ctrl.height = data.height;
-								}
-							}
-						}).exec();
-						this.redraw();
-					},
-					getValue: () => {
-						if (!this.lines.length)
-							return '';
-						let svg = this._get_svg();
-						// new Buff
-						let b64 = base64encode(svg);
-						let data = 'data:image/svg+xml;base64,' + b64;
-						// console.log(svg);
-						// console.log(data);
-						return data;
-					},
-				};
-				this.$nextTick(function() {
-					this.ctrl.clear();
-				})
-			},
-			_get_svg() {
-				let r = -90;
-				let paths = [];
-				let raww = this.ctrl.width;
-				let rawh = this.ctrl.height;
-				let width = Math.abs(r) != 90 ? raww : rawh;
-				let height = Math.abs(r) == 90 ? raww : rawh;
-				let cx = raww / 2;
-				let cy = rawh / 2;
-				let PI = Math.PI;
-				let R = (r || 0) % 360;
-				let cosv = Math.cos(R * PI / 180);
-				let sinv = Math.sin(R * PI / 180);
-				let dcx = (width - raww) / 2;
-				let dcy = (height - rawh) / 2;
-				let trans = function(p) {
-					if (!R) {
-						return p;
-					} else {
-						let nx = (p.x - cx) * cosv - (p.y - cy) * sinv + cx;
-						let ny = (p.x - cx) * sinv + (p.y - cy) * cosv + cy;
-						return {
-							x: nx + dcx,
-							y: ny + dcy
-						};
-					}
-					return p;
-				}
-				this.lines.map(l => {
-					if (l.points.length < 2) {
-						return;
-					}
-					let sp = trans(l.start)
-					let pts = [`M ${sp.x} ${Number(sp.y)}`];
-					l.points.map(p => {
-						let np = trans(p)
-						pts.push(`L ${np.x} ${Number(np.y)}`);
-					});
-					paths.push(
-						`<path stroke-linejoin="round" stroke-linecap="round" stroke-width="3" stroke="rgb(0,0,0)" fill="none" d="${pts.join(' ')}"/>`
-					);
-				})
-				let svg =
-					`<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="${width}" height="${height}">${paths.join('\n')}</svg>`;
-				return svg;
-			},
-			_get_svg_raw() {
-				let paths = [];
-				this.lines.map(l => {
-					if (l.points.length < 2) {
-						return;
-					}
-					let pts = [`M ${l.start.x} ${Number(l.start.y)}`];
-					l.points.map(p => {
-						pts.push(`L ${p.x} ${Number(p.y)}`);
-					});
-					paths.push(
-						`<path stroke-linejoin="round" stroke-linecap="round" stroke-width="3" stroke="rgb(0,0,0)" fill="none" d="${pts.join(' ')}"/>`
-					);
-				})
-				let width = this.ctrl.width;
-				let height = this.ctrl.height;
-				let svg =
-					`<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="${width}" height="${height}" transform="rotate(-90)">${paths.join('\n')}</svg>`;
-				return svg;
-			},
-			_get_point(e) {
-				return {
-					x: e.changedTouches[0].x.toFixed(1),
-					y: e.changedTouches[0].y.toFixed(1),
-				}
-			},
-			touchstart(e) {
-				let p = this._get_point(e);
-				this.line = {
-					start: p,
-					points: [p],
-				}
-				this.lines.push(this.line);
-			},
-			touchmove(e) {
-				let p = this._get_point(e);
-				this.line.points.push(p)
-				if (!this.tm) {
-					this.tm = setTimeout(() => {
-						this.redraw();
-						this.tm = 0;
-					}, 10)
-				}
-			},
-			touchend(e) {
-				let p = this._get_point(e);
-				this.line.points.push(p)
-				this.line.end = p
-				this.redraw()
-			},
-			redraw() {
-				let cxt = this.cxt;
-				cxt.setStrokeStyle("#000");
-				cxt.setLineWidth(3);
-				var last = null;
-				this.lines.map(l => {
-					cxt.beginPath();
-					if (l.points.length < 2) {
-						return;
-					}
-					cxt.moveTo(l.start.x, l.start.y);
-					l.points.map(p => {
-						cxt.lineTo(p.x, p.y)
-					})
-					cxt.stroke()
-				})
-
-				cxt.draw()
-			},
-			canvasIdErrorCallback: function(e) {
-				console.error(e.detail.errMsg)
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	.signature-wrap {
-		height: 100%;
-		width: 100%;
-		// padding: 0 5px;
-
-		// min-width: 60vw;
-		.img-wrap {
-			width: 100%;
-			min-height: 200rpx;
-			display: flex;
-			align-items: center;
-			text-align: center;
-			align-content: center;
-			justify-content: center;
-
-			image {
-				width: 100%;
-			}
-
-			// background: red;
-		}
-	}
-
-	.signature-contain {
-		z-index: 9000;
-		position: fixed;
-		left: 0;
-		top: 0;
-		width: 100%;
-
-		.signature-main {
-			background: white;
-			flex-direction: row-reverse;
-			display: flex;
-			align-items: stretch;
-			height: 101%;
-			overflow: scroll;
-		}
-
-		.signature-title {
-			font-weight: bold;
-			font-size: 18px;
-			display: flex;
-			padding: 0 20rpx;
-			flex-direction: column;
-			justify-content: center;
-			height: 100vh;
-			color: $uni-text-color;
-
-			text {
-				transform: rotate(90deg);
-			}
-		}
-
-		.signature {
-			border: 1px dotted black;
-			border-bottom: 1px dotted black;
-			background: #FFF;
-			margin: 10px 0;
-			width: 90vw;
-			height: 90vh;
-			align-self: center;
-			// pointer-events:none;
-		}
-
-		.signature-btns {
-			display: flex;
-			padding: 2px;
-			// margin-right: 5px;
-			flex-direction: column;
-
-			.btn {
-				flex-grow: 1;
-				flex-shrink: 0;
-				padding: 20rpx;
-				font-size: 20px;
-				margin: 0;
-				text-align: center;
-				text-decoration: none;
-				height: 30vh;
-				display: flex;
-				align-content: center;
-				justify-content: center;
-				flex-direction: column;
-
-				text {
-					transform: rotate(90deg);
-				}
-
-				&+.btn {
-					border-top: 1px solid #eee;
-				}
-
-				&.btn-clear {
-					// background-color: #fc2a07;
-					color: $uni-color-success;
-				}
-
-				&.btn-cancel {
-					// background-color: #eff4f4;
-					color: $uni-color-warning;
-				}
-
-				&.btn-ok {
-					// background-color: $uni-color-success;
-					color: $uni-color-primary;
-				}
-			}
-		}
-	}
-</style>

+ 65 - 21
information/parent.js

@@ -1,44 +1,88 @@
 //导出家长信息存储模块
-export default{
+export default {
 	//开启命名空间
 	namespaced: true,
-	
+
 	//模块数据
 	state: () => ({
-		
-		token: uni.getStorageSync('token') || 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOjIzLCJpYXQiOjE1NjQ3MzAwNzksImV4cCI6MTAwMTU2NDczMDA3OH0.YPt-XeLnjV-_1ITaXGY2FhxmCe4NvXuRnRB8OMCfnPo',
-		
-		parentinfo: JSON.parse(uni.getStorageSync('parentinfo') || '{}'),
-		
-		
+
+		token: uni.getStorageSync('token') || '假数据',
+
+		parentinfo: {
+			avatarUrl: "https://thirdwx.qlogo.cn/mmopen/vi_32/P79Xu1vuLVV1VykYd37lYsjXJxdBuibMlQRz9qSSzFmjEEf80ibISEtmUoxGQvyJ9QYBIicXYca2mX2qOEVBhuOdw/132",
+			city: "",
+			country: "",
+			gender: 0,
+			language: "zh_CN",
+			nickName: "荒川",
+			province: ""
+		},
+
+		parentdetail: {
+			openid: '123',
+			phoneNumber: '17882237075',
+			name: '家长姓名',
+			defaultChild: 'tmdid01',
+			childrenList: [{
+				avatar: '/static/boy.png',
+				name: '张三',
+				classid: '0301',
+				className: '三年级一班',
+				tmdid: 'tmdid01'
+			}, {
+				avatar: '/static/boy.png',
+				name: '张五',
+				classid: '0304',
+				className: '三年级四班',
+				tmdid: 'tmdid02'
+			}, {
+				avatar: '/static/girl.png',
+				name: '张梅',
+				classid: '0504',
+				className: '五年级四班',
+				tmdid: 'tmdid03'
+			},
+			]
+		},
+
+
 	}),
 	//模块方法(修改数据)
 	mutations: {
 		//更新用户信息
-		updateParentInfo(state,parentinfo){
+		updateParentInfo(state, parentinfo) {
 			state.parentinfo = parentinfo
 			this.commit('m_parent/saveParentInfoToStorage')
 		},
 		//持久化存储
-		saveParentInfoToStorage(state){
-			uni.setStorageSync('parentinfo',JSON.stringify(state.parentinfo))
+		saveParentInfoToStorage(state) {
+			uni.setStorageSync('parentinfo', JSON.stringify(state.parentinfo))
+		},
+		//更新家长详细信息
+		updateParentDetail(state,parentdetail){
+			state.parentdetail = parentdetail
+			this.commit('m_parent/saveParentDetailToStorage')
+		},
+		//持久化存储
+		saveParentDetailToStorage(state){
+			uni.setStorageSync('parentinfo', JSON.stringify(state.parentdetail))
 		},
-		
+
 		//更新token字符串
-		updateToken(state,token) {
+		updateToken(state, token) {
 			state.token = token
 			this.commit('m_parent/saveTokenToStorage')
 		},
-		
-		//将token持久化存储到本地
+
+		//token持久化存储
 		saveTokenToStorage(state) {
-			uni.setStorageSync('token',state.token)
+			uni.setStorageSync('token', state.token)
 		},
-		
-		
+
+
 	},
 	//模块属性(数据包装)
-	getters:{
-		
+	getters: {
+
 	}
-}
+}

+ 71 - 53
pages.json

@@ -1,73 +1,91 @@
 {
 	"pages": [{
-		"path": "pages/home/home",
-		"style": {
-			// "navigationBarTitleText": "",
-			"enablePullDownRefresh": false,
-			"navigationStyle":"custom"
-		}
+			"path": "pages/login/login",
+			"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/my/my",
+			"style": {
+				"enablePullDownRefresh": false,
+				"navigationStyle": "custom"
+			}
 
-	}],
+		}
+	    ,{
+            "path" : "pages/guide/guide",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+    ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",
 		"navigationBarTitleText": "家长端",
-		"navigationBarBackgroundColor": "#fafafa",
-		"backgroundColor": "#fafafa"
+		"navigationBarBackgroundColor": "#f1f3f5",
+		"backgroundColor": "#f1f3f5"
 	},
-	"tabBar":{
-		"backgroundColor":"#fafafa",
-		"borderStyle":"white",
-		"color":"#707070",
-		"selectedColor":"#2c2c2c",
-		"spacing":"5px",
+	"tabBar": {
+		"backgroundColor": "#f1f3f5",
+		"borderStyle": "white",
+		"color": "#707070",
+		"selectedColor": "#2c2c2c",
+		"spacing": "5px",
 		"fontSize": "12px",
-		"height":"55px",
-		"iconWidth":"24px",
-		
-		"list":[
-			{
-				"pagePath":"pages/home/home",
-				"iconPath":"static/tab-icons/home.png",
-				"selectedIconPath":"static/tab-icons/home-selected.png",
-				"text":"首页"
+		"height": "55px",
+		"iconWidth": "24px",
+
+		"list": [{
+				"pagePath": "pages/home/home",
+				"iconPath": "static/tab-icons/home.png",
+				"selectedIconPath": "static/tab-icons/home-selected.png",
+				"text": "首页"
 			},
 			{
-				"pagePath":"pages/grade/grade",
-				"iconPath":"static/tab-icons/grade.png",
-				"selectedIconPath":"static/tab-icons/grade-selected.png",
-				"text":"成绩"
+				"pagePath": "pages/grade/grade",
+				"iconPath": "static/tab-icons/grade.png",
+				"selectedIconPath": "static/tab-icons/grade-selected.png",
+				"text": "成绩"
 			},
 			{
-				"pagePath":"pages/approval/approval",
-				"iconPath":"static/tab-icons/approval.png",
-				"selectedIconPath":"static/tab-icons/approval-selected.png",
-				"text":"审批"
+				"pagePath": "pages/approval/approval",
+				"iconPath": "static/tab-icons/approval.png",
+				"selectedIconPath": "static/tab-icons/approval-selected.png",
+				"text": "审批"
 			},
 			{
-				"pagePath":"pages/my/my",
-				"iconPath":"static/tab-icons/my.png",
-				"selectedIconPath":"static/tab-icons/my-selected.png",
-				"text":"我的"
+				"pagePath": "pages/my/my",
+				"iconPath": "static/tab-icons/my.png",
+				"selectedIconPath": "static/tab-icons/my-selected.png",
+				"text": "我的"
 			}
 		]
 	}

+ 5 - 18
pages/approval/approval.vue

@@ -1,31 +1,18 @@
 <template>
-	<view class="content" style="padding: 10rpx;">
-		<!-- 签字板 -->
-	  <view style="border: 1rpx dashed #555555;">
-	    <Signature ref="sig" v-model="v"></Signature>
-	  </view>
-	    <button @tap="startSign">手动弹出</button>
-		<text style="overflow-wrap: break-word;">{{v}}</text>
+	<view class="content">
+		
 	</view>
 </template>
 
-<script>
-	import Signature from '@/components/sin-signature/sin-signature.vue'
+<script>
 	export default {
 		data() {
 			return {
-				v: ''
 			};
 		},
-		components:{
-			Signature,
-		},
+
 		methods:{
-			async startSign(){
-				let sign = await this.$refs.sig.getSyncSignature();
-				console.log('组件版本',this.$refs.sig.VERSION);
-				console.log('签名数据',sign);
-			}
+			
 		}
 	}
 </script>

+ 2 - 2
pages/grade/grade.vue

@@ -53,7 +53,7 @@
 		height: 100%;
 		.home-topinfo{
 			height: 400rpx;
-			background: linear-gradient(#FFC600, #fafafa);
+			background: linear-gradient(#FFC600, #f1f3f5);
 			display: flex;
 			justify-content: flex-start;
 			align-items: center;
@@ -64,7 +64,7 @@
 			width: 48px;
 			height: 48px;
 			border-radius: 25px;
-			border: 1px solid #FFFFFF;
+			border: 2px solid #FFFFFF;
 			box-shadow: 0 5px 10px rgba(0,0,0,0.2);
 		}
 		.children-name{

+ 115 - 0
pages/guide/guide.vue

@@ -0,0 +1,115 @@
+<template>
+	<view class="children-container">
+		<!-- 标题 -->
+		<view class="tips">
+			<view class="title">选择您的孩子</view>
+		</view>
+		<!-- 孩子选择界面 -->
+		<view class="children-item">
+			<view class="com-box">
+				<view class="item" v-for="(item,index) in parentdetail.childrenList" :key="index" @click="chooseChildren(item)">
+					<view class="item-text">{{item.name}}</view>
+					<view class="avatar-box">
+						<u-avatar size="120" class="item-avatar" :src="item.avatar" mode="aspectFill"></u-avatar>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {mapState,mapMutations} from 'vuex'
+	
+	export default {
+		data() {
+			return {
+				
+			};
+		},
+		computed:{
+			...mapState('m_parent',['parentdetail'])
+		},
+		onLoad(){
+			//获得家长详细信息
+			// if(parentdetail === '')
+			// this.getParentDetail();
+		},
+		methods:{
+			...mapMutations('m_children',['updateChildrenInfo']),
+			// async getParentDetail(){
+			// 	const res = await uni.$http.post('',);
+			// }
+			//选择孩子并跳转首页传入id查询显示孩子信息
+			chooseChildren(item){
+				console.log(item.tmdid);
+				this.updateChildrenInfo(item)
+				uni.switchTab({
+					url:'/pages/home/home'
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+	.children-container{
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+		
+		.tips {
+			width: 100%;
+			padding-top: 100rpx;
+			padding-left: 80rpx;
+			display: flex;
+			flex-direction: column;
+			margin-bottom: 100rpx;
+		
+			.title {
+				line-height: 70rpx;
+				font-weight: bold;
+				font-size: 50rpx;
+			}
+		}
+		.children-item{
+			.com-box{
+				display: flex;
+				flex-direction: row;
+				justify-content: center;
+				align-items: center;
+				flex-wrap: wrap;//元素换行
+				
+				.item{
+					margin: 10px;
+					padding: 10px;
+					display: flex;
+					flex-direction: column;
+					justify-content: center;
+					align-items: center;
+					background-color: #FFFFFF;
+					border-radius: 10px;
+					width: 140px;
+					height: 160px;
+					
+					.item-text{
+						margin-left: 20rpx;
+						margin-bottom: 10rpx;
+						width: 100%;
+						line-height: 40rpx;
+						font-weight: bold;
+						font-size: 30rpx;
+						color: #696969;
+					}
+					.avatar-box{
+						.item-avatar{
+							width: 220rpx;
+							height: 220rpx;
+						}
+					}
+				}
+			}
+		}
+	}
+</style>

+ 5 - 4
pages/home/home.vue

@@ -8,10 +8,11 @@
 				<text class="detail">学习近况</text>
 			</view>
 		</view>
+		<mainline-chart></mainline-chart>
 		<!-- 步骤条区域 -->
-		<view class="steps-box">
+		<!-- <view class="steps-box">
 			<uni-steps :options="stepsValue" direction="column" :active="active"></uni-steps>
-		</view>
+		</view> -->
 		<!-- 滚动条 -->
 		<view class="notice">
 			<u-notice-bar :text="notification" mode="closable" bgColor="#6495ED" color="#FFFFFF"></u-notice-bar>
@@ -163,7 +164,7 @@
 
 		.home-topinfo {
 			height: 400rpx;
-			background: linear-gradient(#0080ff, #fafafa);
+			background: linear-gradient(#0080ff, #f1f3f5);
 			display: flex;
 			justify-content: flex-start;
 			align-items: center;
@@ -174,7 +175,7 @@
 				width: 48px;
 				height: 48px;
 				border-radius: 25px;
-				border: 1px solid #FFFFFF;
+				border: 2px solid #FFFFFF;
 				box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
 
 			}

+ 19 - 0
pages/login/login.vue

@@ -0,0 +1,19 @@
+<template>
+	<view>
+		<mini-login></mini-login>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				
+			};
+		}
+	}
+</script>
+
+<style lang="scss">
+
+</style>

+ 2 - 3
pages/my/my.vue

@@ -1,7 +1,6 @@
 <template>
 	<view class="my-container">
-		<mini-userinfo v-if="token"></mini-userinfo>
-		<mini-login v-else></mini-login>
+		<mini-userinfo v-if="parentdetail"></mini-userinfo>
 	</view>
 </template>
 
@@ -10,7 +9,7 @@
 	
 	export default {
 		computed:{
-			...mapState('m_parent',['token'])
+			...mapState('m_parent',['token','parentdetail'])
 		},
 		
 		data() {

+ 123 - 3
uni_modules/qiun-data-charts/js_sdk/u-charts/config-ucharts.js

@@ -52,14 +52,14 @@ 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"
+		"gauge", "candle", "mix", "tline", "tarea", "scatter", "bubble", "demotype","mainline"
 	],
 	"range": ["饼状图", "圆环图", "玫瑰图", "词云图", "漏斗图", "地图", "圆弧进度条", "折线图", "柱状图", "条状图", "区域图", "雷达图", "仪表盘", "K线图",
-		"混合图", "时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型"
+		"混合图", "时间轴折线", "时间轴区域", "散点图", "气泡图", "自定义类型", "首页趋势图"
 	],
 	//增加自定义图表类型,如果需要categories,请在这里加入您的图表类型,例如最后的"demotype"
 	//自定义类型时需要注意"tline","tarea","scatter","bubble"等时间轴(矢量x轴)类图表,没有categories,不需要加入categories
-	"categories": ["line", "column", "bar", "area", "radar", "gauge", "candle", "mix", "demotype"],
+	"categories": ["line", "column", "bar", "area", "radar", "gauge", "candle", "mix", "demotype", "mainline"],
 	//instance为实例变量承载属性,不要删除
 	"instance": {},
 	//option为opts及eopts承载属性,不要删除
@@ -1044,6 +1044,126 @@ const cfu = {
 				"opacity": 0.5,
 			},
 		}
+	},
+	"mainline": {
+		"type": "area",
+		"canvasId": "",
+		"canvas2d": false,
+		"background": "none",
+		"animation": true,
+		"timing": "easeOut",
+		"duration": 1000,
+		"color": [
+			"#6495ed",
+			"#91CB74",
+			"#FAC858",
+			"#EE6666",
+			"#73C0DE",
+			"#3CA272",
+			"#FC8452",
+			"#9A60B4",
+			"#ea7ccc"
+		],
+		"padding": [
+			15,
+			15,
+			0,
+			15
+		],
+		"rotate": false,
+		"errorReload": true,
+		"fontSize": 13,
+		"fontColor": "#666666",
+		"enableScroll": false,
+		"touchMoveLimit": 60,
+		"enableMarkLine": false,
+		"dataLabel": false,
+		"dataPointShape": false,
+		"dataPointShapeType": "solid",
+		"tapLegend": true,
+		"xAxis": {
+			"disabled": true,
+			"axisLine": false,
+			"axisLineColor": "#CCCCCC",
+			"calibration": false,
+			"fontColor": "#666666",
+			"fontSize": 13,
+			"rotateLabel": false,
+			"itemCount": 5,
+			"boundaryGap": "center",
+			"disableGrid": true,
+			"gridColor": "#CCCCCC",
+			"gridType": "solid",
+			"dashLength": 4,
+			"gridEval": 1,
+			"scrollShow": false,
+			"scrollAlign": "left",
+			"scrollColor": "#A6A6A6",
+			"scrollBackgroundColor": "#EFEBEF",
+			"format": ""
+		},
+		"yAxis": {
+			"disabled": true,
+			"disableGrid": true,
+			"splitNumber": 5,
+			"gridType": "dash",
+			"dashLength": 2,
+			"gridColor": "#CCCCCC",
+			"padding": 10,
+			"showTitle": false,
+			"data": []
+		},
+		"legend": {
+			"show": false,
+			"position": "bottom",
+			"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": 11,
+			"hiddenColor": "#CECECE",
+			"itemGap": 10
+		},
+		"extra": {
+			"area": {
+				"type": "curve",
+				"opacity": 1,
+				"addLine": true,
+				"width": 5,
+				"gradient": true
+			},
+			"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"
+			},
+			"markLine": {
+				"type": "solid",
+				"dashLength": 4,
+				"data": []
+			}
+		}
 	}
 }