增加顶部横向的game cell

This commit is contained in:
zhl 2019-02-18 13:14:52 +08:00
parent 8a5f8de016
commit d1099fd7b3
3 changed files with 127 additions and 3 deletions

View File

@ -1,11 +1,12 @@
{
"description": "A WePY project",
"setting": {
"urlCheck": true,
"urlCheck": false,
"es6": false,
"postcss": false,
"minified": false,
"newFeature": true
"newFeature": true,
"autoAudits": false
},
"compileType": "miniprogram",
"appid": "wxbf333d56b4de3905",

View File

@ -0,0 +1,53 @@
<!--游戏cell-->
<style lang="less">
.recent-game {
display: flex;
justify-content: flex-start;
width: 750rpx;
}
.recent-game .one-game{
width: 138rpx;
height: 138rpx;
margin-left: 10rpx;
border-radius:10rpx;
overflow:hidden;
}
.recent-game .one-game image {
width: 100%;
height: 100%;
}
.comp-title {
font-size:28rpx;
margin-left:10rpx;
}
</style>
<template>
<view>
<view class="comp-title">最近在玩</view>
<view class="recent-game">
<repeat for="{{gameList}}" item="game">
<view class="one-game" @tap="gameTap({{game.image}})">
<image src="{{game.image}}"/>
</view>
</repeat>
</view>
</view>
</template>
<script>
import wepy from 'wepy'
export default class recentGameComp extends wepy.component {
props = {
gameList: []
}
data = {
}
methods = {
gameTap (url, e) {
this.$emit('gameCellTap', url)
}
}
}
</script>

View File

@ -9,6 +9,7 @@
<view class="userinfo-nickname">{{ nickname }}</view>
</view>
</view>
<recentGame :gameList.sync="recent_game_list" @gameCellTap.user="gameTap"></recentGame>
<repeat for="{{records}}" item="item" >
<recordCell :item="item" @gameCellTap.user="gameTap"/>
</repeat>
@ -23,6 +24,7 @@
import base from '../mixins/base';
import tips from '../mixins/tips';
import recordCell from '../components/game-cell';
import recentGame from '../components/recent-game';
import zanLoadmore from '../components/zan-loadmore';
export default class Index extends wepy.page {
@ -34,6 +36,7 @@
components = {
toast: Toast,
recordCell: recordCell,
recentGame: recentGame,
zanLoadmore: zanLoadmore
};
@ -41,6 +44,7 @@
nickname: '加载中',
avatar: '',
records: [],
recent_game_list: [],
all_count: 0,
current: 0,
loading: false,
@ -102,8 +106,74 @@
image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg',
url: 'http://192.168.100.84:7456/',
id: '001'
}];
},
{
title: '超级玛丽(日版)',
content: '《超级马里奥兄弟》又名《超级玛丽兄弟》是任天堂于1985年出品的著名横版过关游戏作为1983年游...',
image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg',
url: 'http://192.168.100.84:7456/',
id: '001'
},
{
title: '超级玛丽(日版)',
content: '《超级马里奥兄弟》又名《超级玛丽兄弟》是任天堂于1985年出品的著名横版过关游戏作为1983年游...',
image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg',
url: 'http://192.168.100.84:7456/',
id: '001'
},
{
title: '超级玛丽(日版)',
content: '《超级马里奥兄弟》又名《超级玛丽兄弟》是任天堂于1985年出品的著名横版过关游戏作为1983年游...',
image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg',
url: 'http://192.168.100.84:7456/',
id: '001'
},
{
title: '超级玛丽(日版)',
content: '《超级马里奥兄弟》又名《超级玛丽兄弟》是任天堂于1985年出品的著名横版过关游戏作为1983年游...',
image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg',
url: 'http://192.168.100.84:7456/',
id: '001'
},
{
title: '超级玛丽(日版)',
content: '《超级马里奥兄弟》又名《超级玛丽兄弟》是任天堂于1985年出品的著名横版过关游戏作为1983年游...',
image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg',
url: 'http://192.168.100.84:7456/',
id: '001'
},
{
title: '超级玛丽(日版)',
content: '《超级马里奥兄弟》又名《超级玛丽兄弟》是任天堂于1985年出品的著名横版过关游戏作为1983年游...',
image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg',
url: 'http://192.168.100.84:7456/',
id: '001'
},{
title: '超级玛丽(日版)',
content: '《超级马里奥兄弟》又名《超级玛丽兄弟》是任天堂于1985年出品的著名横版过关游戏作为1983年游...',
image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg',
url: 'http://192.168.100.84:7456/',
id: '001'
},
{
title: '超级玛丽(日版)',
content: '《超级马里奥兄弟》又名《超级玛丽兄弟》是任天堂于1985年出品的著名横版过关游戏作为1983年游...',
image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg',
url: 'http://192.168.100.84:7456/',
id: '001'
}
];
this.recent_game_list = [
{image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg'},
{image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg'},
{image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg'},
{image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg'},
{image: 'http://pub.hoh8.cn/files/game/fc/7002058/icon.jpg'}
];
this.records = records;
this.$apply();
this.noData = false;
this.noMore = true;
}
}
</script>