四零语境前端代码仓库
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

482 lines
12 KiB

1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
  1. <template>
  2. <view class="directory-container">
  3. <view class="book-container">
  4. <view class="book-info">
  5. <view class="book-cover">
  6. <image :src="bookInfo.cover" mode="aspectFill" :style="{width: '100%', height: '100%'}"></image>
  7. </view>
  8. <view class="book-details">
  9. <view class="book-title">{{ bookInfo.title }}</view>
  10. <view class="book-subtitle">{{ bookInfo.subtitle }}</view>
  11. <view class="book-author">{{ bookInfo.author }}</view>
  12. <view class="book-level" :class="classMap[bookInfo.level]">{{ bookInfo.level }}</view>
  13. </view>
  14. </view>
  15. <view class="book-knowledge">
  16. <view class="book-knowledge-title">
  17. <text>
  18. 适合词汇量
  19. </text>
  20. <text class="book-knowledge-vocabulary">
  21. {{ bookInfo.vocabularyRange }}
  22. </text>
  23. </view>
  24. <view class="border" />
  25. <view class="book-knowledge-detail">
  26. <view class="book-knowledge-detail-title">
  27. 知识收获
  28. </view>
  29. <rich-text :nodes="bookInfo.knowledgePoints">
  30. </rich-text>
  31. </view>
  32. </view>
  33. </view>
  34. <!-- 课程和简介容器 -->
  35. <view class="content-container">
  36. <!-- 课程部分 -->
  37. <view class="course-section">
  38. <view class="course-header">
  39. <view class="course-title">课程</view>
  40. </view>
  41. <view class="course-list">
  42. <view
  43. v-for="(course, index) in courseList"
  44. :key="index"
  45. class="course-item"
  46. >
  47. <view class="course-number">{{ String(index + 1).padStart(2, '0') }}</view>
  48. <view class="course-content">
  49. <view class="course-name">{{ course.name }}</view>
  50. <view class="course-subtitle">{{ course.subtitle }}</view>
  51. </view>
  52. </view>
  53. </view>
  54. <view class="course-footer">
  55. <view class="course-total">全部课程 · {{ courseList.length }}</view>
  56. <uv-icon name="arrow-right" size="24rpx" color="#999"></uv-icon>
  57. </view>
  58. </view>
  59. <!-- 简介部分 -->
  60. <view class="intro-section">
  61. <view class="intro-title">简介</view>
  62. <view class="intro-content">
  63. {{ bookInfo.introduction }}
  64. </view>
  65. </view>
  66. <!-- 作者部分 -->
  67. <view class="author-section">
  68. <view class="author-title">作者</view>
  69. <view class="author-info">
  70. <view class="author-avatar">
  71. <image src="/static/默认头像.png" mode="aspectFill"></image>
  72. <view>
  73. <view class="author-name">John Steinbeck</view>
  74. <view class="author-subtitle">约翰·斯坦贝克</view>
  75. </view>
  76. </view>
  77. <view class="author-details">
  78. <view class="author-description">
  79. 约翰·斯坦贝克1902 1968是美国现代小说家1962 年荣获诺贝尔文学奖斯坦贝克一生创作出了 27 部作品它们大多着眼于美国底层人民的生活对贫穷而善良的劳苦大众展现出了强烈的同情心不仅为被压迫者申辩而且还歌颂了他们在困境中生存的勇气和斗志斯坦贝克最为优秀的几部作品都发表于 20世纪30年代之后例如荣获美国国家图书奖普利策奖的长篇小说愤怒的葡萄具有浓厚乡土气息的短篇集小红马和中篇小说人鼠之间以反法西斯战争为题材的中篇小说月亮下去了斯坦贝克既是地位崇高的文学大师也是深受美国民众爱戴的畅销作家他的作品不仅深刻影响了美国文学的发展也启发了人们对社会人性生死等话题的思考
  80. </view>
  81. </view>
  82. </view>
  83. </view>
  84. </view>
  85. <!-- 底部固定操作栏 -->
  86. <view class="bottom-action-bar">
  87. <view class="bottom-action-container">
  88. <view class="action-button secondary">
  89. <image src="/static/课程图标.png" class="button-icon" mode="aspectFill"></image>
  90. <text>加入课程</text>
  91. </view>
  92. <view class="action-button primary">
  93. <image src="/static/内容图标.png" class="button-icon" ></image>
  94. <text>内容朗读</text>
  95. </view>
  96. <uv-button type="primary" :custom-style="{
  97. width: '400rpx',
  98. height: '80rpx',
  99. borderRadius: '198rpx',
  100. background: '#06DADC',
  101. fontSize: '28rpx',
  102. fontWeight: '600'
  103. }" >开始学习</uv-button>
  104. </view>
  105. <uv-safe-bottom></uv-safe-bottom>
  106. </view>
  107. </view>
  108. </template>
  109. <script>
  110. export default {
  111. data() {
  112. return {
  113. classMap: {
  114. '朵蕾会员': 'book-level-1',
  115. '萌芽会员': 'book-level-2',
  116. '盛放会员': 'book-level-3',
  117. },
  118. bookInfo: {
  119. cover: '/static/默认图片.png',
  120. title: 'The Little Prince',
  121. subtitle: '小王子',
  122. author: '圣-埃克苏佩里',
  123. level: '朵蕾会员',
  124. vocabularyRange: '1.6K~2.5K',
  125. // 我是富文本字符串
  126. knowledgePoints: '<div>1. 41天读完法国作家圣埃克苏佩里文学作品</div><div>2. 掌握400+单词英文文本,收获对于法语的</div><div>3. 感受英文文学作品的魅力,在阅读中提升英语语感和文学素养</div><div>4. 通过英文原著,在生活中,对语言使用的文学性</div><div>5. 名作阅读</div>',
  127. introduction: '在阿尔卑斯山上住着一个可爱的女孩小海蒂。她自幼失去父母,同性格倔强但心地善良的爷爷一起生活。后来,因为姨妈介绍的一个机会,海蒂去到了法兰克福,和一个叫克拉拉的女孩儿作伴。克拉拉自小患病无法行走,虽然两个孩子感情很好,但海蒂却因为想家患上了梦游症。最终海蒂回到了阿尔卑斯山,同山里的亲友们找回了幸福的生活。随后,克拉拉也如约前来拜访,在海蒂和爷爷的悉心照料下,奇迹发生了...'
  128. },
  129. courseList: [
  130. {
  131. name: 'Look, George!',
  132. subtitle: '你瞧,乔治'
  133. },
  134. {
  135. name: 'A Live Mouse?',
  136. subtitle: '活老鼠?'
  137. },
  138. {
  139. name: 'Beans with Ketchup',
  140. subtitle: '豆子配番茄酱'
  141. },
  142. {
  143. name: 'Aunt Clara',
  144. subtitle: '卡莉拉姑姑'
  145. },
  146. {
  147. name: 'No Ketchup',
  148. subtitle: '无番茄酱'
  149. }
  150. ]
  151. }
  152. },
  153. methods: {
  154. goBack() {
  155. uni.navigateBack()
  156. }
  157. }
  158. }
  159. </script>
  160. <style scoped lang="scss">
  161. .directory-container {
  162. min-height: 100vh;
  163. background-color: #264C8F;
  164. }
  165. .book-container{
  166. position: sticky;
  167. left: 0;
  168. right: 0;
  169. top: 0;
  170. padding: 30rpx;
  171. }
  172. .book-info {
  173. display: flex;
  174. align-items: start;
  175. gap: 32rpx;
  176. .book-cover {
  177. width: 208rpx;
  178. height: 292rpx;
  179. border-radius: 16rpx;
  180. }
  181. .book-details{
  182. color: white;
  183. display: flex;
  184. flex-direction: column;
  185. gap: 16rpx;
  186. .book-title{
  187. font-weight: 500;
  188. font-size: 40rpx;
  189. }
  190. .book-subtitle{
  191. font-weight: 500;
  192. font-size: 30rpx;
  193. }
  194. .book-author{
  195. font-size: 24rpx;
  196. }
  197. .book-level{
  198. font-size: 24rpx;
  199. width: 124rpx;
  200. height: 38rpx;
  201. border-radius: 8rpx;
  202. text-align: center;
  203. line-height: 38rpx;
  204. color: #080D21;
  205. }
  206. .book-level-1{
  207. background: #E9F1FF;
  208. border: 2rpx solid #C4DAFF
  209. }
  210. .book-level-2{
  211. background: #FFE9E9;
  212. border: 2rpx solid #FFDBC4
  213. }
  214. .book-level-3{
  215. background: #FFF4E9;
  216. border: 2rpx solid #FFE2C4
  217. }
  218. }
  219. }
  220. .book-knowledge{
  221. box-shadow: 0px 1px 5px 0px #103577;
  222. background: #234684;
  223. color: #fff;
  224. margin-top: 32rpx;
  225. border: 2rpx solid #FFFFFF3B;
  226. border-radius: 32rpx;
  227. padding-top: 32rpx;
  228. padding-right: 40rpx;
  229. padding-bottom: 32rpx;
  230. padding-left: 40rpx;
  231. gap: 24rpx;
  232. display: flex;
  233. flex-direction: column;
  234. gap: 22rpx;
  235. .book-knowledge-title{
  236. font-size: 32rpx;
  237. font-weight: 600;
  238. display: flex;
  239. justify-content: space-between;
  240. .book-knowledge-vocabulary{
  241. font-size: 40rpx;
  242. color: #06DADC;
  243. }
  244. }
  245. .border {
  246. width: 100%;
  247. border: 2rpx solid;
  248. 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%);
  249. border-image-slice: 1;
  250. }
  251. .book-knowledge-detail-title{
  252. font-size: 32rpx;
  253. font-weight: 600;
  254. margin-bottom: 16rpx;
  255. }
  256. }
  257. /* 课程和简介容器 */
  258. .content-container {
  259. padding: 40rpx 32rpx 240rpx;
  260. border-radius: 40rpx 40rpx 0 0;
  261. overflow: hidden;
  262. background: #fff;
  263. display: flex;
  264. gap: 24rpx;
  265. flex-direction: column;
  266. position: relative;
  267. z-index: 100;
  268. }
  269. /* 课程部分 */
  270. .course-section {
  271. background: #F8F8F8;
  272. border-radius: 32rpx;
  273. border-radius: 32rpx;
  274. padding-top: 36rpx;
  275. padding-right: 32rpx;
  276. padding-bottom: 36rpx;
  277. padding-left: 32rpx;
  278. gap: 36rpx;
  279. display: flex;
  280. flex-direction: column;
  281. }
  282. .course-title {
  283. font-size: 32rpx;
  284. font-weight: 600;
  285. color: #3B3D3D;
  286. }
  287. .course-list {
  288. // margin-bottom: 32rpx;
  289. display: flex;
  290. flex-direction: column;
  291. gap: 24rpx;
  292. }
  293. .course-item {
  294. display: flex;
  295. align-items: center;
  296. // background: red;
  297. border-bottom: 2rpx solid #EEEEEE;
  298. padding-bottom: 20rpx;
  299. gap: 36rpx;
  300. }
  301. .course-item:last-child {
  302. border-bottom: none;
  303. }
  304. .course-number {
  305. font-size: 36rpx;
  306. color: #999;
  307. }
  308. .course-content {
  309. flex: 1;
  310. }
  311. .course-name {
  312. font-size: 32rpx;
  313. font-weight: 600;
  314. color: #3B3D3D;
  315. margin-bottom: 8rpx;
  316. }
  317. .course-subtitle {
  318. font-size: 28rpx;
  319. color: #3B3D3D;
  320. }
  321. .course-footer {
  322. display: flex;
  323. align-items: center;
  324. // justify-content: space-between;
  325. }
  326. .course-total {
  327. font-size: 24rpx;
  328. color: #999;
  329. }
  330. /* 简介部分 */
  331. .intro-section {
  332. background: #F8F8F8;
  333. border-radius: 32rpx;
  334. padding: 32rpx;
  335. }
  336. .intro-title {
  337. font-size: 32rpx;
  338. font-weight: 600;
  339. color: #3B3D3D;
  340. margin-bottom: 24rpx;
  341. }
  342. .intro-content {
  343. font-size: 28rpx;
  344. line-height: 48rpx;
  345. color: #4F4F4F;
  346. }
  347. /* 作者部分 */
  348. .author-section {
  349. background: #F8F8F8;
  350. border-radius: 32rpx;
  351. padding: 32rpx;
  352. .author-title {
  353. font-size: 32rpx;
  354. font-weight: 600;
  355. color: #3B3D3D;
  356. margin-bottom: 24rpx;
  357. }
  358. .author-info {
  359. display: flex;
  360. gap: 24rpx;
  361. align-items: flex-start;
  362. flex-direction: column;
  363. .author-avatar {
  364. display: flex;
  365. align-items: center;
  366. gap: 16rpx;
  367. image {
  368. width: 80rpx;
  369. height: 80rpx;
  370. border-radius: 50%;
  371. overflow: hidden;
  372. flex-shrink: 0;
  373. }
  374. .author-name {
  375. font-size: 36rpx;
  376. font-weight: 600;
  377. color: #252545;
  378. margin-bottom: 12rpx;
  379. }
  380. .author-subtitle {
  381. font-size: 28rpx;
  382. color: #3B3D3D;
  383. // margin-bottom: 16rpx;
  384. }
  385. }
  386. .author-details {
  387. flex: 1;
  388. .author-description {
  389. font-size: 28rpx;
  390. line-height: 48rpx;
  391. color: #4F4F4F;
  392. }
  393. }
  394. }
  395. }
  396. /* 底部固定操作栏 */
  397. .bottom-action-bar {
  398. position: fixed;
  399. bottom: 0;
  400. left: 0;
  401. right: 0;
  402. background: #fff;
  403. padding: 24rpx 32rpx 0;
  404. box-shadow: 0rpx -2rpx 0rpx 0rpx #0000001A;
  405. z-index: 999;
  406. .bottom-action-container{
  407. display: flex;
  408. align-items: center;
  409. gap: 20rpx;
  410. .action-button {
  411. display: flex;
  412. flex-direction: column;
  413. align-items: center;
  414. justify-content: center;
  415. padding: 16rpx 0rpx;
  416. border-radius: 16rpx;
  417. min-width: 120rpx;
  418. gap: 8rpx;
  419. .button-icon {
  420. width: 44rpx;
  421. height: 44rpx;
  422. }
  423. text {
  424. font-size: 24rpx;
  425. color: #999999;
  426. }
  427. }
  428. }
  429. }
  430. </style>