index.vue 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <template>
  2. <view class="work-container">
  3. <!-- 第一块内容 -->
  4. <view class="section" @click="handleCourseSelection">
  5. <view class="icon-and-text">
  6. <!-- 假设使用 iconfont 图标 -->
  7. <view class="iconfont1 icon-jxa text-red icon"></view>
  8. <view class="text-content">
  9. <text class="course-title">课程精选</text>
  10. <text class="no-new-message">暂无新消息</text>
  11. </view>
  12. </view>
  13. </view>
  14. <!-- 分割线 -->
  15. <view class="divider"></view>
  16. <!-- 第二块内容 -->
  17. <view class="section" @click="handleCourseUpdate">
  18. <view class="icon-and-text">
  19. <view class="iconfont1 icon-kechengshangxin text-bule icon"></view>
  20. <view class="text-content">
  21. <text class="course-title">课程上新</text>
  22. <text class="no-new-message">暂无新消息</text>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 分割线 -->
  27. <view class="divider"></view>
  28. <!-- 第三块内容 -->
  29. <view class="section" @click="handleLiveBooking">
  30. <view class="icon-and-text">
  31. <view class="iconfont1 icon-zhiboyuyue text-purple icon"></view>
  32. <view class="text-content">
  33. <text class="course-title">直播预约</text>
  34. <text class="no-new-message">暂无新消息</text>
  35. </view>
  36. </view>
  37. </view>
  38. <!-- 分割线 -->
  39. <view class="divider"></view>
  40. <!-- 第四块内容 -->
  41. <view class="section" @click="handleCircleMessage">
  42. <view class="icon-and-text">
  43. <view class="iconfont1 icon-quanzixiaoxihover text-green icon"></view>
  44. <view class="text-content">
  45. <text class="course-title">圈子消息</text>
  46. <text class="no-new-message">暂无新消息</text>
  47. </view>
  48. </view>
  49. </view>
  50. <view class="divider"></view>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. methods: {
  56. // 处理课程精选点击事件
  57. handleCourseSelection() {
  58. console.log('点击了课程精选');
  59. // 这里可以添加具体的业务逻辑
  60. this.$modal.showToast('模块建设中~')
  61. },
  62. // 处理课程上新点击事件
  63. handleCourseUpdate() {
  64. console.log('点击了课程上新');
  65. // 这里可以添加具体的业务逻辑
  66. this.$modal.showToast('模块建设中~')
  67. },
  68. // 处理直播预约点击事件
  69. handleLiveBooking() {
  70. console.log('点击了直播预约');
  71. // 这里可以添加具体的业务逻辑
  72. this.$modal.showToast('模块建设中~')
  73. },
  74. // 处理圈子消息点击事件
  75. handleCircleMessage() {
  76. console.log('点击了圈子消息');
  77. // 这里可以添加具体的业务逻辑
  78. this.$modal.showToast('模块建设中~')
  79. }
  80. }
  81. }
  82. </script>
  83. <style lang="scss" scoped>
  84. @import '@/static/fontico/iconfont.css';
  85. .section {
  86. padding: 20px;
  87. min-height: 100px;
  88. display: flex;
  89. align-items: center;
  90. gap: 10px;
  91. }
  92. .divider {
  93. height: 1px;
  94. background-color: #ccc;
  95. margin: 10px 0;
  96. }
  97. .iconfont1 {
  98. font-size: 36px;
  99. }
  100. .course-title {
  101. font-size: 20px;
  102. font-weight: bold;
  103. }
  104. .icon-and-text {
  105. display: flex;
  106. flex-direction: row; // 修改为水平排列
  107. align-items: center;
  108. gap: 15px; // 设置图标和文字之间的间距
  109. }
  110. .text-content {
  111. display: flex;
  112. flex-direction: column;
  113. }
  114. .no-new-message {
  115. font-size: 12px;
  116. color: #999;
  117. margin-top: 5px;
  118. }
  119. </style>