hotel.vue 8.5 KB

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