index.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. <template>
  2. <view class="container">
  3. <!-- 应用标题栏 -->
  4. <view class="header">
  5. <text class="app-name">小鹅通</text>
  6. <view class="header-icons">
  7. <image class="search-icon" src="/static/search-icon.png"></image>
  8. <image class="more-icon" src="/static/more-icon.png"></image>
  9. </view>
  10. </view>
  11. <!-- 日期和标语部分 -->
  12. <view class="date-section">
  13. <view class="date">
  14. <text class="date-num">{{dateNum}}</text>
  15. <text class="date-month">/五月</text>
  16. </view>
  17. <text class="slogan">学习让你更接近自己的梦想。</text>
  18. <image class="book-img" src="/static/book-img.png"></image>
  19. </view>
  20. <!-- 我的课程部分 -->
  21. <view class="my-courses">
  22. <text class="section-title">我的课程</text>
  23. <view class="view-more">
  24. <text class="view-more-text">查看更多</text>
  25. <image class="arrow-icon" src="/static/arrow-icon.png"></image>
  26. </view>
  27. <view v-if="!hasCourses" class="no-courses">
  28. <image class="box-img" src="/static/box-img.png"></image>
  29. <text class="no-courses-text">你还没有学习系列课程</text>
  30. <text class="no-courses-text">前往查看你的其他课程</text>
  31. <button class="more-courses-btn">更多课程</button>
  32. </view>
  33. <view v-else class="course-list">
  34. <!-- 这里可以循环展示课程列表,示例省略 -->
  35. </view>
  36. <text v-if="!hasCourses" class="find-course">找不到已购课程?</text>
  37. </view>
  38. <!-- 底部导航栏 -->
  39. <!-- <view class="tab-bar">
  40. <view class="tab-item" @click="goToPage('index')">
  41. <image class="tab-icon" src="/static/home-icon.png"></image>
  42. <text class="tab-text">首页</text>
  43. </view>
  44. <view class="tab-item" @click="goToPage('discover')">
  45. <image class="tab-icon" src="/static/discover-icon.png"></image>
  46. <text class="tab-text">发现</text>
  47. </view>
  48. <view class="tab-item" @click="goToPage('message')">
  49. <image class="tab-icon" src="/static/message-icon.png"></image>
  50. <text class="tab-text">消息</text>
  51. </view>
  52. <view class="tab-item" @click="goToPage('mine')">
  53. <image class="tab-icon" src="/static/mine-icon.png"></image>
  54. <text class="tab-text">我的</text>
  55. </view>
  56. </view> -->
  57. </view>
  58. </template>
  59. <script>
  60. export default {
  61. data() {
  62. return {
  63. time: '18:31',
  64. speed: '70.0',
  65. battery: '36',
  66. dateNum: '6',
  67. hasCourses: false // 假设当前没有课程,可根据实际接口数据修改
  68. };
  69. },
  70. methods: {
  71. goToPage(page) {
  72. uni.navigateTo({
  73. url: `/${page}`
  74. });
  75. }
  76. }
  77. };
  78. </script>
  79. <style scoped>
  80. /* 全局样式 */
  81. .container {
  82. background-color: #f7fafc;
  83. height: 100vh;
  84. display: flex;
  85. flex-direction: column;
  86. }
  87. .status-bar {
  88. display: flex;
  89. justify-content: space-between;
  90. align-items: center;
  91. padding: 10rpx 20rpx;
  92. background-color: #ebf4ff;
  93. }
  94. .time {
  95. font-size: 30rpx;
  96. }
  97. .network-status {
  98. display: flex;
  99. align-items: center;
  100. }
  101. .speed,
  102. .signal,
  103. .battery {
  104. font-size: 24rpx;
  105. margin-left: 10rpx;
  106. }
  107. .header {
  108. display: flex;
  109. justify-content: space-between;
  110. align-items: center;
  111. padding: 20rpx 40rpx;
  112. background-color: #ebf4ff;
  113. }
  114. .app-name {
  115. font-size: 40rpx;
  116. font-weight: bold;
  117. }
  118. .header-icons {
  119. display: flex;
  120. }
  121. .search-icon,
  122. .more-icon {
  123. width: 40rpx;
  124. height: 40rpx;
  125. margin-left: 20rpx;
  126. }
  127. .date-section {
  128. display: flex;
  129. justify-content: space-between;
  130. align-items: center;
  131. padding: 40rpx;
  132. background-color: #ebf4ff;
  133. margin-bottom: 20rpx;
  134. }
  135. .date {
  136. display: flex;
  137. flex-direction: column;
  138. }
  139. .date-num {
  140. font-size: 60rpx;
  141. font-weight: bold;
  142. }
  143. .date-month {
  144. font-size: 30rpx;
  145. }
  146. .slogan {
  147. font-size: 30rpx;
  148. width: 60%;
  149. }
  150. .book-img {
  151. width: 200rpx;
  152. height: 150rpx;
  153. }
  154. .my-courses {
  155. padding: 0 40rpx;
  156. margin-bottom: 20rpx;
  157. }
  158. .section-title {
  159. font-size: 36rpx;
  160. font-weight: bold;
  161. margin-bottom: 20rpx;
  162. }
  163. .view-more {
  164. display: flex;
  165. align-items: center;
  166. justify-content: flex-end;
  167. margin-bottom: 20rpx;
  168. }
  169. .view-more-text {
  170. font-size: 28rpx;
  171. margin-right: 10rpx;
  172. }
  173. .arrow-icon {
  174. width: 20rpx;
  175. height: 20rpx;
  176. }
  177. .no-courses {
  178. display: flex;
  179. flex-direction: column;
  180. align-items: center;
  181. justify-content: center;
  182. padding: 40rpx 0;
  183. background-color: #fff;
  184. border-radius: 20rpx;
  185. box-shadow: 0 0 10rpx rgba(0, 0, 0, 0.1);
  186. }
  187. .box-img {
  188. width: 120rpx;
  189. height: 120rpx;
  190. margin-bottom: 20rpx;
  191. }
  192. .no-courses-text {
  193. text-align: center;
  194. font-size: 30rpx;
  195. margin-bottom: 10rpx;
  196. }
  197. .more-courses-btn {
  198. background-color: #ebf4ff;
  199. color: #007aff;
  200. border: 2rpx solid #007aff;
  201. border-radius: 40rpx;
  202. padding: 15rpx 80rpx;
  203. font-size: 32rpx;
  204. margin-top: 20rpx;
  205. }
  206. .find-course {
  207. text-align: center;
  208. font-size: 28rpx;
  209. color: #999;
  210. margin-top: 20rpx;
  211. }
  212. .tab-bar {
  213. display: flex;
  214. justify-content: space-around;
  215. align-items: center;
  216. height: 80rpx;
  217. background-color: #fff;
  218. position: fixed;
  219. bottom: 0;
  220. left: 0;
  221. right: 0;
  222. box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.1);
  223. }
  224. .tab-item {
  225. display: flex;
  226. flex-direction: column;
  227. align-items: center;
  228. justify-content: center;
  229. }
  230. .tab-icon {
  231. width: 40rpx;
  232. height: 40rpx;
  233. margin-bottom: 5rpx;
  234. }
  235. .tab-text {
  236. font-size: 24rpx;
  237. }
  238. </style>