hwq 4 anni fa
parent
commit
0be87816c1

+ 41 - 1
api/course.js

@@ -1,5 +1,5 @@
 import request from '@/utils/request'
-
+import { upFilse, upFilse1} from '@/utils/request';
 //获取课程
 export function getCourse(data) {
 	return request({
@@ -7,4 +7,44 @@ export function getCourse(data) {
 		method: 'get',
 		data
 	});
+}
+//获取请假列表
+export function getLeave(data) {
+	return request({
+		url: '/api/student/leavelist',
+		method: 'get',
+		data
+	});
+}
+//请假
+export function setLeave(data) {
+	return request({
+		url: '/api/student/leave',
+		method: 'post',
+		data
+	});
+}
+//获取评价列表
+export function getEvaluate(data) {
+	return request({
+		url: '/api/student/evaluatelist',
+		method: 'get',
+		data
+	});
+}
+//评价
+export function setEvaluate(data) {
+	return request({
+		url: '/api/student/evaluate',
+		method: 'post',
+		data
+	});
+}
+//上传照片
+export function uploads(data){
+	return upFilse({
+		url:'/api/upload/image',
+		method:'post',
+		data
+	})
 }

+ 18 - 0
api/homework.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+//获取作业
+export function gethomework(data) {
+	return request({
+		url: '/api/student/tasklist',
+		method: 'get',
+		data
+	});
+}
+//上传作业
+export function sethomework(data) {
+	return request({
+		url: '/api/student/task',
+		method: 'post',
+		data
+	});
+}

+ 18 - 0
api/problem.js

@@ -0,0 +1,18 @@
+import request from '@/utils/request'
+
+//获取反馈
+export function getProblem(data) {
+	return request({
+		url: '/api/student/Feedbacklist',
+		method: 'get',
+		data
+	});
+}
+//提交反馈
+export function setProblem(data) {
+	return request({
+		url: '/api/student/Feedback',
+		method: 'post',
+		data
+	});
+}

+ 3 - 3
manifest.json

@@ -1,5 +1,5 @@
 {
-    "name" : "基础项目",
+    "name" : "培训机构",
     "appid" : "__UNI__F0EBD91",
     "description" : "",
     "versionName" : "1.0.0",
@@ -64,7 +64,7 @@
         }
     },
     "h5" : {
-        "title" : "商城",
+        "title" : "培训机构",
         "domain" : "",
         "router" : {
             "base" : "/index/",
@@ -73,7 +73,7 @@
         "devServer" : {
             "proxy" : {
                 "/api" : {
-                    "target" : "http://192.168.0.101/api",
+                    "target" : "http://js.frp.liuniu946.com/api",
                     // "changeOrigin": true,
                     "pathRewrite" : {
                         "/api" : "" // rewrite path

+ 37 - 0
pages.json

@@ -68,6 +68,24 @@
 				"navigationBarTextStyle":"black"
 			}
 		    
+		},
+		{
+			"path": "pages/homework/homework",
+			"style": {
+				"navigationBarTitleText": "我的作业",
+				"navigationBarBackgroundColor":"#FFFFFF",
+				"navigationBarTextStyle":"black"
+			}
+		    
+		},
+		{
+			"path": "pages/homework/setHomework",
+			"style": {
+				"navigationBarTitleText": "上传作业",
+				"navigationBarBackgroundColor":"#FFFFFF",
+				"navigationBarTextStyle":"black"
+			}
+		    
 		},
 		//详细评价
 		{
@@ -78,6 +96,15 @@
 				"navigationBarTextStyle":"black"
 			}
 		    
+		},
+		{
+			"path": "pages/course/myEvaluate",
+			"style": {
+				"navigationBarTitleText": "我的评价",
+				"navigationBarBackgroundColor":"#FFFFFF",
+				"navigationBarTextStyle":"black"
+			}
+		    
 		},
 		{
 			"path": "pages/course/success",
@@ -96,6 +123,16 @@
 				"navigationBarTextStyle":"black"
 			}
 		    
+		},
+		{
+			//请假的课程
+			"path": "pages/leave/leaveClass",
+			"style": {
+				"navigationBarTitleText": "请假",
+				"navigationBarBackgroundColor":"#FFFFFF",
+				"navigationBarTextStyle":"black"
+			}
+		    
 		},
 		{
 			//请假详情

+ 14 - 7
pages/course/course.vue

@@ -2,10 +2,10 @@
 	<view class="center">
 		<view class="english">various courses for children</view>
 		<scroll-view scroll-y="true" class="list">
-			<view v-for="(item,index) in courseList" :key="index" class="listBox">
+			<view v-for="(item,index) in courseList" :key="index" class="listBox" @click="nav(index)">
 				<view class="bg"></view>
-				<view class="title">{{ item.title}}</view>
-				<view class="teacher">{{ item.teacher }}</view>
+				<view class="title">暑假培训阅读精品课</view>
+				<view class="teacher">授课科目:{{ item.subject}} {{ item.teacher}}</view>
 				<view class="bzr">{{ item.bzr }}</view>
 				<view class="button">上传作业</view>
 			</view>
@@ -14,7 +14,7 @@
 </template>
 
 <script>
-	import getCourse from '@/api/course.js'
+	import { getCourse } from '@/api/course.js'
 	export default {
 		data() {
 			return {
@@ -26,7 +26,7 @@
 				],
 			}
 		},
-		onShow() {
+		onLoad() {
 			this.loadData();
 		},
 		//下拉刷新
@@ -58,7 +58,9 @@
 					page: obj.page,
 					limit: obj.limit
 				}).then(e => {
-					obj.courseList = obj.courseList.concat(e.data);
+					
+					obj.courseList = obj.courseList.concat(e.data.data);
+					console.log(obj.courseList);
 					//判断是否还有下一页,有是more  没有是nomore
 					if (obj.limit==e.data.length) {
 						obj.page++
@@ -74,6 +76,11 @@
 						}
 					}
 				})
+			},
+			nav(index){
+				uni.navigateTo({
+					url: '/pages/homework/setHomework?id=' + this.courseList[index].id
+				})
 			}
 		}
 	}
@@ -94,7 +101,7 @@ page,
 	color: #C2C2C2;
 }
 .list {
-	height: calc(100%-400px);
+	height: 1100rpx;
 }
 .listBox {
 	position: relative;

+ 69 - 39
pages/course/coursePj.vue

@@ -2,10 +2,10 @@
 	<view class="center">
 		<view class="english">various courses for children</view>
 		<scroll-view scroll-y="true" class="list">
-			<view v-for="(item,index) in courseList" :key="index" class="listBox" @click="nav()">
+			<view v-for="(item,index) in courseList" :key="index" class="listBox" @click="nav(index)">
 				<view class="bg"></view>
-				<view class="title">{{ item.title}}<text>{{item.type}}</text></view>
-				<view class="teacher">{{ item.teacher }}</view>
+				<view class="title">暑假培训阅读精品课</view>
+				<view class="teacher">授课科目:{{ item.subject}} {{ item.teacher}}</view>
 				<view class="bzr">{{ item.bzr }}</view>
 				<view class="button" >课程评价</view>
 			</view>
@@ -13,51 +13,81 @@
 	</view>
 </template>
 <script>
+	import { getCourse } from '@/api/course.js'
 	export default {
 		data() {
 			return {
+				page: 1,
+				limit: 10,
+				loadingType: 'more',
 				courseList: [
-					{
-						type: "已完成",
-						title: "暑假培训阅读精品课",
-						time: "2021年07月01日 16:00",
-						teacher: "授课科目:数学  林丹丹",
-						bzr: "班主任:王琳琳  13201202102"
-						
-					},
-					{
-						title: "暑假培训阅读精品课",
-						time: "2021年07月01日 16:00",
-						teacher: "授课科目:数学  林丹丹",
-						bzr: "班主任:王琳琳  13201202102"
-						
-					},
-					{
-						title: "暑假培训阅读精品课",
-						time: "2021年07月01日 16:00",
-						teacher: "授课科目:数学  林丹丹",
-						bzr: "班主任:王琳琳  13201202102"
-						
-					},
-					{
-						title: "暑假培训阅读精品课",
-						time: "2021年07月01日 16:00",
-						teacher: "授课科目:数学  林丹丹",
-						bzr: "班主任:王琳琳  13201202102"
-						
-					}
+					
 				],
 			}
 		},
-		methods: {
-			nav(){
-				console.log(1)
-				uni.navigateTo({
-					url: '/pages/course/evaluate'
-				})
+		onLoad() {
+				this.loadData();
+			},
+			//下拉刷新
+			onPullDownRefresh() {
+				this.loadData('refresh');
+			},
+			//监听页面是否滚动到底部加载更多
+			onReachBottom() {
+				this.loadData();
+			},
+			methods: {
+				async loadData(type = 'add', loading) {
+					let obj = this;
+					if (type === 'add') {
+						if (obj.loadingType === 'nomore') {
+							return;
+						}
+						obj.loadingType = 'loading';
+					} else {
+						obj.loadingType = 'more';
+					}
+					if (type === 'refresh') {
+						// 清空数组
+						obj.courseList = [];
+						obj.page = 1
+					}
+					//获取课程
+					getCourse({
+						page: obj.page,
+						limit: obj.limit
+					}).then(e => {
+						console.log(e)
+						obj.courseList = obj.courseList.concat(e.data.data);
+						//判断是否还有下一页,有是more  没有是nomore
+						if (obj.limit==e.data.length) {
+							obj.page++
+							obj.loadingType='more'
+						} else{
+							obj.loadingType='nomore'
+						}
+						if (type === 'refresh') {
+							if (loading == 1) {
+								uni.hideLoading();
+							} else {
+								uni.stopPullDownRefresh();
+							}
+						}
+					})
+				},
+				nav(index){
+					index = + index;
+					let id = '';
+					console.log(this.courseList[index]);
+					if(this.courseList[+index]){
+						id = this.courseList[index].id;
+					}
+					uni.navigateTo({
+						url: '/pages/course/evaluate?id=' + id
+					})
+				}
 			}
 		}
-	}
 </script>
 
 <style lang="scss">

+ 69 - 4
pages/course/evaluate.vue

@@ -1,22 +1,87 @@
 <template>
 	<view class="center">
-		<view class="button" @click="nav()">
+		<view class="pf">
+			<view><uniRate text="1" size="20" margin="10" :value="evaluate_fraction" @change="rateChange1"></uniRate></view>
+		</view>
+		<view class="pjnr">
+			<text>评价内容</text><input type="text" v-model="evaluate" />
+		</view>
+		<view class="item-left">评价图片:</view>
+		<view class="item-right">
+			<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>
+		</view>
+		<view class="button" @click="submit('/pages/course/success')">
 			提交评价
 		</view>
+		<view class="button" @click="nav('/pages/course/myEvaluate')">
+			我的评价
+		</view>
 	</view>
 </template>
 
 <script>
+import { setEvaluate,uploads } from '@/api/course.js';
+import uniRate from '@/components/uni-rate/uni-rate.vue';
 export default {
+	components: {
+		uniRate
+	},
+	data(){
+		return{
+			cardimg: '',
+			id: '',
+			evaluate_fraction: '',//评分
+			evaluate: '',//评价内容
+			evaluate_imgs: '',//图片
+		}
+	},
+	onLoad(option) {
+		this.id = option.id;
+	},
 	methods: {
-		nav(){
+		imgsub() {
+			console.log('上传照片')
+			uploads({
+				filename: ''
+			}).then(data => {
+				console.log("data",data);
+				this.evaluate_imgs = data[0].url;
+			})
+		},
+		submit(url){
+			console.log(this.evaluate_fraction)
+			setEvaluate({
+				timetable_id: this.id,
+				evaluate_fraction: this.evaluate_fraction,
+				evaluate: this.evaluate,
+				evaluate_imgs: this.evaluate_imgs
+			}).then(() =>{
+				uni.navigateTo({
+					url: url
+				})
+			}).catch(err =>{
+				console.log(err)
+			})
+		},
+		nav(url) {
 			uni.navigateTo({
-				url: '/pages/course/success'
+				url: url
 			})
-		}
+		},
+		rateChange1(val) {
+			this.evaluate_fraction = val.value;
+		},
 	}
 }
 </script>
 
 <style>
+	.button{
+		height: 200rpx;
+	}
+	.zhil {
+		font-size: 28rpx !important;
+		padding: 15rpx 15rpx;
+	}
 </style>

+ 78 - 0
pages/course/myEvaluate.vue

@@ -0,0 +1,78 @@
+<template>
+	<view class="center">
+		<view v-for="(item,index) in dataList" :key="index">
+			
+		</view>
+	</view>
+</template>
+
+<script>
+import { getEvaluate} from '@/api/course.js'
+export default {
+	data() {
+		return{
+			page: 1,
+			limit: 10,
+			loadingType: 'more',
+			dataList:[]
+		}
+	},
+	onLoad() {
+		this.loadData()
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		this.loadData('refresh');
+	},
+	//监听页面是否滚动到底部加载更多
+	onReachBottom() {
+		this.loadData();
+	},
+	methods: {
+		async loadData(type = 'add', loading){
+			let obj = this;
+			if (type === 'add') {
+				if (obj.loadingType === 'nomore') {
+					return;
+				}
+				obj.loadingType = 'loading';
+			} else {
+				obj.loadingType = 'more';
+			}
+			if (type === 'refresh') {
+				// 清空数组
+				obj.courseList = [];
+				obj.page = 1
+			}
+			//获取反馈列表
+			getEvaluate({
+				page: obj.page,
+				limit: obj.limit
+			}).then(e => {
+				console.log(e)
+				obj.dataList = obj.dataList.concat(e.data.data);
+				console.log(obj.dataList)
+				//判断是否还有下一页,有是more  没有是nomore
+				if (obj.limit==e.data.length) {
+					obj.page++
+					obj.loadingType='more'
+				} else{
+					obj.loadingType='nomore'
+				}
+				if (type === 'refresh') {
+					if (loading == 1) {
+						uni.hideLoading();
+					} else {
+						uni.stopPullDownRefresh();
+					}
+				}
+			})
+		},
+		
+	}
+}
+</script>
+
+<style lang="scss">
+
+</style>

+ 77 - 0
pages/homework/homework.vue

@@ -0,0 +1,77 @@
+<template>
+	<view class="center">
+		<view v-for="(item,index) in homeList" :key="index">
+			
+		</view>
+	</view>
+</template>
+
+<script>
+	import { gethomework } from '@/api/homework.js'
+	export default {
+		data(){
+			return{
+				homeList: [],
+				limit: 10,
+				page: 1,
+				loadingType: 'more'
+			}
+		},
+		onLoad() {
+			this.loadData()
+		},
+		//下拉刷新
+		onPullDownRefresh() {
+			this.loadData('refresh');
+		},
+		//监听页面是否滚动到底部加载更多
+		onReachBottom() {
+			this.loadData();
+		},
+		methods: {
+			async loadData(type = 'add', loading){
+				let obj = this;
+				if (type === 'add') {
+					if (obj.loadingType === 'nomore') {
+						return;
+					}
+					obj.loadingType = 'loading';
+				} else {
+					obj.loadingType = 'more';
+				}
+				if (type === 'refresh') {
+					// 清空数组
+					obj.courseList = [];
+					obj.page = 1
+				}
+				//获取反馈列表
+				gethomework({
+					page: obj.page,
+					limit: obj.limit
+				}).then(e => {
+					
+					obj.homeList = obj.homeList.concat(e.data.data);
+					console.log(obj.homeList)
+					//判断是否还有下一页,有是more  没有是nomore
+					if (obj.limit==e.data.length) {
+						obj.page++
+						obj.loadingType='more'
+					} else{
+						obj.loadingType='nomore'
+					}
+					if (type === 'refresh') {
+						if (loading == 1) {
+							uni.hideLoading();
+						} else {
+							uni.stopPullDownRefresh();
+						}
+					}
+				})
+			},
+			
+		}
+	}
+</script>
+
+<style>
+</style>

+ 33 - 0
pages/homework/setHomework.vue

@@ -0,0 +1,33 @@
+<template>
+	<view class="center">
+		<view class="buttom" @click="submit()">上传作业</view>
+	</view>
+</template>
+
+<script>
+import { sethomework } from '@/api/homework.js'
+export default {
+	data(){
+		return{
+			id: '',
+		}
+	},
+	onLoad(option) {
+		this.id = option.id
+	},
+	methods:{
+		submit(){
+			sethomework({
+				timetable_id: this.id
+			}).then(() =>{
+				
+			}).catch(err =>{
+				console.log(err)
+			})
+		}
+	}
+}
+</script>
+
+<style>
+</style>

+ 1 - 1
pages/index/index.vue

@@ -20,7 +20,7 @@
 					课程评价
 				</view>
 			</view>
-			<view class="navBox-item" @click="nav('/pages/leave/leave')">
+			<view class="navBox-item" @click="nav('/pages/leave/leaveClass')">
 				<image src="../../static/img/indexQjsp.png" mode=""></image>
 				<view class="font">
 					请假审批

+ 49 - 1
pages/index/message.vue

@@ -1,8 +1,56 @@
 <template>
+	<view class="center">
+		<view class="bg">
+			<image src="" mode=""></image>
+		</view>
+		<view class="title">新闻大标题放在这里最多两排最多两排换行新闻大标题放在这里最多两排最多两排</view>
+		<view class="time">时间,时分秒</view>
+		<view class="content">
+			这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容
+		</view>
+	</view>
 </template>
 
 <script>
 </script>
 
-<style>
+<style lang="scss">
+.center{
+	height: 100%;
+}
+.bg{
+	background: #00BCD4;
+	width: 100%;
+	height: 474rpx;
+}
+.title {
+	width: 90%;
+	margin: 0 auto;
+	font-size: 40rpx;
+	font-weight: 500;
+	color: #171313;
+	text-overflow: -o-ellipsis-lastline;
+	overflow: hidden;
+	text-overflow: ellipsis;
+	display: -webkit-box;
+	-webkit-line-clamp: 2;
+	-webkit-box-orient: vertical;
+}
+.time {
+	width: 90%;
+	margin: 0 auto;
+	margin-top: 16rpx;
+	font-size: 24rpx;
+	font-weight: 500;
+	color: #656B6C;
+}
+.content {
+	width: 90%;
+	margin: 0 auto;
+	margin-top: 20rpx;
+	font-size: 32rpx;
+	font-weight: 500;
+	color: #777777;
+}
+
 </style>

+ 65 - 1
pages/leave/details.vue

@@ -2,7 +2,71 @@
 </template>
 
 <script>
+import { getLeave } from '@/api/course.js'
+export default {
+	data() {
+		return{
+			page: 1,
+			limit: 10,
+			loadingType: 'more',
+			leaveList:[]
+		}
+	},
+	onLoad() {
+		this.loadData()
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		this.loadData('refresh');
+	},
+	//监听页面是否滚动到底部加载更多
+	onReachBottom() {
+		this.loadData();
+	},
+	methods: {
+		async loadData(type = 'add', loading){
+			let obj = this;
+			if (type === 'add') {
+				if (obj.loadingType === 'nomore') {
+					return;
+				}
+				obj.loadingType = 'loading';
+			} else {
+				obj.loadingType = 'more';
+			}
+			if (type === 'refresh') {
+				// 清空数组
+				obj.courseList = [];
+				obj.page = 1
+			}
+			//获取反馈列表
+			getLeave({
+				page: obj.page,
+				limit: obj.limit
+			}).then(e => {
+				
+				obj.leaveList = obj.leaveList.concat(e.data.data);
+				console.log(obj.leaveList)
+				//判断是否还有下一页,有是more  没有是nomore
+				if (obj.limit==e.data.length) {
+					obj.page++
+					obj.loadingType='more'
+				} else{
+					obj.loadingType='nomore'
+				}
+				if (type === 'refresh') {
+					if (loading == 1) {
+						uni.hideLoading();
+					} else {
+						uni.stopPullDownRefresh();
+					}
+				}
+			})
+		},
+		
+	}
+}
 </script>
 
-<style>
+<style lang="scss">
 </style>

+ 38 - 1
pages/leave/leave.vue

@@ -1,6 +1,10 @@
 <template>
 	<view class="center">
-		<view class="buttom" @click="nav('/pages/course/success')">
+		<view class="">
+			<text>请假原因</text>
+			<input type="text" v-model="reason" />
+		</view>
+		<view class="buttom" @click="submit('/pages/course/success')">
 			立即提交
 		</view>
 		<view class="" @click="nav('/pages/leave/details')">
@@ -10,8 +14,41 @@
 </template>
 
 <script>
+import { setLeave} from '@/api/course.js'
 export default {
+	data(){
+		return{
+			id: '',
+			ifyid: '',
+			grade_id: '',
+			subject_id: '',
+			manage_admin: '',
+			reason: ''
+		}
+	},
+	onLoad(option) {
+		this.id = option.id;
+		this.ifyid = option.ifyid;
+		this.grade_id = option.grade_id;
+		this.subject_id = option.subject_id
+	},
 	methods: {
+		submit(url){
+			setLeave({
+				timetable_id: this.id,
+				ifyid: this.ifyid,
+				grade_id: this.grade_id,
+				subject_id: this.subject_id,
+				reason: this.reason,
+				manage_admin:this.manage_admin
+			}).then(() =>{
+				uni.navigateTo({
+					url: url
+				})
+			}).catch(err =>{
+				console.log(err);
+			})
+		},
 		nav(url){
 			uni.navigateTo({
 				url: url

+ 165 - 0
pages/leave/leaveClass.vue

@@ -0,0 +1,165 @@
+<template>
+	<view class="center">
+		<view class="english">various courses for children</view>
+		<scroll-view scroll-y="true" class="list">
+			<view v-for="(item,index) in courseList" :key="index" class="listBox" @click="nav(index)">
+				<view class="bg"></view>
+				<view class="title">暑假培训阅读精品课</view>
+				<view class="teacher">授课科目:{{ item.subject}} {{ item.teacher}}</view>
+				<view class="bzr">{{ item.bzr }}</view>
+				<view class="button">请假</view>
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+	import { getCourse } from '@/api/course.js'
+	export default {
+		data() {
+			return {
+				page: 1,
+				limit: 10,
+				loadingType: 'more',
+				courseList: [
+					
+				],
+			}
+		},
+		onLoad() {
+			this.loadData();
+		},
+		//下拉刷新
+		onPullDownRefresh() {
+			this.loadData('refresh');
+		},
+		//监听页面是否滚动到底部加载更多
+		onReachBottom() {
+			this.loadData();
+		},
+		methods: {
+			async loadData(type = 'add', loading) {
+				let obj = this;
+				if (type === 'add') {
+					if (obj.loadingType === 'nomore') {
+						return;
+					}
+					obj.loadingType = 'loading';
+				} else {
+					obj.loadingType = 'more';
+				}
+				if (type === 'refresh') {
+					// 清空数组
+					obj.courseList = [];
+					obj.page = 1
+				}
+				//获取课程
+				getCourse({
+					page: obj.page,
+					limit: obj.limit
+				}).then(e => {
+					
+					obj.courseList = obj.courseList.concat(e.data.data);
+					console.log(obj.courseList);
+					//判断是否还有下一页,有是more  没有是nomore
+					if (obj.limit==e.data.length) {
+						obj.page++
+						obj.loadingType='more'
+					} else{
+						obj.loadingType='nomore'
+					}
+					if (type === 'refresh') {
+						if (loading == 1) {
+							uni.hideLoading();
+						} else {
+							uni.stopPullDownRefresh();
+						}
+					}
+				})
+			},
+			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
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="scss">
+page,
+.center {
+	width: 100%;
+	height: 100%;
+	background-color: #f8f8f8;
+}
+.english {
+	padding-left: 41rpx;
+	font-size: 25rpx;
+	font-family: Source Han Sans CN;
+	font-weight: 400;
+	color: #C2C2C2;
+}
+.list {
+	height: 1100rpx;
+}
+.listBox {
+	position: relative;
+	width: 90%;
+	height: 250rpx;
+	margin: 0 auto;
+	margin-top: 34rpx;
+	box-shadow: 0rpx 5rpx 16rpx 0rpx rgba(253, 90, 84, 0.48);
+	border-radius: 28rpx;
+	.bg {
+		width: 100%;
+		height: 100%;
+		position: absolute;
+		left: 0;
+		top: 0;
+		background-color: #4EADFA;;
+		border-radius: 28rpx;
+	}
+	.title {
+		position: relative;
+		padding-top: 36rpx;
+		padding-left: 36rpx;
+		font-size: 36rpx;
+		font-weight: bold;
+		color: #FFFFFF;
+		z-index: 1;
+	}
+	.teacher {
+		position: relative;
+		margin-top: 56rpx;
+		margin-left: 36rpx;
+		font-size: 24rpx;
+		font-weight: 500;
+		color: #FFFFFF;
+		z-index: 1;
+	}
+	.bzr {
+		position: relative;
+		margin-left: 36rpx;
+		font-size: 24rpx;
+		font-weight: 500;
+		color: #FFFFFF;
+		z-index: 1;
+	}
+	.button {
+		position: absolute;
+		right: 26rpx;
+		bottom: 35rpx;
+		width: 160rpx;
+		height: 57rpx;
+		background: #FFFFFF;
+		border-radius: 28rpx;
+		text-align: center;
+		line-height: 57rpx;
+		font-size: 27rpx;
+		font-weight: bold;
+		color: #FD5954;
+	}
+}
+</style>
+

+ 63 - 0
pages/problem/problem.vue

@@ -1,5 +1,10 @@
 <template>
 	<view class="center">
+		<view v-for="(item,index) in problemList" :key="index">
+			<view class="title">{{item.title}}</view>
+			<view class="content">{{item.content}}</view>
+			<view class="reply">{{item.reply}}</view>
+		</view>
 		<view class="buttom" @click="nav('/pages/problem/problemAdd')">
 			新增问题
 		</view>
@@ -7,8 +12,66 @@
 </template>
 
 <script>
+import { getProblem } from '@/api/problem.js' 
 export default {
+	data(){
+		return{
+			page: 1,
+			limit: 10,
+			loadingType: 'more',
+			problemList:[]
+		}
+	},
+	onLoad() {
+		this.loadData()
+	},
+	//下拉刷新
+	onPullDownRefresh() {
+		this.loadData('refresh');
+	},
+	//监听页面是否滚动到底部加载更多
+	onReachBottom() {
+		this.loadData();
+	},
 	methods: {
+		async loadData(type = 'add', loading){
+			let obj = this;
+			if (type === 'add') {
+				if (obj.loadingType === 'nomore') {
+					return;
+				}
+				obj.loadingType = 'loading';
+			} else {
+				obj.loadingType = 'more';
+			}
+			if (type === 'refresh') {
+				// 清空数组
+				obj.courseList = [];
+				obj.page = 1
+			}
+			//获取反馈列表
+			getProblem({
+				page: obj.page,
+				limit: obj.limit
+			}).then(e => {
+				obj.problemList = obj.problemList.concat(e.data.data);
+				console.log(obj.problemList);
+				//判断是否还有下一页,有是more  没有是nomore
+				if (obj.limit==e.data.length) {
+					obj.page++
+					obj.loadingType='more'
+				} else{
+					obj.loadingType='nomore'
+				}
+				if (type === 'refresh') {
+					if (loading == 1) {
+						uni.hideLoading();
+					} else {
+						uni.stopPullDownRefresh();
+					}
+				}
+			})
+		},
 		nav(url) {
 			uni.navigateTo({
 				url: url

+ 21 - 2
pages/problem/problemAdd.vue

@@ -1,5 +1,7 @@
 <template>
 	<view class="center">
+		<view class="login_name"><input class="uni-input" v-model="title" focus placeholder="标题" /></view>
+		<input class="text" v-model="content" focus placeholder="内容"></input>
 		<view class="buttom" @click="nav('/pages/course/success')">
 			提交
 		</view>
@@ -7,11 +9,25 @@
 </template>
 
 <script>
+	import { setProblem } from '@/api/problem.js'
 export default {
+	data(){
+		return{
+			title:'',
+			content:''
+		}
+	},
 	methods: {
 		nav(url){
-			uni.navigateTo({
-				url:url
+			setProblem({
+				title: this.title,
+				content: this.content
+			}).then(e =>{
+				uni.navigateTo({
+					url:url
+				})
+			}).cache(err =>{
+				console.log(err)
 			})
 		}
 	}
@@ -19,4 +35,7 @@ export default {
 </script>
 
 <style>
+	.text{
+		height: 300rpx;
+	}
 </style>

+ 8 - 9
pages/user/user.vue

@@ -3,16 +3,16 @@
 		<view class="top">
 			<view class="bg"><image src="../../static/img/userBg.png" mode="aspectFill"></image></view>
 			<view class="userinfo">
-				<view class="price"><image src="" mode=""></image></view>
-				<view class="name">Divid</view>
+				<view class="price"><image :src="userInfo.avatar" mode=""></image></view>
+				<view class="name">{{ userInfo.nickname }}</view>
 				<view class="guiwen">顾问:李丹丹 12521026301</view>
 			</view>
 		</view>
 		<view class="box">
 			<view class="index" @click="navT()"><image src="../../static/img/we.png"></image></view>
 			<view class="right">
-				<view class="about"><image src="../../static/img/about.png"></image></view>
-				<view class="set" @click="nav()"><image src="../../static/img/set.png"></image></view>
+				<view class="about" @click="nav('/pages/homework/homework')"><image src="../../static/img/about.png"></image></view>
+				<view class="set" @click="nav('/pages/user/userInfo')"><image src="../../static/img/set.png"></image></view>
 			</view>
 		</view>
 	</view>
@@ -28,9 +28,8 @@ export default {
 	},
 	onShow() {
 		// 判断是否已经登录
-		console.log(this.hasLogin)
 		if (this.hasLogin) {
-			console.log(this.hasLogin)
+			console.log(this.userInfo)
 			this.loadBaseData();
 		}
 	},
@@ -72,7 +71,7 @@ export default {
 				})
 			}
 		},
-		nav(){
+		nav(url){
 			if (!this.hasLogin) {
 				uni.showModal({
 					title: '登录',
@@ -89,7 +88,7 @@ export default {
 				return;
 			}else{
 				uni.navigateTo({
-					url: '/pages/user/userInfo'
+					url: url
 				})
 			}
 		}
@@ -127,12 +126,12 @@ page,
 		z-index: 1;
 		width: 125rpx;
 		height: 125rpx;
-		background: #ff0000;
 		box-shadow: 0rpx 14rpx 22rpx 0rpx rgba(247, 144, 108, 0.25);
 		border-radius: 50%;
 		image {
 			width: 100%;
 			height: 100%;
+			border-radius: 50%;
 		}
 	}
 	.name {

+ 19 - 3
pages/user/userInfo.vue

@@ -6,20 +6,36 @@
 		</view>
 		<view class="row">
 			<text class="tit">家长</text>
-			<input class="input" type="text"  placeholder-class="placeholder" />
+			<input class="input" type="text" v-model="patriarch" placeholder-class="placeholder" />
 		</view>
 		<view class="row">
 			<text class="tit">学生</text>
-			<input class="input" type="text"  placeholder-class="placeholder" />
+			<input class="input" type="text" v-model="student" placeholder-class="placeholder" />
 		</view>
 		<view class="row">
 			<text class="tit">手机号</text>
-			<input class="input" type="text"  placeholder-class="placeholder" />
+			<input class="input" type="text" v-model="phone" placeholder-class="placeholder" />
 		</view>
 	</view>
 </template>
 
 <script>
+import { mapState } from 'vuex';
+export default{
+	data(){
+		return{
+			patriarch: '',
+			student: '',
+			phone: ''
+		}
+	},
+	computed: {
+		...mapState('user', ['userInfo'])
+	},
+	onLoad() {
+		console.log(this.userInfo)
+	}
+}
 </script>
 
 <style lang="scss">