oneIndex.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. <template>
  2. <view>
  3. <view class="searchType" style="background: #fff;">
  4. <view class="input-view">
  5. <uni-icon type="search" size="22" color="#666666" />
  6. <input confirm-type="search" class="input" type="text" placeholder="搜索文章" @confirm="confirm" />
  7. </view>
  8. </view>
  9. <view>
  10. <van-tabs :active="active" @click="onChange">
  11. <van-tab :name="1" title="标签 1"></van-tab>
  12. <van-tab :name="2" title="标签 2"></van-tab>
  13. <van-tab :name="3" title="标签 3"></van-tab>
  14. <van-tab :name="4" title="标签 4"></van-tab>
  15. </van-tabs>
  16. </view>
  17. <!-- refresher-enabled 开启自定义下拉-->
  18. <scroll-view class="floor-list"
  19. :scroll-top="scrollTop" scroll-y="true" @scroll="scroll" @scrolltoupper="upper" @scrolltolower="lower"
  20. @refresherabort="onAbort"
  21. @refresherrefresh="onRefresh"
  22. @refresherpulling="onPulling"
  23. refresher-enabled="true">
  24. <view>
  25. <view class="hotelList">
  26. <view class="hotleLeft">
  27. <image style="width: 214upx;height: 152upx;" src=""/>
  28. </view>
  29. <view class="hotelright">
  30. <view style="font-size: 28upx;color: #303133;">华南城市酒店</view>
  31. <view>
  32. 07-05 14:58
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </scroll-view>
  38. </view>
  39. </template>
  40. <script>
  41. import uniIcon from '@/component/uni-icon/uni-icon.vue'
  42. export default {
  43. components: {
  44. uniIcon
  45. },
  46. data() {
  47. return {
  48. active: 1,
  49. scrollTop: 0,
  50. old: {
  51. scrollTop: 0
  52. }
  53. }
  54. },
  55. methods: {
  56. confirm() {
  57. },
  58. onChange(event) {
  59. this.active = event.detail.name;
  60. console.log(this.active)
  61. },
  62. // 自定义下拉控件被触发
  63. onPulling() {
  64. },
  65. // 自定义下拉刷新被触发
  66. onRefresh() {
  67. },
  68. // 自定义下拉刷新被中止
  69. onAbort() {
  70. },
  71. // 滚动到顶部
  72. upper(e) {
  73. console.log(e)
  74. console.log("顶部")
  75. },
  76. // 滚到底部
  77. lower(e) {
  78. console.log("底部")
  79. },
  80. // 滚动时触发
  81. scroll(e) {
  82. this.old.scrollTop = e.detail.scrollTop
  83. },
  84. }
  85. }
  86. </script>
  87. <style>
  88. .hotelList {
  89. display: flex;
  90. flex-direction: row;
  91. padding: 24upx 32upx;
  92. }
  93. .hotleLeft {
  94. width: 214upx;
  95. height: 152upx;
  96. background-color: #007AFF;
  97. }
  98. .hotelright {
  99. padding-left: 16upx;
  100. display: flex;
  101. flex-direction: column;
  102. width: 100%;
  103. }
  104. .searchType .input-view {
  105. width: 85%;
  106. display: flex;
  107. background-color: #e7e7e7;
  108. height: 30px;
  109. border-radius: 15px;
  110. padding: 0 4%;
  111. flex-wrap: nowrap;
  112. margin: 7px 0;
  113. line-height: 30px;
  114. margin: 24upx auto;
  115. }
  116. .searchType .input-view .uni-icon {
  117. line-height: 30px !important;
  118. }
  119. .searchType .input-view .input {
  120. height: 30px;
  121. line-height: 30px;
  122. width: 94%;
  123. padding: 0 3%;
  124. }
  125. </style>