Просмотр исходного кода

1. 日程页面开发完成

2. 课程详情页UI开发 50%
Cee.Yang 3 лет назад
Родитель
Сommit
bc672d5727

+ 2 - 1
api/api.js

@@ -21,7 +21,8 @@ class Api {
 	/// LESON
 	///
 	
-	static lessonDetail(id) { return request({ url: `/api/v1/lesson_detail/${id}` }) }
+	/// 获取课程详情
+	static lessonDetail(id) { return request({ url: `/api/v1/school_app_class_schedule_page/get_kq_stu?cs_id=${id}` }) }
 }
 
 export default Api

+ 21 - 0
common/tools.js

@@ -0,0 +1,21 @@
+export var lessonStatus = [
+	{"index": 0, "state": null, "name": 'onGoing', "color": '#F7C405'},
+	{"index": 1, "state": 45, "name": 'absence', "color": '#F7C405', "image":require('../static/lesson/lesson_wsk.png')},
+	{"index": 2, "state": 47, "name": 'finished', "color": '#99CA3A', "image":require('../static/lesson/lesson_sk.png')},
+	{"index": 3, "state": 686, "name": 'kqCancel', "color": '#A1A9B5', "image":require('../static/lesson/lesson_qx.png')},
+]
+
+export function getLessonStatus(state) {
+	var item = lessonStatus.find(e=>e.state==state)
+	return item || {}
+}
+
+export function getLessonStatusName(state) {
+	var item = lessonStatus.find(e=>e.state==state)
+	return item.name || ''
+}
+
+export function getLessonStatusImage(state) {
+	var item = lessonStatus.find(e=>e.state==state)
+	return item.image || ''
+}

+ 5 - 4
components/uni-calendar/uni-calendar-item.vue

@@ -75,10 +75,11 @@
 			},
 			imagePath() {
 				var weeks = this.weeks;
-				if (weeks.extraInfo != null && weeks.extraInfo.status != null && weeks.extraInfo.status == 1) return require('../../static/home/green_book.png')
-				if (weeks.extraInfo != null && weeks.extraInfo.status != null && weeks.extraInfo.status == 2) return require('../../static/home/blue_book.png')
-				if (weeks.extraInfo != null && weeks.extraInfo.status != null && weeks.extraInfo.status == 3) return require('../../static/home/grey_book.png')
-				return require('../../static/home/yellow_book.png')
+				if (weeks.extraInfo != null && weeks.extraInfo.status != null && weeks.extraInfo.status == 'finished') return require('../../static/home/green_book.png')
+				if (weeks.extraInfo != null && weeks.extraInfo.status != null && weeks.extraInfo.status == 'onGoing') return require('../../static/home/blue_book.png')
+				if (weeks.extraInfo != null && weeks.extraInfo.status != null && weeks.extraInfo.status == 'canceled') return require('../../static/home/grey_book.png')
+				if (weeks.extraInfo != null && weeks.extraInfo.status != null && weeks.extraInfo.status == 'absence') return require('../../static/home/yellow_book.png')
+				return ''
 			}
 		},
 		mounted() {

+ 5 - 1
i18n/en.js

@@ -285,6 +285,10 @@ const en = {
 	"uni-calender.THU": "THU",
 	"uni-calender.FRI": "FRI",
 	"uni-calender.SAT": "SAT",
-	"uni-calender.SUN": "SUN"
+	"uni-calender.SUN": "SUN",
+	
+	
+	"courseProgress": "CourseProgress"
+	
 }
 export default en;

+ 3 - 1
i18n/zh.js

@@ -283,6 +283,8 @@ const cn = {
 	"uni-calender.WED": "三",
 	"uni-calender.THU": "四",
 	"uni-calender.FRI": "五",
-	"uni-calender.SAT": "六"
+	"uni-calender.SAT": "六",
+	
+	"courseProgress": "课程进度"
 }
 export default cn;

+ 8 - 1
pages.json

@@ -43,7 +43,14 @@
                 "navigationBarTitleText": "直播测试",
                 "enablePullDownRefresh": false
             }
-        }
+        },
+		{
+		    "path" : "pages/lesson/lesson_detail",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "课堂详情"
+		    }
+		}
     ],
 	"globalStyle": {
 		"navigationBarTextStyle": "black",

+ 10 - 4
pages/calendar/course_item.vue

@@ -1,5 +1,5 @@
 <template>
-	<view class="lesson-item u-flex-column" :style="{ 'border-left': '5px solid ' + mainColor }">
+	<view class="lesson-item u-flex-column" :style="{ 'border-left': '5px solid ' + mainColor }" @click="lessonItemOnTap">
 		<view class="flex justify-between margin-sm">
 			<text :style="{ color: mainColor }">{{ startTime + ' - ' + endTime }}</text>
 			<text v-if="lessonStatus" class="lesson-status text-xs round" :style="{ 'background-color': mainColor }">{{ lessonStatus }}</text>
@@ -48,20 +48,26 @@ export default {
 		},
 		mainColor() {
 			if (this.data.study_state == 45) return '#F7C405';
-			if (this.data.study_state == 46) return '#99CA3A';
+			if (this.data.study_state == 47) return '#99CA3A';
 			if (this.data.study_state == 686) return '#A1A9B5';
 			return '#54AFD9';
 		},
 		lessonStatus() {
 			if (this.data.study_state == 45) return '未上课';
-			if (this.data.study_state == 46) return '已上课';
+			if (this.data.study_state == 47) return '已上课';
 			if (this.data.study_state == 686) return '已取消';
 			return ''
 		}
 	},
 	onReady() {},
 	mounted() {},
-	methods: {}
+	methods: {
+		lessonItemOnTap(){
+			uni.navigateTo({
+				url:`../lesson/lesson_detail?lessonId=${this.data.id}`
+			})
+		}
+	}
 };
 </script>
 <style scoped>

+ 8 - 10
pages/calendar/index.vue

@@ -56,7 +56,7 @@ export default {
 		lessonStatus() {
 			return [
 				{ index: 0, code: '45', color: '#F7C405', name: this.$i18n.t('absence') },
-				{ index: 1, code: '46', color: '#99CA3A', name: this.$i18n.t('finished') },
+				{ index: 1, code: '47', color: '#99CA3A', name: this.$i18n.t('finished') },
 				{ index: 2, code: '', color: '#54AFD9', name: this.$i18n.t('onGoing') },
 				{ index: 3, code: '686', color: '#A1A9B5', name: this.$i18n.t('kqCancel') }
 			];
@@ -98,15 +98,13 @@ export default {
 				for (let i = 0; i < Object.keys(map).length; i++) {
 					var time = Object.keys(map)[i];
 					var study_states = map[time].map(a => a.study_state)
-					var status = 0
-					var finished_lessons = study_states.find(e=>e=='47')
-					if (finished_lessons != null) {
-						status = finished_lessons.length == study_states.length ? 1 : 2
-					}
-					var cancel_lessons = study_states.find(e=>e=='686')
-					if (cancel_lessons != null && cancel_lessons.length == study_states.length) {
-						status = -1
-					}
+					var status = 'absence' /// 默认未上课
+					var absence_lessons = study_states.filter(e=>e=='45') /// 未上课等 != 当天总数量:未上完课
+					if (absence_lessons.length != study_states.length) { status = 'onGoing' }
+					var finished_lessons = study_states.filter(e=>e=='47') /// 已经上完课 == 当天总课: 已上课
+					if (finished_lessons.length == study_states.length) { status = 'finished' }
+					var cancel_lessons = study_states.filter(e=>e=='686') /// 已取消 == 当天总课:已取消
+					if (cancel_lessons.length == study_states.length) { status = 'canceled' }
 					_tempSelected.push({
 						date: time,
 						status: status,

+ 88 - 0
pages/lesson/lesson_detail.vue

@@ -0,0 +1,88 @@
+<template>
+	<view class="u-flex-column" style="background-color: #FFF3F4FA;">
+		<view class="flex top-bg" :style="{backgroundImage:`url(${lessonStatus.image})`}">
+			<text class="margin-sm text-white text-lg"> {{ $t(lessonStatus.name) }} </text>
+		</view>
+		<view class="u-flex-column padding-lr-sm bg-white">
+			<view v-for="(item,index) in items" :key="index" class="flex justify-between padding-tb-sm" :class="{
+				'gap-line': item.gap != null,
+			}">
+				<text> {{ $t(item.title) }} </text>
+				<text>{{ item.value }}</text>
+			</view>
+			<view class="bg-gray margin-tb-sm" style="height: 1px; width: 100%;" />
+		</view>
+	</view>
+</template>
+
+<script>
+	import Api from '../../api/api.js';
+	import { getLessonStatus } from '../../common/tools.js'
+	import moment from 'moment';
+	export default {
+		data() {
+			return {
+				lessonId: '',
+				data:{},
+				classState: {},
+				teaState: {},
+			};
+		},
+		name: 'lesson-detail',
+		computed: {
+			mainColor() {
+				if (this.classState.study_state == null) return '#F7C405';
+				if (this.classState.study_state == 45) return '#F7C405';
+				if (this.classState.study_state == 47) return '#99CA3A';
+				if (this.classState.study_state == 686) return '#A1A9B5';
+				return '#54AFD9';
+			},
+			lessonStatus() {
+				return getLessonStatus(this.classState.study_state)
+			},
+			items() {
+				var startTime = moment(this.classState.appStartTime).format('HH:mm');
+				var endTime = moment(this.classState.appEndTime).format('HH:mm');
+				return [
+					{'title': 'classId', 'value': this.classState.class_number},
+					{'title': 'textBook', 'value': this.classState.tb_name},
+					{'title': 'ft', 'value': this.classState.tb_name},
+					{'title': 'courseProgress', 'value': `Topic ${this.classState.unit} / Lesson ${this.classState.lession}`, 'gap': true},
+					{'title': 'lessonDate', 'value': moment(this.classState.appStartTime).format('YYYY-MM-DD')},
+					{'title': 'lessonTime', 'value': `${startTime}-${endTime}`},
+					{'title': 'classroom', 'value': this.classState.name},
+				]
+			}
+		},
+		onLoad(options) {
+			this.lessonId = options.lessonId
+			this.getLessonDetail()
+		},
+		mounted() {
+
+		},
+		methods: {
+			async getLessonDetail() {
+				var that = this
+				Api.lessonDetail(this.lessonId).then(res=>{
+					if (res.code != 200) return;
+					that.classState = res.data.class_state
+					that.teaState = res.data.tea_state
+				})
+			}
+		}
+	}
+</script>
+
+
+<style lang="scss">
+	.top-bg {
+		height: 80px;
+		background-size: 100% 100%;
+		background-repeat:	no-repeat;
+		background-position: center;
+	}
+	.gap-line {
+		border-bottom: 1px solid #d9d6d6e2;
+	}
+</style>

BIN
static/home/arrow_left.png


BIN
static/home/arrow_right.png


BIN
static/home/grey_book.png


BIN
static/home/i2_name.png


BIN
static/lesson/lesson_dkxy.png


BIN
static/lesson/lesson_fk.png


BIN
static/lesson/lesson_js.png


BIN
static/lesson/lesson_kq.png


BIN
static/lesson/lesson_nr.png


BIN
static/lesson/lesson_qx.png


BIN
static/lesson/lesson_rz.png


BIN
static/lesson/lesson_select_tag.png


BIN
static/lesson/lesson_sk.png


BIN
static/lesson/lesson_sl.png


BIN
static/lesson/lesson_wr.png


BIN
static/lesson/lesson_wsk.png


BIN
static/lesson/lesson_xs.png


BIN
static/lesson/lesson_zy.png


+ 2 - 2
unpackage/dist/dev/app-plus/app-config-service.js

@@ -1,8 +1,8 @@
 
 var isReady=false;var onReadyCallbacks=[];
 var isServiceReady=false;var onServiceReadyCallbacks=[];
-var __uniConfig = {"pages":["pages/launch/index","pages/login/index","pages/index/index","pages/login/env_page","pages/mine/setting","pages/test/upload","pages/test/livetest"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","enablePullDownRefresh":false},"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"i2School","compilerVersion":"3.3.11","entryPagePath":"pages/launch/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
-var __uniRoutes = [{"path":"/pages/launch/index","meta":{"isQuit":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/login/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/index/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/login/env_page","meta":{},"window":{"navigationBarTitleText":"开发者工具"}},{"path":"/pages/mine/setting","meta":{},"window":{"navigationBarTitleText":"设置"}},{"path":"/pages/test/upload","meta":{},"window":{"navigationBarTitleText":"上传"}},{"path":"/pages/test/livetest","meta":{},"window":{"navigationBarTitleText":"直播测试","enablePullDownRefresh":false}}];
+var __uniConfig = {"pages":["pages/launch/index","pages/login/index","pages/index/index","pages/login/env_page","pages/mine/setting","pages/test/upload","pages/test/livetest","pages/lesson/lesson_detail"],"window":{"navigationBarTextStyle":"black","navigationBarTitleText":"uni-app","navigationBarBackgroundColor":"#F8F8F8","backgroundColor":"#F8F8F8","enablePullDownRefresh":false},"nvueCompiler":"uni-app","nvueStyleCompiler":"uni-app","renderer":"auto","splashscreen":{"alwaysShowBeforeRender":true,"autoclose":false},"appname":"i2School","compilerVersion":"3.3.11","entryPagePath":"pages/launch/index","networkTimeout":{"request":60000,"connectSocket":60000,"uploadFile":60000,"downloadFile":60000}};
+var __uniRoutes = [{"path":"/pages/launch/index","meta":{"isQuit":true},"window":{"navigationStyle":"custom"}},{"path":"/pages/login/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/index/index","meta":{},"window":{"navigationStyle":"custom"}},{"path":"/pages/login/env_page","meta":{},"window":{"navigationBarTitleText":"开发者工具"}},{"path":"/pages/mine/setting","meta":{},"window":{"navigationBarTitleText":"设置"}},{"path":"/pages/test/upload","meta":{},"window":{"navigationBarTitleText":"上传"}},{"path":"/pages/test/livetest","meta":{},"window":{"navigationBarTitleText":"直播测试","enablePullDownRefresh":false}},{"path":"/pages/lesson/lesson_detail","meta":{},"window":{"navigationBarTitleText":"课堂详情"}}];
 __uniConfig.onReady=function(callback){if(__uniConfig.ready){callback()}else{onReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"ready",{get:function(){return isReady},set:function(val){isReady=val;if(!isReady){return}const callbacks=onReadyCallbacks.slice(0);onReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
 __uniConfig.onServiceReady=function(callback){if(__uniConfig.serviceReady){callback()}else{onServiceReadyCallbacks.push(callback)}};Object.defineProperty(__uniConfig,"serviceReady",{get:function(){return isServiceReady},set:function(val){isServiceReady=val;if(!isServiceReady){return}const callbacks=onServiceReadyCallbacks.slice(0);onServiceReadyCallbacks.length=0;callbacks.forEach(function(callback){callback()})}});
 service.register("uni-app-config",{create(a,b,c){if(!__uniConfig.viewport){var d=b.weex.config.env.scale,e=b.weex.config.env.deviceWidth,f=Math.ceil(e/d);Object.assign(__uniConfig,{viewport:f,defaultFontSize:Math.round(f/20)})}return{instance:{__uniConfig:__uniConfig,__uniRoutes:__uniRoutes,global:void 0,window:void 0,document:void 0,frames:void 0,self:void 0,location:void 0,navigator:void 0,localStorage:void 0,history:void 0,Caches:void 0,screen:void 0,alert:void 0,confirm:void 0,prompt:void 0,fetch:void 0,XMLHttpRequest:void 0,WebSocket:void 0,webkit:void 0,print:void 0}}}});

Разница между файлами не показана из-за своего большого размера
+ 1 - 0
unpackage/dist/dev/app-plus/app-service.js


Разница между файлами не показана из-за своего большого размера
+ 59 - 1
unpackage/dist/dev/app-plus/app-view.js


Некоторые файлы не были показаны из-за большого количества измененных файлов