add search list page

This commit is contained in:
zhl 2021-12-13 15:55:27 +08:00
parent 166f3b71f2
commit 1b39bb3f9c
4 changed files with 109 additions and 2 deletions

View File

@ -1,4 +1,3 @@
<!--带缩略图轮播图组件-->
<template>
<uni-card mode="style" @click="onClick(gData.gameId)">
<template v-slot:cover>

View File

@ -0,0 +1,85 @@
<template>
<view class="s-game-cell">
<view class="left-part">
<img src="https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg">
</view>
<view class="right-part">
<view class="title-view">
<text>游戏名</text>
</view>
<view class="sub-title-view">
<text>游戏英文名</text>
</view>
<view class="tags-view">
<uni-tag v-for="tag in tagList" :text="tag" inverted="true" type="error"></uni-tag>
</view>
<view class="price-view">
<view>游戏英文名</view>
<view class="price">100</view>
<uni-tag text="25%折扣" type="error"></uni-tag>
</view>
</view>
</view>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
declare module 'vue/types/vue' {
interface Vue {
data?: any
}
}
@Component({
name: 'GameSmallCell',
props: ['data'],
})
export default class extends Vue{
private tagList: string[] = ['t1', 't2']
}
</script>
<style>
.s-game-cell{
display: flex;
justify-content: space-between;
width: 100%;
padding: 5px;
}
.left-part{
width: 25%;
}
.left-part img{
max-width: 150px;
}
.right-part {
width: 75%;
margin-left: 5px;
}
.title-view{
font-size: 18px;
}
.sub-title-view {
font-size: 14px;
color: #666666;
}
.price-view {
width: 100%;
font-size: 14px;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.price-view .price{
color: red;
}
.tags-view {
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
padding: 5px 0;
}
.tags-view .uni-tag {
margin-right: 5px;
}
</style>

View File

@ -123,5 +123,6 @@ export default class extends Vue{
height: 40px;
vertical-align: middle;
line-height: 40px;
color: #666666;
}
</style>

View File

@ -1,17 +1,39 @@
<template>
<view class="container">
<uni-list>
<uni-list-item v-for="item in games" >
<game-small-cell :g-data="item" v-on:cellClicked = 'onClick'></game-small-cell>
</uni-list-item>
</uni-list>
</view>
</template>
<script lang="ts">
import { Component, Vue } from 'vue-property-decorator'
import { IGameInfo } from '@/modules/gameinfo'
import GameSmallCell from '@/components/GameSmallCell/index.vue'
@Component({
name: 'Index',
components: {}
components: {
GameSmallCell
}
})
export default class extends Vue{
private games: IGameInfo[] = []
onLoad() {
for (let i = 0; i < 10; i++) {
this.games.push({
gameId: i + '',
cover: 'https://vkceyugu.cdn.bspapp.com/VKCEYUGU-dc-site/094a9dc0-50c0-11eb-b680-7980c8a877b8.jpg',
name: '测试游戏' + i,
ename: 'test game ' + i
})
}
}
onClick() {
}