Authored by 沈志敏

Merge branch 'develop' of git.yoho.cn:fe/yohoblk-wap into develop

... ... @@ -13,13 +13,26 @@
-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 */
.app::-webkit-scrollbar {
display: none;
}
/* stylelint-enable */
a {
outline: none;
... ...
... ... @@ -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();
}
... ...
... ... @@ -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>
... ...
<template>
<div v-if="shopInfo.isBlkShop" class="brand-top-box" v-lazy:background-image="shopInfo.shopBg | resize 750 478">
<div v-if="shopInfo.isBlkShop" class="brand-top-box" v-bind:style="{ background: 'url(' + shopInfo.shopBg + ')' }">
<div class="brand-bottom">
<img v-if="shopInfo.shopLogo" v-lazy="shopInfo.shopLogo.split('?')[0] + '?imageMogr2/thumbnail/{width}x{height}' | resize 120 80" alt="{{ shopInfo.shopName }}">
<img v-if="shopInfo.shopLogo" :src="shopInfo.shopLogo.split('?')[0] + '?imageMogr2/thumbnail/{width}x{height}' | resize 120 80" alt="{{ shopInfo.shopName }}">
<div v-else class="brand-title">{{ shopInfo.shopName }}</div>
<hr>
<div v-show="showMore" transition="brand-intro" :class="{ 'brand-short': !showMore }">{{ shopInfo.shopIntro }}</div>
... ...
<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()">&#xe60d;</span>
<span v-if="shareData.isBlkShop" v-show="!shareData.isFav" class="icon" @click="collectShop()">&#xe60c;</span>
<span v-if="shareData.isBlkShop" class="icon" @click="goShare()">&#xe60e;</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.scrollTop;
let topHeight = $('.brand-top-box').offset().top;
if (topHeight > 100) {
if (topHeight < -200) {
topChange = false;
}
... ... @@ -98,7 +99,7 @@
this.domain = this.shareData.domain;
if (this.shareData.isBlkShop) {
window.onscroll = this.changeTopStatus;
$('body').on('scroll', this.changeTopStatus);
}
}
};
... ...