hotel.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <template>
  2. <view>
  3. <scroll-view style="height: 100vh;" class="floor-list"
  4. :scroll-top="scrollTop" scroll-y="true" @scroll="scroll" @scrolltoupper="upper" @scrolltolower="lower"
  5. refresher-enabled="true">
  6. <van-sticky class="titleFixed">
  7. <van-nav-bar offset-top="100" title="标题" left-text="返回" left-arrow>
  8. <van-icon name="search" slot="right" />
  9. </van-nav-bar>
  10. </van-sticky>
  11. <view class="scrollswiper">
  12. <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
  13. <swiper-item>
  14. <view style="height: 100%;" class="swiper-item uni-bg-red">A</view>
  15. </swiper-item>
  16. <swiper-item>
  17. <view style="height: 100%;" class="swiper-item uni-bg-green">B</view>
  18. </swiper-item>
  19. <swiper-item>
  20. <view style="height: 100%;" class="swiper-item uni-bg-blue">C</view>
  21. </swiper-item>
  22. </swiper>
  23. </view>
  24. <view class="tip">
  25. <view style="font-size: 36upx;color: #303133;">华南城市酒店</view>
  26. <view>
  27. <uniIcon type="star" size="22" color="#909399"></uniIcon>
  28. </view>
  29. </view>
  30. <view>
  31. <van-tabs :active="active" @click="onChange">
  32. <van-tab name="1" title="服务">
  33. <view>
  34. <view class="giveList">
  35. <view class="giveItem">
  36. <image src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1553409398864&di=4a12763adccf229133fb85193b7cc08f&imgtype=0&src=http%3A%2F%2Fb-ssl.duitang.com%2Fuploads%2Fitem%2F201703%2F19%2F20170319150032_MNwmn.jpeg" style="width:100%;height: 100upx;background: #909399"></image>
  37. <p style="text-align: center;">商品销售</p>
  38. </view>
  39. </view>
  40. <view style="padding: 40upx 18upx;">
  41. <view v-for="(tab,index) in tabBars" :key="tab.id"
  42. class="swiper-tab-list"
  43. :class="tabIndex==index ? 'active' : ''"
  44. :id="tab.id"
  45. :data-current="index"
  46. @click="tapTab">
  47. {{tab.name}}
  48. </view>
  49. <!-- <van-dropdown-menu>
  50. <van-dropdown-item :value="value1" :options="option1" />
  51. <van-dropdown-item :value="value1" :options="option1" />
  52. </van-dropdown-menu> -->
  53. <view>
  54. <view class="listType">
  55. <view>
  56. <image src="" ></image>
  57. <view>商品描述</view>
  58. <view>¥25.00</view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. </view>
  64. </van-tab>
  65. <van-tab name="2" title="评价">
  66. </van-tab>
  67. <van-tab name="3" title="酒店信息">
  68. </van-tab>
  69. </van-tabs>
  70. </view>
  71. <van-dropdown-menu>
  72. <van-dropdown-item title="分类" >
  73. <!-- <van-cell title="全部"></van-cell>
  74. <van-cell title="包邮"></van-cell>
  75. <van-cell title="自费"></van-cell> -->
  76. </van-dropdown-item>
  77. </van-dropdown-menu>
  78. <commoNar :option1 = 'option1' :menu = 'menu' />
  79. </scroll-view>
  80. </view>
  81. </template>
  82. <script>
  83. import uniIcon from '@/component/uni-icon/uni-icon.vue'
  84. import commoNar from '@/component/commoNar.vue'
  85. export default {
  86. components: {
  87. uniIcon,
  88. commoNar
  89. },
  90. data() {
  91. return {
  92. tabIndex: 0,
  93. menu: [{
  94. name: '综合',
  95. id: '0'
  96. }, {
  97. name: '上新',
  98. id: '1'
  99. }, {
  100. name: '价格',
  101. id: '2'
  102. },
  103. {
  104. name:'分类',
  105. id:'3'
  106. }
  107. ],
  108. option1: [
  109. { text: '全部', value: 1 },
  110. { text: '商品销售', value: 2 },
  111. ],
  112. background: ['color1', 'color2', 'color3'],
  113. indicatorDots: true,
  114. autoplay: true,
  115. interval: 2000,
  116. duration: 500,
  117. active: 1,
  118. scrollTop: 0,
  119. old: {
  120. scrollTop: 0
  121. },
  122. option1: [
  123. { text: '全部商品', value: 0 },
  124. { text: '新款商品', value: 1 },
  125. { text: '活动商品', value: 2 }
  126. ],
  127. value1: 0
  128. }
  129. },
  130. methods: {
  131. tapTab(e) {
  132. console.log(e);
  133. this.tabIndex = e.currentTarget.id;
  134. },
  135. onChange(event) {
  136. this.active = event.detail.name;
  137. console.log(this.active)
  138. },
  139. upper(e) {
  140. console.log(e)
  141. console.log("顶部")
  142. },
  143. // 滚到底部
  144. lower(e) {
  145. console.log("底部")
  146. },
  147. // 滚动时触发
  148. scroll(e) {
  149. this.old.scrollTop = e.detail.scrollTop
  150. },
  151. }
  152. }
  153. </script>
  154. <style>
  155. .scrollswiper {
  156. width: 100%;
  157. position: relative;
  158. }
  159. .titleFixed {
  160. position: absolute;
  161. top: 0;
  162. left: 0;
  163. z-index: 99;
  164. padding-top: 0;
  165. background-color: transparent;
  166. }
  167. .swiper {
  168. height: 300upx;
  169. }
  170. .swiper-item {
  171. display: block;
  172. height: 100%!important;
  173. line-height: 300upx;
  174. text-align: center;
  175. }
  176. .tip {
  177. display: flex;
  178. justify-content: space-between;
  179. padding: 36upx 32upx;
  180. }
  181. .giveList {
  182. padding: 10upx 12upx;
  183. display: flex;
  184. flex-wrap: wrap;
  185. }
  186. .giveItem {
  187. width: 18%;
  188. height: 120upx;
  189. margin: 10upx 20upx;
  190. /* background-color: #909399 */
  191. }
  192. .active {
  193. color: #F76260;
  194. }
  195. .listType {
  196. }
  197. </style>