index.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179
  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. <view class="p-l-r-30 p-t-30 dis-flex flex-x-around nav-btns">
  15. <view class="nav-btn">
  16. <view class="nav-btn-icon icon-circle">
  17. <u-image width="32px" height="32px" mode="aspectFit" src="@/static/images/home/professional.png"></u-image>
  18. </view>
  19. <view class="nav-btn-text">专业风采</view>
  20. </view>
  21. <view class="nav-btn">
  22. <view class="nav-btn-icon icon-circle">
  23. <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/dish.png"></u-image>
  24. </view>
  25. <view class="nav-btn-text">名菜</view>
  26. </view>
  27. <view class="nav-btn">
  28. <view class="nav-btn-icon icon-circle">
  29. <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/snacks.png"></u-image>
  30. </view>
  31. <view class="nav-btn-text">名点</view>
  32. </view>
  33. <view class="nav-btn">
  34. <view class="nav-btn-icon icon-circle">
  35. <u-image width="28px" height="28px" mode="aspectFit" src="@/static/images/home/restaurant.png"></u-image>
  36. </view>
  37. <view class="nav-btn-text">名店</view>
  38. </view>
  39. </view>
  40. <view class="info-list">
  41. <view class="dis-flex flex-x-between info-item" v-for="item in 10">
  42. <view class="info-pic"></view>
  43. <view class="info-view">
  44. <view class="info-title">
  45. 标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题标题
  46. </view>
  47. <view class="dis-flex info-bottom">
  48. <view style="margin-right: 20rpx;">10月07日</view>
  49. <u-icon name="thumb-up" color="#7f7f7f" size="18"></u-icon>
  50. <view style="margin-right: 20rpx;">点赞</view>
  51. <u-icon name="eye" color="#7f7f7f" size="18"></u-icon>
  52. <view>阅读量</view>
  53. </view>
  54. </view>
  55. </view>
  56. </view>
  57. </view>
  58. </template>
  59. <script>
  60. import themeMixins from '@/pages/yuecai/mixins/themeMixins.js';
  61. export default {
  62. mixins: [themeMixins],
  63. data() {
  64. return {
  65. chartOption: {
  66. },
  67. keyword: '',
  68. bannerList: [],
  69. page: {},
  70. keyword: '',
  71. list: []
  72. }
  73. },
  74. onLoad(options) {},
  75. onShow() {
  76. this.getBanners()
  77. },
  78. methods: {
  79. getBanners() {
  80. this.$u.api.getInformationList(0, 6, {}).then(res => {
  81. this.bannerList = res.data.records || []
  82. })
  83. },
  84. clickInfo(index) {
  85. if (index < 0) {
  86. return;
  87. }
  88. uni.navigateTo({
  89. url: "/pages/yuecai/information/detail/index?id=" + this.bannerList[index].id,
  90. })
  91. },
  92. doSearch() {
  93. }
  94. },
  95. }
  96. </script>
  97. <style scoped lang="scss">
  98. .search-left-btn {
  99. width: 35px;
  100. min-width: 35px;
  101. height: 35px;
  102. margin-right: 5px;
  103. box-sizing: border-box;
  104. }
  105. .icon-circle {
  106. border-radius: 50%;
  107. border: 4rpx solid #65371b;
  108. display: flex;
  109. justify-content: center;
  110. align-items: center;
  111. }
  112. .nav-btns {
  113. border-bottom: 1rpx solid #65371b;
  114. margin-bottom: 20rpx;
  115. padding-bottom: 50rpx;
  116. .nav-btn {
  117. width: 150rpx;
  118. .nav-btn-icon {
  119. margin: auto;
  120. width: 110rpx;
  121. height: 110rpx;
  122. }
  123. .nav-btn-text {
  124. width: 100%;
  125. color: #65371b;
  126. margin-top: 5rpx;
  127. font-weight: bolder;
  128. text-align: center;
  129. }
  130. }
  131. }
  132. .info-list {
  133. .info-item {
  134. padding: 20rpx;
  135. .info-pic {
  136. width: 175rpx;
  137. height: 175rpx;
  138. background: bisque;
  139. }
  140. .info-view {
  141. width: calc(100% - 195rpx);
  142. .info-title {
  143. color: #65371b;
  144. font-size: 24rpx;
  145. font-weight: 300;
  146. line-height: 47rpx;
  147. word-spacing: 2rpx;
  148. overflow: hidden;
  149. text-overflow: -o-ellipsis-lastline;
  150. overflow: hidden;
  151. text-overflow: ellipsis;
  152. display: -webkit-box;
  153. -webkit-line-clamp: 3;
  154. line-clamp: 3;
  155. -webkit-box-orient: vertical;
  156. }
  157. .info-bottom {
  158. color: #7f7f7f;
  159. font-size: 24rpx;
  160. margin-top: 10rpx;
  161. }
  162. }
  163. }
  164. }
  165. </style>