Procházet zdrojové kódy

Merge branch 'master' of https://gitee.com/he2802/saas_applet

Tang před 4 roky
rodič
revize
6d50b6de0e

+ 1 - 1
common/request.js

@@ -5,7 +5,7 @@ import store from '@/store/index.js'
 import api from './api.js'
 var num = 1
 
-export const BASE_URL = 'http://192.168.1.222:5055'//接口api  http://42.192.164.187:19005
+export const BASE_URL = 'http://42.192.164.187:19005'//接口api  http://42.192.164.187:19005
 
 
 export const BASE_IMG_URL = 'https://file-dev.xyyxt.net/'//图片上传api  'https://file.xyyxt.net/

+ 26 - 4
components/course/courseChapter.vue

@@ -61,14 +61,36 @@ export default {
 		openChapter(item){
 			this.down = !this.down
 			if(!this.down&&this.list.length==0){
-				if(this.isRebuild){
-					this.getReSectionList(item.id,item.courseId,item.moduleId)
+				console.log(item.id,69)
+				if(this.isBuy){
+					if(this.isRebuild){
+						this.getReSectionList(item.id,item.courseId,item.moduleId)
+					}else{
+						this.getBuySectionList(item.id,item.courseId,item.moduleId)
+					}
 				}else{
 					this.getSectionList(item.id)
 				}
 				
 			}
 		},
+		getSectionList(chapterId) {
+			let self = this
+			this.$api.sectionList(chapterId).then(res => {
+				if(res.data.code==200){
+					for(let i=0;i<res.data.data.length;i++){
+						let item = res.data.data[i]
+						item.id = item.sectionId
+						//判断是否试听
+						item.tryListen = false
+						if(self.goodsAuditionConfigIdList.indexOf(item.id)!==-1){
+							item.tryListen = true
+						}	
+					}
+					self.list = res.data.data
+				}
+			});
+		},
 		getReSectionList(chapterId,courseId,moduleId) {
 			let self = this
 			this.$api.reSectionList({chapterId:chapterId,gradeId:this.gradeId,courseId:courseId,rebuild:1,moduleId:moduleId}).then(res => {
@@ -86,9 +108,9 @@ export default {
 				}
 			});
 		},
-		getSectionList(chapterId) {
+		getBuySectionList(chapterId,courseId,moduleId) {
 			let self = this
-			this.$api.sectionList(chapterId).then(res => {
+			this.$api.reSectionList({chapterId:chapterId,gradeId:this.gradeId,courseId:courseId,moduleId:moduleId}).then(res => {
 				if(res.data.code==200){
 					for(let i=0;i<res.data.data.length;i++){
 						let item = res.data.data[i]

+ 22 - 5
components/course/courseModule.vue

@@ -60,14 +60,31 @@ export default {
 		openModule(item){
 			this.down = !this.down
 			if(!this.down&&this.list.length==0){
-				if(this.isRebuild){
-					this.getReChapterList(item.id,item.courseId)
+				if(this.isBuy){
+					if(this.isRebuild){
+						this.getReChapterList(item.id,item.courseId)
+					}else{
+						this.getBuyChapterList(item.id,item.courseId) //已购买目录
+					}
 				}else{
-					this.getChapterList(item.id)
+					this.getChapterList(item.id) //未购买目录
 				}
 				
 			}
 		},
+			getChapterList(moduleId) {
+					let self = this
+					this.$api.chapterList(moduleId).then(res => {
+						if(res.data.code==200){
+							for(let i=0;i<res.data.data.length;i++){
+								let item = res.data.data[i]
+								item.id = item.chapterId
+								
+							}
+							self.list = res.data.data
+						}
+					});
+				},
 		getReChapterList(moduleId,courseId) {
 			let self = this
 			this.$api.reChapterList({moduleId:moduleId,gradeId:this.gradeId,courseId:courseId,rebuild:1}).then(res => {
@@ -81,9 +98,9 @@ export default {
 				}
 			});
 		},
-		getChapterList(moduleId) {
+		getBuyChapterList(moduleId,courseId) {
 			let self = this
-			this.$api.chapterList(moduleId).then(res => {
+			this.$api.reChapterList({moduleId:moduleId,gradeId:this.gradeId,courseId:courseId}).then(res => {
 				if(res.data.code==200){
 					for(let i=0;i<res.data.data.length;i++){
 						let item = res.data.data[i]

+ 1 - 1
components/course/courseSection.vue

@@ -24,7 +24,7 @@
 				</view>
 				<view v-if="menuItem.sectionType==null">{{menuItem.name}}</view>
 			</view>
-			<view v-if="isRebuild" class="tagRe">待重修</view>
+			<view v-if="isRebuild||menuItem.rebuild>0" class="tagRe">待重修</view>
 		</view>
 		<view v-if="menuItem.tryListen&&!isBuy" class="tryBox">
 			试看

+ 2 - 2
pages/course/index.vue

@@ -48,7 +48,7 @@
 							</view>
 							<view style="display: flex;justify-content: space-between;margin-top: 13rpx;">
 								<view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
-								共 <text class="blackFont">6</text> 科 <text class="blackFont">120</text> 节  <text class="blackFont">60</text> 学时</view>
+								共 <text class="blackFont">{{item.subjectNum}}</text> 科   <text class="blackFont">{{item.classHours}}</text> 学时</view>
 								<view class="priceTag">¥ {{item.standPrice}}</view>
 							</view>
 						</view>
@@ -65,7 +65,7 @@
 								<view class="yearTag">{{item.year}}</view>
 								<view class="titleTag">{{item.goodsName}}</view>
 							</view>
-							<view style="display: flex;justify-content: space-between;margin-top: 13rpx;">
+							<view style="display: flex;justify-content: space-between;margin-top: 13rpx;" v-if="false">
 								<view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
 								共 <text class="blackFont">6</text> 张卷 <text class="blackFont">120</text>道题  </view>
 								<view class="priceTag">¥ {{item.standPrice}}</view>

+ 1 - 1
pages2/bank/detail.vue

@@ -8,7 +8,7 @@
 						<view class="yearTag">{{goodsData.year}}</view>
 						<view class="titleTag">{{goodsData.goodsName}}</view>
 					</view>
-					<view style="display: flex;justify-content: space-between;margin-top: 13rpx;">
+					<view style="display: flex;justify-content: space-between;margin-top: 13rpx;" v-if="false">
 						<view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
 						共 <text class="blackFont">{{goodsData.updateTime}}</text> 张卷 <text class="blackFont">1200</text> 道题  </view>
 						

+ 5 - 3
pages2/bank/question_detail.vue

@@ -10,7 +10,7 @@
 								<text>总进度</text>
 							</view>
 							<view class="percent">
-								{{goodsCount.doNum/goodsCount.totalNum * 100}}
+								{{goodsCount.totalNum>0?(goodsCount.doNum/goodsCount.totalNum * 100):0}}
 								<text class="per">%</text>
 							</view>
 						</view>
@@ -117,7 +117,9 @@ export default {
 			goodsData:{},
 			bankList:[],
 			id:'',
-			goodsCount:{}
+			goodsCount:{
+				totalNum:0
+			}
 		};
 	},
 	onUnload() {
@@ -446,7 +448,7 @@ export default {
 					height:80rpx;
 					display: flex;
 					align-items: center;
-					margin-left:72rpx;
+					
 					font-size: 24rpx;
 					color: #666666;
 					border-bottom: 1rpx solid #EEEEEE;

+ 7 - 4
pages2/class/detail.vue

@@ -56,11 +56,11 @@
 			<view v-show="current == 1">
 				<view class="menuBox" v-for="(item, index) in menuList">
 					<!--模块 -->
-					<view v-if="item.type == 1"><courseModule  :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
+					<view v-if="item.type == 1"><courseModule :gradeId="gradeId"  :isBuy="true" :menuItem="item" :levelId="item.menuId"></courseModule></view>
 					<!--章 -->
-					<view v-if="item.type == 2"><courseChapter  :isBuy="true" :menuItem="item" :levelId="'0-'+item.menuId"></courseChapter></view>
+					<view v-if="item.type == 2"><courseChapter :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-'+item.menuId"></courseChapter></view>
 					<!--节 -->
-					<view v-if="item.type == 3"><courseSection  :isBuy="true" :menuItem="item" :levelId="'0-0-'+item.menuId"></courseSection></view>
+					<view v-if="item.type == 3"><courseSection :gradeId="gradeId" :isBuy="true" :menuItem="item" :levelId="'0-0-'+item.menuId"></courseSection></view>
 				</view>
 			</view>
 			<!--笔记 -->
@@ -619,7 +619,7 @@ export default {
 		},
 		getMenuList() {
 			let self = this;
-			this.$api.menuList({ courseId: this.courseId }).then(res => {
+			this.$api.reMenuList({ courseId: this.courseId,gradeId:this.gradeId }).then(res => {
 				if (res.data.code == 200) {
 					for (let i = 0; i < res.data.rows.length; i++) {
 						let item = res.data.rows[i];
@@ -1120,6 +1120,9 @@ page {
 	font-family: PingFang SC;
 	font-weight: bold;
 	color: #333333;
+	overflow: hidden;
+	text-overflow:ellipsis;
+	white-space: nowrap;
 }
 .video_t1_t {
 	display: flex;

+ 4 - 1
pages2/course/detail.vue

@@ -28,7 +28,7 @@
 					</view>
 					<view style="display: flex;justify-content: space-between;margin-top: 13rpx;">
 						<view class="noteTag"><image src="/static/icon/wk_icon1.png" class="wk_icon"></image>
-						共 <text class="blackFont">6</text> 科 <text class="blackFont">120</text> 节  <text class="blackFont">60</text> 学时</view>
+						共 <text class="blackFont">{{detail.subjectNum}}</text> 科 {{detail.classHours}}</text> 学时</view>
 						
 					</view>
 				</view>
@@ -309,6 +309,9 @@ export default {
 		font-family: PingFang SC;
 		font-weight: bold;
 		color: #333333;
+		overflow: hidden;
+		text-overflow:ellipsis;
+		white-space: nowrap;
 	}
 	.video_t1_t {
 		display: flex;