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
陈峰
7 years ago
Commit
4a34316e293cd6b37a7225cda1be8c799a881ac7
1 parent
35c8076e
yas
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
361 additions
and
230 deletions
config/common.js
public/js/yoho.js
public/vue/component/product/filter/index.vue
src/components/links/a-link.vue
src/components/links/product-link.vue
src/components/resources/resource-category.vue
src/components/resources/resource-focus-image.vue
src/components/resources/resource-goods.vue
src/components/resources/resource-new-product-list.vue
src/components/resources/resource-product-list.vue
src/components/resources/resource-single-image.vue
src/components/resources/resource-tfgoods-list.vue
src/components/resources/resource-two-image.vue
src/entry-client.js
src/pages/channel/about/about.vue
src/pages/channel/channel-home/channel-home.vue
src/pages/channel/home/components/home-slider.vue
src/pages/channel/home/home.vue
src/store/yoho/index.js
src/store/yoho/types.js
config/common.js
View file @
4a34316
...
...
@@ -80,7 +80,7 @@ module.exports = {
port
:
'4444'
// influxdb port
},
console
:
{
level
:
'
info
'
,
level
:
'
debug
'
,
colorize
:
'all'
,
prettyPrint
:
true
}
...
...
public/js/yoho.js
View file @
4a34316
...
...
@@ -27,6 +27,14 @@ if (isYohoBuy && !$appLink) {
$appLink
.
className
=
'no-intercept'
;
body
.
appendChild
(
$appLink
);
setTimeout
(()
=>
{
if
(
window
.
newBlk
)
{
// 如果是新版blk框架屏蔽页面跳转时走yas上报,统一走新版框架上报
$appLink
.
onclick
=
(
evt
)
=>
{
evt
.
stopPropagation
();
};
}
},
0
);
}
/* 提示信息 */
...
...
public/vue/component/product/filter/index.vue
View file @
4a34316
...
...
@@ -262,6 +262,16 @@ export default {
if (history.replaceState) {
history.replaceState({}, '', location.pathname + '?'+ query);
}
if (filter.gender) {
if (window._yas && window._yas.sendAppLogs) {
window._yas.sendAppLogs({
appop: 'YB_BLK_LIST_GENDER_C',
param: JSON.stringify({
gender: filter.gender
})
}, true);
}
}
bus.$emit('fold.choice.except');
bus.$emit('filter.change', {
...
...
src/components/links/a-link.vue
View file @
4a34316
<template>
<v-touch tag="a" @tap="click">
<v-touch tag="
span" class="link-
a" @tap="click">
<slot></slot>
</v-touch>
</template>
<script>
import parse from 'yoho-qs/parse';
import {REPORT_YAS} from 'store/yoho/types';
import parse from 'yoho-qs/parse';
export default {
name: 'ALink',
props: {
href: [String],
to: String,
yas: Object,
yasF: Number,
yasI: Number
},
methods: {
click() {
if (this.href) {
let url = this.href;
const classList = this.$el.classList;
const excluded = classList.contains('no-intercept');
if (excluded) {
location.href = this.href;
return;
}
if (/^\/\//.test(url)) {
url = 'https:' + url;
}
const routeUrl = url.replace(location.origin, '');
const route = this.$router.resolve(routeUrl).route;
export default {
name: 'ALink',
props: {
href: [String],
to: String
if (route.matched.length) {
this.reportYas(`${location.origin}${routeUrl}`);
this.$router.push(routeUrl);
} else {
this.reportYas(url);
this.dispatch(url);
}
} else if (this.to) {
this.reportYas(`${location.origin}${this.to}`);
this.$router.push(this.to);
}
},
methods: {
click() {
if (this.href) {
let url = this.href;
const classList = this.$el.classList;
const excluded = classList.contains('no-intercept');
if (excluded) {
location.href = this.href;
return;
reportYas(url) {
const param = {
F_URL: url,
PAGE_URL: `${location.origin}${this.$route.fullPath}`,
PAGE_NAME: this.$route.name
};
if (this.yas) {
param.F_ID = this.yas.template_id;
param.F_NM = this.yas.template_name;
param.F_INDEX = (this.yasF || 0) + 1;
param.I_INDEX = (this.yasI || 0) + 1;
}
this.$store.dispatch(REPORT_YAS, {
params: {
appop: 'YB_H5_PAGE_FLR_C',
param
}
});
},
dispatch(url) {
const origin = location.origin;
const defaultTitleMap = {
1: {
headerid: '1',
left: {
action: ''
},
title: {
des: '',
action: ''
}
if (/^\/\//.test(url)) {
url = 'https:' + url;
},
2: {
headerid: '2',
left: {
action: ''
},
title: {
des: '',
action: ''
},
right: {
icon: 'chat',
action: 'goToService'
}
const routeUrl = url.replace(location.origin, '');
const route = this.$router.resolve(routeUrl).route;
if (route.matched.length) {
this.$router.push(routeUrl);
} else {
this.dispatch(url);
},
3: {
headerid: '3',
left: {
action: ''
},
title: {
des: '',
action: ''
},
right: {
des: '提交',
action: 'test'
}
} else if (this.to) {
this.$router.push(this.to);
}
},
dispatch(url) {
const origin = location.origin;
const defaultTitleMap = {
1: {
headerid: '1',
left: {
action: ''
},
title: {
des: '',
action: ''
}
},
4: {
headerid: '4',
ltitle: {
des: '品牌',
action: origin + '/brands'
},
2: {
headerid: '2',
left: {
action: ''
},
title: {
des: '',
action: ''
},
right: {
icon: 'chat',
action: 'goToService'
}
rtitle: {
des: '品类',
action: origin + '/cate'
}
},
5: {
headerid: '5',
left: {
action: ''
},
3: {
headerid: '3',
left: {
action: ''
},
title: {
des: '',
action: ''
},
right: {
des: '提交',
action: 'test'
}
ltitle: {
des: '商品',
action: origin + '/me/collection'
},
4: {
headerid: '4',
ltitle: {
des: '品牌',
action: origin + '/brands'
},
rtitle: {
des: '品类',
action: origin + '/cate'
}
// mtitle: {
// des: '品牌',
// action: origin + '/me/collection?tab=brand'
// },
rtitle: {
des: '资讯',
action: origin + '/me/collection?tab=article'
},
5: {
headerid: '5',
left: {
action: ''
},
ltitle: {
des: '商品',
action: origin + '/me/collection'
},
// mtitle: {
// des: '品牌',
// action: origin + '/me/collection?tab=brand'
// },
rtitle: {
des: '资讯',
action: origin + '/me/collection?tab=article'
},
right: {
des: '编辑',
action: 'editModel'
},
defaultSelectedIndex: '0'
right: {
des: '编辑',
action: 'editModel'
},
6: {
headerid: '6',
title: {
des: '资讯',
action: ''
}
defaultSelectedIndex: '0'
},
6: {
headerid: '6',
title: {
des: '资讯',
action: ''
}
};
}
};
if (this.$yoho.isApp || this.$yoho.isYohoBuy) {
let titleMap ={...defaultTitleMap};
let [path, qs] = url.split('?');
if (this.$yoho.isApp || this.$yoho.isYohoBuy) {
let titleMap = {...defaultTitleMap};
let [path, qs] = url.split('?');
qs = parse(qs);
qs = parse(qs);
// 个人中心收藏
if (/\/me\/collection$/.test(path)) {
let header = titleMap[5];
// 个人中心收藏
if (/\/me\/collection$/.test(path)) {
let header = titleMap[5];
if (qs.tab === 'article') {
header.defaultSelectedIndex = '1';
} else {
header.defaultSelectedIndex = '0';
}
return this.$yoho.goPageView({
header: header
});
}
// 个人中心首页
if (/\/me$/.test(path)) {
return this.$yoho.goTab({
index: 4
});
if (qs.tab === 'article') {
header.defaultSelectedIndex = '1';
} else {
header.defaultSelectedIndex = '0';
}
return this.$yoho.goPageView({
header: header
});
}
// 资讯
if (/\/editorial\/list$/.test(path)) {
return this.$yoho.goTab({
index: 2
});
}
// 个人中心首页
if (/\/me$/.test(path)) {
return this.$yoho.goTab({
index: 4
});
}
// 品类
if (/\/cate$/.test(path)) {
return this.$yoho.goTab({
index: 1,
headerIndex: 1
});
}
// 资讯
if (/\/editorial\/list$/.test(path)) {
return this.$yoho.goTab({
index: 2
});
}
// 首页
if (/\/$/.test(path) || !path) {
return this.$yoho.goTab({
index: 0,
url: /^(https?:)?\/\//i.test(url) ? url : origin + url
});
}
// 品类
if (/\/cate$/.test(path)) {
return this.$yoho.goTab({
index: 1,
headerIndex: 1
});
}
const args = {
// 首页
if (/\/$/.test(path) || !path) {
return this.$yoho.goTab({
index: 0,
url: /^(https?:)?\/\//i.test(url) ? url : origin + url
};
});
}
if (/\/me\/service$/.test(path)) {
args.showLoading = 'no';
}
const args = {
url: /^(https?:)?\/\//i.test(url) ? url : origin + url
};
// 处理 feature.yoho.cn 等域名下的站外链接
if (/^(https?:)?\/\//i.test(path) && !/m\.yohoblk\.com/.test(path)) {
args.showLoading = 'no';
}
args.header = {
headerid: '-1'
};
this.$yoho.goNewPage(args);
} else {
location.href = url;
if (/\/me\/service$/.test(path)) {
args.showLoading = 'no';
}
// 处理 feature.yoho.cn 等域名下的站外链接
if (/^(https?:)?\/\//i.test(path) && !/m\.yohoblk\.com/.test(path)) {
args.showLoading = 'no';
}
args.header = {
headerid: '-1'
};
this.$yoho.goNewPage(args);
} else {
location.href = url;
}
}
};
}
};
</script>
<style>
...
...
src/components/links/product-link.vue
View file @
4a34316
<template>
<a-link :href="href">
<a-link :href="href"
:yas="yas" :yas-f="yasF" :yas-i="yasI"
>
<slot></slot>
</a-link>
</template>
...
...
@@ -14,7 +14,10 @@ export default {
};
},
props: {
value: [Object]
value: [Object],
yas: Object,
yasF: Number,
yasI: Number
},
computed: {
...mapState(['yoho'])
...
...
@@ -27,8 +30,8 @@ export default {
methods: {
getLink(product) {
let {product_skn} = product;
let href = `/product/pro_${product_skn}.html`;
if (this.yoho.env.isYohoBuy) {
let goParams = {
action: 'go.productDetail',
...
...
@@ -50,7 +53,7 @@ export default {
}
}
}
}
}
;
</script>
<style>
...
...
src/components/resources/resource-category.vue
View file @
4a34316
<template>
<div class="resource-category">
<a-link class="cate-label" :href="brandLink">品牌<i class="icon icon-right"></i></a-link>
<div v-for="(item, index) in sort" v-if="item.sub">
<a-link class="cate-label" :href="brandLink" :yas="value" :yas-f="index">品牌<i class="icon icon-right"></i></a-link>
<div v-for="(item, index) in sort" v-if="item.sub" :key="index">
<p class="cate-label" @click="toggle(index)">{{item.category_name
}}<i class="icon" :class="sortClass[index]"></i></p>
<div class="cate-items" v-if="show[index]">
<a-link class="cate-item"
:href="`/product/list?sort=${getAllSortId(index)}&sort_name=全部${item.category_name}&gender=${genderCvt}`">
:href="`/product/list?sort=${getAllSortId(index)}&sort_name=全部${item.category_name}&gender=${genderCvt}`"
:yas="value"
:yas-f="index">
{{`全部${item.category_name}`}}</a-link>
<a-link
:href="`/product/list?sort=${sub.relation_parameter.sort}&sort_name=${sub.category_name}&gender=${genderCvt}`"
class="cate-item" v-for="sub in item.sub" :key="sub.category_id">{{sub.category_name}}
class="cate-item"
v-for="sub in item.sub"
:key="sub.category_id"
:yas="value"
:yas-f="index">{{sub.category_name}}
</a-link>
</div>
</div>
...
...
@@ -18,19 +24,19 @@
</template>
<script>
import _ from 'lodash/core';
import Resource from './resource';
export default {
name: 'ResourceCategory',
props: {
value: Object
value: Object,
index: Number
},
data() {
return {
show: [],
sortClass: []
}
}
;
},
computed: {
brandLink() {
...
...
@@ -40,10 +46,10 @@ export default {
return { men: '1,3', women: '2,3' }[this.gender];
},
gender() {
return this.value.gender;
return this.value.
data.
gender;
},
sort() {
return this.value.sort;
return this.value.
data.
sort;
}
},
methods: {
...
...
@@ -55,7 +61,7 @@ export default {
});
},
getAllSortId(idx) {
return this.value.sort[idx].sub.map(sort=>sort.relation_parameter.sort).join(',') + ',';
return this.value.
data.
sort[idx].sub.map(sort=>sort.relation_parameter.sort).join(',') + ',';
}
},
created() {
...
...
src/components/resources/resource-focus-image.vue
View file @
4a34316
...
...
@@ -3,7 +3,7 @@
<awesome-swiper name="mySwiper" :options="swiperOption" class="swipe">
<div class="swiper-wrapper" @click="activeLink">
<div class="swiper-slide"
v-for="focus in value"
v-for="focus in value
.data
"
:key="focus.src"
:style="{backgroundColor: focus.bgColor}">
<img-format :src="focus.src" :w="750" :h="480"></img-format>
...
...
@@ -11,7 +11,7 @@
</div>
<div class="swiper-pagination"></div>
</awesome-swiper>
<a-link ref="linkA" :href="activeHref"></a-link>
<a-link ref="linkA" :href="activeHref"
:yas="value" :yas-f="index" :yas-i="imageIndex"
></a-link>
</div>
</template>
...
...
@@ -21,7 +21,8 @@
export default {
name: 'ResourceFocusImage',
props: {
value: Array
value: Object,
index: Number
},
data() {
return {
...
...
@@ -35,9 +36,14 @@
}
};
},
computed: {
imageIndex() {
return this.mySwiper ? this.mySwiper.realIndex : 0;
}
},
methods: {
activeLink() {
const img = this.value[this.mySwiper.realIndex];
const img = this.value
.data
[this.mySwiper.realIndex];
if (img) {
this.activeHref = img.url;
...
...
src/components/resources/resource-goods.vue
View file @
4a34316
<template>
<resource class="no-padding-right">
<ul class="resource-goods">
<li class="product-item" v-for="(item, index) in value" :key="index">
<product-link :value="item" class="link"></product-link>
<li class="product-item" v-for="(item, pi) in value.data" :key="pi">
<product-link :value="item" class="link" :yas="value" :yas-f="index" :yas-i="pi"></product-link>
<img-format :lazy="lazy" :src="item.src" :w="94" :h="125"></img-format>
<div class="ellipsis">
<p class="title">{{item.product_name}}</p>
...
...
@@ -20,7 +20,8 @@ export default {
name: 'ResourceGoods',
props: {
value: Array,
lazy: Boolean
lazy: Boolean,
index: Number
},
computed: {
},
...
...
src/components/resources/resource-new-product-list.vue
View file @
4a34316
<template>
<resource class="no-padding-right" v-if="showFloor">
<ul class="resource-blk-new-products" v-if="value.showType == 1">
<li class="product-item" v-for="(item, index) in value.list" :key="index">
<product-link :value="item" class="link"></product-link>
<ul class="resource-blk-new-products" v-if="value.data.showType == 1">
<li class="product-item" v-for="(item, pi) in value.data.list" :key="pi">
<product-link :value="item" class="link" :yas="value" :yas-f="index" :yas-i="pi"></product-link>
<img-format :lazy="lazy" :src="item.default_images" :w="188" :h="250"></img-format>
<div class="ellipsis">
<p class="title" v-if="item.brand_name">{{item.brand_name}}</p>
...
...
@@ -11,10 +11,10 @@
</div>
</li>
</ul>
<ul class="resource-blk-new-products" v-if="value.showType == 2">
<ul class="resource-blk-new-products" v-if="value.
data.
showType == 2">
<div class="one">
<li class="product-item" v-for="(item, index) in value.list" :key="index" v-if="index % 2 == 0">
<product-link :value="item" class="link"></product-link>
<li class="product-item" v-for="(item, pi) in value.data.list" :key="pi" v-if="pi % 2 == 0">
<product-link :value="item" class="link" :yas="value" :yas-f="index" :yas-i="pi"></product-link>
<img-format :lazy="lazy" :src="item.default_images" :w="188" :h="250"></img-format>
<div class="ellipsis">
<p class="title" v-if="item.brand_name">{{item.brand_name}}</p>
...
...
@@ -24,8 +24,8 @@
</li>
</div>
<div class="two">
<li class="product-item" v-for="(item, index) in value.list" :key="index" v-if="index % 2 == 1">
<product-link :value="item" class="link"></product-link>
<li class="product-item" v-for="(item, pi) in value.data.list" :key="pi" v-if="pi % 2 == 1">
<product-link :value="item" class="link" :yas="value" :yas-f="index" :yas-i="pi"></product-link>
<img-format :lazy="lazy" :src="item.default_images" :w="188" :h="250"></img-format>
<div class="ellipsis">
<p class="title" v-if="item.brand_name">{{item.brand_name}}</p>
...
...
@@ -45,12 +45,13 @@ export default {
name: 'ResourceBlkNewProductList',
props: {
value: Object,
lazy: Boolean
lazy: Boolean,
index: Number
},
computed: {
showFloor() {
return this.value.showType == 1 && this.value.list && this.value.list.length > 3 ||
this.value.showType == 2 && this.value.list && this.value.list.length > 7;
return this.value.data.showType === 1 && this.value.data.list && this.value.data.list.length > 3 ||
this.value.data.showType === 2 && this.value.data.list && this.value.data.list.length > 7;
}
},
components: {Resource}
...
...
src/components/resources/resource-product-list.vue
View file @
4a34316
<template>
<resource class="no-padding-right">
<ul class="resource-products">
<li class="product-item" v-for="(item, index) in value.list" :key="index">
<li class="product-item" v-for="(item, index) in value.
data.
list" :key="index">
<img-format :lazy="lazy" :src="item.default_images" :w="94" :h="125"></img-format>
<div class="ellipsis">
<p class="brand" v-if="item.brand_name">{{item.brand_name}}</p>
...
...
@@ -20,7 +20,8 @@ export default {
name: 'ResourceProductList',
props: {
value: Object,
lazy: Boolean
lazy: Boolean,
index: Number
},
computed: {
},
...
...
src/components/resources/resource-single-image.vue
View file @
4a34316
<template>
<resource class="resource-single-image">
<a-link
:title="value.title"
:title="value.
data.
title"
:href="img.url"
v-for="(img, index) in value.list"
:key="index">
v-for="(img, pi) in value.data.list"
:key="pi"
:yas="value"
:yas-f="index">
<img-format
:lazy="lazy"
:src="img.src"
:w="value.imageWidth"
:h="value.imageHeight"
:w="value.data.imageWidth"
:h="value.data.imageHeight"
:alt="img.alt">
</img-format>
</a-link>
...
...
@@ -23,7 +25,8 @@ export default {
name: 'ResourceSingleImage',
props: {
value: Object,
lazy: Boolean
lazy: Boolean,
index: Number
},
components: {Resource}
};
...
...
src/components/resources/resource-tfgoods-list.vue
View file @
4a34316
<template>
<resource class="no-padding-right">
<ul class="resource-tf-goods">
<li class="product-item" v-for="(item, index) in value.list" :key="index">
<product-link :value="item" class="link"></product-link>
<li class="product-item" v-for="(item, pi) in value.data.list" :key="pi">
<product-link :value="item" class="link" :yas="value" :yas-f="index" :yas-i="pi"></product-link>
<img-format :lazy="lazy" :src="item.default_images" :w="188" :h="250"></img-format>
<div class="ellipsis">
<p class="title" v-if="item.product_name">{{item.product_name}}</p>
...
...
@@ -20,7 +20,8 @@ export default {
name: 'ResourceTfGoodsList',
props: {
value: Object,
lazy: Boolean
lazy: Boolean,
index: Number
},
computed: {
},
...
...
src/components/resources/resource-two-image.vue
View file @
4a34316
<template>
<resource class="resource-ti-image">
<div class="resource-ti-image-item">
<a-link :href="value.list[0].url">
<img-format :lazy="lazy" :src="value.list[0].src" :w="value.imageWidth"
:h="value.imageHeight"></img-format>
<a-link :href="value.data.list[0].url" :yas="value" :yas-f="index" :yas-i="0">
<img-format :lazy="lazy" :src="value.data.list[0].src" :w="value.data.imageWidth"
:h="value.data.imageHeight"></img-format>
</a-link>
</div>
<div class="split"></div>
<div class="resource-ti-image-item">
<a-link :href="value.list[1].url">
<img-format :lazy="lazy" :src="value.list[1].src" :w="value.imageWidth"
:h="value.imageHeight"></img-format>
<a-link :href="value.data.list[1].url" :yas="value" :yas-f="index" :yas-i="1">
<img-format :lazy="lazy" :src="value.data.list[1].src" :w="value.data.imageWidth"
:h="value.data.imageHeight"></img-format>
</a-link>
</div>
</resource>
...
...
@@ -23,7 +23,8 @@ export default {
name: 'ResourceTwoImage',
props: {
value: Object,
lazy: Boolean
lazy: Boolean,
index: Number
},
components: {Resource}
};
...
...
src/entry-client.js
View file @
4a34316
...
...
@@ -3,6 +3,7 @@ import Vue from 'vue';
import
{
ROUTE_CHANGE
,
PAGE_INIT_VISIBLE
,
REPORT_YAS
,
}
from
'store/yoho/types'
;
import
FastClick
from
'fastclick'
;
import
{
createApp
}
from
'./app'
;
...
...
@@ -17,9 +18,10 @@ import 'statics/scss/font.scss';
FastClick
.
attach
(
document
.
body
);
const
{
app
,
router
,
store
}
=
createApp
();
window
.
newBlk
=
true
;
if
(
window
.
__INITIAL_STATE__
)
{
store
.
replaceState
(
window
.
__INITIAL_STATE__
);
}
...
...
@@ -48,6 +50,16 @@ router.onReady(() => {
if
(
window
.
_hmt
)
{
window
.
_hmt
.
push
([
'_trackPageview'
,
to
.
fullPath
]);
}
store
.
dispatch
(
REPORT_YAS
,
{
params
:
{
appop
:
'YB_H5_PAGE_OPEN_L'
,
param
:
{
F_URL
:
`
$
{
location
.
origin
}
$
{
to
.
fullPath
}
`
,
PAGE_URL
:
`
$
{
location
.
origin
}
$
{
from
.
fullPath
}
`
,
PAGE_NAME
:
from
.
name
}
}
});
Promise
.
all
(
matched
.
map
(({
asyncData
})
=>
asyncData
&&
asyncData
({
store
,
router
:
to
})))
...
...
src/pages/channel/about/about.vue
View file @
4a34316
...
...
@@ -17,7 +17,8 @@
<component
:is="component.template_name"
v-for="(component, index) in channel.about.filter(c => ['newSingleImage'].some(k => k === c.template_name) )"
:value="component.data"
:value="component"
:index="index"
:key="index"></component>
</layout-body>
</template>
...
...
@@ -30,7 +31,6 @@ import {mapState} from 'vuex';
import {
ResourceSingleImage
} from 'components/resources';
import components from 'components/resources';
export default {
name: 'About',
...
...
@@ -40,7 +40,7 @@ export default {
computed: {
...mapState(['channel']),
},
beforeRouteEnter
(to, from, next) {
beforeRouteEnter(to, from, next) {
next(vm => {
if (vm.$yoho && vm.$yoho.isAndroid) {
vm.$yoho.blkBackStatus(true);
...
...
src/pages/channel/channel-home/channel-home.vue
View file @
4a34316
...
...
@@ -15,7 +15,8 @@
:is="component.template_name"
v-for="(component, index) in (floors || []).filter(c => ['twoPicture', 'goods', 'tfGoodsList', 'focus', 'blkCategory', 'newSingleImage', 'BlkNewProductFloorResource'].some(k => k === c.template_name) )"
:lazy="index > 5"
:value="component.data"
:value="component"
:index="index"
:key="index"></component>
</scroller>
</layout-body>
...
...
@@ -27,6 +28,7 @@
SET_GENDER,
FETCH_CHANNEL_REQUEST,
} from 'store/channel/types';
import {REPORT_YAS} from 'store/yoho/types';
import {mapState} from 'vuex';
import {
ResourceGoods,
...
...
@@ -49,11 +51,22 @@
men: '男士',
women: '女士'
}
}
}
;
},
methods: {
searchSliderSwitch() {
this.searchSlider = !this.searchSlider;
if (this.searchSlider) {
this.$store.dispatch(REPORT_YAS, {
params: {
appop: 'YB_SECOND_HOME_BLK_SEARCH_C',
param: {
POS_ID: this.gender === 'men' ? 103 : 102
}
}
});
}
},
async loading() {
await this.$store.dispatch(FETCH_CHANNEL_REQUEST, {refresh: true});
...
...
@@ -69,7 +82,7 @@
return this.$store.state.channel[this.gender].floors;
}
},
beforeRouteEnter
(to, from, next) {
beforeRouteEnter(to, from, next) {
next(vm => {
if (vm.$yoho && vm.$yoho.isAndroid) {
vm.$yoho.blkBackStatus(true);
...
...
@@ -78,6 +91,7 @@
},
asyncData({store, router: to}) {
const gender = /\/channel\/men/.test(to.path) ? 'men' : 'women';
store.commit(SET_GENDER, gender);
return store.dispatch(FETCH_CHANNEL_REQUEST, {gender});
},
...
...
src/pages/channel/home/components/home-slider.vue
View file @
4a34316
...
...
@@ -111,7 +111,7 @@ export default {
border-bottom: solid 1px #EEEEEE;
line-height: 86px;
a {
.link-
a {
position: absolute;
top: 0;
right: 20px;
...
...
@@ -126,7 +126,7 @@ export default {
padding-left: 0;
font-family: HiraginoSansGB-W3, HelveticaNeue , Tahoma, Arial;
a {
.link-
a {
left: 0;
}
}
...
...
src/pages/channel/home/home.vue
View file @
4a34316
...
...
@@ -22,7 +22,8 @@
v-for="(component, index) in (channel.home || []).filter(c => ['twoPicture', 'tfGoodsList', 'newSingleImage', 'BlkNewProductFloorResource'].some(k => k === c.template_name) )"
:lazy="index > 5"
v-if="loadComponent || index < 6"
:value="component.data"
:value="component"
:index="index"
:key="index"></component>
</div>
</scroller>
...
...
@@ -42,6 +43,7 @@ import ResourceTfGoodsList from 'components/resources/resource-tfgoods-list';
import {SearchSlider} from 'components/search';
import {mapState} from 'vuex';
import {HomeSlider} from './components';
import {REPORT_YAS} from 'store/yoho/types';
export default {
name: 'Channel',
...
...
@@ -61,15 +63,39 @@ export default {
methods: {
homeSliderSwitch() {
this.homeSlider = !this.homeSlider;
if (this.homeSlider) {
this.$store.dispatch(REPORT_YAS, {
params: {
appop: 'YB_SECOND_HOME_BLK_SIDEBAR_C'
}
});
}
},
searchSliderSwitch() {
this.searchSlider = !this.searchSlider;
if (this.searchSlider) {
this.$store.dispatch(REPORT_YAS, {
params: {
appop: 'YB_SECOND_HOME_BLK_SEARCH_C',
param: {
POS_ID: 101
}
}
});
}
},
async loading() {
await this.$store.dispatch(FETCH_HOME_REQUEST, true);
this.$refs.scroller.stop();
},
goBack() {
this.$store.dispatch(REPORT_YAS, {
params: {
appop: 'YB_SECOND_HOME_BLK_BACK_C'
}
});
this.$yoho.goNewBack();
}
},
...
...
src/store/yoho/index.js
View file @
4a34316
...
...
@@ -3,7 +3,8 @@ import {
SET_TITLE
,
ROUTE_CHANGE
,
INIT_ROUTE_CHANGE
,
PAGE_INIT_VISIBLE
PAGE_INIT_VISIBLE
,
REPORT_YAS
,
}
from
'./types'
;
import
_
from
'lodash/core'
;
...
...
@@ -58,6 +59,16 @@ export function createYoho() {
[
PAGE_INIT_VISIBLE
](
state
,
{
visible
})
{
state
.
visible
=
visible
;
}
},
actions
:
{
[
REPORT_YAS
](
action
,
{
params
:
{
appop
,
param
},
asyncindx
=
false
})
{
if
(
window
.
_yas
)
{
window
.
_yas
.
sendAppLogs
({
appop
,
param
:
JSON
.
stringify
(
param
)
},
asyncindx
);
}
}
}
};
}
...
...
src/store/yoho/types.js
View file @
4a34316
...
...
@@ -3,3 +3,4 @@ export const SET_TITLE = 'SET_TITLE';
export
const
ROUTE_CHANGE
=
'ROUTE_CHANGE'
;
export
const
INIT_ROUTE_CHANGE
=
'INIT_ROUTE_CHANGE'
;
export
const
PAGE_INIT_VISIBLE
=
'PAGE_INIT_VISIBLE'
;
export
const
REPORT_YAS
=
'REPORT_YAS'
;
...
...
Please
register
or
login
to post a comment