index1.vue 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <template>
  2. <view class="width-100 height-100 view-page">
  3. <view class="p-10 dis-flex flex-y-center flex-x-between">
  4. <view class="search-left-btn">
  5. <u-image width="35px" height="35px" mode="aspectFit" src="@/static/images/home/logo.png"></u-image>
  6. </view>
  7. <view class="width-100">
  8. <u-search :clearabled="true" height="35px" placeholder="请输入搜索关键字" v-model="keyword" shape="round"
  9. search="doSearch" @custom="doSearch" :showAction="false" bg-color="#e9f0f8"
  10. placeholder-color="#65371b"></u-search>
  11. </view>
  12. </view>
  13. <u-swiper height="185" :list="bannerList" @click="clickInfo" keyName="cover"></u-swiper>
  14. <u-tabs ref="tabs" :list="tabList" :scrollable="false" :current="currentTab" @change="tabChange" lineColor="#65371b"
  15. :activeStyle="{color:'#65371b'}" inactiveStyle="{color:'#65371b'}"></u-tabs>
  16. <view class="info-list">
  17. <view class="info-item" v-for="(item, index) in 10" :key="index">
  18. <view class="info-pic"></view>
  19. <view class="info-title">
  20. 标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </template>
  26. <script>
  27. import themeMixins from '@/pages/yuecai/mixins/themeMixins.js';
  28. export default {
  29. mixins: [themeMixins],
  30. data() {
  31. return {
  32. chartOption: {
  33. },
  34. keyword: '',
  35. bannerList: [],
  36. page: {},
  37. list: [],
  38. tabList: [{
  39. name: '专业风采'
  40. }, {
  41. name: '名菜'
  42. }, {
  43. name: '名店',
  44. }, {
  45. name: '名点',
  46. }],
  47. currentTab: 0
  48. }
  49. },
  50. onLoad(options) {},
  51. onShow() {
  52. this.getBanners()
  53. },
  54. methods: {
  55. tabChange(index) {
  56. this.current = index;
  57. },
  58. getBanners() {
  59. this.$u.api.getInformationList(0, 6, {}).then(res => {
  60. this.bannerList = res.data.records || []
  61. })
  62. },
  63. clickInfo(index) {
  64. if (index < 0) {
  65. return;
  66. }
  67. uni.navigateTo({
  68. url: "/pages/yuecai/information/detail/index?id=" + this.bannerList[index].id,
  69. })
  70. },
  71. doSearch() {
  72. }
  73. },
  74. }
  75. </script>
  76. <style scoped lang="scss">
  77. .search-left-btn {
  78. width: 35px;
  79. min-width: 35px;
  80. height: 35px;
  81. margin-right: 5px;
  82. box-sizing: border-box;
  83. }
  84. .icon-circle {
  85. border-radius: 50%;
  86. border: 4rpx solid #65371b;
  87. display: flex;
  88. justify-content: center;
  89. align-items: center;
  90. }
  91. .nav-btns {
  92. border-bottom: 1rpx solid #65371b;
  93. margin-bottom: 20rpx;
  94. padding-bottom: 50rpx;
  95. .nav-btn {
  96. width: 150rpx;
  97. .nav-btn-icon {
  98. margin: auto;
  99. width: 110rpx;
  100. height: 110rpx;
  101. }
  102. .nav-btn-text {
  103. width: 100%;
  104. color: #65371b;
  105. margin-top: 5rpx;
  106. font-weight: bolder;
  107. text-align: center;
  108. }
  109. }
  110. }
  111. .info-list {
  112. display: flex;
  113. flex-wrap: wrap;
  114. .info-item {
  115. padding: 20rpx;
  116. width: 33%;
  117. box-sizing: border-box;
  118. .info-pic {
  119. margin: auto;
  120. width: 175rpx;
  121. height: 175rpx;
  122. background: bisque;
  123. }
  124. .info-title {
  125. text-align: center;
  126. color: #65371b;
  127. font-size: 24rpx;
  128. font-weight: 300;
  129. line-height: 47rpx;
  130. word-spacing: 2rpx;
  131. overflow: hidden;
  132. text-overflow: -o-ellipsis-lastline;
  133. overflow: hidden;
  134. text-overflow: ellipsis;
  135. display: -webkit-box;
  136. -webkit-line-clamp: 1;
  137. line-clamp: 3;
  138. -webkit-box-orient: vertical;
  139. }
  140. }
  141. }
  142. </style>