index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <view class="container">
  3. <!--search-->
  4. <view class="search-box main-center cross-center">
  5. <u-input
  6. v-model="keywords"
  7. placeholder="请输入剧名 /演员"
  8. color="#fff"
  9. border="none"
  10. prefix-icon="search"
  11. :prefix-icon-style="{
  12. color: $colors.primaryColor,
  13. fontSize: '50rpx',
  14. fontWeight: 500,
  15. lineHeight: '50rpx'
  16. }"
  17. :custom-style="{
  18. backgroundColor: '#1B203C',
  19. padding: '14rpx 30rpx',
  20. width: '700rpx',
  21. borderRadius: '36rpx',
  22. color: '#fff'
  23. }"
  24. />
  25. </view>
  26. <!--swpier-->
  27. <swiper-box />
  28. <!--栏目分类-->
  29. <view class="category-box main-center cross-center">
  30. <view
  31. v-for="(item,index) in category"
  32. :key="index"
  33. class="category-item dir-top-wrap cross-center"
  34. @click="handleRedirect(item)"
  35. >
  36. <view class="icon">
  37. <image :src="item.icon" />
  38. </view>
  39. <text>{{ item.name }}</text>
  40. </view>
  41. </view>
  42. <!--分类-->
  43. <episode-box title="短剧推荐" />
  44. <episode-box title="最新热剧" />
  45. <episode-box title="排行榜" />
  46. <!--充值-->
  47. <recharge :show.sync="recharge.show" />
  48. </view>
  49. </template>
  50. <script>
  51. import SwiperBox from '../../components/SwiperBox/index'
  52. import EpisodeBox from './components/EpisodeBox'
  53. import Recharge from '../../components/Recharge/index'
  54. export default {
  55. components: { Recharge, EpisodeBox, SwiperBox },
  56. data() {
  57. return {
  58. keywords: '',
  59. category: [
  60. { icon: '', name: '排行榜', href: '/pages/' },
  61. { icon: '', name: '最新', href: '/pages/' },
  62. { icon: '', name: '会员', href: '/pages/member/index' },
  63. { icon: '', name: '签到', href: '/pages/sign/index' },
  64. { icon: '', name: '充值', type: 'recharge' }
  65. ],
  66. recharge: { show: false }
  67. }
  68. },
  69. computed: {
  70. },
  71. onLoad(options) {
  72. },
  73. methods: {
  74. handleRedirect(item) {
  75. if (item.type === 'recharge') {
  76. this.recharge.show = true
  77. } else if (item.href) {
  78. this.$u.route(item.href)
  79. }
  80. }
  81. }
  82. }
  83. </script>
  84. <style lang="scss" scoped>
  85. .container{
  86. padding: 0 20rpx;
  87. .search-box{
  88. margin-top: 30rpx;
  89. }
  90. .category-box{
  91. .category-item{
  92. flex: 1;
  93. font-size: 32rpx;
  94. .icon{
  95. image{
  96. width: 100rpx;
  97. height: 100rpx;
  98. }
  99. }
  100. text{
  101. color: #fff;
  102. }
  103. }
  104. }
  105. }
  106. </style>