Tang 4 лет назад
Родитель
Сommit
8d22a3aebd
6 измененных файлов с 122 добавлено и 39 удалено
  1. 3 1
      common/api.js
  2. 13 0
      common/httpList/teacher.js
  3. 19 15
      common/request.js
  4. 8 6
      components/home.vue
  5. 42 16
      pages2/course/keynote.vue
  6. 37 1
      pages2/wd/info.vue

+ 3 - 1
common/api.js

@@ -6,6 +6,7 @@ import bank from './httpList/bank.js'
 import note from './httpList/note.js'
 import face from './httpList/face.js'
 import userInfo from './httpList/userInfo.js'
+import teacher from './httpList/teacher.js'
 export default {
 	...login,
 	...polyvVideo,
@@ -14,5 +15,6 @@ export default {
 	...bank,
 	...note,
 	...face,
-	...userInfo
+	...userInfo,
+	...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
+		})
+	}
+}

+ 19 - 15
common/request.js

@@ -1,4 +1,7 @@
 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
@@ -17,9 +20,17 @@ export const myRequest = (options) => {
 			success: async (res) => {
 				if (res.data.code == 401) {
 					if (num <= 3) {
-						num++
-						res = await doRequest(options)
+						if (!uni.getStorageSync('union_id')) {
+							uni.navigateTo({
+								url: '/pages/login/login'
+							});
+						} else {
+							num++
+							res = await doRequest(options)
+						}
+
 					};
+					return
 				}
 				resolve(res)
 			},
@@ -44,6 +55,7 @@ export const myRequest = (options) => {
 		const res = await myRequest(datas)
 		if (res.data.code === 200) {
 			uni.setStorageSync('token', res.data.data.token)
+
 			var userInfo = {
 				url: '/getInfo',
 				method: 'get',
@@ -54,20 +66,12 @@ export const myRequest = (options) => {
 				let onset = await myRequest(response)
 				return onset
 			}
+			let onset = await myRequest(response)
+			return onset
 		} else {
-			uni.removeStorageSync('union_id')
-			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;
 			}
 		},

+ 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;
 			},

+ 37 - 1
pages2/wd/info.vue

@@ -62,6 +62,42 @@
 					>
 						<template v-slot:addBtn>
 							<image :src="form.oneInchPhotos ? $method.splitImgHost('/' + form.oneInchPhotos) : '/static/info_1.png'" style="width: 120rpx; height: 169rpx;"></image>
+
+							<image src="/static/info_1.png" style="width: 120rpx; height: 169rpx;"></image>
+						</template>
+					</u-upload>
+				</u-form-item>
+				<u-form-item label="身份证人像面" :label-width="auto" label-position="top">
+					<u-upload
+						:auto-upload="false"
+						custom-btn="true"
+						:action="action"
+						:file-list="fileList1"
+						width="120"
+						height="82"
+						size-type="['compressed']"
+						max-count="1"
+						@on-list-change="changePhotoListZ"
+					>
+						<template v-slot:addBtn>
+							<image src="/static/info_2.png" style="width: 120rpx; height: 82rpx;"></image>
+						</template>
+					</u-upload>
+				</u-form-item>
+				<u-form-item label="身份证国徽面" :label-width="auto" label-position="top">
+					<u-upload
+						:auto-upload="false"
+						custom-btn="true"
+						:action="action"
+						:file-list="fileList2"
+						width="120"
+						height="82"
+						size-type="['compressed']"
+						max-count="1"
+						@on-list-change="changePhotoListF"
+					>
+						<template v-slot:addBtn>
+							<image src="/static/info_3.png" style="width: 120rpx; height: 82rpx;"></image>
 						</template>
 					</u-upload>
 				</u-form-item>
@@ -237,7 +273,7 @@ export default {
 							policy: ossToken.policy,
 							Signature: ossToken.signature,
 							callback: ossToken.callback,
-							success_action_status: 200
+							success_action_status: 200,
 						},
 						success: result => {
 							if (result.statusCode === 200) {