Skip to content

Commit

Permalink
修复部分组件
Browse files Browse the repository at this point in the history
  • Loading branch information
Lewage59 committed May 8, 2020
1 parent ae707d3 commit 7e19cfa
Show file tree
Hide file tree
Showing 3 changed files with 211 additions and 64 deletions.
149 changes: 137 additions & 12 deletions src/api/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,143 @@ export const regionTags = [
{ name: '舞蹈教程', key: 156 }
]
},
{ name: '游戏', key: 4 },
{ name: '科技', key: 36 },
{ name: '数码', key: 188 },
{ name: '生活', key: 160 },
{ name: '鬼畜', key: 119 },
{ name: '时尚', key: 155 },
{ name: '娱乐', key: 5 },
{ name: '影视', key: 181 },
{ name: '广告', key: 165 },
{ name: '纪录片', key: 177 },
{ name: '电影', key: 23 },
{ name: '电视剧', key: 11 },
{
name: '游戏',
key: 4,
blocks: [
{ name: '推荐', key: 4 },
{ name: '单机游戏', key: 17 },
{ name: '电子竞技', key: 171 },
{ name: '手机游戏', key: 172 },
{ name: '网络游戏', key: 65 },
{ name: '桌游棋牌', key: 173 },
{ name: 'GMV', key: 121 },
{ name: '音游', key: 136 },
{ name: 'Mugen', key: 19 }
]
},
{
name: '科技',
key: 36,
blocks: [
{ name: '推荐', key: 36 },
{ name: '科学科普', key: 201 },
{ name: '社科人文', key: 124 },
{ name: '野生技术协会', key: 122 },
{ name: '演讲·公开课', key: 39 },
{ name: '星海', key: 96 },
{ name: '机械', key: 98 },
{ name: '汽车', key: 176 }
]
},
{
name: '数码',
key: 188,
blocks: [
{ name: '推荐', key: 188 },
{ name: '手机平板', key: 95 },
{ name: '电脑装机', key: 189 },
{ name: '摄影摄像', key: 190 },
{ name: '影音智能', key: 191 }
]
},
{
name: '生活',
key: 160,
blocks: [
{ name: '推荐', key: 160 },
{ name: '搞笑', key: 138 },
{ name: '日常', key: 21 },
{ name: '美食圈', key: 76 },
{ name: '动物圈', key: 75 },
{ name: '手工', key: 161 },
{ name: '绘画', key: 162 },
{ name: '运动', key: 163 },
{ name: '其他', key: 174 }
]
},
{
name: '鬼畜',
key: 119,
blocks: [
{ name: '推荐', key: 119 },
{ name: '鬼畜调教', key: 22 },
{ name: '音MAD', key: 26 },
{ name: '人力VOCALOID', key: 126 },
{ name: '教程演示', key: 127 }
]
},
{
name: '时尚',
key: 155,
blocks: [
{ name: '推荐', key: 155 },
{ name: '美妆', key: 157 },
{ name: '服饰', key: 158 },
{ name: '健身', key: 164 },
{ name: 'T台', key: 159 },
{ name: '风尚标', key: 192 }
]
},
{
name: '娱乐',
key: 5,
blocks: [
{ name: '推荐', key: 5 },
{ name: '综艺', key: 71 },
{ name: '明星', key: 137 },
{ name: 'Korea相关', key: 131 }
]
},
{
name: '影视',
key: 181,
blocks: [
{ name: '推荐', key: 181 },
{ name: '影视杂谈', key: 182 },
{ name: '影视剪辑', key: 183 },
{ name: '短片', key: 85 },
{ name: '预告·资讯', key: 184 }
]
},
{
name: '广告',
key: 165,
blocks: [
{ name: '推荐', key: 165 }
]
},
{
name: '纪录片',
key: 177,
blocks: [
{ name: '推荐', key: 177 },
{ name: '人文·历史', key: 37 },
{ name: '科学·探索·自然', key: 178 },
{ name: '军事', key: 179 },
{ name: '社会·美食·旅行', key: 180 }
]
},
{
name: '电影',
key: 23,
blocks: [
{ name: '推荐', key: 23 },
{ name: '华语电影', key: 147 },
{ name: '欧美电影', key: 145 },
{ name: '日本电影', key: 146 },
{ name: '其他国家', key: 83 }
]
},
{
name: '电视剧',
key: 11,
blocks: [
{ name: '推荐', key: 11 },
{ name: '国产剧', key: 185 },
{ name: '海外剧', key: 187 }
]
},
{ name: '直播', key: -1 },
{ name: '相簿', key: -2 }
]
2 changes: 1 addition & 1 deletion src/base/scroll/scroll.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import BScroll from 'better-scroll'
export default {
props: {
data: {
type: Array,
type: Array | Number,
default: null
},
probeType: { // 触发滚动事件的类型
Expand Down
124 changes: 73 additions & 51 deletions src/components/channel-view/channel-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,34 @@
<switcher :list="getBlocks" displayType="start" :indexTab="sindexTab" @switchTab="changeContent"></switcher>
</slider>
</div>
<ul class="recommend" v-if="sindexTab === 0 && regionList">
<li class="list-group" v-for="(list, index) in regionList" :key="index">
<div class="list-bar">
<span class="title">{{getRegionName(index)}}</span>
<span class="rank-more" v-if="index === 0">
<i class="icon-paixingbang"></i>
排行榜
<i class="icon-youjiantou"></i>
</span>
<span class="more" v-else @click="toMore(index)">
查看更多
<i class="icon-youjiantou"></i>
</span>
<scroll class="content-wrapper" ref="content" :data="sindexTab" :bounce="bounce">
<div>
<ul class="recommend" v-if="sindexTab === 0 && regionList">
<li class="list-group" v-for="(list, index) in regionList" :key="index">
<div class="list-bar">
<span class="title">{{getRegionName(index)}}</span>
<span class="rank-more" v-if="index === 0">
<i class="icon-paixingbang"></i>
排行榜
<i class="icon-youjiantou"></i>
</span>
<span class="more" v-else @click="toMore(index)">
查看更多
<i class="icon-youjiantou"></i>
</span>
</div>
<div class="list-group-item">
<card-list @select="selectItem" :list="list"></card-list>
</div>
</li>
</ul>
<div class="loading-container" v-show="!regionList">
<loading title=""></loading>
</div>
<div class="list-group-item">
<card-list @select="selectItem" :list="list"></card-list>
</div>
</li>
</ul>
<div class="loading-container" v-show="!regionList">
<loading title=""></loading>
</div>
<router-view @sswitchTab="sswitchTab" :indexTab="indexTab"></router-view>
<router-view @sswitchTab="sswitchTab" :indexTab="indexTab"></router-view>
<div class="block-box"></div>
</div>
</scroll>
</div>
</template>

Expand All @@ -38,6 +43,7 @@ import Slider from 'base/slider/slider'
import Switcher from 'base/switcher/switcher'
import cardList from 'base/card-list/card-list'
import Loading from 'base/loading/loading'
import Scroll from 'base/scroll/scroll'
export default {
data () {
Expand All @@ -49,6 +55,7 @@ export default {
}
},
created () {
this.bounce = false
this._getIndexTab()
setTimeout(() => {
this._getRegion()
Expand Down Expand Up @@ -102,6 +109,7 @@ export default {
}
},
sswitchTab (index) {
this.$refs.content.scrollTo(0, 0)
this.sindexTab = index
},
selectItem (item) {
Expand Down Expand Up @@ -135,15 +143,23 @@ export default {
Slider,
Switcher,
cardList,
Loading
Loading,
Scroll
}
}
</script>

<style lang="stylus" scoped rel="stylesheet/stylus">
@import '~common/stylus/variable.styl';
.block-box {
width: 100%;
padding-top: 130px;
}
.channel {
position: relative;
.sub-channel-menu {
height: 40.5px;
Expand Down Expand Up @@ -172,44 +188,50 @@ export default {
}
}
.recommend {
padding-top: 10px;
font-size: $font-size-medium-x;
color: $color-text;
.content-wrapper {
position: fixed;
overflow: hidden;
height: 100%;
.list-group {
padding: 0 5px;
margin-bottom: 20px;
.recommend {
padding-top: 10px;
font-size: $font-size-medium-x;
color: $color-text;
.list-bar {
display: flex;
justify-content: space-between;
padding: 5px 10px;
font-size: $font-size-medium;
.list-group {
padding: 0 5px;
margin-bottom: 20px;
.title {
font-size: 15px;
}
.list-bar {
display: flex;
justify-content: space-between;
padding: 5px 10px;
font-size: $font-size-medium;
.rank-more {
color: #ffa726;
}
.title {
font-size: 15px;
}
.more {
color: $color-text-video;
.rank-more {
color: #ffa726;
}
.more {
color: $color-text-video;
}
}
}
.list-group-item {
.list-group-item {
}
}
}
}
.loading-container {
position: absolute;
width: 100%;
top: 50%;
transform: translateY(-50%);
.loading-container {
position: absolute;
width: 100%;
top: 50%;
transform: translateY(-50%);
}
}
}
</style>

0 comments on commit 7e19cfa

Please sign in to comment.