|
@@ -44,7 +44,7 @@ export default {
|
|
navbaractive:1,
|
|
navbaractive:1,
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- props:['mbBodytop','reviewtop'],
|
|
|
|
|
|
+ props:['navid'],
|
|
components: {
|
|
components: {
|
|
HeaderMore,
|
|
HeaderMore,
|
|
TitleHeader
|
|
TitleHeader
|
|
@@ -59,15 +59,10 @@ export default {
|
|
share_info: function () {
|
|
share_info: function () {
|
|
return this.detailInfo?{ title: this.detailInfo.goods_name, link: this.currentUrl, imgUrl: this.detailInfo.photos[0], desc: this.detailInfo.goods_advword }:false
|
|
return this.detailInfo?{ title: this.detailInfo.goods_name, link: this.currentUrl, imgUrl: this.detailInfo.photos[0], desc: this.detailInfo.goods_advword }:false
|
|
},
|
|
},
|
|
- listenChange(){
|
|
|
|
- let mbBodytop = this.mbBodytop
|
|
|
|
- let reviewtop = this.reviewtop
|
|
|
|
- return { mbBodytop, reviewtop}
|
|
|
|
- }
|
|
|
|
},
|
|
},
|
|
mounted () {
|
|
mounted () {
|
|
// #ifdef MP-WEIXIN
|
|
// #ifdef MP-WEIXIN
|
|
- this.navHeight = uni.getMenuButtonBoundingClientRect().top
|
|
|
|
|
|
+ this.navHeight = uni.getMenuButtonBoundingClientRect().height
|
|
// #endif
|
|
// #endif
|
|
var pages = getCurrentPages()
|
|
var pages = getCurrentPages()
|
|
var page = pages[pages.length - 1]
|
|
var page = pages[pages.length - 1]
|
|
@@ -101,26 +96,26 @@ export default {
|
|
this.changeIndex(index)
|
|
this.changeIndex(index)
|
|
},
|
|
},
|
|
goanchor(id){
|
|
goanchor(id){
|
|
- document.querySelector(id).scrollIntoView({
|
|
|
|
- behavior:"smooth"
|
|
|
|
- });
|
|
|
|
|
|
+ if(id == '#goods-swipe'){
|
|
|
|
+ this.navbaractive = 1
|
|
|
|
+ }else if(id == '#review'){
|
|
|
|
+ this.navbaractive = 2
|
|
|
|
+ }else if(id == '#mbBody'){
|
|
|
|
+ this.navbaractive = 3
|
|
|
|
+ }
|
|
|
|
+ this.$emit('setnav',id);
|
|
},
|
|
},
|
|
goBack () {
|
|
goBack () {
|
|
uni.navigateBack({delta:1})
|
|
uni.navigateBack({delta:1})
|
|
}
|
|
}
|
|
},
|
|
},
|
|
watch:{
|
|
watch:{
|
|
- listenChange(val){
|
|
|
|
- val.mbBodytop = val.mbBodytop - 100
|
|
|
|
- val.reviewtop = val.reviewtop - 100
|
|
|
|
- if(val.mbBodytop > 0 && val.reviewtop >0){
|
|
|
|
- this.navbaractive = 1
|
|
|
|
- }else if(val.reviewtop < 0 && val.mbBodytop > 0){
|
|
|
|
- this.navbaractive = 2
|
|
|
|
- }else if(val.reviewtop < 0 && val.mbBodytop < 0){
|
|
|
|
- this.navbaractive = 3
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ navid: {
|
|
|
|
+ handler (newName, oldName) {
|
|
|
|
+ this.navbaractive = newName
|
|
|
|
+ },
|
|
|
|
+ immediate: true
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|