diff --git a/src/views/game/game_setting.vue b/src/views/game/game_setting.vue index 73c66eb..8cdf50b 100644 --- a/src/views/game/game_setting.vue +++ b/src/views/game/game_setting.vue @@ -94,7 +94,7 @@ import { Component, Vue, Watch } from 'vue-property-decorator' import { getGames, IGameData, IGameVersion } from '@/api/game' import Sticky from '@/components/Sticky/index.vue' -import ElImageViewer from 'element-ui/packages/image/src/image-viewer' +import ElImageViewer from 'element-ui/packages/image/src/image-viewer.vue' import { getShopGameInfo, @@ -175,8 +175,7 @@ export default class extends Vue { const game = this.list[i] for (const v of game.versions) { if (v.type === 1) { - const url = await this.getGameQr(this.shop, this.gameid, this.versionid) - v.qr = [url] + v.qr = await this.getGameQr(this.shop, game._id!, v._id!) } } Vue.set(this.list, i, game) @@ -277,8 +276,8 @@ export default class extends Vue { } private showPreview(data: IGameVersion) { - if (data.type === 1) { - this.qrUrl = data.qr + if (data.type === 1 && data.qr) { + this.qrUrl = data.qr! this.showViewer = true } else if (data.url) { window.open(data.url, '_blank')