Authored by ccbikai

完善经典品牌资源位

@@ -7,6 +7,7 @@ @@ -7,6 +7,7 @@
7 7
8 'use strict'; 8 'use strict';
9 9
  10 +const $ = require('yoho-jquery');
10 const Overlay = require('./overlay'); 11 const Overlay = require('./overlay');
11 const template = require('components/loading.hbs'); 12 const template = require('components/loading.hbs');
12 13
@@ -28,7 +29,7 @@ class Loading { @@ -28,7 +29,7 @@ class Loading {
28 * 显示 29 * 显示
29 */ 30 */
30 show() { 31 show() {
31 - this.overlay = $.overlay({ 32 + this.overlay = new Overlay({
32 animation: 'fade', 33 animation: 'fade',
33 clickToClose: false 34 clickToClose: false
34 }); 35 });
@@ -44,10 +45,4 @@ class Loading { @@ -44,10 +45,4 @@ class Loading {
44 } 45 }
45 } 46 }
46 47
47 -((function($) {  
48 - $.loading = opts => {  
49 - return new Loading(opts);  
50 - };  
51 -})(jQuery));  
52 -  
53 -module.exports = Loading; 48 +module.exports = new Loading();
1 <template> 1 <template>
2 <div class="resources"> 2 <div class="resources">
3 <template v-for="floor in resources"> 3 <template v-for="floor in resources">
4 - <focus v-if="floor.focus" v-bind:floor="floor.data" v-bind:style="{height: '182px'}"></focus> 4 + <!-- 轮播图,通栏 -->
  5 + <focus v-if="floor.focus && floor.focusType === '1'" v-bind:floor="floor.data" v-bind:style="{height: '182px'}"></focus>
  6 + <!-- 轮播图,左右滑动 -->
  7 + <focus-left-right v-if="floor.focus && floor.focusType === '2'" v-bind:floor="floor.data"></focus-left-right>
  8 + <!-- 标题图片 -->
5 <title-image v-if="floor.titleImage" v-bind:floor="floor.data"></title-image> 9 <title-image v-if="floor.titleImage" v-bind:floor="floor.data"></title-image>
  10 + <!-- 商品 -->
6 <goods v-if="floor.goods" v-bind:floor="floor.data"></goods> 11 <goods v-if="floor.goods" v-bind:floor="floor.data"></goods>
7 </template> 12 </template>
8 </div> 13 </div>
@@ -13,6 +18,7 @@ @@ -13,6 +18,7 @@
13 const tip = require('common/tip'); 18 const tip = require('common/tip');
14 const bus = require('common/vue-bus'); 19 const bus = require('common/vue-bus');
15 const focus = require('component/resources/focus.vue'); 20 const focus = require('component/resources/focus.vue');
  21 + const focusLeftRight = require('component/resources/focus-left-right.vue');
16 const titleImage = require('component/resources/title-image.vue'); 22 const titleImage = require('component/resources/title-image.vue');
17 const goods = require('component/resources/goods.vue'); 23 const goods = require('component/resources/goods.vue');
18 24
@@ -24,9 +30,10 @@ @@ -24,9 +30,10 @@
24 }; 30 };
25 }, 31 },
26 components: { 32 components: {
27 - focus: focus,  
28 - titleImage: titleImage,  
29 - goods: goods 33 + focus,
  34 + focusLeftRight,
  35 + titleImage,
  36 + goods
30 }, 37 },
31 watch: { 38 watch: {
32 channel() { 39 channel() {
@@ -60,7 +67,6 @@ @@ -60,7 +67,6 @@
60 this.getResourcesData(); 67 this.getResourcesData();
61 bus.$on('changeChannel', channel => { 68 bus.$on('changeChannel', channel => {
62 this.channel = channel; 69 this.channel = channel;
63 - this.getResourcesData();  
64 }); 70 });
65 } 71 }
66 }; 72 };
  1 +<template>
  2 + <div class="focus-left-right">
  3 + <a v-for="item in floor" href="{{item.url}}" title="{{item.title}}">
  4 + <img v-bind:src="item.src | resize 80 80">
  5 + </a>
  6 + </div>
  7 +</template>
  8 +
  9 +<script>
  10 + module.exports = {
  11 + props: ['floor']
  12 + };
  13 +</script>
  14 +
  15 +<style>
  16 + .focus-left-right {
  17 + padding: 30px 15px;
  18 + width: 100%;
  19 + overflow-x: auto;
  20 + white-space: nowrap;
  21 + font-size: 0;
  22 +
  23 + a {
  24 + padding: 0 15px;
  25 + }
  26 + }
  27 +</style>