增加微信sitemap文件, 增加收藏页面

This commit is contained in:
zhl 2021-12-16 17:22:39 +08:00
parent d735ce9b7c
commit 45e9114a1b
8 changed files with 114 additions and 6 deletions

View File

@ -18,7 +18,7 @@ export const checkWord = (params: any) => {
export const getArticle = (aid: string) => {
return new Promise((resolve, reject) => {
uni.request({
url: `${GHOST_BASE}/api/emulated/article`,
url: `${GHOST_BASE}/emulated/article`,
method: 'POST',
data: {id: aid},
success: (res) => {

View File

@ -3,7 +3,8 @@ let jcshare = jcfw.share;
let SDKManage = function() {
// this.isoffical = global.env === 'product';
this.isoffical = global.env === 'product';
// this.isoffical = global.env === 'product';
this.isoffical = true
this.gameId = 8007;
this.hasLogin = false;
this.vision = '1.0.0';

View File

@ -52,7 +52,8 @@
"appid": "wxea7901da6fe663e6",
"setting" : {
"urlCheck" : true
}
},
"sitemapLocation": "sitemap.json"
},
"mp-alipay" : {
"usingComponents" : true

View File

@ -46,6 +46,12 @@
"navigationBarTitleText": "价格列表"
}
},
{
"path": "pages/me/collect",
"style": {
"navigationBarTitleText": "收藏列表"
}
},
{
"path": "pages/article/index",

View File

@ -63,7 +63,6 @@ import PriceCell from '@/components/PriceCell/index.vue'
import DlcCell from '@/components/DlcCell/index.vue'
import { getGameInfo, getGamePrice } from '@/api/game_data'
import { IGameInfo } from '@/modules/gameinfo'
import {uniIcons, uniTag} from '@dcloudio/uni-ui'
import { getCollectList, getZanList, updateCollectInfo, updateZanInfo } from '@/api/game'
import { UserModule } from '@/store/modules/user'
@ -73,8 +72,6 @@ import { UserModule } from '@/store/modules/user'
ImageSwiper,
PriceCell,
DlcCell,
uniIcons,
uniTag
}
})
export default class extends Vue{

74
src/pages/me/collect.vue Normal file
View File

@ -0,0 +1,74 @@
<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'
import { searchGames } from '@/api/game_data'
import { UserModule } from '@/store/modules/user'
@Component({
name: 'Collect',
components: {
GameSmallCell
}
})
export default class extends Vue{
private games: IGameInfo[] = []
async onLoad() {
await this.fetchGames({})
}
onClick(e: any) {
uni.navigateTo({
url: '/pages/info/index?gameId=' + e,
animationType: 'pop-in',
animationDuration: 200})
}
private async fetchGames(param: any) {
let searchParam: any = {skip: 0}
let ids = Array.from(UserModule.collectSet)
if (ids.length > 0) {
searchParam['gameids'] = ids.join(',');
}
Object.assign(searchParam, param)
let res: any = await searchGames(searchParam)
if (res.length === 0) {
return
}
for (let data of res) {
data.gameId = data.oldGameId + ''
data.tags = []
if (data.chinese) {
let arr = data.chinese.split(';')
arr.forEach((o: string) => data.tags.push({name: o, type: 'error'}))
}
if (data.isLowest) data.tags.push({name: '史低', type: 'success', fill: true})
this.games.push(data)
}
}
}
</script>
<style>
game-small-cell{
width: 100%;
}
.uni-list-item-box {
padding: 0!important;
}
</style>

View File

@ -1,6 +1,9 @@
<template>
<view class="container">
<uni-list>
<uni-list-item>
<text-arrow-cell class="cell-item" title="收藏" icon="heart" @cellClicked = 'toCollect'></text-arrow-cell>
</uni-list-item>
<!-- #ifdef MP-WEIXIN -->
<uni-list-item>
<text-arrow-cell class="cell-item" title="联系客服" icon="chatbubble" open-type="contact"></text-arrow-cell>
@ -33,6 +36,12 @@ export default class extends Vue{
}
onClick() {
}
toCollect() {
uni.navigateTo({
url: `/pages/me/collect`,
animationType: 'pop-in',
animationDuration: 200})
}
onClickSm() {
uni.navigateTo({

20
src/sitemap.json Normal file
View File

@ -0,0 +1,20 @@
{
"rules": [
{
"action": "allow",
"page": "pages/index/index"
},
{
"action": "allow",
"page": "pages/list/index"
},
{
"action": "allow",
"page": "pages/info/index"
},
{
"action": "disallow",
"page": "*"
}
]
}