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

474 lines
12 KiB

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