普兆健康管家前端代码仓库
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.

87 lines
2.0 KiB

  1. <template>
  2. <view>
  3. <!-- 搜索栏 -->
  4. <view class="search">
  5. <uv-search
  6. v-model="keyword"
  7. placeholder="请输入要查询的内容"
  8. placeholderColor="#C6C6C6"
  9. searchIconColor="#8B8B8B"
  10. :searchIconSize="40"
  11. :inputStyle="{
  12. 'font-family': 'PingFang SC',
  13. 'font-weight': 400,
  14. 'font-size': '28rpx',
  15. 'line-height': 1.4,
  16. 'padding': '12rpx 0',
  17. }"
  18. bgColor="#fff"
  19. :showAction="false"
  20. @search="search"
  21. ></uv-search>
  22. </view>
  23. <view class="section">
  24. <view class="section-header">
  25. <!-- todo -->
  26. <sectionHeader :title="`直播 · 05月11日 12:00`" @showAll="jumpToLive"></sectionHeader>
  27. </view>
  28. <view style="padding: 0 32rpx;">
  29. <courseLiveCard v-for="item in liveList" :key="item.id" :data="item"></courseLiveCard>
  30. </view>
  31. </view>
  32. <view class="section">
  33. <sectionHeader title="推荐课程" @showAll="jumpToRecommendCourse"></sectionHeader>
  34. <courseRecommendView></courseRecommendView>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. import sectionHeader from '@/components/home/sectionHeader.vue'
  40. import courseLiveCard from './courseLiveCard.vue'
  41. import courseRecommendView from './courseRecommendView.vue'
  42. export default {
  43. components: {
  44. sectionHeader,
  45. courseLiveCard,
  46. courseRecommendView,
  47. },
  48. data() {
  49. return {
  50. keyword: '',
  51. liveList: [],
  52. }
  53. },
  54. mounted() {
  55. this.liveList = [
  56. {
  57. id: '001',
  58. url: '',
  59. startTime: '2025-07-25 19:30:00',
  60. },
  61. ]
  62. },
  63. methods: {
  64. // 搜素
  65. search() {
  66. // todo
  67. uni.navigateTo({
  68. url: '/pages/index/category?search=' + this.keyword
  69. })
  70. this.keyword = ''
  71. },
  72. jumpToLive() {
  73. // todo
  74. },
  75. jumpToRecommendCourse() {
  76. // todo
  77. },
  78. },
  79. }
  80. </script>
  81. <style scoped lang="scss">
  82. @import '../styles/tab.scss';
  83. </style>