diff --git a/pages.json b/pages.json
index c647c8c..15a66c5 100644
--- a/pages.json
+++ b/pages.json
@@ -127,6 +127,12 @@
"navigationStyle": "custom",
"navigationBarTitleText": "%courseSearch.title%"
}
+ }, {
+ "path": "pages/course/list/tryListen",
+ "style": {
+ "navigationStyle": "custom",
+ "navigationBarTitleText": "%courseHome.tryListen%"
+ }
}
],
"tabBar": {
diff --git a/pages/course/index.vue b/pages/course/index.vue
index f22a31c..c2bb567 100644
--- a/pages/course/index.vue
+++ b/pages/course/index.vue
@@ -195,9 +195,7 @@
- {{ $t('courseHome.moreTryListen') }}
+ {{ $t('courseHome.moreTryListen') }}
diff --git a/pages/course/list/category.vue b/pages/course/list/category.vue
new file mode 100644
index 0000000..e69de29
diff --git a/pages/course/list/components/list-item.vue b/pages/course/list/components/list-item.vue
new file mode 100644
index 0000000..e1bcf2f
--- /dev/null
+++ b/pages/course/list/components/list-item.vue
@@ -0,0 +1,141 @@
+
+
+
+
+
+ {{ data[title] }}
+
+
+
+
+ {{ data.level === 1 ? $t('courseSearch.levelBeginner') : $t('courseSearch.levelAdvanced') }}
+
+
+ {{ $t('courseSearch.required') }}
+
+
+ {{ $t('courseSearch.elective') }}
+
+
+
+
+
+
+
+
+
+ {{
+ data.courseCatalogueEntityList[0].halfFee === 0
+ ? $t('courseSearch.free')
+ : `¥${data.courseCatalogueEntityList[0].halfFee}/${data.courseCatalogueEntityList[0].fee}`
+ }}
+
+
+
+ {{ formatCatalogueTitle(v.title) }}
+ /
+
+ {{
+ data.courseCatalogueEntityList[0].halfFee === 0
+ ? $t('courseSearch.free')
+ : ` ${$t('courseSearch.each')}${data.courseCatalogueEntityList[0].halfFee}/${data.courseCatalogueEntityList[0].fee}`
+ }}
+
+
+ 课程详情
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/course/list/tryListen.vue b/pages/course/list/tryListen.vue
new file mode 100644
index 0000000..1092177
--- /dev/null
+++ b/pages/course/list/tryListen.vue
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pages/course/search.vue b/pages/course/search.vue
index 91451e0..657c657 100644
--- a/pages/course/search.vue
+++ b/pages/course/search.vue
@@ -40,51 +40,13 @@
-
-
-
- {{ item.title }}
-
-
-
-
- {{ item.level === 1 ? $t('courseSearch.levelBeginner') : $t('courseSearch.levelAdvanced') }}
-
-
- {{ $t('courseSearch.required') }}
-
-
- {{ $t('courseSearch.elective') }}
-
-
-
-
-
-
- {{
- item.courseCatalogueEntityList[0].halfFee === 0
- ? $t('courseSearch.free')
- : `¥${item.courseCatalogueEntityList[0].halfFee}/${item.courseCatalogueEntityList[0].fee}`
- }}
-
-
-
- {{ formatCatalogueTitle(v.title) }}
- /
-
- {{
- item.courseCatalogueEntityList[0].halfFee === 0
- ? $t('courseSearch.free')
- : ` ${$t('courseSearch.each')}${item.courseCatalogueEntityList[0].halfFee}/${item.courseCatalogueEntityList[0].fee}`
- }}
-
-
-
+ :data="item"
+ :showToDetail="false"
+ desc="content"
+ />
@@ -102,6 +64,7 @@ import { onShow } from '@dcloudio/uni-app'
import { useI18n } from 'vue-i18n'
import { courseApi } from '@/api/modules/course'
import type { ICourse } from '@/types/search'
+import listItem from './list/components/list-item.vue'
const { t } = useI18n()
@@ -207,32 +170,6 @@ const handleClear = () => {
getHistory()
}
-/**
- * 跳转到课程详情
- */
-const goCourseDetail = (courseId: number) => {
- uni.navigateTo({
- url: `/pages/course/courseDetail?id=${courseId}`
- })
-}
-
-/**
- * 格式化课程目录标题
- * 提取"上/中/下"
- */
-const formatCatalogueTitle = (title: string): string => {
- const keywords = ['上部', '中部', '下部']
- const result: string[] = []
-
- keywords.forEach((keyword) => {
- if (title.includes(keyword)) {
- result.push(keyword.substring(0, 1))
- }
- })
-
- return result.join('')
-}
-
/**
* 页面挂载
*/
@@ -313,78 +250,6 @@ onShow(() => {
text-shadow: 0 2rpx 4rpx rgba(0, 122, 255, 0.6);
}
-// 商品网格样式
-.product-section {
- margin-bottom: 40rpx;
-}
-
-.product-grid {
- display: grid;
- grid-template-columns: repeat(3, 1fr);
- gap: 20rpx;
-}
-
-.product-item {
- background: #fff;
- border-radius: 15rpx;
- padding: 14rpx;
- position: relative;
- overflow: hidden;
-
- .vip-badge {
- position: absolute;
- top: 10rpx;
- left: 10rpx;
- z-index: 10;
- background: #f94f04;
- color: #fff;
- font-size: 22rpx;
- font-weight: bold;
- padding: 4rpx 8rpx;
- border-radius: 4rpx;
- }
-
- .product-image {
- width: 100%;
- height: 220rpx;
- border-radius: 10rpx;
- background: #f0f0f0;
- }
-
- .product-name {
- font-size: 24rpx;
- font-weight: bold;
- margin-top: 10rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .product-price {
- font-size: 26rpx;
- margin-top: 10rpx;
-
- .price-vip {
- color: #e97512;
- font-size: 26rpx;
- font-weight: bold;
- }
-
- .price-original {
- color: #8a8a8a;
- font-size: 22rpx;
- margin-left: 8rpx;
- text-decoration: line-through;
- }
-
- .price-normal {
- color: #e97512;
- font-size: 26rpx;
- font-weight: bold;
- }
- }
-}
-
// 课程列表样式
.course-section {
margin-bottom: 40rpx;
@@ -395,62 +260,4 @@ onShow(() => {
flex-direction: column;
gap: 20rpx;
}
-
-.course-item {
- display: flex;
- background: #fff;
- border-radius: 20rpx;
- padding: 20rpx;
- position: relative;
- box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
-
- .course-image {
- width: 250rpx;
- height: 250rpx;
- margin-right: 20rpx;
- border-radius: 10rpx;
- background: #f0f0f0;
- flex-shrink: 0;
- }
-
- .course-info {
- flex: 1;
- display: flex;
- flex-direction: column;
-
- .course-title {
- font-size: 30rpx;
- font-weight: bold;
- color: #000;
- margin-bottom: 10rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
- }
-
- .course-content {
- font-size: 24rpx;
- color: #9c9c9c;
- line-height: 30rpx;
- height: 60rpx;
- overflow: hidden;
- margin-bottom: 10rpx;
- }
-
- .course-tags {
- display: flex;
- gap: 10rpx;
- flex-wrap: wrap;
- }
- }
-
- .course-price {
- position: absolute;
- bottom: 20rpx;
- right: 20rpx;
- font-size: 32rpx;
- font-weight: 500;
- color: red;
- }
-}
diff --git a/style/tailwind.css b/style/tailwind.css
index 16aeac9..dbb1504 100644
--- a/style/tailwind.css
+++ b/style/tailwind.css
@@ -267,6 +267,9 @@
.text-\[\#fff\] {
color: #fff;
}
+ .text-\[red\] {
+ color: red;
+ }
.lowercase {
text-transform: lowercase;
}