hotel.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390
  1. <template>
  2. <view>
  3. <view style="height: 50upx;"></view>
  4. <scroll-view style="height: 95vh;" class="floor-list"
  5. :scroll-top="scrollTop" scroll-y="true" @scroll="scroll" @scrolltoupper="upper" @scrolltolower="lower"
  6. refresher-enabled="true">
  7. <!-- <uniNavBar>
  8. <view slot="left">
  9. </view>
  10. <view class="input-view">
  11. <uniIcon type="search" size="22" color="#666666" />
  12. <input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" @confirm="confirm" />
  13. </view>
  14. <view slot="right">
  15. </view>
  16. </uniNavBar> -->
  17. <!-- <van-sticky class="titleFixed">
  18. <van-nav-bar title="标题" left-arrow>
  19. <van-icon name="search" slot="right" />
  20. </van-nav-bar>
  21. </van-sticky> -->
  22. <view class="scrollswiper">
  23. <swiper class="swiper" :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval" :duration="duration">
  24. <swiper-item>
  25. <view style="height: 100%;" class="swiper-item uni-bg-red">A</view>
  26. </swiper-item>
  27. <swiper-item>
  28. <view style="height: 100%;" class="swiper-item uni-bg-green">B</view>
  29. </swiper-item>
  30. <swiper-item>
  31. <view style="height: 100%;" class="swiper-item uni-bg-blue">C</view>
  32. </swiper-item>
  33. </swiper>
  34. </view>
  35. <view class="titeTop" :class="iScrolltop == 2?'activeColor' : ''">
  36. <view class="topleft">
  37. <uniIcon type="back" size="22" color="#666666" />
  38. </view>
  39. <view>
  40. <view class="input-view">
  41. <uniIcon type="search" size="22" color="#666666" />
  42. <input confirm-type="search" class="input" type="text" placeholder="输入搜索关键词" @confirm="confirm" />
  43. </view>
  44. </view>
  45. <view class="topright">
  46. <uniIcon type="arrowright" size="22" color="#666666" />
  47. </view>
  48. </view>
  49. <view class="tip">
  50. <view style="font-size: 36upx;color: #303133;">{{iScrolltop}}华南城市酒店</view>
  51. <view>
  52. <uniIcon type="star" size="22" color="#909399"></uniIcon>
  53. </view>
  54. </view>
  55. <view>
  56. <van-tabs :active="active" @click="onChange">
  57. <van-tab name="1" title="服务">
  58. <view>
  59. <view class="giveList">
  60. <view class="giveItem">
  61. <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>
  62. <p style="text-align: center;">商品销售</p>
  63. </view>
  64. </view>
  65. <view style="padding: 40upx 18upx;">
  66. <view style="width: 95%;margin: 0 auto;">
  67. <view @click="choseType(1)" :class="tabIndex==1 ? 'active' : ''" class="typeItem">
  68. 全部
  69. </view>
  70. <view @click="choseType(2)" class="typeItem">
  71. <view class="iconClass">
  72. <view :class="tabIndex==2 ? 'active' : ''">上新</view>
  73. <view style="display: flex;flex-direction: column;">
  74. <van-icon size="8px" name="arrow-up" />
  75. <van-icon size="8px" name="arrow-down" />
  76. </view>
  77. </view>
  78. </view>
  79. <view @click="choseType(3)" class="typeItem">
  80. <view class="iconClass">
  81. <view :class="tabIndex==3 ? 'active' : ''">价格</view>
  82. <view style="display: flex;flex-direction: column;">
  83. <van-icon size="8px" name="arrow-up" />
  84. <van-icon size="8px" name="arrow-down" />
  85. </view>
  86. </view>
  87. </view>
  88. <view @click="choseType(4)" class="typeItem">
  89. <van-dropdown-menu active-color="#ee0a24" :overlay="false">
  90. <van-dropdown-item
  91. title="分类" id="item">
  92. <view @click="confirm()" style="display: flex; flex-direction: wrap;">
  93. <van-cell style="margin: 10upx 15upx;" v-for="(item, index) in option1" :key="index" title="包邮">{{item.text}}</van-cell>
  94. </view>
  95. </van-dropdown-item>
  96. </van-dropdown-menu>
  97. </view>
  98. </view>
  99. </view>
  100. <!-- 商品列表 -->
  101. <shopList />
  102. </view>
  103. </van-tab>
  104. <van-tab name="2" title="评价">
  105. <!-- 评价列表 -->
  106. <assess />
  107. </van-tab>
  108. <van-tab name="3" title="酒店信息">
  109. <view class="hoteletail">
  110. <view class="hotlItem">酒店信息</view>
  111. <view>
  112. </view>
  113. </view>
  114. <view class="hotlItem">
  115. <view>酒店地址</view>
  116. <view>1111111</view>
  117. </view>
  118. <view class="hotlItem">
  119. <view>酒店电话</view>
  120. <view>55555555</view>
  121. </view>
  122. </van-tab>
  123. </van-tabs>
  124. <view v-if="active == 3" class="bottomButton">
  125. <button type="warn">您的入住意见反馈(反馈送圈币)</button>
  126. </view>
  127. </view>
  128. </scroll-view>
  129. </view>
  130. </template>
  131. <script>
  132. import uniIcon from '@/component/uni-icon/uni-icon.vue'
  133. import uniNavBar from '@/component/uni-nav-bar/uni-nav-bar.vue'
  134. import commoNar from '@/component/commoNar.vue' // 筛选栏
  135. import shopList from '@/component/shopList.vue' // 商品列表
  136. import assess from '@/component/assess.vue' // 评价列表
  137. export default {
  138. components: {
  139. uniIcon,
  140. uniNavBar,
  141. commoNar,
  142. assess,
  143. shopList
  144. },
  145. data() {
  146. return {
  147. tabIndex: 0,
  148. menu: [{
  149. name: '综合',
  150. id: '0'
  151. }, {
  152. name: '上新',
  153. id: '1'
  154. }, {
  155. name: '价格',
  156. id: '2'
  157. },
  158. {
  159. name:'分类',
  160. id:'3'
  161. }
  162. ],
  163. option1: [
  164. { text: '全部', value: 1 },
  165. { text: '商品销售', value: 2 },
  166. ],
  167. background: ['color1', 'color2', 'color3'],
  168. indicatorDots: true,
  169. autoplay: true,
  170. interval: 2000,
  171. duration: 500,
  172. active: 1,
  173. scrollTop: 0,
  174. old: {
  175. scrollTop: 0
  176. },
  177. option1: [
  178. { text: '全部商品', value: 0 },
  179. { text: '新款商品', value: 1 },
  180. { text: '活动商品', value: 2 }
  181. ],
  182. value1: 0,
  183. iScrolltop: 1
  184. }
  185. },
  186. // 初次渲染进来关闭分享菜单栏
  187. onReady:function(){
  188. uni.hideShareMenu({
  189. success(res) {
  190. console.log(res)
  191. console.log("kkkkkkkkkkkk")
  192. },
  193. fail(res){
  194. console.log(res)
  195. console.log("dddddd")
  196. }
  197. });
  198. },
  199. methods: {
  200. choseType(e) {
  201. console.log(e);
  202. this.tabIndex = e
  203. },
  204. onChange(event) {
  205. this.active = event.detail.name;
  206. console.log(this.active)
  207. },
  208. confirm() {
  209. this.selectComponent('#item').toggle();
  210. },
  211. upper(e) {
  212. console.log(e)
  213. console.log("顶部")
  214. },
  215. // 滚到底部
  216. lower(e) {
  217. console.log("底部")
  218. },
  219. // 滚动时触发
  220. scroll(e) {
  221. this.old.scrollTop = e.detail.scrollTop
  222. if(e.detail.scrollTop > 160) {
  223. console.log("是是是")
  224. this.iScrolltop = 2;
  225. }else {
  226. this.iScrolltop = 1;
  227. }
  228. },
  229. }
  230. }
  231. </script>
  232. <style>
  233. .scrollswiper {
  234. width: 100%;
  235. position: relative;
  236. }
  237. .titleFixed {
  238. position: absolute;
  239. top: 0;
  240. left: 0;
  241. z-index: 99;
  242. padding-top: 0;
  243. }
  244. .van-nav-bar {
  245. padding-top: 0!important;
  246. /* background: #000000!important; */
  247. /* opacity: 0.2; */
  248. background:rgba(0,0,0,0.2)!important;
  249. }
  250. .swiper {
  251. height: 300upx;
  252. }
  253. .swiper-item {
  254. display: block;
  255. height: 100%!important;
  256. line-height: 300upx;
  257. text-align: center;
  258. }
  259. .tip {
  260. display: flex;
  261. justify-content: space-between;
  262. padding: 36upx 32upx;
  263. }
  264. .giveList {
  265. padding: 10upx 12upx;
  266. display: flex;
  267. flex-wrap: wrap;
  268. }
  269. .giveItem {
  270. width: 18%;
  271. height: 120upx;
  272. margin: 10upx 20upx;
  273. /* background-color: #909399 */
  274. }
  275. .active {
  276. color: #F76260;
  277. }
  278. .typeItem {
  279. width: 25%;
  280. display: inline-block;
  281. text-align: center;
  282. }
  283. .iconClass {
  284. display: flex;
  285. flex-direction: row;
  286. align-items: center;
  287. justify-content: space-around;
  288. }
  289. .hotlItem {
  290. padding: 22upx 30upx;
  291. border-bottom: 1px solid #EEEEEE;
  292. display: flex;
  293. justify-content: space-between;
  294. }
  295. .bottomButton {
  296. width: 95%;
  297. left: 2.5%;
  298. position: absolute;
  299. bottom: 0;
  300. }
  301. .titeTop {
  302. display: flex;
  303. justify-content: space-between;
  304. align-items: center;
  305. position: absolute;
  306. top: 10upx;
  307. width: 100%;
  308. }
  309. .topleft {
  310. }
  311. .topright {
  312. }
  313. .input-view {
  314. width: 85%;
  315. display: flex;
  316. height: 30px;
  317. border-radius: 15px;
  318. padding: 0 4%;
  319. flex-wrap: nowrap;
  320. margin: 7px 0;
  321. line-height: 30px;
  322. margin: 24upx auto;
  323. background:rgba(0,0,0,1);
  324. border-radius:15px;
  325. opacity:0.4;
  326. }
  327. .input-view .uni-icon {
  328. line-height: 30px !important;
  329. }
  330. .input-view .input {
  331. height: 30px;
  332. line-height: 30px;
  333. width: 94%;
  334. padding: 0 3%;
  335. }
  336. .activeColor {
  337. background: #fff!important;
  338. position: fixed;
  339. top: 0;
  340. }
  341. .listType {
  342. }
  343. </style>