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
b347b291845dcdadc5cef59bdddee62bbf6f1ce5
1 parent
34fe1e2b
完善资源位
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
16 deletions
apps/channel/views/action/index.hbs
config/content-code.js
public/vue/channel/resources.vue
public/vue/component/resources/goods.vue
apps/channel/views/action/index.hbs
View file @
b347b29
<div
id=
"app"
>
<tab></tab>
<resources
v-bind:channel=
"'
{{
channel
}}
' || 'men'"
v-ref:resources
></resources>
<resources
v-bind:channel=
"'
{{
channel
}}
' || 'men'"
></resources>
</div>
...
...
config/content-code.js
View file @
b347b29
...
...
@@ -7,9 +7,9 @@
'use strict'
;
const
channel
=
{
men
:
'9ee58aadd9559d07207fe4a98843eaac'
,
// 男 9ee58aadd9559d07207fe4a98843eaac
women
:
'9ee58aadd9559d07207fe4a98843eaac'
,
lifestyle
:
'9ee58aadd9559d07207fe4a98843eaac'
men
:
'9ee58aadd9559d07207fe4a98843eaac'
,
women
:
'aa8d34c85934c2ccc16e2babd3eb5e47'
,
lifestyle
:
'3ad8826fc89fb0d023a4cd06a6991219'
};
module
.
exports
=
{
...
...
public/vue/channel/resources.vue
View file @
b347b29
<template>
<div class="resources">
<template v-for="floor in resources">
<!-- 轮播图,通栏 -->
<focus v-if="floor.focus && floor.focusType === '1'" v-bind:floor="floor.data" v-bind:style="{height: '182px'}"></focus>
<!-- 轮播图,左右滑动 -->
<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>
<!-- 带标题的12个小图推荐 -->
<recommend-content-five v-if="floor.recommendContentFive" v-bind:floor="floor.data.list"></recommend-content-five>
<!-- 商品 -->
<goods v-if="floor.goods" v-bind:floor="floor.data"></goods>
<focus v-if="floor.focus && floor.focusType === '1'" v-bind:floor="floor.data" v-bind:style="{height: '182px'}">
<!-- 轮播图,通栏 -->
</focus>
<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>
<recommend-content-five v-if="floor.recommendContentFive" v-bind:floor="floor.data.list">
<!-- 带标题的12个小图推荐 -->
</recommend-content-five>
<goods v-if="floor.goods" v-bind:floor="floor.data">
<!-- 商品 -->
</goods>
</template>
</div>
</template>
...
...
@@ -29,6 +35,8 @@
const recommendContentFive = require('component/resources/recommend-content-five.vue');
const goods = require('component/resources/goods.vue');
const dataCache = {};
module.exports = {
props: ['channel', 'contentCode'],
data() {
...
...
@@ -62,11 +70,22 @@
data.channel = this.channel;
}
let param = $.param(data);
if (dataCache[param]) {
this.resources = dataCache[param];
return;
}
$.ajax({
url: '/resources',
data: data
}).then(result => {
this.resources = result;
if (result.length) {
dataCache[param] = result;
}
}).fail(() => {
tip('网络错误');
});
...
...
public/vue/component/resources/goods.vue
View file @
b347b29
...
...
@@ -11,6 +11,9 @@
props: ['floor'],
components: {
titleFloor: titleFloor
},
created() {
// console.log(this.floor)
}
};
</script>
...
...
Please
register
or
login
to post a comment