xuhaolan 4 éve
szülő
commit
5ce7901961

+ 8 - 0
api/index.js

@@ -15,4 +15,12 @@ export function category(data,cid) {
 		method: 'get',
 		data
 	});
+}
+// 获取文章详情
+export function details(data,id) {
+	return request({
+		url: '/api/article/details/' + id ,
+		method: 'get',
+		data
+	})
 }

+ 4 - 2
manifest.json

@@ -72,8 +72,10 @@
         },
         "devServer" : {
             "proxy" : {
-                "/api" : {
-                    "target" : "http://js.frp.liuniu946.com/api",
+                "/api" : {
+					// "target" : "http://js.frp.liuniu946.com/api",
+					
+                    "target" : "http://bbd.liuniu946.com/api",
                     // "changeOrigin": true,
                     "pathRewrite" : {
                         "/api" : "" // rewrite path

+ 1 - 9
pages.json

@@ -100,15 +100,7 @@
 			}
 		    
 		},
-		{
-			"path": "pages/homework/setHomework",
-			"style": {
-				"navigationBarTitleText": "上传作业",
-				"navigationBarBackgroundColor":"#FFFFFF",
-				"navigationBarTextStyle":"black"
-			}
-		    
-		},
+		
 		//详细评价
 		{
 			"path": "pages/course/evaluate",

+ 26 - 21
pages/course/course.vue

@@ -12,15 +12,15 @@
 				</view>
 				<view class="main">
 					<view class="left">
-						<view class="font">授课科目: {{item.subject}}</view>
-						<view class="font">班主任:{{ bzr }}</view>
+						<view class="font">授课科目:<text style=" display: inline-block;padding-left: 20rpx;">{{item.subject}}</text></view>
+						<view class="font">班主任:<text style=" display: inline-block;padding-left: 20rpx;">{{ bzr }}</text></view>
 					</view>
 					<view class="right">
-						<view class="font">授课老师: {{item.teacher}}</view>
-						<view class="font">电话:</view>
+						<view class="font">授课老师:<text style=" display: inline-block;padding-left: 20rpx;">{{item.teacher}}</text></view>
+						<view class="font">电话:<text style=" display: inline-block;padding-left: 20rpx;">{{ phone }}</text></view>
 					</view>
 				</view>
-				<view class="button">作业上传</view>
+				<view class="button">请假审批</view>
 			</view>
 			<uni-load-more :status="loadingType"></uni-load-more>
 		</scroll-view>
@@ -102,7 +102,8 @@
 				//获取课程
 				getCourse({
 					page: obj.page,
-					limit: obj.limit
+					limit: obj.limit,
+					type: 1,
 				}).then(e => {
 					
 					obj.courseList = obj.courseList.concat(e.data.data);
@@ -125,12 +126,14 @@
 			},
 			data(){
 				my({}).then(({data}) => {
-					this.bzr = data.manage
+					this.bzr = data.manage.real_name;
+					this.phone = data.manage.phone;
 				})
 			},
-			nav(index){
+			nav(index){
+				console.log(index)
 				uni.navigateTo({
-					url: '/pages/homework/setHomework?id=' + this.courseList[index].id
+					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
 				})
 			}
 		}
@@ -146,14 +149,12 @@ page,
 }
 
 .listBox {
-	position: relative;
-	padding-left: 28rpx;
-	padding-top: 42rpx;
-	margin: 0 auto;
-	margin: 20rpx;
-	padding-bottom: 20rpx;
-	background: #FFFFFF;
-	box-shadow: 0px 5rpx 24rpx 0px rgba(4, 0, 0, 0.06);
+	position: relative;
+	padding: 42rpx 32rpx 20rpx 30rpx;
+	margin: 0 auto;
+	margin: 20rpx;
+	background: #FFFFFF;
+	box-shadow: 0px 5rpx 24rpx 0px rgba(4, 0, 0, 0.06);
 	border-radius: 15rpx;
 	.type {
 		position: absolute;
@@ -183,7 +184,8 @@ page,
 				font-weight: bold;
 				color: #333333;
 			}
-			.time {
+			.time {
+				margin-top: 14rpx;
 				font-size: 24rpx;
 				font-weight: 400;
 				color: #808080;
@@ -194,8 +196,10 @@ page,
 		display: flex;
 		justify-content: start;
 		.left {
-			width: 50%;
-			.font{
+			width: 50%;
+			padding-left: 10rpx;
+			.font{
+				margin-top: 20rpx;
 				font-size: 28rpx;
 				font-weight: 500;
 				color: #808080;
@@ -203,7 +207,8 @@ page,
 		}
 		.right {
 			padding-left: 10rpx;
-			.font{
+			.font{
+				margin-top: 20rpx;
 				font-size: 28rpx;
 				font-weight: 500;
 				color: #808080;

+ 64 - 60
pages/course/courseWan.vue

@@ -12,16 +12,15 @@
 				</view>
 				<view class="main">
 					<view class="left">
-						<view class="font">授课科目: {{item.subject}}</view>
-						<view class="font">班主任:{{ bzr }}</view>
+						<view class="font">授课科目: <text style=" display: inline-block;padding-left: 20rpx;">{{item.subject}}</text></view>
+						<view class="font">班主任: <text style=" display: inline-block;padding-left: 20rpx;">{{ bzr }}</text></view>
 					</view>
 					<view class="right">
-						<view class="font">授课老师: {{item.teacher}}</view>
-						<view class="font">电话:</view>
+						<view class="font">授课老师: <text style=" display: inline-block;padding-left: 20rpx;">{{item.teacher}}</text></view>
+						<view class="font">电话:<text style=" display: inline-block;padding-left: 20rpx;">{{ phone }}</text></view>
 					</view>
 				</view>
 				<view class="btnBox flex">
-					<view class="button" @click="navzy(index)">作业上传</view>
 					<view class="button" @click="nav(index)">课程评价</view>
 				</view>
 			</view>
@@ -106,7 +105,8 @@
 				//获取课程
 				getCourse({
 					page: obj.page,
-					limit: obj.limit
+					limit: obj.limit,
+					type: 2,
 				}).then(e => {
 					
 					obj.courseList = obj.courseList.concat(e.data.data);
@@ -129,7 +129,8 @@
 			},
 			data(){
 				my({}).then(({data}) => {
-					this.bzr = data.manage
+					this.bzr = data.manage.real_name;
+					this.phone = data.manage.phone;
 				})
 			},
 			nav(index){
@@ -143,17 +144,17 @@
 					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
-				})
-			},
+			// 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>
@@ -168,11 +169,9 @@ page,
 
 .listBox {
 	position: relative;
-	padding-left: 28rpx;
-	padding-top: 42rpx;
+	padding: 42rpx 32rpx 20rpx 30rpx;
 	margin: 0 auto;
 	margin: 20rpx;
-	padding-bottom: 20rpx;
 	background: #FFFFFF;
 	box-shadow: 0px 5rpx 24rpx 0px rgba(4, 0, 0, 0.06);
 	border-radius: 15rpx;
@@ -190,46 +189,51 @@ page,
 		color: #1CC7C6;
 		line-height: 38rpx;
 	}
-	.top {
-		justify-content: start;
-		margin-bottom: 34rpx;
-		image {
-			width: 76rpx;
-			height: 60rpx;
-		}
-		.font {
-			margin-left: 10rpx;
-			.title {
-				font-size: 32rpx;
-				font-weight: bold;
-				color: #333333;
-			}
-			.time {
-				font-size: 24rpx;
-				font-weight: 400;
-				color: #808080;
-			}
-		}
+	.top {
+		justify-content: start;
+		margin-bottom: 34rpx;
+		image {
+			width: 76rpx;
+			height: 60rpx;
+		}
+		.font {
+			margin-left: 10rpx;
+			.title {
+				font-size: 32rpx;
+				font-weight: bold;
+				color: #333333;
+			}
+			.time {
+				margin-top: 14rpx;
+				font-size: 24rpx;
+				font-weight: 400;
+				color: #808080;
+			}
+		}
 	}
-	.main {
-		display: flex;
-		justify-content: start;
-		.left {
-			width: 50%;
-			.font{
-				font-size: 28rpx;
-				font-weight: 500;
-				color: #808080;
-			}
-		}
-		.right {
-			padding-left: 10rpx;
-			.font{
-				font-size: 28rpx;
-				font-weight: 500;
-				color: #808080;
-			}
-		}
+	.main {
+		padding-left: 8rpx;
+		display: flex;
+		justify-content: start;
+		.left {
+			padding-left: 10rpx;
+			width: 50%;
+			.font{
+				margin-top: 20rpx;
+				font-size: 28rpx;
+				font-weight: 500;
+				color: #808080;
+			}
+		}
+		.right {
+			padding-left: 10rpx;
+			.font{
+				margin-top: 20rpx;
+				font-size: 28rpx;
+				font-weight: 500;
+				color: #808080;
+			}
+		}
 	}
 	.btnBox{
 		width: 100%;

+ 0 - 136
pages/homework/setHomework.vue

@@ -1,136 +0,0 @@
-<template>
-	<view class="center">
-		<view class="text">上传视频</view>
-		<view class="add_picture" v-if="src" >
-			<video :src="src" ></video>
-			<view @click="DelImg" class="x">x</view>
-		</view>
-		<view v-else class="add_picture">
-			<image src="https://zhibo.liuniu946.com/img/phone.png"  @click="test"></image>
-		</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>
-		</view>
-		<view class="buttom" @click="submit()">上传作业</view>
-	</view>
-</template>
-
-<script>
-import { sethomework } from '@/api/homework.js';
-import {
-		uploads, upvideo
-	} from '@/api/apply.js';
-export default {
-	data(){
-		return{
-			id: '',
-			src:'',
-			key:'',
-			cardimg:'',
-			token:''//七牛云的token
-		}
-	},
-	onLoad(option) {
-		this.id = option.id
-	},
-	methods:{
-		// 上传图片
-		imgsub() {
-			console.log('上传图片')
-			uploads({
-				filename: ''
-			}).then(data => {
-				console.log("data",data);
-				this.cardimg = data[0].url;
-			})
-		},
-		submit(){
-			sethomework({
-				timetable_id: this.id,
-				task_video: this.src
-			}).then(() =>{
-				
-			}).catch(err =>{
-				console.log(err)
-			})
-		},
-		test(){
-			console.log('上传视频')
-			upvideo({
-				filename: ''
-			}).then(data => {
-				console.log("data",data);
-				// this.src = data[0].url;
-			})
-		},
-	// 	test: function () {
-	// 				    var self = this;
-	// 				    uni.chooseVideo({
-	// 						count: 1,
-	// 						sourceType: ['camera', 'album'],
-	// 				        success: function (res) {
-	// 							console.log("选择视频成功",res)
-	// 				            self.src = res.tempFilePath;
-	// 							uni.uploadFile({
-	// 								url: 'https://up-z2.qiniup.com', //仅为示例,非真实的接口地址
-	// 								filePath: res.tempFilePath,
-	// 								name: 'files',
-	// 								formData: {
-	// 								    'token':self.token,
-	// 									'key':self.key
-	// 								},
-	// 								header: {
-	// 									Authorization: 'Bearer ' + uni.getStorageSync('access')
-	// 								},
-	// 								 success: (uploadFileRes) => {
-	// 									console.log('1张', uploadFileRes);
-	// 									let bold = JSON.parse(uploadFileRes.data)
-	// 									console.log(bold)
-	// 									console.log(bold.result[0].filePath)
-	// 									self.src = bold.result[0].filePath + bold.result[0].fileName
-	// 									console.log("this.returnImage", self.returnImage)
-	// 								},
-								
-	// 							});
-	// 				        }
-	// 				    });
-	// 				},
-		//右上角删除视频
-			DelImg(){
-						this.src='',
-						this.showVideo=false,
-						this.addVideo=true
-					},
-	}
-}
-</script>
-
-<style lang="scss">
-	.buttom {
-		margin: 50rpx auto;
-		width: 560rpx;
-		height: 90rpx;
-		background: #1CC7C7;
-		border-radius: 45px;
-		text-align: center;
-		line-height: 90rpx;
-	}
-	.add_picture {
-		text-align: center;
-		position: relative;
-		.x{
-			position: absolute;
-			top: 10rpx;
-			right: 90rpx;
-			width: 40rpx;
-			height: 40rpx;
-			color: #FFFFFF;
-			z-index: 99;
-		}
-	}
-	.text {
-		text-align: center;
-	}
-</style>

+ 15 - 28
pages/index/index.vue

@@ -26,11 +26,11 @@
 		</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 class="img"><image src="../../static/img/test.jpg" mode=""></image></view>
+			<view v-for="(item, index) in dataList" :key="index" class="list" @click="navto(item)">
+				<view class="img"><image :src="item.image_input[0]" mode=""></image></view>
 				<view class="right">
 					<view class="r-title">{{ item.title }}</view>
-					<view class="time">{{ item.time }}</view>
+					<view class="time">{{ item.add_time }}</view>
 				</view>
 			</view>
 		</scroll-view>
@@ -44,28 +44,7 @@ export default {
 		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'
-				}
-			]
+			dataList: []
 		};
 	},
 	onLoad() {
@@ -76,14 +55,21 @@ export default {
 			uni.navigateTo({
 				url: url
 			});
+		},
+		navto(e){
+			uni.navigateTo({
+				url:'/pages/index/message?id=' + e.id
+			})
 		},
 		async loadData() {
 			const obj = this;
 			banner({}).then(e => {
 				obj.carouselList = e.data.banner;
 			});
-			category({},0).then(e => {
-				console.log(e)
+			category({page:1,limit: 1000},2).then(({data}) => {
+				console.log(data)
+				obj.dataList = data
+				
 			});
 		},
 		swiperChange(e) {
@@ -95,7 +81,8 @@ export default {
 </script>
 
 <style lang="scss">
-.center {
+.center {
+	background: #FFFFFF;
 	height: 100%;
 }
 .cl {

+ 38 - 8
pages/index/message.vue

@@ -1,17 +1,44 @@
 <template>
 	<view class="center">
 		<view class="bg">
-			<image src="" mode=""></image>
+			<image :src="image" mode=""></image>
 		</view>
-		<view class="title">新闻大标题放在这里最多两排最多两排换行新闻大标题放在这里最多两排最多两排</view>
-		<view class="time">时间,时分秒</view>
-		<view class="content">
-			这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容这里是文字内容
+		<view class="title">{{ title }}</view>
+		<view class="time">{{ time }}</view>
+		<view class="content" v-html="content">
+			{{ content }}
 		</view>
 	</view>
 </template>
 
-<script>
+<script>
+	import { details } from '@/api/index.js';
+	export default {
+		data() {
+			return {
+				title:'',
+				time:'',
+				content:'',
+				id:'',
+				image:'',
+			}
+		},
+		onLoad(option){
+			this.id = option.id;
+			this.loadData();
+		},
+		methods:{
+			async loadData(){
+				const obj = this;
+				details({},obj.id).then(({data}) => {
+					obj.title = data.title;
+					obj.time = data.add_time;
+					obj.content = data.content;
+					obj.image = data.image_input[0];
+				})
+			}
+		}
+	}
 </script>
 
 <style lang="scss">
@@ -19,9 +46,12 @@
 	height: 100%;
 }
 .bg{
-	background: #00BCD4;
 	width: 100%;
-	height: 474rpx;
+	height: 474rpx;
+	image{
+		height: 100%;
+		width: 100%;
+	}
 }
 .title {
 	width: 90%;

+ 18 - 9
pages/leave/details.vue

@@ -3,7 +3,7 @@
 		<scroll-view scroll-y="true">
 			<view v-for="(item,index) in leaveList" :key="index">
 				<view class="leave">
-					<view class="type">审批中</view>
+					<view class="type">已通过</view>
 					<view class="top flex">
 						<image src="../../static/img/indexKcpj.png"></image>
 						<view class="font">
@@ -12,8 +12,8 @@
 						</view>
 					</view>
 					<view class="leavefont">请假类型:事假</view>
-					<view class="leavefont">开始时间:2021/3/18上午</view>
-					<view class="leavefont">结束时间:2021/3/18下午</view>
+					<view class="leavefont">开始时间:{{item.timetable.start_time}}</view>
+					<view class="leavefont">结束时间:{{item.timetable.end_time}}</view>
 					<view class="leavefont">理由:{{ item.reason }}</view>
 				</view>
 			</view>
@@ -68,12 +68,18 @@ export default {
 			getLeave({
 				page: obj.page,
 				limit: obj.limit
-			}).then(e => {
-				
-				obj.leaveList = obj.leaveList.concat(e.data.data);
+			}).then(({data}) => {
+				console.log(data)
+				for(let i = 0;i<data.count;i++){
+					console.log(data.data[i])
+					data.data[i].timetable.add_time = obj.timestampToTime(data.data[i].timetable.add_time);
+					data.data[i].timetable.end_time = obj.timestampToTime(data.data[i].timetable.end_time);
+					data.data[i].timetable.start_time = obj.timestampToTime(data.data[i].timetable.start_time);
+				}
+				obj.leaveList = obj.leaveList.concat(data.data);
 				console.log(obj.leaveList)
-				//判断是否还有下一页,有是more  没有是nomore
-				if (obj.limit==e.data.data.length) {
+				// 判断是否还有下一页,有是more  没有是nomore
+				if (obj.limit==data.count) {
 					obj.page++
 					obj.loadingType='more'
 				} else{
@@ -155,7 +161,10 @@ export default {
 		font-size: 28rpx;
 		font-weight: 500;
 		color: #808080;
-		margin-bottom: 10rpx;
+		margin-bottom: 10rpx;
+		overflow: hidden;
+		text-overflow: ellipsis;
+		white-space: nowrap;
 	}
 }
 </style>

+ 5 - 2
pages/leave/leave.vue

@@ -96,13 +96,16 @@ export default {
 			bottom: 24rpx;
 			
 		}
-		textarea {
+		textarea {
+			margin-top: 20rpx;
+			background: #fff;
+			padding: 20rpx;
 			height: 100%;
 			width: 100%;
 		}
 	}
 	.buttom {
-		margin: 10rpx auto;
+		margin: 100rpx auto 0;
 		width: 560rpx;
 		height: 90rpx;
 		background: #1CC7C7;

+ 48 - 42
pages/leave/leaveClass.vue

@@ -12,12 +12,12 @@
 				</view>
 				<view class="main">
 					<view class="left">
-						<view class="font">授课科目: {{item.subject}}</view>
-						<view class="font">班主任: {{bzr}}</view>
+						<view class="font">授课科目: <text style=" display: inline-block;padding-left: 20rpx;">{{item.subject}}</text></view>
+						<view class="font">班主任: <text style=" display: inline-block;padding-left: 20rpx;">{{ bzr }}</text></view>
 					</view>
 					<view class="right">
-						<view class="font">授课老师: {{item.teacher}}</view>
-						<view class="font">电话:</view>
+						<view class="font">授课老师: <text style=" display: inline-block;padding-left: 20rpx;">{{ item.teacher }}</text></view>
+						<view class="font">电话:<text style=" display: inline-block;padding-left: 20rpx;">{{ phone }}</text></view>
 					</view>
 				</view>
 				<view class="button">请假</view>
@@ -105,7 +105,8 @@
 				//获取课程
 				getCourse({
 					page: obj.page,
-					limit: obj.limit
+					limit: obj.limit,
+					type: 1
 				}).then(e => {
 					
 					obj.courseList = obj.courseList.concat(e.data.data);
@@ -128,7 +129,8 @@
 			},
 			data(){
 				my({}).then(({data}) => {
-					this.bzr = data.manage
+					this.bzr = data.manage.real_name;
+					this.phone = data.manage.phone;
 				})
 			},
 			nav(index){
@@ -177,45 +179,49 @@ page,
 		color: #FF5850;
 		line-height: 38rpx;
 	}
-	.top {
-		justify-content: start;
-		margin-bottom: 34rpx;
-		image {
-			width: 76rpx;
-			height: 60rpx;
-		}
-		.font {
-			margin-left: 10rpx;
-			.title {
-				font-size: 32rpx;
-				font-weight: bold;
-				color: #333333;
-			}
-			.time {
-				font-size: 24rpx;
-				font-weight: 400;
-				color: #808080;
-			}
+	.top {
+		justify-content: start;
+		margin-bottom: 34rpx;
+		image {
+			width: 76rpx;
+			height: 60rpx;
+		}
+		.font {
+			margin-left: 10rpx;
+			.title {
+				font-size: 32rpx;
+				font-weight: bold;
+				color: #333333;
+			}
+			.time {
+				margin-top: 14rpx;
+				font-size: 24rpx;
+				font-weight: 400;
+				color: #808080;
+			}
 		}
 	}
 	.main {
-		display: flex;
-		justify-content: start;
-		.left {
-			width: 50%;
-			.font{
-				font-size: 28rpx;
-				font-weight: 500;
-				color: #808080;
-			}
-		}
-		.right {
-			padding-left: 10rpx;
-			.font{
-				font-size: 28rpx;
-				font-weight: 500;
-				color: #808080;
-			}
+		display: flex;
+		justify-content: start;
+		.left {
+			padding-left: 10rpx;
+			width: 50%;
+			.font{
+				margin-top: 20rpx;
+				font-size: 28rpx;
+				font-weight: 500;
+				color: #808080;
+			}
+		}
+		.right {
+			padding-left: 10rpx;
+			.font{
+				margin-top: 20rpx;
+				font-size: 28rpx;
+				font-weight: 500;
+				color: #808080;
+			}
 		}
 	}
 	.button {

+ 32 - 12
pages/problem/problem.vue

@@ -2,7 +2,7 @@
 	<view class="center">
 		<view class="bg">
 			<view class="back" @click="back">
-				<image src="../../static/img/return.png" ></image>
+				<image src="../../static/img/fanhui.png" ></image>
 			</view>
 			<view class="title">问题反馈</view>
 		</view>
@@ -12,8 +12,8 @@
 					<view class="top flex">
 						<image :src="userInfo.avatar"></image>
 						<view class="font">
-							<view class="title">{{ userInfo.nickname}}</view>
-							<view class="time">2020-10-23 16:00</view>
+							<view class="title">{{ userInfo.real_name}}</view>
+							<view class="time">{{ item.add_time }}</view>
 						</view>
 					</view>
 					<view class="centent">
@@ -98,11 +98,15 @@ export default {
 			getProblem({
 				page: obj.page,
 				limit: obj.limit
-			}).then(e => {
-				obj.problemList = obj.problemList.concat(e.data.data);
+			}).then(({data}) => {
+				for(let i = 0;i<data.count;i++){
+					console.log(data.data[i])
+					data.data[i].add_time = obj.timestampToTime(data.data[i].add_time);
+				}
+				obj.problemList = obj.problemList.concat(data.data);
 				console.log(obj.problemList);
 				//判断是否还有下一页,有是more  没有是nomore
-				if (obj.limit==e.data.data.length) {
+				if (obj.limit==data.data.length) {
 					obj.page++
 					obj.loadingType='more'
 				} else{
@@ -124,6 +128,16 @@ export default {
 		},
 		back(){
 			uni.navigateBack();
+		},
+		timestampToTime(timestamp) {
+		        var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
+		        var Y = date.getFullYear() + '/';
+		        var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1):date.getMonth()+1) + '/';
+		        var D = (date.getDate()< 10 ? '0'+date.getDate():date.getDate())+ ' ';
+		        var h = (date.getHours() < 10 ? '0'+date.getHours():date.getHours())+ ':';
+		        var m = (date.getMinutes() < 10 ? '0'+date.getMinutes():date.getMinutes()) + ':';
+		        var s = date.getSeconds() < 10 ? '0'+date.getSeconds():date.getSeconds();
+		        return Y+M+D+h+m+s;
 		}
 	}
 }
@@ -151,12 +165,17 @@ export default {
 		top: 54rpx;
 		left: 24rpx;
 		width: 46rpx;
-		height: 46rpx;
-		background: #F5F4FA;
-		opacity: 0.23;
+		height: 46rpx;
+		background: rgba(245,244,250,0.23);
+		// opacity: ;
 		border-radius: 50%;
-		text-align: center;
-		image {
+		text-align: center;
+		display: flex;
+		align-items: center;
+		image {
+			position: relative;
+			margin: 0 auto;
+			line-height: 46rpx;
 			width: 18rpx;
 			height: 24rpx;
 			border-radius: 50%;
@@ -182,7 +201,8 @@ export default {
 				font-weight: bold;
 				color: #3D4458;
 			}
-			.time {
+			.time {
+				margin-top: 18rpx;
 				font-size: 26rpx;
 				font-weight: 500;
 				color: #999999;

+ 13 - 5
pages/problem/problemAdd.vue

@@ -42,7 +42,12 @@ export default {
 <style lang="scss">
 	.login_name {
 		width: 90%;
-		margin: 30rpx auto;
+		margin: 30rpx auto;
+		.uni-input{
+			padding:20rpx;
+			background: #fff;
+			height: 80rpx;
+		}
 	}
 	.text{
 		position: relative;
@@ -50,8 +55,10 @@ export default {
 		margin: 30rpx auto;
 		height: 430rpx;
 		font-size: 30rpx;
-		font-weight: 500;
-		color: #999999;
+		font-weight: 500;
+		background: #fff;
+		color: #999999;
+		padding: 30rpx;
 		.js{
 			position: absolute;
 			right: 50rpx;
@@ -64,12 +71,13 @@ export default {
 		}
 	}
 	.buttom{
-		margin: 0 auto;
+		margin: 114rpx auto 0;
 		width: 560rpx;
 		height: 90rpx;
 		background: #1CC7C7;
 		border-radius: 45px;
 		text-align: center;
-		line-height: 90rpx;
+		line-height: 90rpx;
+		color: #FFFFFF;
 	}
 </style>

+ 1 - 1
pages/public/login.vue

@@ -14,7 +14,7 @@
 			<view><button type="green" class="uni-button uni-button-red" @click="toLogin">登录</button></view>
 			<!-- <view><button type="green" class="uni-button uni-button-green uni-button-green-plain" plain="true" hover-class="none" @click="register">注册</button></view> -->
 			<view class="forget" @click="forget">忘记密码?</view>
-			<view class="forget" @click="register">没有账号?立即创建一个。</view>
+			<!-- <view class="forget" @click="register">没有账号?立即创建一个。</view> -->
 			<!-- <view class="flex other">
 				<view class="fenge"></view>
 				<view class="qita">其他方式登录</view>

+ 1 - 1
pages/public/set.vue

@@ -2,7 +2,7 @@
 	<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/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">

+ 69 - 6
pages/user/about.vue

@@ -1,15 +1,78 @@
 <template>
-	<view class="content">
-	言图同伴小组遵循不同年级不同科目的学习特点及规律,采取分层教学,因材施教,使得不同程度的学生都有适合自己的班型课程;同时,在教学内容上既要匹配考纲对知识与技能的要求,也要注重提升学生的综合能力。
+	<view class="center">
+		<view class="content" v-html="content">
+			{{ content }}
+		</view>
 	</view>
 </template>
 
-<script>
+<script>
+	import { details } from '@/api/index.js';
+	export default {
+		data() {
+			return {
+				title:'',
+				content:'',
+				id:'',
+				image:'',
+			}
+		},
+		onLoad(option){
+			this.loadData();
+		},
+		methods:{
+			async loadData(){
+				const obj = this;
+				details({},3).then(({data}) => {
+					obj.time = data.add_time;
+					obj.content = data.content;
+					obj.image = data.image_input[0];
+				})
+			}
+		}
+	}
 </script>
 
 <style lang="scss">
-	.content {
-		width: 90%;
-		margin: 0 auto;
+.center{
+	height: 100%;
+}
+.bg{
+	width: 100%;
+	height: 474rpx;
+	image{
+		height: 100%;
+		width: 100%;
 	}
+}
+.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>

+ 13 - 9
pages/user/user.vue

@@ -16,22 +16,22 @@
 			<view class="navBox flex">
 				<view class="main">
 					<view class="font">已上课时</view>
-					<view class="num">{{ achieve }}</view>
+					<view class="num">{{ achieve || 0 }}</view>
 				</view>
 				<view class="xian"></view>
 				<view class="main">
 					<view class="font">总课时</view>
-					<view class="num">{{ all }}</view>
+					<view class="num">{{ all || 0 }}</view>
 				</view>
 				<view class="xian"></view>
 				<view class="main">
 					<view class="font">赠送课时</view>
-					<view class="num">{{ gift }}</view>
+					<view class="num">{{ gift || 0 }}</view>
 				</view>
 				<view class="xian"></view>
 				<view class="main">
 					<view class="font">请假课时</view>
-					<view class="num">{{ leave }}</view>
+					<view class="num">{{ leave || 0 }}</view>
 				</view>
 			</view>
 
@@ -87,10 +87,10 @@ export default {
 	},
 	data() {
 		return {
-			all: '200', //总课时
-			achieve: '208', //完成课时
-			leave: '20', //请假课时
-			gift: '20', //赠送课时
+			all: '', //总课时
+			achieve: '', //完成课时
+			leave: '', //请假课时
+			gift: '', //赠送课时
 			guwen: ''
 		};
 	},
@@ -129,7 +129,11 @@ export default {
 					console.log(e);
 				});
 			my({}).then(({ data }) => {
-				this.guwen = data.adviser;
+				this.guwen = data.adviser;
+				this.all = data.sum_class;
+				this.leave = data.leave;
+				this.gift = data.give_class;
+				this.achieve = data.sum_class;
 			});
 			getCourse({})
 				.then(e => {

+ 9 - 3
pages/user/userInfo.vue

@@ -22,7 +22,7 @@
 
 <script>
 import { mapState } from 'vuex';
-import { uploads } from '@/api/user.js';
+import { uploads,my } from '@/api/user.js';
 import {userEdit} from '@/api/set.js'
 export default{
 	data(){
@@ -30,13 +30,19 @@ export default{
 			student:''
 		}
 	},
-	onLoad() {
+	onLoad() {
+		this.loadData();
 		console.log(this.userInfo)
 	},
 	computed: {
 		...mapState( ['userInfo'])
 	},
-	methods: {
+	methods: {
+		async loadData(){
+			my({}).then(({ data }) => {
+				this.student = data.full_name;
+			});
+		},
 		imgsub() {
 			console.log('上传头像')
 			uploads({

BIN
static/img/fanhui.png


+ 7 - 5
store/index.js

@@ -1,10 +1,11 @@
 import Vue from 'vue'
-import Vuex from 'vuex'
+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: 'http://bbd.liuniu946.com'	,
 		// baseURL: 'https://zhibo.liuniu946.com', //请求地址配置
 		urlFile:'/index',//项目部署所在文件夹
 		hasLogin: false, //是否登录
@@ -68,9 +69,10 @@ const store = new Vuex.Store({
 			}
 			// #endif
 		},
-		actions: {
-	
-		}
+	modules:{
+		user
+	},	
+	actions: {}
 	})
 	
 	export default store

+ 107 - 246
utils/newRequest.js

@@ -86,252 +86,113 @@ let service = {
 		})
 	},
 	// 上传文件
-	upFilse: async function(data) {
-		return await new Promise(function(resolve, reject) {
-			let requestData = ''; //保存处理完成后请求数据
-			let url = '' //保存请求地址
-			try {
-				// 请求前数据处理
-				requestData = service.request.success(data);
-			} catch (e) {
-				// 请求报错拦截
-				service.request.error(e);
-			}
-			// #ifdef H5
-			if(process.env.NODE_ENV === 'development'){
-				url= requestData.url;
-			    console.log('开发环境')
-			}else{
-				url=service.baseURL + requestData.url;
-			    console.log('生产环境')
-			}
-			// #endif
-			// #ifndef H5
-			url=service.baseURL + requestData.url;
-			// #endif
-			let config = {
-				// 上传图片的API
-				upload_img_url:url
-			}
-
-			let Uploader = {
-				// 选择图片
-				choose(num) {
-					return new Promise((resolve, reject) => {
-						uni.chooseImage({
-							count: num,
-							success(res) {
-								// console.log(res);
-								// 缓存文件路径
-								resolve(res.tempFilePaths)
-							},
-							fail(err) {
-								console.log(err)
-								reject(err)
-							}
-						})
-					})
-
-				},
-				// 上传图片
-				upload_one(path) {
-					return new Promise((resolve, reject) => {
-						uni.showLoading({
-							title: '上传中'
-						})
-						uni.uploadFile({
-							url: config.upload_img_url, //仅为示例,非真实的接口地址
-							filePath: path,
-							name: 'file',
-							header: {
-								"Authori-zation": 'Bearer ' + uni.getStorageSync('token')
-							},
-							success: (uploadFileRes) => {
-								if ("string" === typeof uploadFileRes.data) {
-									resolve(JSON.parse(uploadFileRes.data).data)
-								} else {
-									resolve(uploadFileRes.data.data)
-								}
-							},
-							complete() {
-								uni.hideLoading()
-							}
-						});
-					})
-				},
-				// 上传多个图片
-				upload(path_arr) {
-					let num = path_arr.length;
-					return new Promise(async (resolve, reject) => {
-						let img_urls = []
-						for (let i = 0; i < num; i++) {
-							let img_url = await this.upload_one(path_arr[i]);
-							img_urls.push(img_url)
-						};
-						resolve(img_urls)
-					})
-				},
-				// 触发上传图片事件
-				choose_and_upload(num) {
-					return new Promise(async (resolve, reject) => {
-						// 选择图片
-						let path_arr = await this.choose(num);
-						// 上传图片
-						await this.upload(path_arr).then((e) => {
-							resolve(e);
-						}).catch((e) => {
-							reject(e)
-						});
-					})
-				}
-			};
-			Uploader.choose_and_upload(1).then((e) => {
-				resolve(e);
-			}).catch((e) => {
-				console.log(e);
-			})
-		})
-	},
-	//上传视频
-	upVideo: async function(data) {
-			return await new Promise(function(resolve, reject) {
-				let requestData = ''; //保存处理完成后请求数据
-				let url = '' //保存请求地址
-				try {
-					// 请求前数据处理
-					requestData = service.request.success(data);
-				} catch (e) {
-					// 请求报错拦截
-					service.request.error(e);
-				}
-				// #ifdef H5
-				if(process.env.NODE_ENV === 'development'){
-					url= requestData.url;
-				    console.log('开发环境')
-				}else{
-					url=service.baseURL + requestData.url;
-				    console.log('生产环境')
-				}
-				// #endif
-				// #ifndef H5
-				url=service.baseURL + requestData.url;
-				// #endif
-				let config = {
-					// 上传图片的API
-					upload_img_url:url
-				}
-	
-				let Uploader = {
-					// 选择视频
-					choose(num) {
-						return new Promise((resolve, reject) => {
-							uni.chooseVideo({
-								count: 1,
-								sourceType: ['camera', 'album'],
-								success(res) {
-									console.log(res);
-									// 缓存文件路径
-									resolve(res.tempFilePaths)
-								},
-								fail(err) {
-									console.log(err)
-									reject(err)
-								}
-							})
-						})
-						
-					},
-					// 上传视频
-					upload_one(path) {
-						return new Promise((resolve, reject) => {
-								uni.showLoading({
-									title: '上传中'
-								})
-									let file = path;
-									// let imageType = /^image\//;
-									// //判断是否为图片不是则跳过不执行下面语句
-									// if (!imageType.test(file.type)) {
-									// 	Indicator.close()
-									// 	Toast({
-									// 		message: '格式错误',
-									// 		duration: 1000
-									// 	});
-									// }
-									request({
-										url: "/api/Upload/wxUploudtoken",
-										method: 'post',
-										data: {}
-									}).then(({
-										data
-									}) => {
-										console.log(data,99);
-										let observable = qiniu.upload(file, file.name, data.token, {
-											fname: "",
-											params: {},
-											mimeType: null
-										}, {
-											useCdnDomain: true,
-											region: qiniu.region.z0
-										});
-										let observer = {
-											next(res) {
-												console.log(res);
-												// ...
-											},
-											error(err) {
-												console.log(err);
-												// ...
-											},
-											complete(res) {
-												uni.hideLoading()
-												uni.showLoading({
-													title: '上传成功'
-												})
-												setTimeout(function(){uni.hideLoading()},1000);
-												fun('https://limg.liuniu946.com/' + res.key)
-												// ...
-											}
-										}
-										let subscription = observable.subscribe(observer) // 上传开始
-									})
-							})
-						},
-							
-						
-						// 上传多个视频
-						// upload(path_arr) {
-						// 	let num = path_arr.length;
-						// 	return new Promise(async (resolve, reject) => {
-						// 		let img_urls = []
-						// 		for (let i = 0; i < num; i++) {
-						// 			let img_url = await this.upload_one(path_arr[i]);
-						// 			img_urls.push(img_url)
-						// 		};
-						// 		resolve(img_urls)
-						// 	})
-						// },
-						// 触发上传视频事件
-						choose_and_upload(num) {
-						return new Promise(async (resolve, reject) => {
-							// 选择视频
-							let path_arr = await this.choose(num);
-							// 上传视频
-							await this.upload_one(path_arr).then((e) => {
-								
-								resolve(e);
-							}).catch((e) => {
-								reject(e)
-							});
-						})
-					}
-				};
-				Uploader.choose_and_upload(1).then((e) => {
-					resolve(e);
-				}).catch((e) => {
-					console.log(e);
-				})
-			})
-		},
+	upFilse: async function(data) {
+		return await new Promise(function(resolve, reject) {
+			let requestData = ''; //保存处理完成后请求数据
+			let url = '' //保存请求地址
+			try {
+				// 请求前数据处理
+				requestData = service.request.success(data);
+			} catch (e) {
+				// 请求报错拦截
+				service.request.error(e);
+			}
+			// #ifdef H5
+			if(process.env.NODE_ENV === 'development'){
+				url= requestData.url;
+			    console.log('开发环境')
+			}else{
+				url=service.baseURL + requestData.url;
+			    console.log('生产环境')
+			}
+			// #endif
+			// #ifndef H5
+			url=service.baseURL + requestData.url;
+			// #endif
+			let config = {
+				// 上传图片的API
+				upload_img_url:url
+			}
+			let Uploader = {
+				// 选择图片
+				choose(num) {
+					return new Promise((resolve, reject) => {
+						uni.chooseImage({
+							count: num,
+							success(res) {
+								console.log(res);
+								// 缓存文件路径
+								resolve(res.tempFilePaths)
+							},
+							fail(err) {
+								console.log(err)
+								reject(err)
+							}
+						})
+					})
+
+				},
+				// 上传图片
+				upload_one(path) {
+					return new Promise((resolve, reject) => {
+						uni.showLoading({
+							title: '上传中'
+						})
+						console.log(path);
+						uni.uploadFile({
+							url: config.upload_img_url, //仅为示例,非真实的接口地址
+							filePath: path,
+							name: 'file',
+							header: {
+								"Authori-zation": 'Bearer ' + uni.getStorageSync('token')
+							},
+							success: (uploadFileRes) => {
+								if ("string" === typeof uploadFileRes.data) {
+									resolve(JSON.parse(uploadFileRes.data).data)
+								} else {
+									resolve(uploadFileRes.data.data)
+								}
+							},
+							complete() {
+								uni.hideLoading()
+							}
+						});
+					})
+				},
+				// 上传多个图片
+				upload(path_arr) {
+					let num = path_arr.length;
+					return new Promise(async (resolve, reject) => {
+						let img_urls = []
+						for (let i = 0; i < num; i++) {
+							let img_url = await this.upload_one(path_arr[i]);
+							img_urls.push(img_url)
+						};
+						resolve(img_urls)
+					})
+				},
+				// 触发上传图片事件
+				choose_and_upload(num) {
+					return new Promise(async (resolve, reject) => {
+						// 选择图片
+						let path_arr = await this.choose(num);
+						console.log(path_arr)
+						// 上传图片
+						await this.upload(path_arr).then((e) => {
+							resolve(e);
+						}).catch((e) => {
+							reject(e)
+						});
+					})
+				}
+			};
+			Uploader.choose_and_upload(1).then((e) => {
+				resolve(e);
+			}).catch((e) => {
+				console.log(e);
+			})
+		})
+	},
 };
 
 

+ 3 - 2
utils/request.js

@@ -81,6 +81,7 @@ service.interceptors.request(
 	}
 )
 let upFilse = service.upFilse;
-let upVideo = service.upVideo;
-export {upFilse,upVideo};
+export {
+	upFilse
+};
 export default service.open;