hwq 4 лет назад
Родитель
Сommit
d53c19a259

+ 8 - 0
api/index.js

@@ -7,4 +7,12 @@ export function banner(data) {
 		method: 'get',
 		data
 	});
+}
+// 获取文章列表
+export function category(data,cid) {
+	return request({
+		url: '/api/article/list/'+cid ,
+		method: 'get',
+		data
+	});
 }

+ 10 - 83
api/user.js

@@ -1,13 +1,7 @@
 import request from '@/utils/request'
+import { upFilse} from '@/utils/request';
+
 
-// 订单统计信息
-export function orderData(data) {
-	return request({
-		url: '/api/order/data',
-		method: 'get',
-		data
-	});
-}
 
 // 获取用户信息
 export function getUserInfo(data) {
@@ -17,88 +11,21 @@ export function getUserInfo(data) {
 		data
 	});
 }
-
-// 用户分享图
-export function spreadBanner(data) {
-	return request({
-		url: '/api/spread/banner',
-		method: 'get',
+export function uploads(data){
+	return upFilse({
+		url:'/api/upload/image',
+		method:'post',
 		data
 	});
 }
-
-// 获取地址列表
-export function getAddressList(data) {
+// 获取信息
+export function my(data) {
 	return request({
-		url: '/api/address/list',
+		url: '/api/student/my',
 		method: 'get',
 		data
-	});
-}
-// 修改地址
-export function addressEdit(data) {
-	return request({
-		url: '/api/address/edit',
-		method: 'post',
-		data
-	});
-}
-// 删除地址
-export function addressDel(data) {
-	return request({
-		url: '/api/address/del',
-		method: 'post',
-		data
-	});
-}
-// 设为默认地址
-export function setAddressDefault(data) {
-	return request({
-		url: '/api/address/default/set',
-		method: 'post',
-		data
-	});
-}
-// 购物车列表
-export function getCartList(data) {
-	return request({
-		url: '/api/cart/list',
-		method: 'get',
-		data
-	});
+	})
 }
 
-// 修改购物车数量
-export function getCartNum(data) {
-	return request({
-		url: '/api/cart/num',
-		method: 'post',
-		data
-	});
-}
-//删除购物车
-export function cartDel(data) {
-	return request({
-		url: '/api/cart/del',
-		method: 'post',
-		data
-	});
-}
-//获取收藏夹列表
-export function getcollectList(data) {
-	return request({
-		url: '/api/collect/user',
-		method: 'get',
-		data
-	});
-}
-// 取消收藏
-export function delcollect(data) {
-	return request({
-		url: '/api/collect/del',
-		method: 'post',
-		data
-	});
-}
 
 

+ 31 - 3
pages.json

@@ -52,6 +52,24 @@
 				"navigationBarTextStyle":"black"
 			}
 		    
+		},
+		{
+			"path": "pages/user/about",
+			"style": {
+				"navigationBarTitleText": "关于我们",
+				"navigationBarBackgroundColor":"#FFFFFF",
+				"navigationBarTextStyle":"black"
+			}
+		    
+		},
+		{
+			"path": "pages/public/set",
+			"style": {
+				"navigationBarTitleText": "修改密码",
+				"navigationBarBackgroundColor":"#FFFFFF",
+				"navigationBarTextStyle":"black"
+			}
+		    
 		},
 		{
 			"path": "pages/course/course",
@@ -147,6 +165,16 @@
 				"navigationBarTextStyle":"black"
 			}
 		    
+		},
+		{
+			//修改密码
+			"path": "pages/set/password",
+			"style": {
+				"navigationBarTitleText": "修改密码",
+				"navigationBarBackgroundColor":"#FFFFFF",
+				"navigationBarTextStyle":"black"
+			}
+		    
 		},
 		{
 		    "path" : "pages/problem/problem",
@@ -197,21 +225,21 @@
 	},
 	"tabBar": {
 		"color": "#999999",
-		"selectedColor": "#F85415",
+		"selectedColor": "#1CC7C7",
 		"iconWidth":"18px",
 		"borderStyle": "black",
 		"backgroundColor": "#ffffff",
 		"list": [{
 				"pagePath": "pages/index/index",
 				"iconPath": "static/tabBar/index.png",
-				"selectedIconPath": "static/tabBar/indexD.png",
+				"selectedIconPath": "static/tabBar/indexafter.png",
 				"text": "首页"
 			},
 			
 			{
 				"pagePath": "pages/user/user",
 				"iconPath": "static/tabBar/user.png",
-				"selectedIconPath": "static/tabBar/userD.png",
+				"selectedIconPath": "static/tabBar/userafter.png",
 				"text": "我的"
 			}
 		]

+ 10 - 1
pages/course/course.vue

@@ -13,7 +13,7 @@
 				<view class="main">
 					<view class="left">
 						<view class="font">授课科目: {{item.subject}}</view>
-						<view class="font">班主任:</view>
+						<view class="font">班主任:{{ bzr }}</view>
 					</view>
 					<view class="right">
 						<view class="font">授课老师: {{item.teacher}}</view>
@@ -32,6 +32,7 @@
 	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 	import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 	import { mapState, mapMutations } from 'vuex';
+	import { my } from '@/api/user.js';
 	export default {
 		computed: {
 			...mapState(['hasLogin', 'userInfo', 'baseURL', 'urlFile'])
@@ -47,12 +48,15 @@
 				courseList: [
 					
 				],
+				bzr: '',
+				phone:'',
 			}
 		},
 		onLoad() {
 			if (this.hasLogin) {
 				console.log(this.userInfo)
 				this.loadData();
+				this.data();
 			}else{
 				uni.showModal({
 					title: '登录',
@@ -119,6 +123,11 @@
 					}
 				})
 			},
+			data(){
+				my({}).then(({data}) => {
+					this.bzr = data.manage
+				})
+			},
 			nav(index){
 				uni.navigateTo({
 					url: '/pages/homework/setHomework?id=' + this.courseList[index].id

+ 42 - 15
pages/course/courseWan.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="center">
 		<scroll-view scroll-y="true" class="list">
-			<view v-for="(item,index) in courseList" :key="index" class="listBox" @click="nav(index)">
+			<view v-for="(item,index) in courseList" :key="index" class="listBox" >
 				<view class="type">已完成</view>
 				<view class="top flex">
 					<image src="../../static/img/indexMycourse.png"></image>
@@ -13,14 +13,17 @@
 				<view class="main">
 					<view class="left">
 						<view class="font">授课科目: {{item.subject}}</view>
-						<view class="font">班主任:</view>
+						<view class="font">班主任:{{ bzr }}</view>
 					</view>
 					<view class="right">
 						<view class="font">授课老师: {{item.teacher}}</view>
 						<view class="font">电话:</view>
 					</view>
 				</view>
-				<view class="button">课程评价</view>
+				<view class="btnBox flex">
+					<view class="button" @click="navzy(index)">作业上传</view>
+					<view class="button" @click="nav(index)">课程评价</view>
+				</view>
 			</view>
 			<uni-load-more :status="loadingType"></uni-load-more>
 		</scroll-view>
@@ -32,6 +35,7 @@
 	import { getCourse } from '@/api/course.js';
 	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 	import { mapState, mapMutations } from 'vuex';
+	import { my } from '@/api/user.js';
 	import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 	export default {
 		computed: {
@@ -48,12 +52,15 @@
 				courseList: [
 					
 				],
+				bzr: '',
+				phone:'',
 			}
 		},
 		onLoad() {
 			if (this.hasLogin) {
 				console.log(this.userInfo)
 				this.loadData();
+				this.data();
 			}else{
 				uni.showModal({
 					title: '登录',
@@ -120,6 +127,11 @@
 					}
 				})
 			},
+			data(){
+				my({}).then(({data}) => {
+					this.bzr = data.manage
+				})
+			},
 			nav(index){
 				index = + index;
 				let id = '';
@@ -130,7 +142,18 @@
 				uni.navigateTo({
 					url: '/pages/course/evaluate?id=' + id
 				})
-			}
+			},
+			navzy(index){
+				index = + index;
+				let id = '';
+				console.log(this.courseList[index]);
+				if(this.courseList[+index]){
+					id = this.courseList[index].id;
+				}
+				uni.navigateTo({
+					url: '/pages/homework/setHomework?id=' + id
+				})
+			},
 		}
 	}
 </script>
@@ -208,18 +231,22 @@ page,
 			}
 		}
 	}
-	.button {
+	.btnBox{
+		width: 100%;
 		margin-top: 40rpx;
-		margin-left: 500rpx;
-		width: 145rpx;
-		height: 48rpx;
-		border: 1rpx solid #FF5850;
-		border-radius: 24rpx;
-		font-size: 26rpx;
-		font-weight: 500;
-		color: #FF5850;
-		text-align: center;
-		line-height: 48rpx;
+		justify-content: flex-end;
+		.button {
+			margin-right: 20rpx;
+			width: 145rpx;
+			height: 48rpx;
+			border: 1rpx solid #FF5850;
+			border-radius: 24rpx;
+			font-size: 26rpx;
+			font-weight: 500;
+			color: #FF5850;
+			text-align: center;
+			line-height: 48rpx;
+		}
 	}
 }
 </style>

+ 2 - 1
pages/course/evaluate.vue

@@ -137,7 +137,8 @@ export default {
 		margin-top: 82rpx;
 	}
 	textarea{
-		width: 90%;
+		padding: 20rpx;
+		width: 80%;
 		margin: 0 auto;
 		margin-top: 86rpx;
 		height: 232rpx;

+ 5 - 2
pages/homework/setHomework.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="center">
-		<view>上传视频</view>
+		<view class="text">上传视频</view>
 		<view class="add_picture" v-if="src" >
 			<video :src="src" ></video>
 			<view @click="DelImg" class="x">x</view>
@@ -8,7 +8,7 @@
 		<view v-else class="add_picture">
 			<image src="https://zhibo.liuniu946.com/img/phone.png"  @click="test"></image>
 		</view>
-		<view>上传图片</view>
+		<view class="text">上传图片</view>
 		<view class="add_picture">
 			<image :src="cardimg" mode="" class="upload-img" @click.stop="imgsub" v-if="cardimg"></image>
 			<image src="https://zhibo.liuniu946.com/img/phone.png" class="upload-img" mode="" v-if="!cardimg" @click.stop="imgsub"></image>
@@ -130,4 +130,7 @@ export default {
 			z-index: 99;
 		}
 	}
+	.text {
+		text-align: center;
+	}
 </style>

+ 44 - 52
pages/index/index.vue

@@ -3,40 +3,30 @@
 		<!-- <view class="cl"></view> -->
 		<view class="carousel-section">
 			<swiper class="carousel" autoplay="true" interval="5000" duration="400" @change="swiperChange">
-				<swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item" @click="bannerNavToUrl(item)"> 
-					<image :src="item.pic" />
-				</swiper-item>	
+				<swiper-item v-for="(item, index) in carouselList" :key="index" class="carousel-item"><image :src="item.pic" /></swiper-item>
 			</swiper>
 		</view>
 		<view class="navBox">
 			<view class="navBox-item" @click="nav('/pages/course/course')">
-				<image class="bg1" src="../../static/img/indexMycourse.png" ></image>
-				<view class="font">
-					我的课程
-				</view>
+				<image class="bg1" src="../../static/img/indexMycourse.png"></image>
+				<view class="font">我的课程</view>
 			</view>
 			<view class="navBox-item" @click="nav('/pages/course/courseWan')">
-				<image class="bg2" src="../../static/img/indexKcpj.png" ></image>
-				<view class="font">
-					课程评价
-				</view>
+				<image class="bg2" src="../../static/img/indexKcpj.png"></image>
+				<view class="font">课程评价</view>
 			</view>
 			<view class="navBox-item" @click="nav('/pages/leave/leaveClass')">
 				<image class="bg3" src="../../static/img/indexQjsp.png" mode=""></image>
-				<view class="font">
-					请假审批
-				</view>
+				<view class="font">请假审批</view>
 			</view>
 			<view class="navBox-item" @click="nav('/pages/problem/problem')">
 				<image class="bg4" src="../../static/img/indexWtfq.png" mode="aspectFill"></image>
-				<view class="font">
-					问题反馈
-				</view>
+				<view class="font">问题反馈</view>
 			</view>
 		</view>
 		<view class="title">教育资讯</view>
 		<scroll-view scroll-y="true" class="listBox">
-			<view v-for="(item,index) in dataList" :key="index" class="list" @click="nav('/pages/index/message')">
+			<view v-for="(item, index) in dataList" :key="index" class="list" @click="nav('/pages/index/message')">
 				<view class="img"><image src="../../static/img/test.jpg" mode=""></image></view>
 				<view class="right">
 					<view class="r-title">{{ item.title }}</view>
@@ -48,62 +38,64 @@
 </template>
 
 <script>
-	import { banner } from '@/api/index.js'
+import { banner,category } from '@/api/index.js';
 export default {
-	data(){
-		return{
+	data() {
+		return {
 			swiperCurrent: 0,
 			carouselList: [],
 			dataList: [
 				{
-					title: "马云马化腾对决交通场景,一文说清双方布局",
-					time: "2020-12-26 12:30",
+					title: '马云马化腾对决交通场景,一文说清双方布局',
+					time: '2020-12-26 12:30'
 				},
 				{
-					title: "贾跃亭的一篇采访,让我的朋友圈干起了架",
-					time: "2020-12-26 12:30",
+					title: '贾跃亭的一篇采访,让我的朋友圈干起了架',
+					time: '2020-12-26 12:30'
 				},
 				{
-					title: "世界互联网大会红利释放 互联网产业发展迅速世界互联网",
-					time: "2020-12-26 12:30",
+					title: '世界互联网大会红利释放 互联网产业发展迅速世界互联网',
+					time: '2020-12-26 12:30'
 				},
 				{
-					title: "学习教育网名师在线答疑",
-					time: "2020-12-26 12:30",
+					title: '学习教育网名师在线答疑',
+					time: '2020-12-26 12:30'
 				},
 				{
-					title: "学习教育网名师在线答疑",
-					time: "2020-12-26 12:30",
-				},
+					title: '学习教育网名师在线答疑',
+					time: '2020-12-26 12:30'
+				}
 			]
-		}
+		};
 	},
 	onLoad() {
 		this.loadData();
 	},
 	methods: {
-		nav(url){
+		nav(url) {
 			uni.navigateTo({
-				url: url,
-			})
+				url: url
+			});
 		},
-		async loadData(){
+		async loadData() {
 			const obj = this;
 			banner({}).then(e => {
 				obj.carouselList = e.data.banner;
-			})
+			});
+			category({},0).then(e => {
+				console.log(e)
+			});
 		},
 		swiperChange(e) {
 			const index = e.detail.current;
 			this.swiperCurrent = index;
-			this.titleNViewBackground = this.carouselList[index].background;
-		},
+		}
 	}
-}
+};
 </script>
 
 <style lang="scss">
-.center{
+.center {
 	height: 100%;
 }
 .cl {
@@ -114,7 +106,7 @@ export default {
 	width: 90%;
 	height: 280rpx;
 	border-radius: 20rpx;
-	image{
+	image {
 		border-radius: 20rpx;
 		height: 100%;
 		width: 100%;
@@ -141,19 +133,19 @@ export default {
 	// 	}
 	// }
 }
-.bg1{
+.bg1 {
 	width: 70rpx;
 	height: 60rpx;
 }
-.bg2{
+.bg2 {
 	width: 62rpx;
 	height: 66rpx;
 }
-.bg3{
+.bg3 {
 	width: 78rpx;
 	height: 70rpx;
 }
-.bg4{
+.bg4 {
 	width: 60rpx;
 	height: 62rpx;
 }
@@ -168,7 +160,7 @@ export default {
 			font-size: 24rpx;
 			font-family: PingFang SC;
 			font-weight: 500;
-			color: #69717B;
+			color: #69717b;
 		}
 	}
 }
@@ -178,7 +170,7 @@ export default {
 	font-size: 36rpx;
 	font-family: PingFang SC;
 	font-weight: bold;
-	color: #24272C;
+	color: #24272c;
 }
 .listBox {
 	margin-top: 28rpx;
@@ -188,11 +180,11 @@ export default {
 	padding-left: 34rpx;
 	padding-right: 40rpx;
 	display: flex;
-	.img{
-		background-color: #FFFFFF;
+	.img {
+		background-color: #ffffff;
 		width: 200rpx;
 		height: 160rpx;
-		flex-shrink:0;
+		flex-shrink: 0;
 		image {
 			width: 100%;
 			height: 100%;

+ 6 - 1
pages/leave/details.vue

@@ -17,13 +17,18 @@
 					<view class="leavefont">理由:{{ item.reason }}</view>
 				</view>
 			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
 		</scroll-view>
 	</view>
 </template>
 
 <script>
-import { getLeave } from '@/api/course.js'
+import { getLeave } from '@/api/course.js';
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 export default {
+	components: {
+		uniLoadMore
+	},
 	data() {
 		return{
 			page: 1,

+ 30 - 1
pages/leave/leaveClass.vue

@@ -13,7 +13,7 @@
 				<view class="main">
 					<view class="left">
 						<view class="font">授课科目: {{item.subject}}</view>
-						<view class="font">班主任:</view>
+						<view class="font">班主任: {{bzr}}</view>
 					</view>
 					<view class="right">
 						<view class="font">授课老师: {{item.teacher}}</view>
@@ -24,6 +24,9 @@
 			</view>
 			<uni-load-more :status="loadingType"></uni-load-more>
 		</scroll-view>
+		<view class="jilv" @click="navTo('/pages/leave/details')">
+			申请记录
+		</view>
 	</view>
 </template>
 
@@ -31,6 +34,7 @@
 	import { getCourse } from '@/api/course.js';
 	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 	import { mapState, mapMutations } from 'vuex';
+	import { my } from '@/api/user.js';
 	import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 	export default {
 		computed: {
@@ -47,12 +51,15 @@
 				courseList: [
 					
 				],
+				bzr: '',
+				phone:'',
 			}
 		},
 		onLoad() {
 			if (this.hasLogin) {
 				console.log(this.userInfo)
 				this.loadData();
+				this.data();
 			}else{
 				uni.showModal({
 					title: '登录',
@@ -119,10 +126,20 @@
 					}
 				})
 			},
+			data(){
+				my({}).then(({data}) => {
+					this.bzr = data.manage
+				})
+			},
 			nav(index){
 				uni.navigateTo({
 					url: '/pages/leave/leave?id='+ this.courseList[index].id +'&ifyid='+this.courseList[index].ifyid + '&grade_id=' + this.courseList[index].grade_id + '&subject_id=' + this.courseList[index].subject_id
 				})
+			},
+			navTo(url){
+				uni.navigateTo({
+					url: url
+				})
 			}
 		}
 	}
@@ -215,6 +232,18 @@ page,
 		line-height: 48rpx;
 	}
 }
+
+.jilv {
+	text-align: center;
+	background: #1CC7C7;
+	color: #FFFFFF;
+	font-size: 30rpx;
+	position: fixed;
+	bottom: 0;
+	width: 100%;
+	height: 80rpx;
+	line-height: 80rpx;
+}
 </style>
 
 

+ 1 - 0
pages/problem/problem.vue

@@ -24,6 +24,7 @@
 					</view>
 				</view>
 			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
 		</scroll-view>
 		<view class="buttom" @click="nav('/pages/problem/problemAdd')">
 			新增问题

+ 3 - 0
pages/public/login.vue

@@ -65,6 +65,7 @@ export default {
 			
 				.then(function(e) {
 					uni.setStorageSync('token',e.data.token);
+					
 					getUserInfo({}).then((e)=> {
 						obj.login();
 						// 保存返回用户数据
@@ -78,6 +79,7 @@ export default {
 				.catch(function(e) {
 					console.log(e);
 				});
+				
 		},
 		//跳转注册页
 		register() {
@@ -200,5 +202,6 @@ page {
 .uni-button {
 	height: 100rpx;
 	line-height: 100rpx;
+	background-color: #1CC7C7;
 }
 </style>

+ 99 - 0
pages/public/set.vue

@@ -0,0 +1,99 @@
+<template>
+	<view class="container">
+		<uni-list>
+		    <uni-list-item title="个人资料" @click="navTo('/pages/user/userInfo')" ></uni-list-item>
+			<uni-list-item title="修改密码" @click="navTo('/pages/set/password')" ></uni-list-item>
+		    <!-- <uni-list-item title="实名认证" @click="navTo('/pages/set/phone')" ></uni-list-item> -->
+		</uni-list>
+		<view class="list-cell log-out-btn" @click="toLogout">
+			<text class="cell-tit">退出登录</text>
+		</view>
+	</view>
+</template>
+
+<script>
+	import uniList from "@/components/uni-list/uni-list.vue"
+	import uniListItem from "@/components/uni-list-item/uni-list-item.vue"
+	import { logout } from '@/api/set.js';
+	import {  
+	    mapMutations  
+	} from 'vuex';
+	export default {
+		components: {
+			uniList,uniListItem
+		},
+		data() {
+			return {
+				
+			};
+		},
+		methods:{
+			...mapMutations('user',['logout']),
+			navTo(url){
+				uni.navigateTo({
+					url:url
+				})
+			},
+			//退出登录
+			toLogout(){
+				let obj = this;
+				uni.showModal({
+				    content: '确定要退出登录么',
+				    success: (e)=>{
+				    	if(e.confirm){
+							logout({}).then((e) => {
+								uni.navigateBack();
+							}).catch((e) => {
+								console.log(e);
+							})
+				    		obj.logout();
+				    	}
+				    }
+				});
+			},
+			//switch切换触发方法
+			switchChange(e){
+				console.log(e);
+				let statusTip = e.value ? '打开': '关闭';
+				this.$api.msg(`${statusTip}消息推送`);
+			},
+
+		}
+	}
+</script>
+
+<style lang='scss'>
+	page{
+		background: $page-color-base;
+	}
+	.list-cell{
+		display:flex;
+		align-items:baseline;
+		padding: 20rpx $page-row-spacing;
+		line-height:60rpx;
+		position:relative;
+		background: #fff;
+		justify-content: center;
+		&.log-out-btn{
+			margin-top: 40rpx;
+			.cell-tit{
+				color: #1CC7C7;
+				text-align: center;
+				margin-right: 0;
+			}
+		}
+		.cell-tit{
+			flex: 1;
+			font-size: $font-base + 2rpx;
+			color: $font-color-dark;
+			margin-right:10rpx;
+		}
+		.cell-tip{
+			font-size: $font-base;
+			color: $font-color-light;
+		}
+		switch{
+			transform: translateX(16rpx) scale(.84);
+		}
+	}
+</style>

+ 161 - 0
pages/set/password.vue

@@ -0,0 +1,161 @@
+<template>
+	<view class="container">
+		<view class="row b-b">
+			<text class="tit">手机号</text>
+			<input class="input" v-model="account" type="text" placeholder="请填写手机号" placeholder-class="placeholder" />
+		</view>
+		<view class="row b-b">
+			<text class="tit">验证码</text>
+			<input class="input" v-model="captcha" type="text" placeholder="请填写验证码" placeholder-class="placeholder" />
+			<view class="code" @click="verification">{{ countDown == 0 ? '验证码' : countDown }}</view>
+		</view>
+		<view class="row b-b">
+			<text class="tit">新密码</text>
+			<input class="input" v-model="password" type="password" placeholder="请填写新密码" placeholder-class="placeholder" />
+		</view>
+		<button class="add-btn" :class="{'bg-gray':loding}" @click="loding?'':confirm()">提交</button>
+	</view>
+</template>
+
+<script>
+import { verify } from '@/api/login.js';
+import { mapState } from 'vuex';
+import { registerReset } from '@/api/set.js';
+export default {
+	data() {
+		return {
+			time: '', //保存倒计时对象
+			countDown: 0, //倒计时
+			account: '', //手机号
+			captcha: '', //验证码
+			password: '' ,//新密码
+			loding:false,//是否载入中
+		};
+	},
+	computed: {
+		...mapState(['userInfo'])
+	},
+	onLoad() {
+		if(this.userInfo.phone == null){
+			this.account = '';
+		}else{
+			this.account = this.userInfo.phone;
+			this.show = false;
+		}
+	},
+	watch: {
+		// 监听倒计时
+		countDown(i) {
+			if (i == 0) {
+				clearInterval(this.time);
+			}
+		}
+	},
+	methods: {
+		//发送验证码
+		verification() {
+			let obj = this;
+			if (this.account == '') {
+				this.$api.msg('请输入电话号码');
+				return;
+			}
+			if (!/(^1[3|4|5|7|8][0-9]{9}$)/.test(this.account)) {
+				this.$api.msg('请输入正确的手机号');
+				return;
+			}
+			// 判断是否在倒计时
+			if (obj.countDown > 0) {
+				return false;
+			} else {
+				obj.countDown = 60;
+				obj.time = setInterval(() => {
+					obj.countDown--;
+				}, 1000);
+				//调用验证码接口
+				verify({
+					phone: obj.account,
+					type: ''
+				})
+					.then(({ data }) => {})
+					.catch(err => {
+						console.log(err);
+					});
+			}
+		},
+		confirm(e) {
+			this.loding = true;
+			registerReset({
+				account: this.account,
+				captcha: this.captcha,
+				password: this.password,
+			})
+				.then(({ data }) => {
+					this.loding = false;
+					this.$api.msg('修改成功');
+				})
+				.catch(err => {
+					this.loding = false;
+					console.log(err);
+				});
+		}
+	}
+};
+</script>
+
+<style lang="scss">
+page {
+	background: $page-color-base;
+}
+.container {
+	padding-top: 30rpx;
+}
+.row {
+	display: flex;
+	align-items: center;
+	position: relative;
+	padding: 0 30rpx;
+	height: 110rpx;
+	background: #fff;
+
+	.tit {
+		flex-shrink: 0;
+		width: 120rpx;
+		font-size: 30rpx;
+		color: $font-color-dark;
+	}
+	.input {
+		flex: 1;
+		font-size: 30rpx;
+		color: $font-color-dark;
+	}
+	.iconlocation {
+		font-size: 36rpx;
+		color: $font-color-light;
+	}
+}
+.add-btn {
+	display: flex;
+	align-items: center;
+	justify-content: center;
+	width: 690rpx;
+	height: 80rpx;
+	margin: 60rpx auto;
+	font-size: $font-lg;
+	color: #fff;
+	background-color: #1CC7C7;
+	border-radius: 10rpx;
+	// box-shadow: 1px 2px 5px rgba(219, 63, 96, 0.4);
+}
+
+.bg-gray{
+	background-color: $color-gray;
+}
+.code {
+	color: #1CC7C7;
+	font-size: 23rpx;
+	border-left: 1px solid #eeeeee;
+	width: 150rpx;
+	flex-shrink: 0;
+	text-align: center;
+}
+</style>

+ 15 - 0
pages/user/about.vue

@@ -0,0 +1,15 @@
+<template>
+	<view class="content">
+	言图同伴小组遵循不同年级不同科目的学习特点及规律,采取分层教学,因材施教,使得不同程度的学生都有适合自己的班型课程;同时,在教学内容上既要匹配考纲对知识与技能的要求,也要注重提升学生的综合能力。
+	</view>
+</template>
+
+<script>
+</script>
+
+<style lang="scss">
+	.content {
+		width: 90%;
+		margin: 0 auto;
+	}
+</style>

+ 143 - 71
pages/user/user.vue

@@ -4,15 +4,38 @@
 			<image class="bg" src="../../static/img/userBg.png"></image>
 			<view class="title">我的</view>
 			<view class="user flex">
-				<view class="toux"><image :src="userInfo.avatar" mode=""></image></view>
+				<view class="toux"><image :src="userInfo.avatar || '/static/error/missing-face.png'" mode=""></image></view>
 				<view class="font">
-					<view class="name">{{ userInfo.nickname }}</view>
-					<view class="banzhuren">顾问:李丹 12012502360</view>
+					<view class="name">{{ userInfo.real_name || '游客' }}</view>
+					<view class="banzhuren">顾问:{{ guwen || 'null' }}</view>
 				</view>
 			</view>
 		</view>
-		<view class="navBar flex">
-			<view class="left" @click="nav('/pages/course/course')">
+		<view class="navBar ">
+			<image class="navBg" src="../../static/img/user.png"></image>
+			<view class="navBox flex">
+				<view class="main">
+					<view class="font">已上课时</view>
+					<view class="num">{{ achieve }}</view>
+				</view>
+				<view class="xian"></view>
+				<view class="main">
+					<view class="font">总课时</view>
+					<view class="num">{{ all }}</view>
+				</view>
+				<view class="xian"></view>
+				<view class="main">
+					<view class="font">赠送课时</view>
+					<view class="num">{{ gift }}</view>
+				</view>
+				<view class="xian"></view>
+				<view class="main">
+					<view class="font">请假课时</view>
+					<view class="num">{{ leave }}</view>
+				</view>
+			</view>
+
+			<!-- <view class="left" @click="nav('/pages/leave/leaveClass')">
 				<image src="../../static/img/userLeft.png"></image>
 				<view class="centent">
 					<view class="title">待上课程</view>
@@ -27,80 +50,87 @@
 					<view class="text">总完成数</view>
 					<view class="number">{{wan}}<text>个</text></view>
 				</view>
-			</view>
+			</view> -->
 		</view>
 		<view class="system">
 			<view class="item flex" @click="nav('/pages/user/userInfo')">
 				<image class="img" src="../../static/img/aboutMy.png"></image>
 				<view class="item-text">我的资料</view>
-				<image class="return" src="../../static/img/return.png" ></image>
+				<image class="return" src="../../static/img/return.png"></image>
 			</view>
-			<view class="item flex">
+			<view class="item flex" @click="nav('/pages/user/about')">
 				<image class="img" src="../../static/img/userAbout.png"></image>
 				<view class="item-text">关于我们</view>
-				<image class="return" src="../../static/img/return.png" ></image>
+				<image class="return" src="../../static/img/return.png"></image>
 			</view>
-			<view class="item flex">
+			<view class="item flex" @click="nav('/pages/public/set')">
 				<image class="img" src="../../static/img/aboutSet.png"></image>
 				<view class="item-text">设置</view>
-				<image class="return" src="../../static/img/return.png" ></image>
+				<image class="return" src="../../static/img/return.png"></image>
 			</view>
 		</view>
 	</view>
 </template>
 
 <script>
-import { getCourse } from '@/api/course.js'
+import { getCourse } from '@/api/course.js';
 import { mapState, mapMutations } from 'vuex';
 import { saveUrl, interceptor } from '@/utils/loginUtils.js';
-import { getUserInfo,} from '@/api/user.js';
+import { getUserInfo, my } from '@/api/user.js';
+import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
 export default {
+	components: {
+		uniLoadMore
+	},
 	computed: {
 		...mapState(['hasLogin', 'userInfo', 'baseURL', 'urlFile'])
 	},
 	data() {
 		return {
-			dai: '0',//待上课程
-			wan: '0',//完成课程
-		}
+			all: '200', //总课时
+			achieve: '208', //完成课时
+			leave: '20', //请假课时
+			gift: '20', //赠送课时
+			guwen: ''
+		};
 	},
 	onShow() {
+		console.log(this.hasLogin);
 		// 判断是否已经登录
 		if (this.hasLogin) {
-			console.log(this.userInfo)
+			console.log(this.userInfo);
 			this.loadBaseData();
-		}else{
-				uni.showModal({
-					title: '登录',
-					content: '您未登录,是否马上登陆?',
-					success: e => {
-						console.log(e)
-						if (e.confirm) {
-							console.log("1111")
-							interceptor();
-						}
-					},
-					fail: e => {
-						console.log(e);
+		} else {
+			uni.showModal({
+				title: '登录',
+				content: '您未登录,是否马上登陆?',
+				success: e => {
+					console.log(e);
+					if (e.confirm) {
+						console.log('1111');
+						interceptor();
 					}
-				});
-				return;
-			}
+				},
+				fail: e => {
+					console.log(e);
+				}
+			});
+			return;
+		}
 	},
 	methods: {
-		...mapMutations( ['setUserInfo', 'setOrderInfo']),
+		...mapMutations(['setUserInfo']),
 		loadBaseData() {
 			getUserInfo({})
 				.then(({ data }) => {
-					
-					if (data.store_switch == '1') {
-						this.showBox = true;
-					}
 					this.setUserInfo(data);
 				})
 				.catch(e => {
 					console.log(e);
 				});
+			my({}).then(({ data }) => {
+				this.guwen = data.adviser;
+			});
 			getCourse({})
 				.then(e => {
 					this.dai = e.data.count;
@@ -109,15 +139,15 @@ export default {
 					console.log(e);
 				});
 		},
-		navT(){
+		navT() {
 			if (!this.hasLogin) {
 				uni.showModal({
 					title: '登录',
 					content: '您未登录,是否马上登陆?',
 					success: e => {
-						console.log(e)
+						console.log(e);
 						if (e.confirm) {
-							console.log("1111")
+							console.log('1111');
 							interceptor();
 						}
 					},
@@ -126,13 +156,13 @@ export default {
 					}
 				});
 				return;
-			}else{
+			} else {
 				uni.switchTab({
 					url: '/pages/index/index'
-				})
+				});
 			}
 		},
-		nav(url){
+		nav(url) {
 			if (!this.hasLogin) {
 				uni.showModal({
 					title: '登录',
@@ -147,14 +177,14 @@ export default {
 					}
 				});
 				return;
-			}else{
+			} else {
 				uni.navigateTo({
 					url: url
-				})
+				});
 			}
 		}
 	}
-}
+};
 </script>
 
 <style lang="scss">
@@ -164,7 +194,7 @@ page,
 	height: 100%;
 	background-color: #f8f8f8;
 }
-.top{
+.top {
 	position: relative;
 	width: 100%;
 	height: 474rpx;
@@ -189,7 +219,7 @@ page,
 		.toux {
 			width: 136rpx;
 			height: 136rpx;
-			background: #FFFFFF;
+			background: #ffffff;
 			border-radius: 50%;
 			image {
 				width: 136rpx;
@@ -210,35 +240,78 @@ page,
 				margin-top: 14rpx;
 				font-size: 26rpx;
 				font-weight: 500;
-				color: #8E8E8E;
+				color: #8e8e8e;
 			}
 		}
 	}
 }
-.navBar{
+.navBar {
 	margin-top: -100rpx;
 	padding: 18rpx;
 	width: 100%;
-	.left {
-		position: relative;
-		width: 50%;
-		height: 250rpx;
-		image {
-			
-			height: 100%;
-			width: 100%;
-		}
-		
+	height: 250rpx;
+	position: relative;
+	.navBg {
+		position: absolute;
+		top: 0;
+		left: 0;
+		width: 100%;
+		height: 100%;
 	}
-	.right {
+	.navBox {
 		position: relative;
-		width: 50%;
-		height: 250rpx;
-		image {
-			height: 100%;
-			width: 100%;
+		z-index: 3;
+		width: 100%;
+		justify-content: flex-start;
+		.main {
+			flex: 1;
+			padding: 50rpx 30rpx;
+			display: flex;
+			flex-direction: column;
+			.font {
+				margin: 0 auto;
+				font-size: 26rpx;
+				font-family: PingFang SC;
+				font-weight: 500;
+				color: #ffffff;
+			}
+			.num {
+				margin: 0 auto;
+				margin-top: 24rpx;
+				font-size: 40rpx;
+				font-family: PingFang SC;
+				font-weight: bold;
+				color: #ffffff;
+				text-shadow: 0px 2rpx 24rpx rgba(28, 199, 199, 0.4);
+			}
+		}
+		.xian {
+			width: 2rpx;
+			height: 80rpx;
+			background: #ffffff;
+			// opacity: 0.12;
 		}
 	}
+	// .left {
+	// 	position: relative;
+	// 	width: 50%;
+	// 	height: 250rpx;
+	// 	image {
+
+	// 		height: 100%;
+	// 		width: 100%;
+	// 	}
+
+	// }
+	// .right {
+	// 	position: relative;
+	// 	width: 50%;
+	// 	height: 250rpx;
+	// 	image {
+	// 		height: 100%;
+	// 		width: 100%;
+	// 	}
+	// }
 }
 .centent {
 	position: absolute;
@@ -255,12 +328,12 @@ page,
 		margin-top: 10rpx;
 		font-size: 24rpx;
 		font-weight: bold;
-		color: #8E8E8E;
+		color: #8e8e8e;
 	}
 	.number {
 		font-size: 44rpx;
 		font-weight: bold;
-		color: #1CC7C7;
+		color: #1cc7c7;
 		text-shadow: 0px 2px 24px rgba(28, 199, 199, 0.4);
 		margin-top: 20rpx;
 		text {
@@ -272,7 +345,7 @@ page,
 	width: 90%;
 	margin: 0 auto;
 	padding-top: 10rpx;
-	background: #FFFFFF;
+	background: #ffffff;
 	box-shadow: 0px 2rpx 24rpx 0rpx rgba(0, 0, 0, 0.06);
 	border-radius: 20rpx;
 	.item {
@@ -281,7 +354,6 @@ page,
 		.img {
 			height: 36rpx;
 			width: 36rpx;
-			
 		}
 		.item-text {
 			width: 85%;

+ 51 - 24
pages/user/userInfo.vue

@@ -2,43 +2,66 @@
 	<view class="content">
 		<view class="row1">
 			<text class="tit">头像</text>
-			<view class="background-img"><image class="background-img" v-model="avatar" :src="avatar" mode="aspectFill"></image></view>
+			<view class="background-img" @click.stop="imgsub"><image class="background-img" v-model="userInfo.avatar" :src="userInfo.avatar" mode="aspectFill"></image></view>
 		</view>
 		<view class="row">
 			<text class="tit">家长</text>
-			<input class="input" type="text" v-model="patriarch" placeholder-class="placeholder" />
+			<input class="input" type="text"  disabled="true" v-model="userInfo.real_name" placeholder-class="placeholder" />
 		</view>
 		<view class="row">
 			<text class="tit">学生</text>
-			<input class="input" type="text" v-model="student" placeholder-class="placeholder" />
+			<input class="input" type="text"  disabled="true" v-model="student" placeholder-class="placeholder" />
 		</view>
 		<view class="row">
 			<text class="tit">手机号</text>
-			<input class="input" type="text" v-model="phone" placeholder-class="placeholder" />
+			<input class="input" type="text"  disabled="true" v-model="userInfo.phone" placeholder-class="placeholder" />
 		</view>
+		<button class="add-btn" @click="confirm">提交</button>
 	</view>
 </template>
 
 <script>
 import { mapState } from 'vuex';
+import { uploads } from '@/api/user.js';
+import {userEdit} from '@/api/set.js'
 export default{
 	data(){
 		return{
-			avatar: '',
-			patriarch: '',
-			student: '',
-			phone: ''
+			student:''
 		}
 	},
-	computed: {
-		...mapState('user', ['userInfo'])
+	onLoad() {
+		console.log(this.userInfo)
 	},
-	onShow(option) {
-		// 获取生日日期
-		this.patriarch = this.userInfo.real_name || '';
-		this.avatar = this.userInfo.avatar || '';
-		this.phone = this.userInfo.phone || '';
+	computed: {
+		...mapState( ['userInfo'])
 	},
+	methods: {
+		imgsub() {
+			console.log('上传头像')
+			uploads({
+				filename: ''
+			}).then(data => {
+				console.log("data",data);
+				this.userInfo.avatar = data[0].url;
+			})
+		},
+		confirm() {
+			userEdit({ avatar: this.userInfo.avatar })
+				.then(e => {
+					this.$api.msg('修改成功');
+					setTimeout(()=> {
+						uni.switchTab({
+							url:'/pages/user/user'
+						});
+					}, 1000);
+					console.log(e);
+				})
+				.catch(e => {
+					console.log(e);
+				});
+		}
+	}
 }
 </script>
 
@@ -69,8 +92,6 @@ export default{
 	.row {
 		display: flex;
 		align-items: center;
-		justify-content: space-between;
-		position: relative;
 		padding: 0 30upx;
 		height: 110upx;
 		background: #fff;
@@ -81,17 +102,23 @@ export default{
 			font-size: $font-lg;
 			color: $font-color-dark;
 		}
-		.tit1 {
-			flex-shrink: 0;
-			width: 150upx;
-			font-size: $font-lg;
-			color: $font-color-dark;
-			
-		}
 		.input {
 			flex: 1;
+			text-align: right;
 			font-size: $font-base;
 			color: $color-gray;
 		}
 	}
+	.add-btn {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		width: 690upx;
+		height: 80upx;
+		margin: 60upx auto;
+		font-size: $font-lg;
+		color: #fff;
+		background-color: #1CC7C7;
+		border-radius: 10upx;
+	}
 </style>

BIN
static/error/emptyCart.png


BIN
static/error/errorImage.jpg


BIN
static/error/missing-face.png


BIN
static/img/user.png


BIN
static/tabBar/course.png


BIN
static/tabBar/courseD.png


BIN
static/tabBar/index.png


BIN
static/tabBar/indexD.png


BIN
static/tabBar/indexafter.png


BIN
static/tabBar/user.png


BIN
static/tabBar/userD.png


BIN
static/tabBar/userafter.png


+ 52 - 57
store/index.js

@@ -1,13 +1,12 @@
 import Vue from 'vue'
 import Vuex from 'vuex'
-import user from './model/user'
 Vue.use(Vuex)
 
 const store = new Vuex.Store({
 	state: {
 		baseURL: 'http://js.frp.liuniu946.com',
 		// baseURL: 'https://zhibo.liuniu946.com', //请求地址配置
-		urlFile: '/index', //项目部署所在文件夹
+		urlFile:'/index',//项目部署所在文件夹
 		hasLogin: false, //是否登录
 		userInfo: {}, //登录信息
 		loginInterceptor: false, //是否打开强制登录
@@ -19,63 +18,59 @@ const store = new Vuex.Store({
 		weichatObj: '', //微信对象
 		weichatBrowser: '' ,//当前是否为微信内置浏览器
 		// #endif
-		// shareData:'',//分享信息
 	},
 	mutations: {
-		// 登录
-		login(state) {
-			state.hasLogin = true;
-		},
-		// 退出登录
-		logout(state) {
-			state.hasLogin = false;
-			state.userInfo = {};
-			uni.removeStorage({
-				key: 'userInfo'
-			})
-			// uni.removeStorage({
-			// 	key: 'mystore'
-			// })
-		},
-		// 保存用户信息
-		setUserInfo(state, provider) {
-			state.userInfo = provider;
-			uni.setStorageSync('userInfo',provider)
-			// if(provider.store_info){
-			console.log(provider.store_info && !(uni.getStorageSync('mystore')||false));
-			
-			uni.showModal({
-				title: '打印',
-				// content: !(uni.getStorageSync('mystore')||false)+'box:'+JSON.stringify(provider)
-				content: (uni.getStorageSync('mystore'))
-			});
-			if(provider.store_info && !(uni.getStorageSync('mystore')||false)){
-				uni.setStorageSync('mystore',provider.store_info.id);
-			
-			} 
-			else {
-				let value = uni.getStorageSync('mystore');
-				console.log('---mystore-8-8-',value);
+			// 登录
+			login(state) {
+				state.hasLogin = true;
+			},
+			// 退出登录
+			logout(state) {
+				state.hasLogin = false;
+				state.userInfo = {};
+				uni.removeStorage({
+					key: 'userInfo'
+				})
+				// uni.removeStorage({
+				// 	key: 'mystore'
+				// })
+			},
+			// 保存用户信息
+			setUserInfo(state, provider) {
+				state.userInfo = provider;
+				uni.setStorageSync('userInfo',provider)
+				// if(provider.store_info){
+				console.log(provider.store_info && !(uni.getStorageSync('mystore')||false));
+				
+				// uni.showModal({
+				// 	title: '打印',
+				// 	// content: !(uni.getStorageSync('mystore')||false)+'box:'+JSON.stringify(provider)
+				// 	content: (uni.getStorageSync('mystore'))
+				// });
+				if(provider.store_info && !(uni.getStorageSync('mystore')||false)){
+					uni.setStorageSync('mystore',provider.store_info.id);
+				
+				} 
+				else {
+					let value = uni.getStorageSync('mystore');
+					console.log('---mystore-8-8-',value);
+				}
+			},
+			// #ifdef H5
+			//保存微信信息
+			setWeiChatInfo(state, provider) {
+				state.weichatInfo = provider;
+			},
+			//保存微信对象
+			setWeiChatObj(state, provider) {
+				state.weichatObj = provider;
+				console.log('保存微信对象',state.weichatObj)
 			}
+			// #endif
 		},
-		// #ifdef H5
-		//保存微信信息
-		setWeiChatInfo(state, provider) {
-			state.weichatInfo = provider;
-		},
-		//保存微信对象
-		setWeiChatObj(state, provider) {
-			state.weichatObj = provider;
-			console.log('保存微信对象',state.weichatObj)
+		actions: {
+	
 		}
-		// #endif
-	},
-	modules:{
-		user
-	},
-	actions: {
-		
-	}
-})
-
-export default store
+	})
+	
+	export default store

+ 1 - 0
说明文档.txt

@@ -0,0 +1 @@
+蓝湖地址: https://lanhuapp.com/url/jhi0k-ErwR4