Authored by ccbikai

完善经典品牌资源位

... ... @@ -7,6 +7,7 @@
'use strict';
const $ = require('yoho-jquery');
const Overlay = require('./overlay');
const template = require('components/loading.hbs');
... ... @@ -28,7 +29,7 @@ class Loading {
* 显示
*/
show() {
this.overlay = $.overlay({
this.overlay = new Overlay({
animation: 'fade',
clickToClose: false
});
... ... @@ -44,10 +45,4 @@ class Loading {
}
}
((function($) {
$.loading = opts => {
return new Loading(opts);
};
})(jQuery));
module.exports = Loading;
module.exports = new Loading();
... ...
<template>
<div class="resources">
<template v-for="floor in resources">
<focus v-if="floor.focus" v-bind:floor="floor.data" v-bind:style="{height: '182px'}"></focus>
<!-- 轮播图,通栏 -->
<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>
<!-- 商品 -->
<goods v-if="floor.goods" v-bind:floor="floor.data"></goods>
</template>
</div>
... ... @@ -13,6 +18,7 @@
const tip = require('common/tip');
const bus = require('common/vue-bus');
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 goods = require('component/resources/goods.vue');
... ... @@ -24,9 +30,10 @@
};
},
components: {
focus: focus,
titleImage: titleImage,
goods: goods
focus,
focusLeftRight,
titleImage,
goods
},
watch: {
channel() {
... ... @@ -60,7 +67,6 @@
this.getResourcesData();
bus.$on('changeChannel', channel => {
this.channel = channel;
this.getResourcesData();
});
}
};
... ...
<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 80">
</a>
</div>
</template>
<script>
module.exports = {
props: ['floor']
};
</script>
<style>
.focus-left-right {
padding: 30px 15px;
width: 100%;
overflow-x: auto;
white-space: nowrap;
font-size: 0;
a {
padding: 0 15px;
}
}
</style>
... ...