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
ccbikai
9 years ago
Commit
de6ecb0b777e61c8796a400cf09d2b2e1dc28376
1 parent
8c9a7b83
add title floor
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
30 additions
and
62 deletions
apps/channel/views/action/index.hbs
config/common.js
public/vue/channel/resources.vue
public/vue/component/resources/focus-left-right.vue
public/vue/component/resources/goods.vue
public/vue/component/resources/floor-header.vue → public/vue/component/resources/title-floor.vue
public/vue/component/resources/title-image.vue
utils/resources-process.js
apps/channel/views/action/index.hbs
View file @
de6ecb0
<div
id=
"app"
>
<tab></tab>
<resources
v-bind:channel=
"'
{{
channel
}}
'"
v-ref:resources
></resources>
<resources
v-bind:channel=
"'
{{
channel
}}
'
|| 'men'
"
v-ref:resources
></resources>
</div>
...
...
config/common.js
View file @
de6ecb0
...
...
@@ -16,7 +16,7 @@ module.exports = {
siteUrl
:
'//m.yohobuy.com'
,
domains
:
{
api
:
'http://devapi.yoho.cn:58078/'
,
service
:
'http://1
23.206.1.104:28077
/'
service
:
'http://1
72.16.6.247:8085/gateway
/'
},
subDomains
:
{
host
:
'.m.yohobuy.com'
,
...
...
public/vue/channel/resources.vue
View file @
de6ecb0
...
...
@@ -7,6 +7,8 @@
<focus-left-right v-if="floor.focus && floor.focusType === '2'" v-bind:floor="floor.data"></focus-left-right>
<!-- 标题图片 -->
<title-image v-if="floor.titleImage" v-bind:floor="floor.data"></title-image>
<!-- 楼层标题 -->
<title-floor v-if="floor.titleFloor" v-bind:title="floor.data.title"></title-floor>
<!-- 商品 -->
<goods v-if="floor.goods" v-bind:floor="floor.data"></goods>
</template>
...
...
@@ -20,6 +22,7 @@
const focus = require('component/resources/focus.vue');
const focusLeftRight = require('component/resources/focus-left-right.vue');
const titleImage = require('component/resources/title-image.vue');
const titleFloor = require('component/resources/title-floor.vue');
const goods = require('component/resources/goods.vue');
module.exports = {
...
...
@@ -33,6 +36,7 @@
focus,
focusLeftRight,
titleImage,
titleFloor,
goods
},
watch: {
...
...
public/vue/component/resources/focus-left-right.vue
View file @
de6ecb0
<template>
<div class="focus-left-right">
<a v-for="item in floor" href="{{item.url}}" title="{{item.title}}">
<img v-bind:src="item.src | resize
80 8
0">
<img v-bind:src="item.src | resize
250 25
0">
</a>
</div>
</template>
...
...
@@ -19,9 +19,26 @@
overflow-x: auto;
white-space: nowrap;
font-size: 0;
background: #fff;
border-bottom: 1px solid #eee;
-webkit-overflow-scrolling: touch;
/* stylelint-disable */
&::-webkit-scrollbar {
display:none;
}
/* stylelint-enable */
a {
display: inline-block;
padding: 0 15px;
width: 250px;
height: 250px;
}
img {
width: 100%;
height: 100%;
}
}
</style>
...
...
public/vue/component/resources/goods.vue
View file @
de6ecb0
...
...
@@ -5,12 +5,12 @@
</template>
<script>
const
floorHeader = require('component/resources/floor-heade
r.vue');
const
titleFloor = require('component/resources/title-floo
r.vue');
module.exports = {
props: ['floor'],
components: {
floorHeader: floorHeade
r
titleFloor: titleFloo
r
}
};
</script>
...
...
public/vue/component/resources/
floor-heade
r.vue → public/vue/component/resources/
title-floo
r.vue
View file @
de6ecb0
<template>
<div class="floor-header">
{{title.
titl
e}}
{{title.
nam
e}}
<a class="more" href="{{title.moreUrl}}">
{{title.moreName}}
...
...
public/vue/component/resources/title-image.vue
View file @
de6ecb0
<template>
<div class="title-image">
<
floor-header v-bind:title="floor.title"></floor-heade
r>
<
title-floor v-bind:title="{name: floor.title, moreName: floor.moreName, moreUrl: floor.moreUrl}"></title-floo
r>
<a class="image" v-bind:href="floor.image.url">
<img v-bind:src="floor.image.src | resize 750 364">
</a>
...
...
@@ -8,12 +8,12 @@
</template>
<script>
const
floorHeader = require('component/resources/floor-heade
r.vue');
const
titleFloor = require('component/resources/title-floo
r.vue');
module.exports = {
props: ['floor'],
components: {
floorHeader: floorHeade
r
titleFloor: titleFloo
r
}
};
</script>
...
...
utils/resources-process.js
View file @
de6ecb0
const
_
=
require
(
'lodash'
);
const
processTime
=
require
(
'./time-process'
);
const
camelCase
=
global
.
yoho
.
camelCase
;
/**
...
...
@@ -17,58 +16,6 @@ module.exports = (list) => {
floor
[
_
.
camelCase
(
floor
.
templateName
)]
=
true
;
// 特殊资源位处理
// PLUS
if
(
floor
.
singleNameImage
&&
floor
.
data
)
{
floor
.
data
.
title
=
{
title
:
floor
.
data
.
title
};
}
// 潮流时装/经典裤裙/时尚靴履/潮人配饰/潮流上装
if
(
floor
.
recommendContentOne
&&
floor
.
data
)
{
if
(
floor
.
data
.
bigImage
&&
floor
.
data
.
bigImage
.
length
>
1
)
{
floor
.
data
.
bigImage
=
{
bigList
:
floor
.
data
.
bigImage
};
}
}
// OUTLETS
if
(
floor
.
titleImage
&&
floor
.
data
)
{
if
(
floor
.
data
.
image
)
{
floor
.
data
.
bigImage
=
{
bigList
:
[
floor
.
data
.
image
]
};
}
floor
.
data
.
title
=
{
moreName
:
floor
.
data
.
moreName
,
moreUrl
:
floor
.
data
.
moreUrl
,
title
:
floor
.
data
.
title
};
}
// 折扣专场
if
(
floor
.
discountActivity
&&
floor
.
data
&&
floor
.
data
.
list
.
length
)
{
_
.
map
(
floor
.
data
.
list
,
(
item
)
=>
{
Object
.
assign
(
item
,
processTime
(
item
.
leftTime
));
});
}
// 断码区 , 此资源位数据结构比较坑
if
(
floor
.
offCodeArea
&&
floor
.
data
&&
floor
.
data
.
list
.
length
)
{
floor
.
data
=
{
title
:
floor
.
data
.
title
,
data
:
[
floor
.
data
.
list
[
0
]],
left
:
[
floor
.
data
.
list
[
1
]],
right
:
floor
.
data
.
list
.
slice
(
2
)
};
}
// 会员专享
if
(
floor
.
vipFloor
&&
floor
.
data
)
{
floor
.
data
.
data
=
floor
.
data
.
image
;
}
formatData
.
push
(
floor
);
});
...
...
Please
register
or
login
to post a comment