he2802 3 éve
szülő
commit
4a93964cbb

+ 13 - 0
common/httpList/course.js

@@ -32,6 +32,19 @@ export default {
 			method: 'get',
 			data: data
 		})
+	},
+	courseCourseList(data) {
+		return myRequest({
+			url: '/course/courseList',
+			method: 'get',
+			data: data
+		})
+	},
+	courseDetail(data) {
+		return myRequest({
+			url: '/course/'+data,
+			method: 'get'
+		})
 	}
 	
 }

+ 0 - 247
components/shopping/goodsInputItem.vue

@@ -1,247 +0,0 @@
-<template>
-	<view>
-		<view v-if="detail.templateType!=null">
-			<u-line color="#D6D6DB" />
-			<view v-if="detail.templateType=='class'" style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(0)">
-				<view style="color: #666666;font-size: 24rpx;">{{gradeIndex<0?'选择班级':gradeList[gradeIndex].className}}</view>
-				<view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
-			</view>
-			<view v-if="detail.templateType=='apply'"  style="display: flex;justify-content: space-between;align-items: center;height: 50rpx;" @click="openPopup(1)">
-				<view style="color: #666666;font-size: 24rpx;" >{{gradeIndex<0?'报考地区':gradeList[gradeIndex].className}}</view>
-				<view><u-icon name="arrow-right" color="#999999" size="28"></u-icon></view>
-			</view>
-		</view>
-		
-		<u-popup v-model="show" mode="bottom"border-radius="40">
-			<view class="popup_box">
-				<view style="margin-bottom: 20rpx;">
-					<view class="line1"></view>
-					<view class="grade">选择班级</view>
-				</view>
-				<u-line color="#D6D6DB" />
-				<view>
-					<scroll-view scroll-y="true" style="height: 500rpx;">
-						<view>
-							<u-radio-group v-model="gradeValue" @change="radioGroupChange">
-								<view v-for="(item, index) in gradeList" :key="index" >
-									<view style="display: flex;align-items: center;padding: 20rpx;">
-										<view>
-											<u-radio
-												shape="circle"
-												:name="index"
-											></u-radio>
-										</view>
-										<view :class="item.checked?'white-box blue-box':'white-box'" >
-											<view>
-												<view class="blackTxt">{{item.className}}</view>
-												<view class="redTxt" v-if="item.classEndTime">有效期至:{{$method.timestampToTime(item.classEndTime)}}</view>
-												<view class="redTxt" v-if="item.classEndTime">本班还剩{{$method.GetRTime(item.classEndTime)}}天将结束学习</view>
-											</view>
-										</view>
-									</view>
-								</view>
-							</u-radio-group>
-						</view>
-					</scroll-view>
-				</view>
-				<view class="confrim-btn">
-					<view class="okBtn" @click="okPopup(0)">确定</view>
-				</view>
-			</view>
-		</u-popup>
-		<u-popup v-model="show1" mode="bottom"border-radius="40">
-			<view class="popup_box">
-				<view style="margin-bottom: 20rpx;">
-					<view class="line1"></view>
-					<view class="grade">选择考期/地区</view>
-				</view>
-				<u-line color="#D6D6DB" />
-				<view style="display: flex;height: 500rpx;">
-					<view style="width: 50%;">
-						<view class="topTxt">考期</view>
-						<view>
-							<picker-view  :indicator-style="indicatorStyle" :value="value" @change="bindChangeE" class="picker-view">
-								<picker-view-column>
-									<view class="picker-item" v-for="(item,index) in examine" :key="index">{{item.examineName}}</view>
-								</picker-view-column>
-							</picker-view>
-						</view>
-					</view>
-					<view style="width: 50%;">
-						<view class="topTxt">地区</view>
-						<view>
-							<picker-view  :indicator-style="indicatorStyle" :value="value" @change="bindChange" class="picker-view">
-								<picker-view-column>
-									<view class="picker-item" v-for="(item,index) in provinceList" :key="index">{{item.areaName}}</view>
-								</picker-view-column>
-								<picker-view-column>
-									<view class="picker-item" v-for="(item,index) in cityList" :key="index">{{item.areaName}}</view>
-								</picker-view-column>
-							</picker-view>
-						</view>
-					</view>
-				</view>
-				<view class="confrim-btn">
-					<view class="okBtn" @click="okPopup(1)">确定</view>
-				</view>
-			</view>
-		</u-popup>
-	</view>
-</template>
-
-<script>
-import { mapGetters } from 'vuex';
-export default {
-	name: 'goodsInputItem',
-	props: {
-		detail: {
-			type: Object,
-			default: {}
-		}
-	},
-	data() {
-		return {
-			gradeValue:-1,
-			gradeIndex:-1,
-			show:false,
-			show1:false,
-			indicatorStyle: `height: 50px;`,
-			gradeList:[],
-			provinceList:[],
-			cityList:[],
-			pAreaIndex:0,
-			cAreaIndex:0,
-			examine:[],
-			eAreaIndex:0,
-			applyObj:{
-				applyAreasJson:null,
-				examDateJson:null
-			}
-	
-		};
-	},
-	onLoad() {},
-	created() {
-		
-	},
-	mounted() {
-		
-	},
-	methods: {
-		openPopup(index){
-			if(index==0){
-				this.show = true
-				this.goodsGradeList()
-			}else{
-				this.show1 = true
-				this.getProvinceList()
-			}
-			
-		},
-		okPopup(index){
-			if(index==0){
-				if(!this.checkData()){
-					return
-				}
-				this.gradeIndex = this.gradeValue
-				this.show = false
-			}else{
-				let examDate = 
-				this.show1 = false
-			}
-		},
-		checkData(){
-			if(this.detail.templateType=='class'){
-				if(this.gradeValue<0){
-					uni.showModal({
-						title: "提示",
-						content: '请选择班级',
-						showCancel: false
-					})
-					return false
-				}
-			}
-			else if(this.detail.templateType=='apply'){
-				if(!this.applyObj.applyAreasJson){
-					uni.showModal({
-						title: "提示",
-						content: '请选择报考地区',
-						showCancel: false
-					})
-					return false
-				}
-				if(!this.applyObj.examDateJson){
-					uni.showModal({
-						title: "提示",
-						content: '请选择考期',
-						showCancel: false
-					})
-					return false
-				}
-			}
-			return true;
-		},
-		bindChangeE(e){
-			console.log(e.detail.value)
-		},
-		bindChange(e) {
-			const val = e.detail.value
-			if(this.pAreaIndex!=e.detail.value[0]){
-				this.pAreaIndex = e.detail.value[0]
-				this.getCityList(this.provinceList[this.pAreaIndex].areaId)
-			}
-			if(this.cAreaIndex!=e.detail.value[1]){
-				this.cAreaIndex = e.detail.value[1]
-			}
-			
-		},
-		getExamine(id) {
-			let self = this
-			this.$api.getExamine({projectId:id}).then(res => {
-				if(res.data.code==200){
-					self.examine = res.data.rows
-				}
-			});
-		},
-		getCityList(id) {
-			let self = this
-			this.$api.getCityList({parentId:id}).then(res => {
-				if(res.data.code==200){
-					self.cityList = res.data.rows
-				}
-			});
-		},
-		getProvinceList() {
-			let self = this
-			if(self.provinceList.length>0){
-				return
-			}
-			this.$api.getProvinceList().then(res => {
-				if(res.data.code==200){
-					self.provinceList = res.data.rows
-					if(self.provinceList.length>0){
-						self.getCityList(self.provinceList[0].areaId)
-					}
-					
-				}
-			});
-		},
-	},computed: { ...mapGetters([]) },
-};
-</script>
-
-<style scoped>
-	.icon_up{
-		width: 24rpx;
-		height: 24rpx;
-	}
-.title{
-	font-size: 24rpx;
-	font-family: PingFang SC;
-	font-weight: bold;
-	color: #666666;
-	white-space:nowrap;
-	overflow:hidden;
-	text-overflow:ellipsis; 
-}
-</style>

+ 10 - 0
pages.json

@@ -477,6 +477,16 @@
 						"bounce": "none"
 					}
 				}
+			},
+			{
+				"path": "wd/course",
+				"style": {
+					"navigationBarTitleText": "所有课程",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
 			}
 		]/*,
 		 "plugins": {

+ 8 - 0
pages/course/index.vue

@@ -53,6 +53,7 @@
 							</view>
 						</view>
 					</navigator>
+					<view class="emptyTip" v-if="list2.length==0">暂未上架相关网课~</view>
 				</view>
 			</view>
 			<view v-show="current==1">
@@ -71,6 +72,7 @@
 							</view>
 						</view>
 					</navigator>
+					<view class="emptyTip" v-if="list2.length==0">暂未上架相关题库~</view>
 				</view>
 			</view>
 		</view>
@@ -305,6 +307,12 @@ export default {
 	
 </style>
 <style scoped>
+	.emptyTip{
+		color: #999999;
+		font-size: 32rpx;
+		text-align: center;
+		margin-top: 20%;
+	}
 	.popuBox{
 		top: 92px;
 		width: 100%;

+ 0 - 4
pages/shopping/shoppingCart.vue

@@ -168,11 +168,7 @@
 </template>
 
 <script>
-	import goodsInputItem from '@/components/shopping/goodsInputItem.vue';
 	export default {
-		components: {
-			goodsInputItem
-		},
 		data() {
 			return {
 				gradeValue:-1,

+ 42 - 30
pages2/class/detail.vue

@@ -11,7 +11,7 @@
 			<view >
 				<u-row>
 					<u-col span="10" >
-						<view class="video_t1">施工承发包模式-施工合同与物资采购合...</view>
+						<view class="video_t1">{{detail.courseName}}</view>
 					</u-col>
 					<u-col span="2">
 						<view class="video_t1_t">
@@ -34,39 +34,15 @@
 				<view class="menuBox" v-for="(item, index) in menuList">
 					<!--模块 -->
 					<view v-if="item.type==1">
-						<view class="b_title">
-							2Z106000 施工合同管理-模块标题
-						</view>
-						<view style="color: #666666;font-size: 24rpx;margin: 30rpx 0;" v-for="(item1, index1) in item.list">
-							<u-icon :name="item1.showChildren?'arrow-down':'arrow-right'" color="#666666" size="28" @click="open(item1)"></u-icon>
-							<text @click="open(item1)">2Z106010 施工承发包的模式-2Z106020 施工合同...</text>
-							<view v-for="(item2, index2) in item1.children" v-if="item1.showChildren" >
-								<view style="display: flex;align-items: center;margin: 20rpx 0;">
-									<view class="tag1">录播</view>
-									<view class="t_content1">施工承发包模式-施工合同与物资采购合同</view>
-								</view>
-							</view>
-						</view>
+						<courseModule  :menuItem="item"></courseModule>
 					</view>
 					<!--章 -->
 					<view v-if="item.type==2">
-						<u-icon :name="item.showChildren?'arrow-down':'arrow-right'" color="#666666" size="28" @click="open(item)"></u-icon>
-						<text @click="open(item1)">2Z106010 施工承发包的模式-2Z106020 施工合同...</text>
-						<view v-for="(item2, index2) in item.list" v-if="item.showChildren">
-							<view style="display: flex;align-items: center;margin: 20rpx 0;">
-								<view class="tag1">录播</view>
-								<view class="t_content1">施工承发包模式-施工合同与物资采购合同</view>
-							</view>
-						</view>
+						<courseChapter  :menuItem="item"></courseChapter>
 					</view>
 					<!--节 -->
 					<view v-if="item.type==3">
-						<view v-for="(item2, index2) in item.list" >
-							<view style="display: flex;align-items: center;margin: 20rpx 0;">
-								<view class="tag1">录播</view>
-								<view class="t_content1">施工承发包模式-施工合同与物资采购合同</view>
-							</view>
-						</view>
+						<courseSection  :menuItem="item"></courseSection>
 					</view>
 				</view>
 			</view>
@@ -137,10 +113,20 @@
 </template>
 
 <script>
+import courseModule from '@/pages2/components/course/courseModule.vue';
+import courseChapter from '@/pages2/components/course/courseChapter.vue';
+import courseSection from '@/pages2/components/course/courseSection.vue';
 import { mapGetters } from 'vuex';
 export default {
+	components: {
+		courseModule,
+		courseChapter,
+		courseSection
+	},
 	data() {
 		return {
+			detail:{},
+			courseId:0,
 			placeholder:"您可以在这里输入笔记内容\n还可以点击左侧图标为笔记加上时间标记",
 			inputStyle:{
 				background: 'rgba(244, 244, 244, 0.98)',
@@ -188,7 +174,8 @@ export default {
 					list:[{},{}]
 				}
 			],
-			current:0
+			current:0,
+			menuList:[]
 		};
 	},
 	onUnload() {
@@ -196,12 +183,37 @@ export default {
 	},
 	computed: { ...mapGetters(['userInfo']) },
 	onLoad(option) {
-
+		this.courseId = option.id
+		this.courseDetail()
+		this.getMenuList()
+		console.log(this.courseId,66)
 	},
 	onShow() {
 		
 	},
 	methods: {
+		getMenuList() {
+			let self = this
+			this.$api.menuList({courseId:this.courseId}).then(res => {
+				if(res.data.code==200){
+					for(let i=0;i<res.data.rows.length;i++){
+						let item = res.data.rows[i]
+						item.down = true
+						item.id = item.menuId
+						item.name = item.menuName
+					}
+					self.menuList = res.data.rows
+				}
+			});
+		},
+		courseDetail() {
+			let self = this
+			this.$api.courseDetail(this.courseId).then(res => {
+				if(res.data.code==200){
+					self.detail = res.data.data
+				}
+			});
+		},
 		open(item){
 			item.showChildren = !item.showChildren
 		},

+ 1 - 4
pages2/wd/class.vue

@@ -1,6 +1,6 @@
 <template>
 	<view style="padding: 30rpx;">
-		<navigator url="/pages2/class/detail" v-for="(item, index) in goodsList" :key="index" style="margin-bottom: 30rpx;">
+		<navigator :url="'/pages2/wd/course?id='+item.goodsId" v-for="(item, index) in goodsList" :key="index" style="margin-bottom: 30rpx;">
 			<view class="class_item">
 				<image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
 				<view style="color: #333333;font-weight: bold;font-size: 32rpx;">
@@ -55,9 +55,6 @@
 	export default {
 		data() {
 			return {
-				list:[
-					1,2,3
-				],
 				goodsList:[]
 				
 			}

+ 111 - 0
pages2/wd/course.vue

@@ -0,0 +1,111 @@
+<template>
+	<view style="padding: 30rpx;">
+		<navigator :url="'/pages2/class/detail?id='+item.courseId" v-for="(item, index) in courseList" :key="index" style="margin-bottom: 30rpx;">
+			<view class="class_item">
+				<image :src="$method.splitImgHost(item.coverUrl, true)" style="height: 316rpx;width: 100%;border-radius: 24rpx;"></image>
+				<view style="color: #333333;font-weight: bold;font-size: 32rpx;">
+					{{item.courseName}}
+				</view>
+			</view>
+			<view class="bottomBox">
+				<view class=".content_box">
+					<image src="/static/icon/wk_icon3.png" class="wk_icon"></image>
+					学习进度:26/120
+				</view>
+				<view class="box_progress">
+					<view style="width: 60%;">
+						<u-line-progress active-color="#ff9900" :percent="70"></u-line-progress>
+					</view>
+					<view>
+						<u-button type="warning" size="mini" @click.stop="studyIn">进入学习</u-button>
+					</view>
+				</view>
+				
+			</view>
+			
+		</navigator>
+	</view>
+</template>
+
+<script>
+	export default {
+		data() {
+			return {
+				goodsId:0,
+				courseList:[]
+				
+			}
+		},
+		onLoad(option) {
+			this.goodsId = option.id
+			 this.courseCourseList()
+		},
+		onShow(){
+			
+		},
+		methods: {
+			courseCourseList() {
+				let self = this
+				this.$api.courseCourseList({goodsId:this.goodsId}).then(res => {
+					if(res.data.code==200){
+						self.courseList = res.data.rows
+					}
+				});
+			},
+			studyIn(){
+				this.$navTo.togo('/pages2/verify/input');
+			},
+			appointment(){
+				this.$navTo.togo('/pages2/appointment/index');
+			}
+		},
+		
+	}
+</script>
+<style >
+	page {
+			background: #EAEEF1;
+		}
+</style>
+<style scope>
+	
+	.box_progress{
+		display: flex;
+		justify-content:space-between;
+		align-items: center;
+		margin-top: 20rpx;
+	}
+	.bottomBox{
+		background: #FFFFFF;
+		width: 94%;
+		border-bottom-left-radius: 24rpx;
+		border-bottom-right-radius: 24rpx;
+		margin: 0 auto;
+		padding: 20rpx;
+	}
+	.content_box{
+		display: flex;
+		align-items: center;
+		color: #999999;
+		margin-top: 8rpx;
+	}
+	.content{
+		color: #000000;
+		margin: 0 8rpx;
+	}
+	.wk_icon{
+		width: 24rpx;
+		height: 24rpx;
+		margin-right: 8rpx;
+	}
+
+	.class_item{
+		width: 100%;
+		background: #FFFFFF;
+		box-shadow: 0rpx 10rpx 9rpx 1rpx rgba(165, 196, 239, 0.1);
+		border-radius: 24rpx;
+		padding: 20rpx;
+		z-index: 999;
+		position: relative;
+	}
+</style>