Authored by 陈峰

header

<div class="about-us">
<div id="header">
{{#unless isYohoBuy}}
<div class="blk-header-wrap" class="is-fixed">
<div class="blk-header">
<div class="blk-header-left">
... ... @@ -13,6 +14,7 @@
</div>
<div class="blk-header-gap"></div>
</div>
{{/unless}}
</div>
<div class="icon-container">
<span class="blk-start-icon"></span>
... ...
<div class="yoho-suggest-sub-page yoho-page">
<div id="header">
{{#unless isYohoBuy}}
<div class="blk-header-wrap" class="is-fixed">
<div class="blk-header">
<div class="blk-header-left">
... ... @@ -13,6 +14,7 @@
</div>
<div class="blk-header-gap"></div>
</div>
{{/unless}}
</div>
<div class="suggest-sub-form">
<textarea name="" id="suggest-textarea" placeholder="请写下对于BLK的意见和建议,我们将及时根据您的意见作出改进"></textarea>
... ...
<div class="help">
<div id="header">
{{#unless isYohoBuy}}
<div class="blk-header-wrap" class="is-fixed">
<div class="blk-header">
<div class="blk-header-left">
... ... @@ -13,6 +14,7 @@
</div>
<div class="blk-header-gap"></div>
</div>
{{/unless}}
</div>
<ul>
{{# helpList}}
... ...
<div id="header">
{{#unless isYohoBuy}}
<div class="blk-header-wrap" class="is-fixed">
<div class="blk-header">
<div class="blk-header-left">
... ... @@ -12,6 +13,7 @@
</div>
<div class="blk-header-gap"></div>
</div>
{{/unless}}
</div>
{{#if helpDetail_1}}
{{> helpDetail_1}}
... ...
<div class="vip-privilege-page yoho-page">
{{#unless isYohoBuy}}
<div class="blk-header-wrap">
<div class="blk-header">
<div class="blk-header-left">
... ... @@ -8,6 +9,7 @@
<span class="blk-header-title">VIP特权</span>
</div>
</div>
{{/unless}}
<ul class="privilege-list">
{{#each privilege}}
<li>
... ...
<div class="provisions">
<div id="header">
{{#unless isYohoBuy}}
<div class="blk-header-wrap" class="is-fixed">
<div class="blk-header">
<div class="blk-header-left">
... ... @@ -13,6 +14,7 @@
</div>
<div class="blk-header-gap"></div>
</div>
{{/unless}}
</div>
<section class="detail">
<p>欢迎访问BLK APP!我们以本隐私申明声明对访问者隐私保护的许诺。</p>
... ...
... ... @@ -40,6 +40,7 @@ exports.index = (req, res, next) => {
/* 查询 产品列表 method:GET */
exports.fetchProducts = (req, res, next) => {
const params = req.query;
searchModel.products(params)
.then(result => res.json(result))
... ...
... ... @@ -17,7 +17,9 @@ module.exports = {
module: 'product',
page: 'shop',
domain: req.params.domain,
shopId: req.query.id
shopId: req.query.id,
title: req.params.domain,
noYohoTitle: true
});
},
... ...
<div id="ssr" style="position: absolute; top: 0; width: 100%;">
<div id="ssr" class="product-list {{#if isYohoBuy}}no-header{{/if}}" style="position: absolute; top: 0; width: 100%;">
{{#unless isYohoBuy}}
<div class="blk-header-wrap" class="is-fixed">
<div class="blk-header">
<div class="blk-header-left">
... ... @@ -12,6 +13,7 @@
</div>
<div class="blk-header-gap"></div>
</div>
{{/unless}}
<div class="top-filter clearfix">
<div class="filter-content">
<ul class="filter-type">
... ...
... ... @@ -38,9 +38,10 @@ module.exports = () => {
// 判断请求是否来自app
let userAgent = req.get('User-Agent');
yoho.isApp = /yh_blk/i.test(req.get('User-Agent'));
yoho.isApp = /yh_blk/i.test(req.get('User-Agent')) || /YH_BLK/i.test(req.get('User-Agent'));
yoho.isiOS = /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(userAgent);
yoho.isAndroid = /Android/i.test(userAgent);
yoho.isYohoBuy = /YohoBuy/i.test(userAgent);
Object.assign(res.locals, yoho);
Object.assign(req.yoho, yoho);
... ...
... ... @@ -11,6 +11,12 @@ module.exports = () => {
delete req.cookies._YOHOUID;
}
delete req.query.app_version;
delete req.query.client_secret;
delete req.query.client_type;
delete req.query.session_key;
delete req.query.udid;
next();
};
};
... ...
... ... @@ -17,13 +17,12 @@ const nullFun = () => {};
/* 提示信息 */
const tipInfo = '暂不支持,请在BLK应用中打开';
const yoho = {
/**
* 判断是否是 APP
*/
isApp: /yh_blk/i.test(navigator.userAgent || '') || /YH_BLK/i.test(navigator.userAgent || ''),
isiOS: true,///\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(navigator.userAgent || ''),
isiOS: /\(i[^;]+;( U;)? CPU.+Mac OS X/i.test(navigator.userAgent || ''),
isAndroid: /Android/i.test(navigator.userAgent || ''),
isYohoBuy: /YohoBuy/i.test(navigator.userAgent || ''),
... ...
<template>
<div class="cate-page" id='cate-page'>
<header-box title="全部品类" ref="header"></header-box>
<header-box title="全部品类" ref="header" v-if="!hideHeader"></header-box>
<div class="cate-container clearfix">
<div class="content">
<ul class="primary-level">
... ... @@ -256,7 +256,8 @@
default() {
return [];
}
}
},
hideHeader: Boolean
},
data() {
return {
... ... @@ -289,6 +290,11 @@
return cate.id.toString() === allSorts;
})
};
this.cateNavRightData.forEach(right => {
right.checked = this.currentValue.some(cate => {
return cate.id.toString() === right.relation_parameter.sort;
});
});
},
/* 筛选列表使用返回值 */
... ...
<template>
<div class="blk-header-wrap" :class="[{'is-fixed': fixed}, className]">
<div class="blk-header-wrap" v-if="showHeader" :class="[{'is-fixed': fixed}, className]">
<div class="blk-header">
<div class="blk-header-left">
<slot name="left">
... ... @@ -27,10 +27,30 @@
fixed: Boolean,
scrollFix: Boolean
},
data() {
return {
showHeader: true
};
},
methods: {
goBack() {
yoho.goBack({}, function() {}, function() {});
}
},
created() {
if (yoho.isYohoBuy) {
this.showHeader = false;
if (this.title) {
document.title = this.title;
}
}
},
watch: {
title(val) {
if (val) {
document.title = val;
}
}
}
};
</script>
... ...
... ... @@ -18,6 +18,7 @@
@select="selectItem"></normal-filter>
<sort-filter class="filter-sub-detail filter-sort"
v-if="subType === 'group_sort'"
:hide-header="true"
:value="currentValue"
:category="data"
@select="selectItem"></sort-filter>
... ...
... ... @@ -288,7 +288,7 @@ export default {
FilterItem,
FilterSub
},
created(){
created() {
let temp = [];
_.each(this.filter.group_sort, item => {
... ...
<template>
<div>
<div class="product-list" :class="{'no-header': noheader}">
<header-box :title="sortName" class="list-header"></header-box>
<filter-box :val="order" :filter="filterConfig" v-if="enableOrder"></filter-box>
<product-list :data="productList" :state="listState" class="list-items"></product-list>
... ... @@ -29,6 +29,7 @@
export default {
data: function() {
return {
noheader: false,
isApp: yoho.isApp,
isiOS: yoho.isiOS,
sortName: locationQuery.title || locationQuery.sort_name, // 优先使用 title
... ... @@ -156,6 +157,7 @@
created: function() {
const self = this;
this.noheader = yoho.isYohoBuy;
bus.$on('list.paging', function() {
self.search();
... ... @@ -198,4 +200,9 @@
background-color: #fff;
padding-top: 105px;
}
.product-list.no-header {
.top-filter {
top: 0;
}
}
</style>
... ...
<template>
<div>
<div class="product-new" :class="{'no-header': noheader}">
<header-box title="新品抢先看"></header-box>
<filter-box :val="order" :filter="filterConfig" v-if="enableOrder"></filter-box>
<product-list :data="productList" :state="listState" class="list-items"></product-list>
... ... @@ -29,6 +29,7 @@
export default {
data: function() {
return {
noheader: false,
isApp: yoho.isApp,
isiOS: yoho.isiOS,
sortName: locationQuery.sort_name,
... ... @@ -147,6 +148,8 @@
created: function() {
const self = this;
this.noheader = yoho.isYohoBuy;
bus.$on('list.paging', function() {
self.search();
});
... ... @@ -174,4 +177,9 @@
background-color: #fff;
padding-top: 105px;
}
.product-new.no-header {
.top-filter {
top: 0;
}
}
</style>
... ...
<template>
<div>
<div class="shop-box" :class="{'no-header': noheader}">
<top-bar :share-data="shareData" :show-top-bar="showTopBar"></top-bar>
<div :class='{"shop-goods-top": true}' class="list-items">
<product-list :data="productList" :state="listState"></product-list>
... ... @@ -8,6 +8,11 @@
</div>
</template>
<style>
.shop-box.no-header {
.top-filter {
top: 0;
}
}
#shop {
.empty-tip {
margin-top: 40px;
... ... @@ -39,6 +44,7 @@
export default {
data() {
return {
noheader: false,
shareData: {}, // 分享相关数据
shopInfo: {}, // 店铺介绍相关数据
sortConfig: {},
... ... @@ -58,7 +64,6 @@
inSearching: false,
enableOrder: false,
order: '',
fixIosTop: false
};
},
computed: {
... ... @@ -184,6 +189,8 @@
created() {
const self = this;
this.noheader = yoho.isYohoBuy;
this.getShopInfo();
this.search()
.then(()=>{
... ... @@ -212,10 +219,6 @@
self.filter = val;
self.$refs.filter.isVisible = false;
});
if(yoho.isiOS) {
this.fixIosTop = true;
}
}
};
... ...
... ... @@ -21,6 +21,7 @@
import tip from 'common/tip';
export default {
name: 'top-bar',
data() {
return {
isiOS: yoho.isiOS
... ...