Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohoblk-wap
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郭成尧
9 years ago
Commit
a0d534fb53ddadca113ff3f82ab12c01dc93cfcf
1 parent
fdf93f01
'scrollBar临时解决方案'
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
20 deletions
public/scss/common/_common.css
public/vue/me/home.vue
public/vue/product/detail/top-nav.vue
public/vue/product/shop/top-bar.vue
public/scss/common/_common.css
View file @
a0d534f
...
...
@@ -13,12 +13,19 @@
-webkit-tap-highlight-color
:
rgba
(
0
,
0
,
0
,
0
);
}
html
,
body
{
html
{
height
:
100%
;
width
:
100%
;
font-size
:
24px
;
font-family
:
"PingFang SC"
,
Helvetica
,
Roboto
,
"Heiti SC"
,
"黑体"
,
Arial
;
line-height
:
1.4
;
overflow
:
hidden
;
body
{
width
:
100%
;
height
:
100%
;
overflow-y
:
scroll
;
font-size
:
24px
;
font-family
:
"PingFang SC"
,
Helvetica
,
Roboto
,
"Heiti SC"
,
"黑体"
,
Arial
;
line-height
:
1.4
;
}
}
/* stylelint-disable */
...
...
public/vue/me/home.vue
View file @
a0d534f
...
...
@@ -140,14 +140,16 @@
let ghost2 = false;
let ghost3 = false;
if (window.scrollY > 40) {
let myHeaderTop = $('.my-header').offset().top;
if (myHeaderTop < -40) {
ghost = false;
ghost2 = false;
ghost3 = false;
} else if (
window.scrollY >
25) {
} else if (
myHeaderTop < -
25) {
ghost = false;
ghost3 = true;
} else if (
window.scrollY >
10) {
} else if (
myHeaderTop < -
10) {
ghost = false;
ghost2 = true;
}
...
...
@@ -165,15 +167,17 @@
return false;
});
window.addEventListener('touchmove', () => {
let body = $('body');
body.on('touchmove', () => {
this.toggle();
});
window.addEventListener
('scroll', () => {
body.on
('scroll', () => {
this.toggle();
});
document.addEventListener
('visibilitychange', () => {
body.on
('visibilitychange', () => {
if (!document.hidden) {
this.reload();
}
...
...
public/vue/product/detail/top-nav.vue
View file @
a0d534f
...
...
@@ -19,6 +19,7 @@
<script>
const yoho = require('yoho');
const cheader = require('component/header.vue');
const $ = require('jquery');
module.exports = {
data() {
...
...
@@ -45,15 +46,15 @@
},
created() {
window.onscroll =
() => {
$('body').on('scroll',
() => {
let transparent = true;
if (
window.scrollY > 20
) {
if (
$('.image-carousel').offset().top < -20
) {
transparent = false;
}
this.$refs.header.$el.classList.toggle('ghost', transparent);
}
}
);
}
};
</script>
...
...
public/vue/product/shop/top-bar.vue
View file @
a0d534f
<template>
<cheader :title="title" :class="{ghost: shareData.isBlkShop}" :fixed="shareData.isBlkShop" v-ref:header>
<template slot="right">
<template slot="right"
v-on:scroll=""
>
<span v-if="shareData.isBlkShop" v-show="shareData.isFav" class="icon" @click="collectShop()"></span>
<span v-if="shareData.isBlkShop" v-show="!shareData.isFav" class="icon" @click="collectShop()"></span>
<span v-if="shareData.isBlkShop" class="icon" @click="goShare()"></span>
...
...
@@ -53,10 +53,11 @@
// 删除两个多余的参数,两个参数是收藏时使用的
delete this.shareData.shopId;
delete this.shareData.isFav;
yoho.goShare(this.shareData
, function() {}, function() {}
);
yoho.goShare(this.shareData);
},
goBack() {
yoho.goBack(
{}, function() {}, function() {}
);
yoho.goBack();
},
/* 收藏或者取消收藏店铺 */
...
...
@@ -85,9 +86,9 @@
},
changeTopStatus() {
let topChange = true;
let topHeight =
document.body.scrollT
op;
let topHeight =
$('.brand-top-box').offset().t
op;
if (topHeight
> 1
00) {
if (topHeight
< -2
00) {
topChange = false;
}
...
...
@@ -98,7 +99,7 @@
this.domain = this.shareData.domain;
if (this.shareData.isBlkShop) {
window.onscroll = this.changeTopStatus
;
$('body').on('scroll', this.changeTopStatus)
;
}
}
};
...
...
Please
register
or
login
to post a comment