he2802 4 lat temu
rodzic
commit
f127502688

+ 3 - 1
common/api.js

@@ -35,11 +35,13 @@ import course from './httpList/course.js'
 import oss from './httpList/oss.js'
 import bank from './httpList/bank.js'
 import note from './httpList/note.js'
+import teacher from './httpList/teacher.js'
 export default {
 	...login,
 	...polyvVideo,
 	...course,
 	...oss,
 	...bank,
-	...note
+	...note,
+	...teacher
 }

+ 13 - 0
common/httpList/teacher.js

@@ -0,0 +1,13 @@
+import {
+	myRequest
+} from '../request.js'
+export default {
+	teacherList(data) {
+		return myRequest({
+			url: '/app/common/course/teacher/list',
+			method: 'get',
+			data: data,
+			noToken:true
+		})
+	}
+}

+ 4 - 14
common/request.js

@@ -1,4 +1,4 @@
-const BASE_URL = 'http://192.168.0.222:8088'
+const BASE_URL = 'http://127.0.0.1:8088'   //
 import store from '@/store/index.js'
 import api from './api.js'
 var num = 1
@@ -52,21 +52,11 @@ export const myRequest = (options) => {
 		if (res.data.code === 200) {
 			uni.setStorageSync('token', res.data.data.token)
 			let onset = await myRequest(response)
-			console.log(datas)
 			return onset
 		} else {
-			uni.showToast({
-				title: '登陆过期请重新登陆!',
-				icon: 'none',
-				duration: 1500,
-				success() {
-					setTimeout(() => {
-						uni.navigateTo({
-							url: '/pages/login/login'
-						});
-					}, 1500)
-				}
-			})
+			uni.navigateTo({
+				url: '/pages/login/login'
+			});
 		}
 	}
 }

+ 8 - 6
components/home.vue

@@ -69,7 +69,7 @@
 				</view>
 				<!-- 课程列表-->
 				<view v-if="current==0">
-					<view @click="jumpDetail" class="list_box" v-for="(item, index) in list1" :key="index">
+					<view @click="jumpDetail(item)" class="list_box" v-for="(item, index) in list1" :key="index">
 						<image :src="$method.splitImgHost(item.coverUrl)" class="list_img"></image>
 						<view class="list_content">
 							<view style="margin-left: 280rpx;margin-top: 10rpx;">
@@ -82,7 +82,7 @@
 				</view>
 				<!-- 题库列表-->
 				<view v-if="current==1">
-					<view @click="jumpDetail" class="list_box" v-for="(item, index) in list2" :key="index">
+					<view @click="jumpDetail(item)" class="list_box" v-for="(item, index) in list2" :key="index">
 						<image :src="$method.splitImgHost(item.coverUrl)" class="list_img"></image>
 						<view class="list_content">
 							<view style="margin-left: 280rpx;margin-top: 10rpx;">
@@ -94,8 +94,8 @@
 					</view>
 				</view>
 				<!-- 重点列表-->
-				<view v-if="current==2">
-					<view @click="jumpDetail" class="list_box" v-for="(item, index) in list3" :key="index">
+				<view v-if="current==2"> 
+					<view @click="jumpDetail(item)" class="list_box" v-for="(item, index) in list3" :key="index">
 						<image :src="$method.splitImgHost(item.coverUrl)" class="list_img"></image>
 						<view class="list_content">
 							<view style="margin-left: 280rpx;margin-top: 10rpx;">
@@ -246,7 +246,7 @@ export default {
 				}
 			})
 		},
-		jumpDetail() {
+		jumpDetail(item) {
 			if (this.current == 0) {
 				this.$navTo.togo('/pages2/course/detail', {});
 				return;
@@ -256,7 +256,9 @@ export default {
 				return;
 			}
 			if (this.current == 2) {
-				this.$navTo.togo('/pages2/course/keynote', {});
+				this.$navTo.togo('/pages2/course/keynote', {
+					id:item.fileId
+				});
 				return;
 			}
 		},

+ 0 - 1
pages/login/login.vue

@@ -26,7 +26,6 @@ export default {
 				};
 				that.$api.login(datas).then(
 					res => {
-						console.log(res.data.code,666)
 						if (res.data.code == 200) {
 							uni.setStorageSync('union_id', res.data.data.union_id);
 							uni.setStorageSync('token', res.data.data.token);

+ 42 - 16
pages2/course/keynote.vue

@@ -2,18 +2,18 @@
 	<view >
 		<view class="video_body">
 			<view class="video_box">
-				<image src="https://cdn.uviewui.com/uview/swiper/3.jpg" style="width: 100%;height: 460rpx;"></image>
+				<image :src="$method.splitImgHost(detail.coverUrl)" style="width: 100%;height: 460rpx;"></image>
 			</view>
 			<view>
 				<u-row >
 					<u-col span="8" offset="1">
 						<view class="video_t1">
-							2020年二级建造师教育选修
+							{{detail.name}}
 						</view>
 					</u-col>
 					<u-col span="3">
 						<view class="price_num">
-							¥499
+							¥{{detail.price}}
 						</view>
 					</u-col>
 				</u-row>
@@ -34,8 +34,7 @@
 						</u-col>
 					</u-row>
 					<view class="text_box">
-						这是一段课程介绍文本,课程介绍内容可在后台设置编辑,以富
-						文本形式呈现,常见的由图片和文本组成。
+						<u-parse :html="detail.introduction"></u-parse>
 					</view>
 				</view>
 				<u-line color="#D6D6DB" />
@@ -51,16 +50,19 @@
 							</view>
 						</u-col>
 					</u-row>
-					<u-row >
-						<view style="margin: 25rpx;display: flex;">
-							<view >
-								<image src="/static/avatar1.png" class="teacher_img"></image>
-							</view>
-							<view class="teacher_t">
-								建工学院名誉院长,建造师建筑资深导师,北京工业大学教授,建造师考试大纲编委会编委。参与过国家一级注册建造师考试大纲、考试辅导书、习题集等书的编写。
+					<view  v-for="(item,index) in teacherList" :key="index">
+						<u-row >
+							<view style="margin: 25rpx;display: flex;">
+								<view >
+									<image :src="$method.splitImgHost(item.avatar)" class="teacher_img"></image>
+								</view>
+								<view class="teacher_t">
+									{{item.introduce}}
+								</view>
 							</view>
-						</view>
-					</u-row>
+						</u-row>
+					</view>
+					
 				</view>
 				<u-line color="#D6D6DB" />
 			</view>
@@ -131,15 +133,39 @@
 				}, {
 					name: '相关推荐',
 				}],
-				current: 0
+				current: 0,
+				id:0,
+				detail:{},
+				teacherList:[]
 			}
 		},
 		onLoad(option) {
-			
+			this.id = option.id
+			this.getDetail()
 		},
 		onShow(){
 		},
 		methods: {
+			getDetail(){
+				let self = this
+				this.$api.noteInfo(this.id).then(res => {
+					self.detail = res.data.data
+					 if(self.detail.teacherIds&&self.detail.teacherIds!=''){
+						 let param = {
+							 teacherIds : self.detail.teacherIds
+						 }
+						 self.getTeacherList(param);
+						
+					} 
+				})
+			},
+			getTeacherList(param){
+				let self = this
+				this.$api.teacherList(param).then(res => {
+					self.teacherList = res.data.rows 
+					
+				})
+			},
 			change(index) {
 				this.current = index;
 			},