Commit 7fd96b13 authored by 潘永坪's avatar 潘永坪

组合票开发

parent 58795d6b
<!-- 修改这个页面时,需要同步更新combiChoose页面的代码 --> <!-- 修改这个页面时,需要同步更新combiChoose页面的代码 -->
<template> <template>
<view class="wrap"> <view class="wrap">
<scroll-view @scroll="scrollFull" style="height: 100%;" scroll-y>
<view class="banner"> <view class="banner">
<u-swiper :list="imgList" @change="e => currentNum = e.current" indicatorStyle="right: 20px;bottom:25px" height="400" circular> <u-swiper :list="imgList" @change="e => currentNum = e.current" indicatorStyle="right: 20px;bottom:25px" height="400" circular>
<view slot="indicator" class="indicator-num"> <view slot="indicator" class="indicator-num">
...@@ -8,8 +9,8 @@ ...@@ -8,8 +9,8 @@
</view> </view>
</u-swiper> </u-swiper>
</view> </view>
<view class="middle" :style="{height:middleHeight+'px'}"> <view class="middle">
<view class="merchant-info"> <view class="merchant-info" :style="middleInfoStyle">
<view class="merchant-name"> <view class="merchant-name">
{{currentMerchant.name}} {{currentMerchant.name}}
</view> </view>
...@@ -43,7 +44,7 @@ ...@@ -43,7 +44,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="middle-bottom"> <view class="middle-bottom" :style="middleBottomStyle">
<!-- <scroll-view :style="{height:middleHeight+'px'}" :scroll-into-view="toViewLeft" scroll-y> --> <!-- <scroll-view :style="{height:middleHeight+'px'}" :scroll-into-view="toViewLeft" scroll-y> -->
<view class="middle-left"> <view class="middle-left">
<view :id="'merchant-tab'+index" class="merchant-tab" v-for="(item,index) in scenicList" :key="index" @click="merchantTabChange(index)" :class='{on:merchantIndex==index}'> <view :id="'merchant-tab'+index" class="merchant-tab" v-for="(item,index) in scenicList" :key="index" @click="merchantTabChange(index)" :class='{on:merchantIndex==index}'>
...@@ -51,7 +52,7 @@ ...@@ -51,7 +52,7 @@
</view> </view>
</view> </view>
<!-- </scroll-view> --> <!-- </scroll-view> -->
<scroll-view @scroll="scroll" :style="{height:middleHeight+'px'}" :scroll-into-view="toViewRight" scroll-y> <scroll-view @scroll="scrollRight" :style="{height:middleHeight+'px'}" :scroll-into-view="toViewRight" scroll-y>
<view class="middle-right"> <view class="middle-right">
<checkbox-group @change="checkboxChange" class="checkbox-box"> <checkbox-group @change="checkboxChange" class="checkbox-box">
<view class="merchantlist-wrap" :id="'merchant'+index" v-for="(item, index) in scenicList" :key="index"> <view class="merchantlist-wrap" :id="'merchant'+index" v-for="(item, index) in scenicList" :key="index">
...@@ -153,6 +154,7 @@ ...@@ -153,6 +154,7 @@
<text class="bottom-btn" @click="goFillorder()">去预定</text> <text class="bottom-btn" @click="goFillorder()">去预定</text>
</view> </view>
</view> </view>
</scroll-view>
<!-- 客服组件 --> <!-- 客服组件 -->
<customer :scenicList="scenicList" ref="customer"></customer> <customer :scenicList="scenicList" ref="customer"></customer>
<!-- 购买须知 --> <!-- 购买须知 -->
...@@ -213,12 +215,14 @@ export default { ...@@ -213,12 +215,14 @@ export default {
showModal: false, //是否显示模态框 showModal: false, //是否显示模态框
chooseMerchantProduct: '', //不支持多产品购买时,选中的景区产品 chooseMerchantProduct: '', //不支持多产品购买时,选中的景区产品
merchantIndex:0,//选中的商家下标 merchantIndex:0,//选中的商家下标
middleHeight:0,//中间列表盒子高度 middleHeight:3000,//中间列表盒子高度
heightArr:[],//元素高度数组 heightArr:[],//元素高度数组
toViewRight:'',//右边滚动到某个元素 toViewRight:'',//右边滚动到某个元素
toViewLeft:'',//左边滚动到某个元素 toViewLeft:'',//左边滚动到某个元素
showBusiness:false,//用于是否显示营业中 showBusiness:false,//用于是否显示营业中
showPauseBusiness:false,//用于显示暂停营业 showPauseBusiness:false,//用于显示暂停营业
middleInfoStyle:'',//中间盒子上部分样式
middleBottomStyle:'',//中间盒子下部分样式
} }
}, },
watch: { watch: {
...@@ -423,13 +427,13 @@ export default { ...@@ -423,13 +427,13 @@ export default {
complete:(info)=> { complete:(info)=> {
let windowHeight=info.windowHeight||753 let windowHeight=info.windowHeight||753
//获取元素都用 uni.createSelectorQuery(),不要用变量代替,不然会循环。 //获取元素都用 uni.createSelectorQuery(),不要用变量代替,不然会循环。
uni.createSelectorQuery().in(this).select('.banner').boundingClientRect(data => { // uni.createSelectorQuery().in(this).select('.banner').boundingClientRect(data => {
//获取中间盒子的高度 // //获取中间盒子的高度
if(data){ // if(data){
bannerHeight=data.height // bannerHeight=data.height
this.middleHeight=windowHeight-bannerHeight // this.middleHeight=windowHeight-bannerHeight
} // }
}).exec() // }).exec()
//不要这样 多个的时候就会循环 varquery = uni.createSelectorQuery() //不要这样 多个的时候就会循环 varquery = uni.createSelectorQuery()
for(let i=0;i<this.scenicList.length;i++){ for(let i=0;i<this.scenicList.length;i++){
uni.createSelectorQuery().in(this).select(`#merchant${i}`).boundingClientRect(data => { uni.createSelectorQuery().in(this).select(`#merchant${i}`).boundingClientRect(data => {
...@@ -513,10 +517,38 @@ export default { ...@@ -513,10 +517,38 @@ export default {
showDetail() { showDetail() {
this.$refs.detail.showPop = true this.$refs.detail.showPop = true
}, },
//---全屏滚动
scrollFull(e){
setTimeout(()=>{
let height=0
uni.createSelectorQuery().in(this).select('.banner').boundingClientRect(data => {
if(data){
//20=中间盒子top:-20的值
height=data.height-20
if(e.detail.scrollTop>height){
this.middleInfoStyle='top:0;position:fixed;'
this.middleBottomStyle='margin-top:240rpx'
this.middleHeight=600
}else{
this.middleInfoStyle='position:relative;'
this.middleBottomStyle='margin-top:0'
this.middleHeight=3000
}
}
}).exec()
},5)
},
//---右边滚动事件 //---右边滚动事件
scroll(e) { scrollRight(e) {
setTimeout(()=>{ setTimeout(()=>{
let scrollTop=e.detail.scrollTop let scrollTop=e.detail.scrollTop
if(scrollTop==0){
//当滑到顶部时,上面固定元素还原
this.middleInfoStyle='position:relative;'
this.middleBottomStyle='margin-top:0'
this.middleHeight=3000
}
//通过滚动值获取下标 //通过滚动值获取下标
this.heightArr.forEach((item,i)=>{ this.heightArr.forEach((item,i)=>{
if(i==0){ if(i==0){
...@@ -531,7 +563,7 @@ export default { ...@@ -531,7 +563,7 @@ export default {
} }
} }
}) })
},100) },5)
}, },
//---导航 //---导航
navigation(merchant){ navigation(merchant){
...@@ -714,13 +746,16 @@ export default { ...@@ -714,13 +746,16 @@ export default {
.middle { .middle {
padding-bottom: 100rpx; padding-bottom: 100rpx;
position: relative; position: relative;
top: -80rpx; top: -20px;
} }
// 中间上部分 // 中间上部分
.merchant-info{ .merchant-info{
width: 100%;
background: #ffffff; background: #ffffff;
border-radius: 24rpx 24rpx 0 0; border-radius: 24rpx 24rpx 0 0;
padding: 12rpx 20rpx 20rpx 20rpx; padding: 12rpx 20rpx 20rpx 20rpx;
z-index: 1;
transition: 0.6s;
} }
.merchant-name{ .merchant-name{
font-size: 36rpx; font-size: 36rpx;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment