Browse Source

'Save'

hfll
hflllll 1 month ago
parent
commit
a5f0220b04
7 changed files with 835 additions and 4 deletions
  1. +1
    -1
      manifest.json
  2. +14
    -2
      pages.json
  3. +12
    -1
      pages/index/home.vue
  4. BIN
      static/内容图标.png
  5. BIN
      static/课程图标.png
  6. +475
    -0
      subPages/home/directory.vue
  7. +333
    -0
      subPages/home/search.vue

+ 1
- 1
manifest.json View File

@ -50,7 +50,7 @@
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wx99fa48d1b6adc699",
"appid" : "wx24736a3864e8f0e9",
"setting" : {
"urlCheck" : false
},


+ 14
- 2
pages.json View File

@ -16,7 +16,7 @@
{
"path": "pages/index/member",
"style": {
"navigationBarTitleText": "custom",
"navigationStyle": "custom",
"enablePullDownRefresh": true
}
},
@ -52,11 +52,23 @@
"navigationBarBackgroundColor": "#06DADC"
}
},
{
"path": "home/search",
"style": {
"navigationStyle": "custom"
}
},
{
"path": "home/submit",
"style": {
"navigationBarTitleText": "报名个人语境定制"
}
},
{
"path": "home/directory",
"style": {
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#264C8F"
}
},
{


+ 12
- 1
pages/index/home.vue View File

@ -5,7 +5,7 @@
<!-- 顶部搜索栏 -->
<view class="header">
<view class="search-container">
<view class="search-container" @click="goSearch">
<uv-search
placeholder="请输入要查询的内容"
:show-action="false"
@ -97,6 +97,7 @@
v-for="(book, index) in recommendBooks"
:key="index"
class="book-item"
@click="goBook"
>
<view class="book-cover">
<image :src="book.cover" mode="aspectFill"></image>
@ -311,6 +312,16 @@ export default {
uni.navigateTo({
url: '/subPages/home/plan'
})
},
goSearch() {
uni.navigateTo({
url: '/subPages/home/search'
})
},
goBook() {
uni.navigateTo({
url: '/subPages/home/directory'
})
}
}
}


BIN
static/内容图标.png View File

Before After
Width: 44  |  Height: 32  |  Size: 742 B

BIN
static/课程图标.png View File

Before After
Width: 38  |  Height: 36  |  Size: 847 B

+ 475
- 0
subPages/home/directory.vue View File

@ -0,0 +1,475 @@
<template>
<view class="directory-container">
<view class="book-container">
<view class="book-info">
<view class="book-cover">
<image :src="bookInfo.cover" mode="aspectFill" :style="{width: '100%', height: '100%'}"></image>
</view>
<view class="book-details">
<view class="book-title">{{ bookInfo.title }}</view>
<view class="book-subtitle">{{ bookInfo.subtitle }}</view>
<view class="book-author">{{ bookInfo.author }}</view>
<view class="book-level" :class="classMap[bookInfo.level]">{{ bookInfo.level }}</view>
</view>
</view>
<view class="book-knowledge">
<view class="book-knowledge-title">
<text>
适合词汇量
</text>
<text class="book-knowledge-vocabulary">
{{ bookInfo.vocabularyRange }}
</text>
</view>
<view class="border" />
<view class="book-knowledge-detail">
<view class="book-knowledge-detail-title">
知识收获
</view>
<rich-text :nodes="bookInfo.knowledgePoints">
</rich-text>
</view>
</view>
</view>
<!-- 课程和简介容器 -->
<view class="content-container">
<!-- 课程部分 -->
<view class="course-section">
<view class="course-header">
<view class="course-title">课程</view>
</view>
<view class="course-list">
<view
v-for="(course, index) in courseList"
:key="index"
class="course-item"
>
<view class="course-number">{{ String(index + 1).padStart(2, '0') }}</view>
<view class="course-content">
<view class="course-name">{{ course.name }}</view>
<view class="course-subtitle">{{ course.subtitle }}</view>
</view>
</view>
</view>
<view class="course-footer">
<view class="course-total">全部课程 · {{ courseList.length }}</view>
<uv-icon name="arrow-right" size="24rpx" color="#999"></uv-icon>
</view>
</view>
<!-- 简介部分 -->
<view class="intro-section">
<view class="intro-title">简介</view>
<view class="intro-content">
{{ bookInfo.introduction }}
</view>
</view>
<!-- 作者部分 -->
<view class="author-section">
<view class="author-title">作者</view>
<view class="author-info">
<view class="author-avatar">
<image src="/static/默认头像.png" mode="aspectFill"></image>
<view>
<view class="author-name">John Steinbeck</view>
<view class="author-subtitle">约翰·斯坦贝克</view>
</view>
</view>
<view class="author-details">
<view class="author-description">
约翰·斯坦贝克1902 1968是美国现代小说家1962 年荣获诺贝尔文学奖斯坦贝克一生创作出了 27 部作品它们大多着眼于美国底层人民的生活对贫穷而善良的劳苦大众展现出了强烈的同情心不仅为被压迫者申辩而且还歌颂了他们在困境中生存的勇气和斗志斯坦贝克最为优秀的几部作品都发表于 20世纪30年代之后例如荣获美国国家图书奖普利策奖的长篇小说愤怒的葡萄具有浓厚乡土气息的短篇集小红马和中篇小说人鼠之间以反法西斯战争为题材的中篇小说月亮下去了斯坦贝克既是地位崇高的文学大师也是深受美国民众爱戴的畅销作家他的作品不仅深刻影响了美国文学的发展也启发了人们对社会人性生死等话题的思考
</view>
</view>
</view>
</view>
</view>
<!-- 底部固定操作栏 -->
<view class="bottom-action-bar">
<view class="bottom-action-container">
<view class="action-button secondary">
<image src="/static/课程图标.png" class="button-icon" mode="aspectFill"></image>
<text>加入课程</text>
</view>
<view class="action-button primary">
<image src="/static/内容图标.png" class="button-icon" ></image>
<text>内容朗读</text>
</view>
<uv-button type="primary" :custom-style="{
width: '400rpx',
height: '80rpx',
borderRadius: '198rpx',
background: '#06DADC',
fontSize: '28rpx',
fontWeight: '600'
}" >开始学习</uv-button>
</view>
<uv-safe-bottom></uv-safe-bottom>
</view>
</view>
</template>
<script>
export default {
data() {
return {
classMap: {
'朵蕾会员': 'book-level-1',
'萌芽会员': 'book-level-2',
'盛放会员': 'book-level-3',
},
bookInfo: {
cover: '/static/默认图片.png',
title: 'The Little Prince',
subtitle: '小王子',
author: '圣-埃克苏佩里',
level: '朵蕾会员',
vocabularyRange: '1.6K~2.5K',
//
knowledgePoints: '<div>1. 41天读完法国作家圣埃克苏佩里文学作品</div><div>2. 掌握400+单词英文文本,收获对于法语的</div><div>3. 感受英文文学作品的魅力,在阅读中提升英语语感和文学素养</div><div>4. 通过英文原著,在生活中,对语言使用的文学性</div><div>5. 名作阅读</div>',
introduction: '在阿尔卑斯山上住着一个可爱的女孩小海蒂。她自幼失去父母,同性格倔强但心地善良的爷爷一起生活。后来,因为姨妈介绍的一个机会,海蒂去到了法兰克福,和一个叫克拉拉的女孩儿作伴。克拉拉自小患病无法行走,虽然两个孩子感情很好,但海蒂却因为想家患上了梦游症。最终海蒂回到了阿尔卑斯山,同山里的亲友们找回了幸福的生活。随后,克拉拉也如约前来拜访,在海蒂和爷爷的悉心照料下,奇迹发生了...'
},
courseList: [
{
name: 'Look, George!',
subtitle: '你瞧,乔治'
},
{
name: 'A Live Mouse?',
subtitle: '活老鼠?'
},
{
name: 'Beans with Ketchup',
subtitle: '豆子配番茄酱'
},
{
name: 'Aunt Clara',
subtitle: '卡莉拉姑姑'
},
{
name: 'No Ketchup',
subtitle: '无番茄酱'
}
]
}
},
methods: {
goBack() {
uni.navigateBack()
}
}
}
</script>
<style scoped lang="scss">
.directory-container {
min-height: 100vh;
background-color: #264C8F;
}
.book-container{
padding: 30rpx;
}
.book-info {
display: flex;
align-items: start;
gap: 32rpx;
.book-cover {
width: 208rpx;
height: 292rpx;
border-radius: 16rpx;
}
.book-details{
color: white;
display: flex;
flex-direction: column;
gap: 16rpx;
.book-title{
font-weight: 500;
font-size: 40rpx;
}
.book-subtitle{
font-weight: 500;
font-size: 30rpx;
}
.book-author{
font-size: 24rpx;
}
.book-level{
font-size: 24rpx;
width: 124rpx;
height: 38rpx;
border-radius: 8rpx;
text-align: center;
line-height: 38rpx;
color: #080D21;
}
.book-level-1{
background: #E9F1FF;
border: 2rpx solid #C4DAFF
}
.book-level-2{
background: #FFE9E9;
border: 2rpx solid #FFDBC4
}
.book-level-3{
background: #FFF4E9;
border: 2rpx solid #FFE2C4
}
}
}
.book-knowledge{
box-shadow: 0px 1px 5px 0px #103577;
background: #234684;
color: #fff;
margin-top: 32rpx;
border: 2rpx solid #FFFFFF3B;
border-radius: 32rpx;
padding-top: 32rpx;
padding-right: 40rpx;
padding-bottom: 32rpx;
padding-left: 40rpx;
gap: 24rpx;
display: flex;
flex-direction: column;
gap: 22rpx;
.book-knowledge-title{
font-size: 32rpx;
font-weight: 600;
display: flex;
justify-content: space-between;
.book-knowledge-vocabulary{
font-size: 40rpx;
color: #06DADC;
}
}
.border {
width: 100%;
border: 2rpx solid;
border-image-source: linear-gradient(90deg, rgba(233, 181, 123, 0) 0%, rgba(255, 255, 255, 0.79) 50.48%, rgba(233, 181, 123, 0) 100%);
border-image-slice: 1;
}
.book-knowledge-detail-title{
font-size: 32rpx;
font-weight: 600;
margin-bottom: 16rpx;
}
}
/* 课程和简介容器 */
.content-container {
padding: 40rpx 32rpx;
border-radius: 40rpx 40rpx 0 0;
overflow: hidden;
background: #fff;
display: flex;
gap: 24rpx;
flex-direction: column;
}
/* 课程部分 */
.course-section {
background: #F8F8F8;
border-radius: 32rpx;
border-radius: 32rpx;
padding-top: 36rpx;
padding-right: 32rpx;
padding-bottom: 36rpx;
padding-left: 32rpx;
gap: 36rpx;
display: flex;
flex-direction: column;
}
.course-title {
font-size: 32rpx;
font-weight: 600;
color: #3B3D3D;
}
.course-list {
// margin-bottom: 32rpx;
display: flex;
flex-direction: column;
gap: 24rpx;
}
.course-item {
display: flex;
align-items: center;
// background: red;
border-bottom: 2rpx solid #EEEEEE;
padding-bottom: 20rpx;
gap: 36rpx;
}
.course-item:last-child {
border-bottom: none;
}
.course-number {
font-size: 36rpx;
color: #999;
}
.course-content {
flex: 1;
}
.course-name {
font-size: 32rpx;
font-weight: 600;
color: #3B3D3D;
margin-bottom: 8rpx;
}
.course-subtitle {
font-size: 28rpx;
color: #3B3D3D;
}
.course-footer {
display: flex;
align-items: center;
// justify-content: space-between;
}
.course-total {
font-size: 24rpx;
color: #999;
}
/* 简介部分 */
.intro-section {
background: #F8F8F8;
border-radius: 32rpx;
padding: 32rpx;
}
.intro-title {
font-size: 32rpx;
font-weight: 600;
color: #3B3D3D;
margin-bottom: 24rpx;
}
.intro-content {
font-size: 28rpx;
line-height: 48rpx;
color: #4F4F4F;
}
/* 作者部分 */
.author-section {
background: #F8F8F8;
border-radius: 32rpx;
padding: 32rpx;
.author-title {
font-size: 32rpx;
font-weight: 600;
color: #3B3D3D;
margin-bottom: 24rpx;
}
.author-info {
display: flex;
gap: 24rpx;
align-items: flex-start;
flex-direction: column;
.author-avatar {
display: flex;
align-items: center;
gap: 16rpx;
image {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
overflow: hidden;
flex-shrink: 0;
}
.author-name {
font-size: 36rpx;
font-weight: 600;
color: #252545;
margin-bottom: 12rpx;
}
.author-subtitle {
font-size: 28rpx;
color: #3B3D3D;
// margin-bottom: 16rpx;
}
}
.author-details {
flex: 1;
.author-description {
font-size: 28rpx;
line-height: 48rpx;
color: #4F4F4F;
}
}
}
}
/* 底部固定操作栏 */
.bottom-action-bar {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #fff;
padding: 24rpx 32rpx 0;
box-shadow: 0rpx -2rpx 0rpx 0rpx #0000001A;
z-index: 999;
.bottom-action-container{
display: flex;
align-items: center;
gap: 20rpx;
.action-button {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding: 16rpx 0rpx;
border-radius: 16rpx;
min-width: 120rpx;
gap: 8rpx;
.button-icon {
width: 44rpx;
height: 44rpx;
}
text {
font-size: 24rpx;
color: #999999;
}
}
}
}
</style>

+ 333
- 0
subPages/home/search.vue View File

@ -0,0 +1,333 @@
<template>
<view class="search-container">
<!-- 状态栏安全区域 -->
<uv-status-bar></uv-status-bar>
<!-- 顶部搜索栏 -->
<view class="search-header">
<uv-search
v-model="searchKeyword"
placeholder="请输入内容"
:show-action="true"
action-text="搜索"
:action-style="{
color: '#fff',
backgroundColor: '#FFA500',
borderRadius: '198rpx',
width: '100rpx',
height: '64rpx',
textAlign: 'center',
fontSize: '26rpx',
lineHeight: '64rpx',
}"
:customStyle="{
width: '500rpx',
}"
@search="handleSearch"
@custom="handleSearch"
></uv-search>
</view>
<!-- 分类标签栏 -->
<view class="category-tabs">
<scroll-view scroll-x class="tab-scroll">
<view class="tab-list">
<view
v-for="(tab, index) in categoryTabs"
:key="index"
class="tab-item"
:class="{ active: currentTab === index }"
@click="switchTab(index)"
>
{{ tab }}
</view>
</view>
</scroll-view>
</view>
<!-- 搜索结果列表 -->
<view class="search-results">
<view
v-for="(book, index) in bookList"
:key="index"
class="book-item"
@click="goToDetail(book)"
>
<view class="book-cover">
<image :src="book.cover" mode="aspectFill"></image>
</view>
<view class="book-info">
<view class="book-title">{{ book.title }}</view>
<view class="book-author">{{ book.author }}</view>
<view class="book-meta">
<view class="book-duration">
<image src="/static/播放图标.png" mode="aspectFill" class="book-icon"></image>
<text>{{ book.duration }}</text>
</view>
<view class="book-membership" :class="classMap[book.membershipType]">
{{ book.membership }}
</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
searchKeyword: '短文',
currentTab: 0,
categoryTabs: ['为你推荐', '精选', '短文', '专栏', '初中', '四六级'],
//
classMap: {
premium: 'book-membership-premium',
vip: 'book-membership-vip',
basic: 'book-membership-basic',
},
bookList: [
{
cover: '/static/主页图标.png',
title: '短文全脑孩子:12项革命性策略...',
author: 'Daniel J. Siegel / Tina Payne Bryson / Del...',
duration: '03:24',
membership: '蕾朵会员',
membershipType: 'premium'
},
{
cover: '/static/默认图片.png',
title: '精讲短文',
author: 'Daniel J. Siegel / Tina Payne Bryson / Del...',
duration: '03:24',
membership: '盛放会员',
membershipType: 'vip'
},
{
cover: '/static/默认图片.png',
title: '精讲短文',
author: 'Daniel J. Siegel / Tina Payne Bryson / Del...',
duration: '03:24',
membership: '蕾朵会员',
membershipType: 'premium'
},
{
cover: '/static/默认图片.png',
title: '精讲短文',
author: 'Daniel J. Siegel / Tina Payne Bryson / Del...',
duration: '03:24',
membership: '盛放会员',
membershipType: 'vip'
},
{
cover: '/static/默认图片.png',
title: '精讲短文',
author: 'Daniel J. Siegel / Tina Payne Bryson / Del...',
duration: '03:24',
membership: '萌芽会员',
membershipType: 'basic'
},
{
cover: '/static/默认图片.png',
title: '精讲短文',
author: 'Daniel J. Siegel / Tina Payne Bryson / Del...',
duration: '03:24',
membership: '萌芽会员',
membershipType: 'basic'
},
{
cover: '/static/默认图片.png',
title: '精讲短文',
author: 'Daniel J. Siegel / Tina Payne Bryson / Del...',
duration: '03:24',
membership: '萌芽会员',
membershipType: 'basic'
},
{
cover: '/static/默认图片.png',
title: '精讲短文',
author: 'Daniel J. Siegel / Tina Payne Bryson / Del...',
duration: '03:24',
membership: '萌芽会员',
membershipType: 'basic'
},
]
}
},
methods: {
handleSearch() {
console.log('搜索:', this.searchKeyword)
//
},
switchTab(index) {
this.currentTab = index
console.log('切换分类:', this.categoryTabs[index])
//
},
goToDetail(book) {
console.log('查看详情:', book)
//
}
}
}
</script>
<style scoped lang="scss">
.search-container {
background: #fff;
min-height: 100vh;
}
.search-header {
padding: 10rpx 32rpx 20rpx;
background: #fff;
}
.category-tabs {
background: #fff;
// border-bottom: 1rpx solid #f0f0f0;
.tab-scroll {
white-space: nowrap;
}
.tab-list {
display: flex;
padding: 0 32rpx;
}
.tab-item {
flex-shrink: 0;
padding: 24rpx 22rpx;
font-size: 32rpx;
color: $secondary-text-color;
position: relative;
&.active {
color: $primary-text-color;
font-weight: 600;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 22rpx;
height: 4rpx;
background: $primary-text-color;
border-radius: 2rpx;
}
}
}
}
.search-results {
padding: 32rpx;
display: flex;
flex-direction: column;
gap: 32rpx;
}
.book-item {
display: flex;
align-items: center;
// border-bottom: 1rpx solid #f5f5f5;
background: #F8F8F8;
// width: 686rpx;
height: 212rpx;
gap: 16rpx;
border-radius: 16rpx;
padding: 0rpx 16rpx;
&:last-child {
border-bottom: none;
}
.book-cover {
width: 136rpx;
height: 180rpx;
border-radius: 16rpx;
overflow: hidden;
margin-right: 16rpx;
image {
width: 100%;
height: 100%;
}
}
.book-info {
flex: 1;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.book-title {
font-size: 32rpx;
font-weight: 600;
color: $primary-text-color;
line-height: 48rpx;
letter-spacing: 0;
margin-bottom: 12rpx;
overflow: hidden;
text-overflow: ellipsis;
}
.book-author {
font-size: 24rpx;
color: $secondary-text-color;
margin-bottom: 16rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.book-meta {
display: flex;
align-items: center;
justify-content: space-between;
}
.book-duration {
display: flex;
align-items: center;
font-size: 22rpx;
color: #999;
.book-icon{
width: 18rpx;
height: 18rpx;
}
text {
margin-left: 8rpx;
}
}
.book-membership {
padding: 8rpx 16rpx;
border-radius: 8rpx;
font-size: 24rpx;
color: #211508;
}
}
.book-membership-premium {
background: #E9F1FF;
border: 2rpx solid #C4DAFF
}
.book-membership-vip {
background: #FFF4E9;
border: 2rpx solid #FFE2C4
}
.book-membership-basic {
background: #FFE9E9;
border: 2rpx solid #FFDBC4
}
</style>

Loading…
Cancel
Save