| xqd
@@ -33,7 +33,7 @@
|
|
|
|
|
|
<u-tabs :list="list1" :activeStyle="{color: '#1E9F6A','font-weight': 'bold'}"
|
|
|
:inactiveStyle="{color: 'rgba(51, 51, 51, 0.5)'}" lineColor="#1E9F6A" lineWidth=50
|
|
|
- :scrollable="false" @click="check"></u-tabs>
|
|
|
+ :scrollable="false" @click="check" :current="active"></u-tabs>
|
|
|
|
|
|
</view>
|
|
|
</u-sticky>
|
| xqd
@@ -68,7 +68,7 @@
|
|
|
<u-parse :content="goodsInfo.instruction"></u-parse>
|
|
|
</view>
|
|
|
</view>
|
|
|
- <view class="" style="padding-top: 100rpx;width: 100%;"></view>
|
|
|
+ <!-- <view class="" style="padding-top: 100rpx;width: 100%;"></view> -->
|
|
|
|
|
|
<view class="navbar footer">
|
|
|
<view class="kefu flex">
|
| xqd
@@ -138,7 +138,7 @@
|
|
|
:key="index" lineWidth="48" lineHeight="4">
|
|
|
</u-tabs>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
<view class="item">
|
|
|
<view class="more" v-if="days.length==0">暂无房型</view>
|
|
|
<view :class="dayindex==index?'day-item-active':'day-item'" v-for="item,index in days"
|
| xqd
@@ -178,12 +178,12 @@
|
|
|
|
|
|
<!-- <scroll-view scroll-y="true" style="height: 90vh;" scroll-with-animation="true"> -->
|
|
|
<view class="model">
|
|
|
- <u-modal :show="isshow" title="报名前必看" showCancelButton @confirm="goadd" @cancel="cancel"
|
|
|
+ <u-modal :show="isshow" title="报名前必看" showCancelButton @confirm="goadd" @cancel="cancel"
|
|
|
confirmColor="#ffffff" style="margin-left: 0;padding-left: 22rpx;">
|
|
|
<view style="height: 560rpx;overflow: auto;">
|
|
|
<u-parse :content="content"></u-parse>
|
|
|
</view>
|
|
|
-
|
|
|
+
|
|
|
</u-modal>
|
|
|
</view>
|
|
|
<!-- </scroll-view> -->
|
| xqd
@@ -244,7 +244,14 @@
|
|
|
//
|
|
|
scrollTop: 0,
|
|
|
price: 0,
|
|
|
- picture:[]
|
|
|
+ picture: [],
|
|
|
+ active: 0,
|
|
|
+ tab1top:'',
|
|
|
+ tab2top:'',
|
|
|
+ tab3top:'',
|
|
|
+ tab4top:'',
|
|
|
+ tab4bottom:'',
|
|
|
+ cancelScroll:false,
|
|
|
}
|
|
|
|
|
|
},
|
| xqd
@@ -254,10 +261,12 @@
|
|
|
this.init(options.id)
|
|
|
}
|
|
|
let data = uni.getStorageSync("data")
|
|
|
- this.content=data[3].value
|
|
|
+ this.content = data[3].value
|
|
|
},
|
|
|
onShow() {
|
|
|
this.initvist()
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
computed: {
|
|
|
minprice() {
|
| xqd
@@ -271,6 +280,7 @@
|
|
|
onPageScroll(e) {
|
|
|
// console.log(e,"<==============距离顶部的距离")
|
|
|
this.scrollTop = e.scrollTop
|
|
|
+ this.handleScroll()
|
|
|
},
|
|
|
// #ifdef MP
|
|
|
onShareAppMessage(s = false) {
|
| xqd
@@ -283,24 +293,22 @@
|
|
|
},
|
|
|
// #endif
|
|
|
methods: {
|
|
|
- initvist(){
|
|
|
- let curPage = getCurrentPages();
|
|
|
- let route = curPage[curPage.length - 1].route; //获取当前页面的路由
|
|
|
- let code=uni.getStorageSync("code")
|
|
|
- let obj={
|
|
|
- page:route,
|
|
|
- code:code
|
|
|
- }
|
|
|
- if(code){
|
|
|
- uni.$u.http.post('/api/visit/add',obj,{
|
|
|
- custom: {
|
|
|
- auth: true
|
|
|
- }
|
|
|
- }).then((res) => {
|
|
|
- }).catch((err) => {
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
+ initvist() {
|
|
|
+ let curPage = getCurrentPages();
|
|
|
+ let route = curPage[curPage.length - 1].route; //获取当前页面的路由
|
|
|
+ let code = uni.getStorageSync("code")
|
|
|
+ let obj = {
|
|
|
+ page: route,
|
|
|
+ code: code
|
|
|
+ }
|
|
|
+ if (code) {
|
|
|
+ uni.$u.http.post('/api/visit/add', obj, {
|
|
|
+ custom: {
|
|
|
+ auth: true
|
|
|
+ }
|
|
|
+ }).then((res) => {}).catch((err) => {})
|
|
|
+ }
|
|
|
+ },
|
|
|
init(id) {
|
|
|
this.$showLoadding("加载中")
|
|
|
uni.$u.http.post('/api/good/show', {
|
| xqd
@@ -313,7 +321,7 @@
|
|
|
uni.hideLoading();
|
|
|
this.goodsInfo = res
|
|
|
this.tags = res.tags
|
|
|
- this.picture=JSON.parse(res.picture)
|
|
|
+ this.picture = JSON.parse(res.picture)
|
|
|
let newmonth = []
|
|
|
for (let key in res.plans) {
|
|
|
newmonth.push({
|
| xqd
@@ -331,18 +339,18 @@
|
|
|
if (this.dayindex >= 0) {
|
|
|
this.isshow = true
|
|
|
} else {
|
|
|
- if(this.days.length>0){
|
|
|
+ if (this.days.length > 0) {
|
|
|
uni.showModal({
|
|
|
title: "提示",
|
|
|
content: "请选择出发日期"
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
uni.showModal({
|
|
|
title: "提示",
|
|
|
content: "暂无房型"
|
|
|
})
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
return
|
|
|
}
|
|
|
},
|
| xqd
@@ -367,7 +375,7 @@
|
|
|
goodsInfo.name = this.goodsInfo.name
|
|
|
goodsInfo.id = this.goodsInfo.id
|
|
|
goodsInfo.subtitle = this.goodsInfo.subtitle
|
|
|
- goodsInfo.cohabit=this.goodsInfo.cohabit
|
|
|
+ goodsInfo.cohabit = this.goodsInfo.cohabit
|
|
|
// uni.navigateTo({
|
|
|
// url:`/pages/travel/travelPeople?days=${JSON.stringify(this.plans)}&goodsinfo=${JSON.stringify(goodsInfo)}`
|
|
|
// })
|
| xqd
@@ -415,6 +423,7 @@
|
|
|
duration: 200, //过渡时间
|
|
|
scrollTop: res.top + this.scrollTop - 50, //到达距离顶部的top值
|
|
|
})
|
|
|
+ console.log( res.top + this.scrollTop - 50,996555)
|
|
|
}).exec()
|
|
|
} else if (item.name == "费用") {
|
|
|
uni.createSelectorQuery().select(".charge").boundingClientRect(res => { //目标位置的节点:类或者id
|
| xqd
@@ -437,8 +446,59 @@
|
|
|
})
|
|
|
|
|
|
}
|
|
|
+ this.cancelScroll = true;
|
|
|
+ setTimeout(() =>{
|
|
|
+ this.cancelScroll = null;
|
|
|
+ },500);
|
|
|
|
|
|
},
|
|
|
+ handleScroll() {
|
|
|
+
|
|
|
+ if (this.cancelScroll) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ // this.$refs 获取的是节点 不是数组
|
|
|
+ uni.createSelectorQuery().select('.trips').boundingClientRect(data => { //目标位置的节点:类或者id
|
|
|
+ that.tab1top = data.top-50 //到达距离顶部的top值
|
|
|
+ }).exec();
|
|
|
+ uni.createSelectorQuery().select('.duction').boundingClientRect(data => { //目标位置的节点:类或者id
|
|
|
+ that.tab2top = data.top-50 //到达距离顶部的top值
|
|
|
+ }).exec();
|
|
|
+ uni.createSelectorQuery().select('.charge').boundingClientRect(data => { //目标位置的节点:类或者id
|
|
|
+ that.tab3top = data.top-50//到达距离顶部的top值
|
|
|
+ console.log(that.tab3top)
|
|
|
+ }).exec();
|
|
|
+ uni.createSelectorQuery().select('.notice').boundingClientRect(data => { //目标位置的节点:类或者id
|
|
|
+ that.tab4top = data.top-50 //到达距离顶部的top值
|
|
|
+ that.tab4bottom= data.bottom-50 //到达距离顶部的top值
|
|
|
+ }).exec();
|
|
|
+ // let tab2top = this.$refs['duction'][0].getBoundingClientRect().top;
|
|
|
+ // let tab3top = this.$refs['charge'][0].getBoundingClientRect().top;
|
|
|
+ // let tab4top = this.$refs['notice'][0].getBoundingClientRect().top;
|
|
|
+ // console.log(document.documentElement.scrollTop, '页面滚出');
|
|
|
+
|
|
|
+ // 86是怎么算的?也可以是0,小于0就是滚出去;(内容超出自己的高度,才会有滚动)
|
|
|
+ // 第一个tab的滚动的距离
|
|
|
+ if ( this.tab1top>0) {
|
|
|
+ this.active = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ // 第二个tab的滚动的距离
|
|
|
+ else if ( this.tab3top>0&&this.tab2top<0) {
|
|
|
+ this.active = 1;
|
|
|
+ }
|
|
|
+ // 第三个tab的滚动的距离
|
|
|
+ else if (this.tab3top<0&&this.tab2top<0&&this.tab4top>0) {
|
|
|
+ this.active = 2;
|
|
|
+ }
|
|
|
+
|
|
|
+ else if ( this.tab4top<0&&this.tab4bottom<0) {
|
|
|
+ this.active = 3;
|
|
|
+ }
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
// 生成海报
|
|
|
goposter() {
|
|
|
uni.navigateTo({
|
| xqd
@@ -459,16 +519,18 @@
|
|
|
page {
|
|
|
background-color: #f4f4f4;
|
|
|
}
|
|
|
- ._div{
|
|
|
+
|
|
|
+ ._div {
|
|
|
margin-left: 0 !important;
|
|
|
padding-left: 22rpx !important;
|
|
|
}
|
|
|
+
|
|
|
.txtgray {
|
|
|
color: #666666;
|
|
|
}
|
|
|
|
|
|
.model {
|
|
|
- height: 500rpx !important;
|
|
|
+ height: 50rpx !important;
|
|
|
}
|
|
|
|
|
|
.detailsPage {
|