zs 1 рік тому
батько
коміт
321f1f4188

+ 6 - 2
App.vue

@@ -116,8 +116,12 @@
 		--fcColor: #cccccc;
 		--f00Color: #000000;
 		--fffColor: #ffffff;
-		--ff0Color:	#FF0000;
-		--3c9Color: #3c9cff;
 		--262Color: #262D3D;
+		--ff0Color: #FF0000;
+		--3c9Color: #3c9cff;
+		--d57Color: #d57dea;
+		--1e9Color: #1E90FF;
+		--40eColor: #40E0D0;
+		--ff6Color: #FF6347;
 	}
 </style>

+ 6 - 0
pages.json

@@ -75,6 +75,12 @@
 					"style": {
 						"navigationBarTitleText": "教师详情"
 					}
+				},
+				{
+					"path": "course/index",
+					"style": {
+						"navigationBarTitleText": "课程详情"
+					}
 				}
 			]
 		},

+ 37 - 54
pages/home/index.vue

@@ -26,26 +26,20 @@
 							<image v-else class="image" :src="config.icon[0].url"></image>
 						</view>
 						<view class="right">
-							<view class="right_1">
-								<view class="leftR">
-									{{item.course||'暂无'}}
-								</view>
-								<view class="rightR">
-									<view class="text">
-										<span class="text_1">最近可约:</span>
-										<span class="text_2">{{item.time||'休息中'}}</span>
-									</view>
-								</view>
+							<view class="right_1 textOne">
+								{{item.name||'暂无'}}
 							</view>
 							<view class="right_2">
 								<view class="text">老师: </view>
-								<view class="value"> {{item.nick_name||'暂无'}} </view>
-							</view>
-							<view class="right_2">
-								<view class="text"> 内容: </view>
-								<view class="value textOne">{{item.content||'暂无'}}</view>
+								<view class="value"> {{item.teacher_name||'暂无'}} </view>
 							</view>
 							<view class="right_3">
+								<view class="text">
+									<span class="text_1">最近可约:</span>
+									<span class="text_2">{{item.start_time||'休息中'}}</span>
+								</view>
+							</view>
+							<view class="right_4">
 								<view class="money">¥{{item.money||'免费'}} </view>
 								<view class="button">
 									<button type="warn" size="mini" @click="toBuy(item)">预约</button>
@@ -132,7 +126,7 @@
 			status: '1',
 			is_show: '0'
 		}
-		const res = await $api('teacher', 'GET', info);
+		const res = await $api('course/appHome', 'GET', info);
 		if (res.errcode === 0) {
 			list.value = list.value.concat(res.data)
 			total.value = res.total
@@ -147,17 +141,14 @@
 	const toTab = async (data) => {
 		console.log(data);
 	};
-	const getDict = (data, model) => {
-		let res
-		if (model == 'education') res = educationList.value.find((f) => f.value == data)
-		return res.label || '暂无'
-	}
 	const showChange = () => {
 		show.value = false
 	}
 	// 去预约
 	const toBuy = (item) => {
-		console.log(item);
+		uni.navigateTo({
+			url: `/pagesHome/course/index?id=${item._id}`
+		})
 	}
 	// 去查看
 	const toList = (item) => {
@@ -250,38 +241,8 @@
 					width: 70%;
 
 					.right_1 {
-						display: flex;
-						align-items: center;
-						justify-content: space-between;
-
-						.leftR {
-							width: 40%;
-							font-size: var(--font16Size);
-							font-weight: bold;
-						}
-
-						.rightR {
-							width: 60%;
-							text-align: right;
-							font-size: var(--font12Size);
-
-							.text {
-								text-align: center;
-								border: 1px solid var(--3c9Color);
-								border-radius: 4px;
-								padding: 1vw;
-								background: linear-gradient(to right, #ffffff, #3c9cff59);
-
-								.text_1 {
-									color: var(--3c9Color);
-									font-weight: bold;
-								}
-
-								.text_2 {
-									color: var(--ff0Color);
-								}
-							}
-						}
+						font-size: var(--font16Size);
+						font-weight: bold;
 					}
 
 					.right_2 {
@@ -302,6 +263,28 @@
 					}
 
 					.right_3 {
+						margin: 1vw 0;
+
+						.text {
+							font-size: var(--font12Size);
+							text-align: center;
+							border: 1px solid var(--3c9Color);
+							border-radius: 4px;
+							padding: 1vw;
+							background: linear-gradient(to right, #ffffff, #3c9cff59);
+
+							.text_1 {
+								color: var(--3c9Color);
+								font-weight: bold;
+							}
+
+							.text_2 {
+								color: var(--ff0Color);
+							}
+						}
+					}
+
+					.right_4 {
 						display: flex;
 						align-items: center;
 						justify-content: space-between;

+ 6 - 0
pages/teacher/index.vue

@@ -141,6 +141,12 @@
 		if (model == 'education') res = educationList.value.find((f) => f.value == data)
 		return res.label || '暂无'
 	}
+	// 去预约
+	const toBuy = (item) => {
+		uni.navigateTo({
+			url: `/pagesHome/teacher/index?id=${item._id}`
+		})
+	}
 	const scrolltolower = () => {
 		if (total.value > list.value.length) {
 			uni.showLoading({

+ 152 - 0
pagesHome/course/index.vue

@@ -0,0 +1,152 @@
+<template>
+	<view class="content">
+		<view class="one"
+			:class="[courseInfo.type==='0'?'one0':courseInfo.type==='1'?'one1':courseInfo.type==='2'?'one2':courseInfo.type==='3'?'one3':'']">
+			<view class="left">
+				<view class="one_1 textOver">{{courseInfo.name||'暂无'}}</view>
+				<view class="one_2">
+					{{getDict(courseInfo.type,'type')}} {{getDict(courseInfo.grade,'grade')}}
+					{{getDict(courseInfo.subject,'subject')}}
+				</view>
+			</view>
+			<view class="right">
+				<up-icon v-if="courseInfo.is_follow" name="star-fill" color="#FFA500" size="30"></up-icon>
+				<up-icon v-else name="star" color="#FFA500" size="30"></up-icon>
+			</view>
+		</view>
+		<view class="two">
+			<view class="two_1">
+				<span> 开始时间:{{courseInfo.start_time||'暂无'}}</span>
+				<span> 结束时间:{{courseInfo.end_time||'暂无'}}</span>
+			</view>
+			<view class="two_2">¥{{courseInfo.money||'免费'}}</view>
+		</view>
+	</view>
+</template>
+
+<script setup lang="ts">
+	import { inject, computed, ref } from 'vue';
+	//该依赖已内置不需要单独安装
+	import { onLoad } from "@dcloudio/uni-app";
+	// 请求接口
+	const $api = inject('$api');
+	const id = ref('');
+	// 基本信息
+	const config = ref({ logo: [], file: [] });
+	const courseInfo = ref({});
+	const teacherInfo = ref({});
+	// 字典表
+	const subjectList = ref([]);
+	const educationList = ref([]);
+	const typeList = ref([]);
+	const gradeList = ref([]);
+	const genderList = ref([])
+	const learnStatusList = ref([])
+	// user
+	const user = computed(() => {
+		return uni.getStorageSync('user');
+	})
+	onLoad(async (options) => {
+		id.value = options && options.id
+		await searchConfig();
+		await searchOther();
+		await search();
+	});
+	// config信息
+	const searchConfig = async () => {
+		config.value = uni.getStorageSync('config');
+	};
+	// 其他查询信息
+	const searchOther = async () => {
+		let res;
+		// 学科
+		res = await $api(`dictData`, 'GET', { code: 'subject', is_use: '0' });
+		if (res.errcode === 0) subjectList.value = res.data;
+		// 年级
+		res = await $api(`dictData`, 'GET', { code: 'grade', is_use: '0' });
+		if (res.errcode === 0) gradeList.value = res.data;
+		// 学历
+		res = await $api(`dictData`, 'GET', { code: 'education', is_use: '0' });
+		if (res.errcode === 0) educationList.value = res.data;
+		// 类型
+		res = await $api(`dictData`, 'GET', { code: 'courseType', is_use: '0' });
+		if (res.errcode === 0) typeList.value = res.data;
+		// 性别
+		res = await $api(`dictData`, 'GET', { code: 'gender', is_use: '0' });
+		if (res.errcode === 0) genderList.value = res.data;
+		// 学业状态
+		res = await $api(`dictData`, 'GET', { code: 'learnStatus', is_use: '0' });
+		if (res.errcode === 0) learnStatusList.value = res.data;
+	};
+	// 查询
+	const search = async () => {
+		if (id.value) {
+			const res = await $api(`course/appHomeDetail/${id.value}`, 'GET', {});
+			if (res.errcode == '0') {
+				courseInfo.value = res.data.courseInfo
+				teacherInfo.value = res.data.teacherInfo
+			}
+		}
+	};
+	const getDict = (data, model) => {
+		if (data) {
+			let res
+			if (model == 'education') res = educationList.value.find((f) => f.value == data)
+			else if (model == 'subject') res = subjectList.value.find((f) => f.value == data)
+			else if (model == 'grade') res = gradeList.value.find((f) => f.value == data)
+			else if (model == 'type') res = typeList.value.find((f) => f.value == data)
+			else if (model == 'gender') res = genderList.value.find((f) => f.value == data)
+			else if (model == 'learnStatus') res = learnStatusList.value.find((f) => f.value == data)
+			return res.label || '暂无'
+		}
+	}
+</script>
+<style lang="scss" scoped>
+	.content {
+		display: flex;
+		flex-direction: column;
+		min-height: 100vh;
+		background-color: var(--f1Color);
+
+		.one {
+			display: flex;
+			align-items: center;
+			justify-content: space-between;
+			margin: 3vw;
+			padding: 5vw;
+			border-radius: 2vw;
+			color: var(--mainColor);
+
+			.left {
+				.one_1 {
+					font-size: var(--font16Size);
+					font-weight: bold;
+					margin: 0 0 2vw 0;
+				}
+			}
+
+
+			.right {
+				background-color: var(--mainColor);
+				padding: 2vw;
+				border-radius: 90px;
+			}
+		}
+
+		.one0 {
+			background-color: var(--d57Color);
+		}
+
+		.one1 {
+			background-color: var(--1e9Color);
+		}
+
+		.one2 {
+			background-color: var(--ff6Color);
+		}
+
+		.one3 {
+			background-color: var(--40eColor);
+		}
+	}
+</style>

+ 135 - 20
pagesHome/list/index.vue

@@ -27,8 +27,34 @@
 					<scroll-view scroll-y="true" class="scroll-view" @scrolltolower="toPage" @scroll="toScroll">
 						<view class="list-scroll-view">
 							<view class=" one_2_1">
-								<view class="list" v-for="(tag,index) in list" :key="index" @tap="toBuy(tag)">
-									{{tag.nick_name}}
+								<view class="list" v-for="(item,index) in list" :key="index" @tap="toBuy(tag)">
+									<view class="left">
+										<image v-if="item.icon&&item.icon.length>0&&item.icon" class="image"
+											:src="item.icon[0].url">
+										</image>
+										<image v-else class="image" :src="config.icon[0].url"></image>
+									</view>
+									<view class="right">
+										<view class="right_1 textOne">
+											{{item.name||'暂无'}}
+										</view>
+										<view class="right_2">
+											<view class="text">老师: </view>
+											<view class="value"> {{item.teacher_name||'暂无'}} </view>
+										</view>
+										<view class="right_3">
+											<view class="text">
+												<span class="text_1">最近可约:</span>
+												<span class="text_2">{{item.start_time||'休息中'}}</span>
+											</view>
+										</view>
+										<view class="right_4">
+											<view class="money">¥{{item.money||'免费'}} </view>
+											<view class="button">
+												<button type="warn" size="mini" @click="toBuy(item)">预约</button>
+											</view>
+										</view>
+									</view>
 								</view>
 							</view>
 							<view class="is_bottom" v-if="is_bottom">
@@ -55,6 +81,7 @@
 	const $api = inject('$api');
 	// 基本信息
 	const config = ref({ logo: [], file: [] });
+	const active = ref(0);
 	const type = ref('');
 	const subject = ref('-1');
 	const grade = ref('-1');
@@ -66,12 +93,11 @@
 	const page = ref(0);
 	// 数据是否触底
 	const is_bottom = ref(false);
+	const scrollTop = ref(0);
 	// 遮罩层
 	const show = ref(false);
 	const nick_name = ref('');
 	// 字典表
-	const educationList = ref([]);
-	const active = ref(0);
 	const subjectList = ref([]);
 	const gradeList = ref([]);
 	// user
@@ -103,9 +129,6 @@
 	// 其他查询信息
 	const searchOther = async () => {
 		let res;
-		// 学历
-		res = await $api(`dictData`, 'GET', { code: 'education', is_use: '0' });
-		if (res.errcode === 0) educationList.value = res.data;
 		// 学科
 		res = await $api(`dictData`, 'GET', { code: 'subject', is_use: '0' });
 		if (res.errcode === 0) subjectList.value = res.data;
@@ -126,10 +149,13 @@
 			skip: skip.value,
 			limit: limit.value,
 			status: '1',
-			is_show: '0'
+			is_show: '0',
+			type: type.value
 		}
-		if (nick_name.value) info.nick_name = nick_name.value
-		const res = await $api('teacher', 'GET', info);
+		if (nick_name.value) info.name = nick_name.value
+		if (subject.value && subject.value !== '-1') info.subject = subject.value
+		if (grade.value && grade.value !== '-1') info.grade = grade.value
+		const res = await $api('course/appHome', 'GET', info);
 		if (res.errcode === 0) {
 			list.value = list.value.concat(res.data)
 			total.value = res.total
@@ -143,22 +169,19 @@
 	const showChange = () => {
 		show.value = false
 	}
-	const getDict = (data, model) => {
-		let res
-		if (model == 'education') res = educationList.value.find((f) => f.value == data)
-		return res.label || '暂无'
-	}
 	// 左侧一级选择
-	const toChange = (index, e) => {
+	const toChange = async (index, e) => {
 		console.log(index, e);
 		active.value = index
 		subject.value = e.value
-		// that.clearPage();
-		// that.searchMarket();
+		await clearPage();
+		await search();
 	}
 	// 改变标签
 	const toTab = async (data) => {
-		console.log(data);
+		grade.value = data.value
+		await clearPage();
+		await search();
 	};
 	// 分页
 	const toPage = () => {
@@ -173,6 +196,13 @@
 			uni.hideLoading();
 		} else is_bottom.value = true
 	};
+	// 触底
+	const toScroll = (e) => {
+		let up = scrollTop.value;
+		scrollTop.value = e.detail.scrollTop
+		let num = Math.sign(up - e.detail.scrollTop);
+		if (num == 1) is_bottom.value = false
+	}
 	// 清空列表
 	const clearPage = () => {
 		list.value = []
@@ -220,7 +250,7 @@
 
 			.two_1 {
 				position: relative;
-				width: 25vw;
+				width: 20vw;
 				background-color: #fafafa;
 				display: flex;
 				flex-direction: column;
@@ -261,9 +291,94 @@
 
 					.list {
 						display: flex;
+						margin: 2vw 0 0 0;
 						padding: 2vw;
 						border-radius: 5px;
 						background-color: var(--mainColor);
+
+						.left {
+							width: 28%;
+							margin: 0 2vw 0 0;
+
+							.image {
+								width: 20vw;
+								height: 20vw;
+								border-radius: 2vw;
+							}
+
+						}
+
+						.right {
+							width: 70%;
+
+							.right_1 {
+								font-size: var(--font16Size);
+								font-weight: bold;
+							}
+
+							.right_2 {
+								display: flex;
+								align-items: center;
+								margin: 1vw 0 0 0;
+
+								.text {
+									font-size: var(--font14Size);
+									margin: 0 1vw 0 0;
+								}
+
+								.value {
+									text-align: right;
+									color: var(--f85Color);
+									font-size: var(--font12Size);
+								}
+							}
+
+							.right_3 {
+								margin: 1vw 0;
+
+								.text {
+									font-size: var(--font12Size);
+									text-align: center;
+									border: 1px solid var(--3c9Color);
+									border-radius: 4px;
+									padding: 1vw;
+									background: linear-gradient(to right, #ffffff, #3c9cff59);
+
+									.text_1 {
+										color: var(--3c9Color);
+										font-weight: bold;
+									}
+
+									.text_2 {
+										color: var(--ff0Color);
+									}
+								}
+							}
+
+							.right_4 {
+								display: flex;
+								align-items: center;
+								justify-content: space-between;
+
+								.money {
+									width: 50%;
+									font-size: var(--font14Size);
+									color: var(--ff0Color);
+								}
+
+								.button {
+									width: 50%;
+									text-align: right;
+
+									button {
+										color: var(--mainColor);
+										background: linear-gradient(to right, #1e3fdc, #3c9cff);
+										font-size: var(--font12Size);
+										border-radius: 5vw;
+									}
+								}
+							}
+						}
 					}
 				}
 

+ 7 - 16
pagesHome/teacher/index.vue

@@ -1,35 +1,29 @@
 <template>
 	<view class="content">
-		详情
-		<up-overlay :show="show">
-			<login @showChange='showChange'></login>
-		</up-overlay>
+		教师详情
 	</view>
 </template>
 
 <script setup lang="ts">
 	import { inject, computed, ref } from 'vue';
 	//该依赖已内置不需要单独安装
-	import { onShow, onPullDownRefresh } from "@dcloudio/uni-app";
+	import { onLoad } from "@dcloudio/uni-app";
 	// 请求接口
 	const $api = inject('$api');
-	const $config = inject('$config');
+	const id = ref('');
 	// 基本信息
 	const config = ref({ logo: [], file: [] });
-	const list = ref([]);
-	const total = ref(0);
+	const info = ref({});
 	// user
 	const user = computed(() => {
 		return uni.getStorageSync('user');
 	})
-	// 遮罩层
-	const show = ref(false);
-	onShow(async () => {
+	onLoad(async (options) => {
+		id.value = options && options.id
 		await searchConfig();
 		await searchOther();
 		await search();
-		if (!user.value) show.value = true
-	})
+	});
 	// config信息
 	const searchConfig = async () => {
 		config.value = uni.getStorageSync('config');
@@ -38,9 +32,6 @@
 	const searchOther = async () => { };
 	// 查询
 	const search = async () => { };
-	const showChange = () => {
-		show.value = false
-	}
 </script>
 <style lang="scss" scoped>
 	.content {

+ 1 - 0
unpackage/dist/dev/mp-weixin/app.js

@@ -13,6 +13,7 @@ if (!Math) {
   "./pagesHome/agree/index.js";
   "./pagesHome/list/index.js";
   "./pagesHome/teacher/index.js";
+  "./pagesHome/course/index.js";
   "./pagesMy/order/index.js";
   "./pagesMy/course/index.js";
   "./pagesMy/course/add.js";

+ 2 - 1
unpackage/dist/dev/mp-weixin/app.json

@@ -12,7 +12,8 @@
       "pages": [
         "agree/index",
         "list/index",
-        "teacher/index"
+        "teacher/index",
+        "course/index"
       ]
     },
     {

+ 6 - 2
unpackage/dist/dev/mp-weixin/app.wxss

@@ -5535,7 +5535,11 @@ page {
   --fcColor: #cccccc;
   --f00Color: #000000;
   --fffColor: #ffffff;
-  --ff0Color:	#FF0000;
+  --262Color: #262D3D;
+  --ff0Color: #FF0000;
   --3c9Color: #3c9cff;
-  --262Color: #262D3D;
+  --d57Color: #d57dea;
+  --1e9Color: #1E90FF;
+  --40eColor: #40E0D0;
+  --ff6Color: #FF6347;
 }page{--status-bar-height:25px;--top-window-height:0px;--window-top:0px;--window-bottom:0px;--window-left:0px;--window-right:0px;--window-magin:0px}[data-c-h="true"]{display: none !important;}

+ 11 - 10
unpackage/dist/dev/mp-weixin/pages/home/index.js

@@ -76,7 +76,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         status: "1",
         is_show: "0"
       };
-      const res = await $api("teacher", "GET", info);
+      const res = await $api("course/appHome", "GET", info);
       if (res.errcode === 0) {
         list.value = list.value.concat(res.data);
         total.value = res.total;
@@ -94,7 +94,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       show.value = false;
     };
     const toBuy = (item) => {
-      console.log(item);
+      common_vendor.index.navigateTo({
+        url: `/pagesHome/course/index?id=${item._id}`
+      });
     };
     const toList = (item) => {
       common_vendor.index.navigateTo({
@@ -160,14 +162,13 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
           } : {
             c: config.value.icon[0].url
           }, {
-            d: common_vendor.t(item.course || "暂无"),
-            e: common_vendor.t(item.time || "休息中"),
-            f: common_vendor.t(item.nick_name || "暂无"),
-            g: common_vendor.t(item.content || "暂无"),
-            h: common_vendor.t(item.money || "免费"),
-            i: common_vendor.o(($event) => toBuy(item), index),
-            j: index,
-            k: "4978fed5-4-" + i0 + ",4978fed5-3"
+            d: common_vendor.t(item.name || "暂无"),
+            e: common_vendor.t(item.teacher_name || "暂无"),
+            f: common_vendor.t(item.start_time || "休息中"),
+            g: common_vendor.t(item.money || "免费"),
+            h: common_vendor.o(($event) => toBuy(item), index),
+            i: index,
+            j: "4978fed5-4-" + i0 + ",4978fed5-3"
           });
         }),
         i: common_vendor.o(scrolltolower)

Різницю між файлами не показано, бо вона завелика
+ 1 - 1
unpackage/dist/dev/mp-weixin/pages/home/index.wxml


+ 21 - 28
unpackage/dist/dev/mp-weixin/pages/home/index.wxss

@@ -56,34 +56,9 @@
   width: 70%;
 }
 .content .five .list .right .right_1.data-v-4978fed5 {
-  display: flex;
-  align-items: center;
-  justify-content: space-between;
-}
-.content .five .list .right .right_1 .leftR.data-v-4978fed5 {
-  width: 40%;
   font-size: var(--font16Size);
   font-weight: bold;
 }
-.content .five .list .right .right_1 .rightR.data-v-4978fed5 {
-  width: 60%;
-  text-align: right;
-  font-size: var(--font12Size);
-}
-.content .five .list .right .right_1 .rightR .text.data-v-4978fed5 {
-  text-align: center;
-  border: 1px solid var(--3c9Color);
-  border-radius: 4px;
-  padding: 1vw;
-  background: linear-gradient(to right, #ffffff, #3c9cff59);
-}
-.content .five .list .right .right_1 .rightR .text .text_1.data-v-4978fed5 {
-  color: var(--3c9Color);
-  font-weight: bold;
-}
-.content .five .list .right .right_1 .rightR .text .text_2.data-v-4978fed5 {
-  color: var(--ff0Color);
-}
 .content .five .list .right .right_2.data-v-4978fed5 {
   display: flex;
   align-items: center;
@@ -99,20 +74,38 @@
   font-size: var(--font12Size);
 }
 .content .five .list .right .right_3.data-v-4978fed5 {
+  margin: 1vw 0;
+}
+.content .five .list .right .right_3 .text.data-v-4978fed5 {
+  font-size: var(--font12Size);
+  text-align: center;
+  border: 1px solid var(--3c9Color);
+  border-radius: 4px;
+  padding: 1vw;
+  background: linear-gradient(to right, #ffffff, #3c9cff59);
+}
+.content .five .list .right .right_3 .text .text_1.data-v-4978fed5 {
+  color: var(--3c9Color);
+  font-weight: bold;
+}
+.content .five .list .right .right_3 .text .text_2.data-v-4978fed5 {
+  color: var(--ff0Color);
+}
+.content .five .list .right .right_4.data-v-4978fed5 {
   display: flex;
   align-items: center;
   justify-content: space-between;
 }
-.content .five .list .right .right_3 .money.data-v-4978fed5 {
+.content .five .list .right .right_4 .money.data-v-4978fed5 {
   width: 50%;
   font-size: var(--font14Size);
   color: var(--ff0Color);
 }
-.content .five .list .right .right_3 .button.data-v-4978fed5 {
+.content .five .list .right .right_4 .button.data-v-4978fed5 {
   width: 50%;
   text-align: right;
 }
-.content .five .list .right .right_3 .button button.data-v-4978fed5 {
+.content .five .list .right .right_4 .button button.data-v-4978fed5 {
   color: var(--mainColor);
   background: linear-gradient(to right, #1e3fdc, #3c9cff);
   font-size: var(--font12Size);

+ 6 - 1
unpackage/dist/dev/mp-weixin/pages/teacher/index.js

@@ -87,6 +87,11 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         res = educationList.value.find((f) => f.value == data);
       return res.label || "暂无";
     };
+    const toBuy = (item) => {
+      common_vendor.index.navigateTo({
+        url: `/pagesHome/teacher/index?id=${item._id}`
+      });
+    };
     const scrolltolower = () => {
       if (total.value > list.value.length) {
         common_vendor.index.showLoading({
@@ -126,7 +131,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
             f: common_vendor.t(item.college || "暂无"),
             g: common_vendor.t(getDict(item.education, "education")),
             h: common_vendor.t(item.money || "免费"),
-            i: common_vendor.o(($event) => _ctx.toBuy(item), index),
+            i: common_vendor.o(($event) => toBuy(item), index),
             j: index,
             k: "f3506c63-1-" + i0 + ",f3506c63-0"
           });

+ 114 - 0
unpackage/dist/dev/mp-weixin/pagesHome/course/index.js

@@ -0,0 +1,114 @@
+"use strict";
+const common_vendor = require("../../common/vendor.js");
+if (!Array) {
+  const _easycom_up_icon2 = common_vendor.resolveComponent("up-icon");
+  _easycom_up_icon2();
+}
+const _easycom_up_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
+if (!Math) {
+  _easycom_up_icon();
+}
+const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
+  __name: "index",
+  setup(__props) {
+    const $api = common_vendor.inject("$api");
+    const id = common_vendor.ref("");
+    const config = common_vendor.ref({ logo: [], file: [] });
+    const courseInfo = common_vendor.ref({});
+    const teacherInfo = common_vendor.ref({});
+    const subjectList = common_vendor.ref([]);
+    const educationList = common_vendor.ref([]);
+    const typeList = common_vendor.ref([]);
+    const gradeList = common_vendor.ref([]);
+    const genderList = common_vendor.ref([]);
+    const learnStatusList = common_vendor.ref([]);
+    common_vendor.computed(() => {
+      return common_vendor.index.getStorageSync("user");
+    });
+    common_vendor.onLoad(async (options) => {
+      id.value = options && options.id;
+      await searchConfig();
+      await searchOther();
+      await search();
+    });
+    const searchConfig = async () => {
+      config.value = common_vendor.index.getStorageSync("config");
+    };
+    const searchOther = async () => {
+      let res;
+      res = await $api(`dictData`, "GET", { code: "subject", is_use: "0" });
+      if (res.errcode === 0)
+        subjectList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "grade", is_use: "0" });
+      if (res.errcode === 0)
+        gradeList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "education", is_use: "0" });
+      if (res.errcode === 0)
+        educationList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "courseType", is_use: "0" });
+      if (res.errcode === 0)
+        typeList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "gender", is_use: "0" });
+      if (res.errcode === 0)
+        genderList.value = res.data;
+      res = await $api(`dictData`, "GET", { code: "learnStatus", is_use: "0" });
+      if (res.errcode === 0)
+        learnStatusList.value = res.data;
+    };
+    const search = async () => {
+      if (id.value) {
+        const res = await $api(`course/appHomeDetail/${id.value}`, "GET", {});
+        if (res.errcode == "0") {
+          courseInfo.value = res.data.courseInfo;
+          teacherInfo.value = res.data.teacherInfo;
+        }
+      }
+    };
+    const getDict = (data, model) => {
+      if (data) {
+        let res;
+        if (model == "education")
+          res = educationList.value.find((f) => f.value == data);
+        else if (model == "subject")
+          res = subjectList.value.find((f) => f.value == data);
+        else if (model == "grade")
+          res = gradeList.value.find((f) => f.value == data);
+        else if (model == "type")
+          res = typeList.value.find((f) => f.value == data);
+        else if (model == "gender")
+          res = genderList.value.find((f) => f.value == data);
+        else if (model == "learnStatus")
+          res = learnStatusList.value.find((f) => f.value == data);
+        return res.label || "暂无";
+      }
+    };
+    return (_ctx, _cache) => {
+      return common_vendor.e({
+        a: common_vendor.t(courseInfo.value.name || "暂无"),
+        b: common_vendor.t(getDict(courseInfo.value.type, "type")),
+        c: common_vendor.t(getDict(courseInfo.value.grade, "grade")),
+        d: common_vendor.t(getDict(courseInfo.value.subject, "subject")),
+        e: courseInfo.value.is_follow
+      }, courseInfo.value.is_follow ? {
+        f: common_vendor.p({
+          name: "star-fill",
+          color: "#FFA500",
+          size: "30"
+        })
+      } : {
+        g: common_vendor.p({
+          name: "star",
+          color: "#FFA500",
+          size: "30"
+        })
+      }, {
+        h: common_vendor.n(courseInfo.value.type === "0" ? "one0" : courseInfo.value.type === "1" ? "one1" : courseInfo.value.type === "2" ? "one2" : courseInfo.value.type === "3" ? "one3" : ""),
+        i: common_vendor.t(courseInfo.value.start_time || "暂无"),
+        j: common_vendor.t(courseInfo.value.end_time || "暂无"),
+        k: common_vendor.t(courseInfo.value.money || "免费")
+      });
+    };
+  }
+});
+const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-115e567b"], ["__file", "D:/project/学吧/learn_applet/pagesHome/course/index.vue"]]);
+wx.createPage(MiniProgramPage);

+ 6 - 0
unpackage/dist/dev/mp-weixin/pagesHome/course/index.json

@@ -0,0 +1,6 @@
+{
+  "navigationBarTitleText": "课程详情",
+  "usingComponents": {
+    "up-icon": "../../node-modules/uview-plus/components/u-icon/u-icon"
+  }
+}

Різницю між файлами не показано, бо вона завелика
+ 1 - 0
unpackage/dist/dev/mp-weixin/pagesHome/course/index.wxml


+ 39 - 0
unpackage/dist/dev/mp-weixin/pagesHome/course/index.wxss

@@ -0,0 +1,39 @@
+/* 水平间距 */
+/* 水平间距 */
+.content.data-v-115e567b {
+  display: flex;
+  flex-direction: column;
+  min-height: 100vh;
+  background-color: var(--f1Color);
+}
+.content .one.data-v-115e567b {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+  margin: 3vw;
+  padding: 5vw;
+  border-radius: 2vw;
+  color: var(--mainColor);
+}
+.content .one .left .one_1.data-v-115e567b {
+  font-size: var(--font16Size);
+  font-weight: bold;
+  margin: 0 0 2vw 0;
+}
+.content .one .right.data-v-115e567b {
+  background-color: var(--mainColor);
+  padding: 2vw;
+  border-radius: 90px;
+}
+.content .one0.data-v-115e567b {
+  background-color: var(--d57Color);
+}
+.content .one1.data-v-115e567b {
+  background-color: var(--1e9Color);
+}
+.content .one2.data-v-115e567b {
+  background-color: var(--ff6Color);
+}
+.content .one3.data-v-115e567b {
+  background-color: var(--40eColor);
+}

+ 41 - 21
unpackage/dist/dev/mp-weixin/pagesHome/list/index.js

@@ -18,19 +18,19 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   setup(__props) {
     const $api = common_vendor.inject("$api");
     const config = common_vendor.ref({ logo: [], file: [] });
+    const active = common_vendor.ref(0);
     const type = common_vendor.ref("");
     const subject = common_vendor.ref("-1");
-    common_vendor.ref("-1");
+    const grade = common_vendor.ref("-1");
     const list = common_vendor.ref([]);
     const total = common_vendor.ref(0);
     const skip = common_vendor.ref(0);
     const limit = common_vendor.ref(5);
     const page = common_vendor.ref(0);
     const is_bottom = common_vendor.ref(false);
+    const scrollTop = common_vendor.ref(0);
     const show = common_vendor.ref(false);
     const nick_name = common_vendor.ref("");
-    const educationList = common_vendor.ref([]);
-    const active = common_vendor.ref(0);
     const subjectList = common_vendor.ref([]);
     const gradeList = common_vendor.ref([]);
     const user = common_vendor.computed(() => {
@@ -60,9 +60,6 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     };
     const searchOther = async () => {
       let res;
-      res = await $api(`dictData`, "GET", { code: "education", is_use: "0" });
-      if (res.errcode === 0)
-        educationList.value = res.data;
       res = await $api(`dictData`, "GET", { code: "subject", is_use: "0" });
       if (res.errcode === 0)
         subjectList.value = res.data;
@@ -81,11 +78,16 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         skip: skip.value,
         limit: limit.value,
         status: "1",
-        is_show: "0"
+        is_show: "0",
+        type: type.value
       };
       if (nick_name.value)
-        info.nick_name = nick_name.value;
-      const res = await $api("teacher", "GET", info);
+        info.name = nick_name.value;
+      if (subject.value && subject.value !== "-1")
+        info.subject = subject.value;
+      if (grade.value && grade.value !== "-1")
+        info.grade = grade.value;
+      const res = await $api("course/appHome", "GET", info);
       if (res.errcode === 0) {
         list.value = list.value.concat(res.data);
         total.value = res.total;
@@ -99,13 +101,17 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     const showChange = () => {
       show.value = false;
     };
-    const toChange = (index, e) => {
+    const toChange = async (index, e) => {
       console.log(index, e);
       active.value = index;
       subject.value = e.value;
+      await clearPage();
+      await search();
     };
     const toTab = async (data) => {
-      console.log(data);
+      grade.value = data.value;
+      await clearPage();
+      await search();
     };
     const toPage = () => {
       if (total.value > list.value.length) {
@@ -120,6 +126,13 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
       } else
         is_bottom.value = true;
     };
+    const toScroll = (e) => {
+      let up = scrollTop.value;
+      scrollTop.value = e.detail.scrollTop;
+      let num = Math.sign(up - e.detail.scrollTop);
+      if (num == 1)
+        is_bottom.value = false;
+    };
     const clearPage = () => {
       list.value = [];
       skip.value = 0;
@@ -146,22 +159,29 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
         }),
         g: total.value > 0
       }, total.value > 0 ? common_vendor.e({
-        h: common_vendor.f(list.value, (tag, index, i0) => {
-          return {
-            a: common_vendor.t(tag.nick_name),
-            b: index,
-            c: common_vendor.o(($event) => _ctx.toBuy(tag), index)
-          };
+        h: common_vendor.f(list.value, (item, index, i0) => {
+          return common_vendor.e({
+            a: item.icon && item.icon.length > 0 && item.icon
+          }, item.icon && item.icon.length > 0 && item.icon ? {
+            b: item.icon[0].url
+          } : {
+            c: config.value.icon[0].url
+          }, {
+            d: common_vendor.t(item.name || "暂无"),
+            e: common_vendor.t(item.teacher_name || "暂无"),
+            f: common_vendor.t(item.start_time || "休息中"),
+            g: common_vendor.t(item.money || "免费"),
+            h: common_vendor.o(($event) => _ctx.toBuy(item), index),
+            i: index,
+            j: common_vendor.o(($event) => _ctx.toBuy(_ctx.tag), index)
+          });
         }),
         i: is_bottom.value
       }, is_bottom.value ? {
         j: common_vendor.t(config.value.bottom_title)
       } : {}, {
         k: common_vendor.o(toPage),
-        l: common_vendor.o(
-          //@ts-ignore
-          (...args) => _ctx.toScroll && _ctx.toScroll(...args)
-        )
+        l: common_vendor.o(toScroll)
       }) : {
         m: common_vendor.p({
           mode: "list",

Різницю між файлами не показано, бо вона завелика
+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/list/index.wxml


+ 70 - 1
unpackage/dist/dev/mp-weixin/pagesHome/list/index.wxss

@@ -32,7 +32,7 @@
 }
 .content .two .two_1.data-v-db68cfa6 {
   position: relative;
-  width: 25vw;
+  width: 20vw;
   background-color: #fafafa;
   display: flex;
   flex-direction: column;
@@ -68,10 +68,79 @@
 }
 .content .two .two_2 .two_2_2 .list.data-v-db68cfa6 {
   display: flex;
+  margin: 2vw 0 0 0;
   padding: 2vw;
   border-radius: 5px;
   background-color: var(--mainColor);
 }
+.content .two .two_2 .two_2_2 .list .left.data-v-db68cfa6 {
+  width: 28%;
+  margin: 0 2vw 0 0;
+}
+.content .two .two_2 .two_2_2 .list .left .image.data-v-db68cfa6 {
+  width: 20vw;
+  height: 20vw;
+  border-radius: 2vw;
+}
+.content .two .two_2 .two_2_2 .list .right.data-v-db68cfa6 {
+  width: 70%;
+}
+.content .two .two_2 .two_2_2 .list .right .right_1.data-v-db68cfa6 {
+  font-size: var(--font16Size);
+  font-weight: bold;
+}
+.content .two .two_2 .two_2_2 .list .right .right_2.data-v-db68cfa6 {
+  display: flex;
+  align-items: center;
+  margin: 1vw 0 0 0;
+}
+.content .two .two_2 .two_2_2 .list .right .right_2 .text.data-v-db68cfa6 {
+  font-size: var(--font14Size);
+  margin: 0 1vw 0 0;
+}
+.content .two .two_2 .two_2_2 .list .right .right_2 .value.data-v-db68cfa6 {
+  text-align: right;
+  color: var(--f85Color);
+  font-size: var(--font12Size);
+}
+.content .two .two_2 .two_2_2 .list .right .right_3.data-v-db68cfa6 {
+  margin: 1vw 0;
+}
+.content .two .two_2 .two_2_2 .list .right .right_3 .text.data-v-db68cfa6 {
+  font-size: var(--font12Size);
+  text-align: center;
+  border: 1px solid var(--3c9Color);
+  border-radius: 4px;
+  padding: 1vw;
+  background: linear-gradient(to right, #ffffff, #3c9cff59);
+}
+.content .two .two_2 .two_2_2 .list .right .right_3 .text .text_1.data-v-db68cfa6 {
+  color: var(--3c9Color);
+  font-weight: bold;
+}
+.content .two .two_2 .two_2_2 .list .right .right_3 .text .text_2.data-v-db68cfa6 {
+  color: var(--ff0Color);
+}
+.content .two .two_2 .two_2_2 .list .right .right_4.data-v-db68cfa6 {
+  display: flex;
+  align-items: center;
+  justify-content: space-between;
+}
+.content .two .two_2 .two_2_2 .list .right .right_4 .money.data-v-db68cfa6 {
+  width: 50%;
+  font-size: var(--font14Size);
+  color: var(--ff0Color);
+}
+.content .two .two_2 .two_2_2 .list .right .right_4 .button.data-v-db68cfa6 {
+  width: 50%;
+  text-align: right;
+}
+.content .two .two_2 .two_2_2 .list .right .right_4 .button button.data-v-db68cfa6 {
+  color: var(--mainColor);
+  background: linear-gradient(to right, #1e3fdc, #3c9cff);
+  font-size: var(--font12Size);
+  border-radius: 5vw;
+}
 .content .two .two_2 .is_bottom.data-v-db68cfa6 {
   width: 100%;
   text-align: center;

+ 6 - 26
unpackage/dist/dev/mp-weixin/pagesHome/teacher/index.js

@@ -1,32 +1,20 @@
 "use strict";
 const common_vendor = require("../../common/vendor.js");
-if (!Array) {
-  const _component_login = common_vendor.resolveComponent("login");
-  const _easycom_up_overlay2 = common_vendor.resolveComponent("up-overlay");
-  (_component_login + _easycom_up_overlay2)();
-}
-const _easycom_up_overlay = () => "../../node-modules/uview-plus/components/u-overlay/u-overlay.js";
-if (!Math) {
-  _easycom_up_overlay();
-}
 const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
   __name: "index",
   setup(__props) {
     common_vendor.inject("$api");
-    common_vendor.inject("$config");
+    const id = common_vendor.ref("");
     const config = common_vendor.ref({ logo: [], file: [] });
-    common_vendor.ref([]);
-    common_vendor.ref(0);
-    const user = common_vendor.computed(() => {
+    common_vendor.ref({});
+    common_vendor.computed(() => {
       return common_vendor.index.getStorageSync("user");
     });
-    const show = common_vendor.ref(false);
-    common_vendor.onShow(async () => {
+    common_vendor.onLoad(async (options) => {
+      id.value = options && options.id;
       await searchConfig();
       await searchOther();
       await search();
-      if (!user.value)
-        show.value = true;
     });
     const searchConfig = async () => {
       config.value = common_vendor.index.getStorageSync("config");
@@ -35,16 +23,8 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
     };
     const search = async () => {
     };
-    const showChange = () => {
-      show.value = false;
-    };
     return (_ctx, _cache) => {
-      return {
-        a: common_vendor.o(showChange),
-        b: common_vendor.p({
-          show: show.value
-        })
-      };
+      return {};
     };
   }
 });

+ 1 - 3
unpackage/dist/dev/mp-weixin/pagesHome/teacher/index.json

@@ -1,6 +1,4 @@
 {
   "navigationBarTitleText": "教师详情",
-  "usingComponents": {
-    "up-overlay": "../../node-modules/uview-plus/components/u-overlay/u-overlay"
-  }
+  "usingComponents": {}
 }

+ 1 - 1
unpackage/dist/dev/mp-weixin/pagesHome/teacher/index.wxml

@@ -1 +1 @@
-<view class="content data-v-5346e3e3"> 详情 <up-overlay wx:if="{{b}}" class="data-v-5346e3e3" u-s="{{['d']}}" u-i="5346e3e3-0" bind:__l="__l" u-p="{{b}}"><login class="data-v-5346e3e3" bindshowChange="{{a}}" u-i="5346e3e3-1,5346e3e3-0" bind:__l="__l"></login></up-overlay></view>
+<view class="content data-v-5346e3e3"> 教师详情 </view>