四零语境前端代码仓库
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.

475 lines
12 KiB

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. padding-bottom: 200rpx;
  165. }
  166. .book-container{
  167. padding: 30rpx;
  168. }
  169. .book-info {
  170. display: flex;
  171. align-items: start;
  172. gap: 32rpx;
  173. .book-cover {
  174. width: 208rpx;
  175. height: 292rpx;
  176. border-radius: 16rpx;
  177. }
  178. .book-details{
  179. color: white;
  180. display: flex;
  181. flex-direction: column;
  182. gap: 16rpx;
  183. .book-title{
  184. font-weight: 500;
  185. font-size: 40rpx;
  186. }
  187. .book-subtitle{
  188. font-weight: 500;
  189. font-size: 30rpx;
  190. }
  191. .book-author{
  192. font-size: 24rpx;
  193. }
  194. .book-level{
  195. font-size: 24rpx;
  196. width: 124rpx;
  197. height: 38rpx;
  198. border-radius: 8rpx;
  199. text-align: center;
  200. line-height: 38rpx;
  201. color: #080D21;
  202. }
  203. .book-level-1{
  204. background: #E9F1FF;
  205. border: 2rpx solid #C4DAFF
  206. }
  207. .book-level-2{
  208. background: #FFE9E9;
  209. border: 2rpx solid #FFDBC4
  210. }
  211. .book-level-3{
  212. background: #FFF4E9;
  213. border: 2rpx solid #FFE2C4
  214. }
  215. }
  216. }
  217. .book-knowledge{
  218. box-shadow: 0px 1px 5px 0px #103577;
  219. background: #234684;
  220. color: #fff;
  221. margin-top: 32rpx;
  222. border: 2rpx solid #FFFFFF3B;
  223. border-radius: 32rpx;
  224. padding-top: 32rpx;
  225. padding-right: 40rpx;
  226. padding-bottom: 32rpx;
  227. padding-left: 40rpx;
  228. gap: 24rpx;
  229. display: flex;
  230. flex-direction: column;
  231. gap: 22rpx;
  232. .book-knowledge-title{
  233. font-size: 32rpx;
  234. font-weight: 600;
  235. display: flex;
  236. justify-content: space-between;
  237. .book-knowledge-vocabulary{
  238. font-size: 40rpx;
  239. color: #06DADC;
  240. }
  241. }
  242. .border {
  243. width: 100%;
  244. border: 2rpx solid;
  245. 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%);
  246. border-image-slice: 1;
  247. }
  248. .book-knowledge-detail-title{
  249. font-size: 32rpx;
  250. font-weight: 600;
  251. margin-bottom: 16rpx;
  252. }
  253. }
  254. /* 课程和简介容器 */
  255. .content-container {
  256. padding: 40rpx 32rpx;
  257. border-radius: 40rpx 40rpx 0 0;
  258. overflow: hidden;
  259. background: #fff;
  260. display: flex;
  261. gap: 24rpx;
  262. flex-direction: column;
  263. }
  264. /* 课程部分 */
  265. .course-section {
  266. background: #F8F8F8;
  267. border-radius: 32rpx;
  268. border-radius: 32rpx;
  269. padding-top: 36rpx;
  270. padding-right: 32rpx;
  271. padding-bottom: 36rpx;
  272. padding-left: 32rpx;
  273. gap: 36rpx;
  274. display: flex;
  275. flex-direction: column;
  276. }
  277. .course-title {
  278. font-size: 32rpx;
  279. font-weight: 600;
  280. color: #3B3D3D;
  281. }
  282. .course-list {
  283. // margin-bottom: 32rpx;
  284. display: flex;
  285. flex-direction: column;
  286. gap: 24rpx;
  287. }
  288. .course-item {
  289. display: flex;
  290. align-items: center;
  291. // background: red;
  292. border-bottom: 2rpx solid #EEEEEE;
  293. padding-bottom: 20rpx;
  294. gap: 36rpx;
  295. }
  296. .course-item:last-child {
  297. border-bottom: none;
  298. }
  299. .course-number {
  300. font-size: 36rpx;
  301. color: #999;
  302. }
  303. .course-content {
  304. flex: 1;
  305. }
  306. .course-name {
  307. font-size: 32rpx;
  308. font-weight: 600;
  309. color: #3B3D3D;
  310. margin-bottom: 8rpx;
  311. }
  312. .course-subtitle {
  313. font-size: 28rpx;
  314. color: #3B3D3D;
  315. }
  316. .course-footer {
  317. display: flex;
  318. align-items: center;
  319. // justify-content: space-between;
  320. }
  321. .course-total {
  322. font-size: 24rpx;
  323. color: #999;
  324. }
  325. /* 简介部分 */
  326. .intro-section {
  327. background: #F8F8F8;
  328. border-radius: 32rpx;
  329. padding: 32rpx;
  330. }
  331. .intro-title {
  332. font-size: 32rpx;
  333. font-weight: 600;
  334. color: #3B3D3D;
  335. margin-bottom: 24rpx;
  336. }
  337. .intro-content {
  338. font-size: 28rpx;
  339. line-height: 48rpx;
  340. color: #4F4F4F;
  341. }
  342. /* 作者部分 */
  343. .author-section {
  344. background: #F8F8F8;
  345. border-radius: 32rpx;
  346. padding: 32rpx;
  347. .author-title {
  348. font-size: 32rpx;
  349. font-weight: 600;
  350. color: #3B3D3D;
  351. margin-bottom: 24rpx;
  352. }
  353. .author-info {
  354. display: flex;
  355. gap: 24rpx;
  356. align-items: flex-start;
  357. flex-direction: column;
  358. .author-avatar {
  359. display: flex;
  360. align-items: center;
  361. gap: 16rpx;
  362. image {
  363. width: 80rpx;
  364. height: 80rpx;
  365. border-radius: 50%;
  366. overflow: hidden;
  367. flex-shrink: 0;
  368. }
  369. .author-name {
  370. font-size: 36rpx;
  371. font-weight: 600;
  372. color: #252545;
  373. margin-bottom: 12rpx;
  374. }
  375. .author-subtitle {
  376. font-size: 28rpx;
  377. color: #3B3D3D;
  378. // margin-bottom: 16rpx;
  379. }
  380. }
  381. .author-details {
  382. flex: 1;
  383. .author-description {
  384. font-size: 28rpx;
  385. line-height: 48rpx;
  386. color: #4F4F4F;
  387. }
  388. }
  389. }
  390. }
  391. /* 底部固定操作栏 */
  392. .bottom-action-bar {
  393. position: fixed;
  394. bottom: 0;
  395. left: 0;
  396. right: 0;
  397. background: #fff;
  398. padding: 24rpx 32rpx 0;
  399. box-shadow: 0rpx -2rpx 0rpx 0rpx #0000001A;
  400. z-index: 999;
  401. .bottom-action-container{
  402. display: flex;
  403. align-items: center;
  404. gap: 20rpx;
  405. .action-button {
  406. display: flex;
  407. flex-direction: column;
  408. align-items: center;
  409. justify-content: center;
  410. padding: 16rpx 0rpx;
  411. border-radius: 16rpx;
  412. min-width: 120rpx;
  413. gap: 8rpx;
  414. .button-icon {
  415. width: 44rpx;
  416. height: 44rpx;
  417. }
  418. text {
  419. font-size: 24rpx;
  420. color: #999999;
  421. }
  422. }
  423. }
  424. }
  425. </style>