diff --git a/src/components/game-cell.wpy b/src/components/game-cell.wpy index 1106498..f9d8e66 100644 --- a/src/components/game-cell.wpy +++ b/src/components/game-cell.wpy @@ -10,6 +10,7 @@ {{item.name}} {{item.introduce}} + {{item.category}} diff --git a/src/pages/gameInfo.wpy b/src/pages/gameInfo.wpy index 41bd20b..2fae671 100644 --- a/src/pages/gameInfo.wpy +++ b/src/pages/gameInfo.wpy @@ -247,6 +247,7 @@ if (this.record.taglist) { this.tagList = this.record.taglist.split(','); } + this.tagList.unshift(this.record.category.toUpperCase()); wepy.setNavigationBarTitle({ title: this.record.name }) diff --git a/src/pages/search.wpy b/src/pages/search.wpy index d3ed4e3..09cdbb9 100644 --- a/src/pages/search.wpy +++ b/src/pages/search.wpy @@ -22,6 +22,11 @@ + + + {{category}} + + {{language}} @@ -81,7 +86,9 @@ languageArr: ['所有语言', '中文', '简体中文', '繁体中文', '英文', '日文', '多国语言', '德文', '法文', '欧洲', '其他'], typeArr: g.gameTypes, typeName: '所有类型', - showAll: false + showAll: false, + category: '所有', + categoryArr: ['所有', 'FC', 'GBA'] }; methods = { @@ -111,6 +118,11 @@ this.initPageParam(); this.getRecords(); }, + categoryChange(e) { + this.category = this.categoryArr[e.detail.value]; + this.initPageParam(); + this.getRecords(); + }, gameTap(gid, e) { wepy.navigateTo({ url: '/pages/gameInfo?id=' + gid @@ -171,6 +183,9 @@ if (this.type > 0) { data.type = this.type; } + if (this.category !== '所有') { + data.category = this.category.toLowerCase(); + } let res = await http.post(`/api/emulated/games`, data); wepy.stopPullDownRefresh(); if (res.errcode === 0) { @@ -180,7 +195,7 @@ self.current += 10; for (let obj of res.records) { (obj.open) && (obj.owned = true); - obj.icon = `${global.cdnBase}${obj.gid}/1.png`; + obj.icon = `${g.cdnBase}images/${obj.gid}/1.png`; self.records.push(obj); } self.loading = false; diff --git a/src/style/game-cell.wxss b/src/style/game-cell.wxss index 5e6544b..c266b17 100644 --- a/src/style/game-cell.wxss +++ b/src/style/game-cell.wxss @@ -1,14 +1,13 @@ .game-cell { display: flex; flex-flow: row nowrap; - padding: 15px; + padding: 15px 15px 5px 15px; border-bottom: 1px solid #eee; width: 750rpx; } .game-cell .game-icon { margin-right:0.8em; width:60px; - height:60px; line-height:60px; text-align:center; margin-left: 15px; @@ -63,3 +62,7 @@ justify-content: center; align-items: center; } +.zan-label{ + text-transform:uppercase; + font-size: 9px; +} diff --git a/src/style/search.less b/src/style/search.less index 5dcbb4b..b86f5ac 100644 --- a/src/style/search.less +++ b/src/style/search.less @@ -84,7 +84,7 @@ white-space: nowrap; } .filter-bar .search-btn{ - width: 50%; + width: 33%; text-align: center; margin: 10rpx; font-size: 30rpx;