hwq 4 سال پیش
والد
کامیت
1f14e04a76

+ 2 - 1
pages.json

@@ -58,7 +58,8 @@
 			"style": {
 				"navigationBarTitleText": "待上课程",
 				"navigationBarBackgroundColor":"#FFFFFF",
-				"navigationBarTextStyle":"black"
+				"navigationBarTextStyle":"black",
+				"enablePullDownRefresh": true
 			}
 		    
 		},

+ 32 - 3
pages/course/course.vue

@@ -22,13 +22,23 @@
 				</view>
 				<view class="button">作业上传</view>
 			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
 		</scroll-view>
 	</view>
 </template>
 
 <script>
-	import { getCourse } from '@/api/course.js'
+	import { getCourse } from '@/api/course.js';
+	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+	import { saveUrl, interceptor } from '@/utils/loginUtils.js';
+	import { mapState, mapMutations } from 'vuex';
 	export default {
+		computed: {
+			...mapState(['hasLogin', 'userInfo', 'baseURL', 'urlFile'])
+		},
+		components: {
+			uniLoadMore
+		},
 		data() {
 			return {
 				page: 1,
@@ -40,7 +50,26 @@
 			}
 		},
 		onLoad() {
-			this.loadData();
+			if (this.hasLogin) {
+				console.log(this.userInfo)
+				this.loadData();
+			}else{
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						console.log(e)
+						if (e.confirm) {
+							console.log("1111")
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
+				return;
+			}
 		},
 		//下拉刷新
 		onPullDownRefresh() {
@@ -75,7 +104,7 @@
 					obj.courseList = obj.courseList.concat(e.data.data);
 					console.log(obj.courseList);
 					//判断是否还有下一页,有是more  没有是nomore
-					if (obj.limit==e.data.length) {
+					if (obj.limit==e.data.data.length) {
 						obj.page++
 						obj.loadingType='more'
 					} else{

+ 34 - 4
pages/course/courseWan.vue

@@ -22,13 +22,24 @@
 				</view>
 				<view class="button">课程评价</view>
 			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
 		</scroll-view>
+		
 	</view>
 </template>
 
 <script>
-	import { getCourse } from '@/api/course.js'
+	import { getCourse } from '@/api/course.js';
+	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+	import { mapState, mapMutations } from 'vuex';
+	import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 	export default {
+		computed: {
+			...mapState(['hasLogin', 'userInfo', 'baseURL', 'urlFile'])
+		},
+		components: {
+			uniLoadMore
+		},
 		data() {
 			return {
 				page: 1,
@@ -40,7 +51,26 @@
 			}
 		},
 		onLoad() {
-			this.loadData();
+			if (this.hasLogin) {
+				console.log(this.userInfo)
+				this.loadData();
+			}else{
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						console.log(e)
+						if (e.confirm) {
+							console.log("1111")
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
+				return;
+			}
 		},
 		//下拉刷新
 		onPullDownRefresh() {
@@ -74,9 +104,9 @@
 					
 					obj.courseList = obj.courseList.concat(e.data.data);
 					console.log(obj.courseList);
+					obj.page++
 					//判断是否还有下一页,有是more  没有是nomore
-					if (obj.limit==e.data.length) {
-						obj.page++
+					if (obj.limit==e.data.data.length) {
 						obj.loadingType='more'
 					} else{
 						obj.loadingType='nomore'

+ 34 - 9
pages/homework/setHomework.vue

@@ -1,8 +1,8 @@
 <template>
 	<view class="center">
-		<view class="" v-if="showVideo" >
+		<view class="add_picture" v-if="showVideo" >
 			<video :src="src" ></video>
-			<view @click="DelImg">x</view>
+			<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>
@@ -19,7 +19,9 @@ export default {
 			id: '',
 			showVideo: false,
 			addVideo: false,
-			src:''
+			src:'',
+			key:'',
+			token:''//七牛云的token
 		}
 	},
 	onLoad(option) {
@@ -47,12 +49,13 @@ export default {
 								self.addVideo=false
 					            self.src = res.tempFilePath;
 								uni.uploadFile({
-									url:  config.upload_img_url, //仅为示例,非真实的接口地址
+									url: 'https://up-z2.qiniup.com', //仅为示例,非真实的接口地址
 									filePath: res.tempFilePath,
 									name: 'files',
-									// formData: {
-									//     'user': 'test'
-									// },
+									formData: {
+									    'token':self.token,
+										'key':self.key
+									},
 									header: {
 										Authorization: 'Bearer ' + uni.getStorageSync('access')
 									},
@@ -61,7 +64,7 @@ export default {
 										let bold = JSON.parse(uploadFileRes.data)
 										console.log(bold)
 										console.log(bold.result[0].filePath)
-										self.returnImage = bold.result[0].filePath + bold.result[0].fileName
+										self.src = bold.result[0].filePath + bold.result[0].fileName
 										console.log("this.returnImage", self.returnImage)
 									},
 								
@@ -79,5 +82,27 @@ export default {
 }
 </script>
 
-<style>
+<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;
+		}
+	}
 </style>

+ 11 - 2
pages/leave/details.vue

@@ -68,7 +68,7 @@ export default {
 				obj.leaveList = obj.leaveList.concat(e.data.data);
 				console.log(obj.leaveList)
 				//判断是否还有下一页,有是more  没有是nomore
-				if (obj.limit==e.data.length) {
+				if (obj.limit==e.data.data.length) {
 					obj.page++
 					obj.loadingType='more'
 				} else{
@@ -83,7 +83,16 @@ export default {
 				}
 			})
 		},
-		
+		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;
+		}
 	}
 }
 </script>

+ 67 - 9
pages/leave/leave.vue

@@ -1,21 +1,25 @@
 <template>
 	<view class="center">
-		<view class="">
+		<view class="text">
 			<text>请假原因</text>
-			<input type="text" v-model="reason" />
+			<textarea  v-model="reason" maxlength="300"  focus placeholder="您为什么要请假呢?"></textarea>
 		</view>
 		<view class="buttom" @click="submit('/pages/course/success')">
 			立即提交
 		</view>
-		<view class="" @click="nav('/pages/leave/details')">
+		<view class="jilv" @click="nav('/pages/leave/details')">
 			申请记录
 		</view>
 	</view>
 </template>
 
 <script>
-import { setLeave} from '@/api/course.js'
+import { setLeave} from '@/api/course.js';
+import { mapState, mapMutations } from 'vuex';
 export default {
+	computed: {
+		...mapState(['hasLogin', 'userInfo', 'baseURL', 'urlFile'])
+	},
 	data(){
 		return{
 			id: '',
@@ -27,10 +31,29 @@ export default {
 		}
 	},
 	onLoad(option) {
-		this.id = option.id;
-		this.ifyid = option.ifyid;
-		this.grade_id = option.grade_id;
-		this.subject_id = option.subject_id
+		if (this.hasLogin) {
+			this.id = option.id;
+			this.ifyid = option.ifyid;
+			this.grade_id = option.grade_id;
+			this.subject_id = option.subject_id
+		}else{
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						console.log(e)
+						if (e.confirm) {
+							console.log("1111")
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
+				return;
+			}
+		
 	},
 	methods: {
 		submit(url){
@@ -58,5 +81,40 @@ export default {
 }
 </script>
 
-<style>
+<style lang="scss">
+	.text{
+		position: relative;
+		width: 90%;
+		margin: 30rpx auto;
+		height: 430rpx;
+		font-size: 30rpx;
+		font-weight: 500;
+		color: #000000;
+		.js{
+			position: absolute;
+			right: 50rpx;
+			bottom: 24rpx;
+			
+		}
+		textarea {
+			height: 100%;
+			width: 100%;
+		}
+	}
+	.buttom {
+		margin: 10rpx auto;
+		width: 560rpx;
+		height: 90rpx;
+		background: #1CC7C7;
+		border-radius: 45px;
+		text-align: center;
+		line-height: 90rpx;
+		
+	}
+	.jilv {
+		margin-top: 30rpx;
+		text-align: center;
+		color: #999999;
+		font-size: 30rpx;
+	}
 </style>

+ 120 - 65
pages/leave/leaveClass.vue

@@ -1,21 +1,44 @@
 <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="type">待完成</view>
+				<view class="top flex">
+					<image src="../../static/img/indexMycourse.png"></image>
+					<view class="font">
+						<view class="title">奥数能力提升班</view>
+						<view class="time">{{item.start_time}}</view>
+					</view>
+				</view>
+				<view class="main">
+					<view class="left">
+						<view class="font">授课科目: {{item.subject}}</view>
+						<view class="font">班主任:</view>
+					</view>
+					<view class="right">
+						<view class="font">授课老师: {{item.teacher}}</view>
+						<view class="font">电话:</view>
+					</view>
+				</view>
 				<view class="button">请假</view>
 			</view>
+			<uni-load-more :status="loadingType"></uni-load-more>
 		</scroll-view>
 	</view>
 </template>
 
 <script>
-	import { getCourse } from '@/api/course.js'
+	import { getCourse } from '@/api/course.js';
+	import uniLoadMore from '@/components/uni-load-more/uni-load-more.vue';
+	import { mapState, mapMutations } from 'vuex';
+	import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 	export default {
+		computed: {
+			...mapState(['hasLogin', 'userInfo', 'baseURL', 'urlFile'])
+		},
+		components: {
+			uniLoadMore
+		},
 		data() {
 			return {
 				page: 1,
@@ -27,7 +50,26 @@
 			}
 		},
 		onLoad() {
-			this.loadData();
+			if (this.hasLogin) {
+				console.log(this.userInfo)
+				this.loadData();
+			}else{
+				uni.showModal({
+					title: '登录',
+					content: '您未登录,是否马上登陆?',
+					success: e => {
+						console.log(e)
+						if (e.confirm) {
+							console.log("1111")
+							interceptor();
+						}
+					},
+					fail: e => {
+						console.log(e);
+					}
+				});
+				return;
+			}
 		},
 		//下拉刷新
 		onPullDownRefresh() {
@@ -62,7 +104,7 @@
 					obj.courseList = obj.courseList.concat(e.data.data);
 					console.log(obj.courseList);
 					//判断是否还有下一页,有是more  没有是nomore
-					if (obj.limit==e.data.length) {
+					if (obj.limit==e.data.data.length) {
 						obj.page++
 						obj.loadingType='more'
 					} else{
@@ -93,73 +135,86 @@ page,
 	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;
+	padding-left: 28rpx;
+	padding-top: 42rpx;
 	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%;
+	margin: 20rpx;
+	padding-bottom: 20rpx;
+	background: #FFFFFF;
+	box-shadow: 0px 5rpx 24rpx 0px rgba(4, 0, 0, 0.06);
+	border-radius: 15rpx;
+	.type {
 		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;
+		top: 38rpx;
+		right: 32rpx;
+		width: 97rpx;
+		height: 38rpx;
+		text-align: center;
+		background: #FFDEDF;
+		border-radius: 5rpx;
+		font-size: 22rpx;
 		font-weight: 500;
-		color: #FFFFFF;
-		z-index: 1;
+		color: #FF5850;
+		line-height: 38rpx;
 	}
-	.bzr {
-		position: relative;
-		margin-left: 36rpx;
-		font-size: 24rpx;
-		font-weight: 500;
-		color: #FFFFFF;
-		z-index: 1;
+	.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;
+			}
+		}
+	}
+	.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;
+			}
+		}
 	}
 	.button {
-		position: absolute;
-		right: 26rpx;
-		bottom: 35rpx;
-		width: 160rpx;
-		height: 57rpx;
-		background: #FFFFFF;
-		border-radius: 28rpx;
+		margin-top: 40rpx;
+		margin-left: 500rpx;
+		width: 145rpx;
+		height: 48rpx;
+		border: 1rpx solid #FF8219;
+		border-radius: 24rpx;
+		font-size: 26rpx;
+		font-weight: 500;
+		color: #FF8219;
 		text-align: center;
-		line-height: 57rpx;
-		font-size: 27rpx;
-		font-weight: bold;
-		color: #FD5954;
+		line-height: 48rpx;
 	}
 }
 </style>
 
+

+ 46 - 3
pages/problem/problem.vue

@@ -1,6 +1,9 @@
 <template>
 	<view class="center">
 		<view class="bg">
+			<view class="back" @click="back">
+				<image src="../../static/img/return.png" ></image>
+			</view>
 			<view class="title">问题反馈</view>
 		</view>
 		<scroll-view scroll-y="true" class="list">
@@ -30,7 +33,8 @@
 
 <script>
 import { mapState, mapMutations } from 'vuex';
-import { getProblem } from '@/api/problem.js' 
+import { getProblem } from '@/api/problem.js';
+import { saveUrl, interceptor } from '@/utils/loginUtils.js';
 export default {
 	computed: {
 		...mapState(['hasLogin', 'userInfo', 'baseURL', 'urlFile'])
@@ -44,7 +48,26 @@ export default {
 		}
 	},
 	onLoad() {
-		this.loadData()
+		if (this.hasLogin) {
+			console.log(this.userInfo)
+			this.loadData();
+		}else{
+			uni.showModal({
+				title: '登录',
+				content: '您未登录,是否马上登陆?',
+				success: e => {
+					console.log(e)
+					if (e.confirm) {
+						console.log("1111")
+						interceptor();
+					}
+				},
+				fail: e => {
+					console.log(e);
+				}
+			});
+			return;
+		}
 	},
 	//下拉刷新
 	onPullDownRefresh() {
@@ -78,7 +101,7 @@ export default {
 				obj.problemList = obj.problemList.concat(e.data.data);
 				console.log(obj.problemList);
 				//判断是否还有下一页,有是more  没有是nomore
-				if (obj.limit==e.data.length) {
+				if (obj.limit==e.data.data.length) {
 					obj.page++
 					obj.loadingType='more'
 				} else{
@@ -97,6 +120,9 @@ export default {
 			uni.navigateTo({
 				url: url
 			})
+		},
+		back(){
+			uni.navigateBack();
 		}
 	}
 }
@@ -119,6 +145,22 @@ export default {
 		font-weight: 400;
 		color: #FFFFFF;
 	}
+	.back{
+		position: absolute;
+		top: 54rpx;
+		left: 24rpx;
+		width: 46rpx;
+		height: 46rpx;
+		background: #F5F4FA;
+		opacity: 0.23;
+		border-radius: 50%;
+		text-align: center;
+		image {
+			width: 18rpx;
+			height: 24rpx;
+			border-radius: 50%;
+		}
+	}
 }
 .problem {
 	margin: 20rpx;
@@ -177,4 +219,5 @@ export default {
 .list{
 	height: 780rpx;
 }
+
 </style>

+ 1 - 1
pages/problem/problemAdd.vue

@@ -12,7 +12,7 @@
 </template>
 
 <script>
-	import { setProblem } from '@/api/problem.js'
+import { setProblem } from '@/api/problem.js'
 export default {
 	data(){
 		return{

+ 17 - 1
pages/user/user.vue

@@ -69,7 +69,23 @@ export default {
 		if (this.hasLogin) {
 			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);
+					}
+				});
+				return;
+			}
 	},
 	methods: {
 		...mapMutations( ['setUserInfo', 'setOrderInfo']),