修正店铺编辑游戏时的一些bug

This commit is contained in:
zhl 2021-05-19 14:57:44 +08:00
parent faa9394f87
commit 6213d20ef9

View File

@ -94,7 +94,7 @@
import { Component, Vue, Watch } from 'vue-property-decorator' import { Component, Vue, Watch } from 'vue-property-decorator'
import { getGames, IGameData, IGameVersion } from '@/api/game' import { getGames, IGameData, IGameVersion } from '@/api/game'
import Sticky from '@/components/Sticky/index.vue' 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 { import {
getShopGameInfo, getShopGameInfo,
@ -175,8 +175,7 @@ export default class extends Vue {
const game = this.list[i] const game = this.list[i]
for (const v of game.versions) { for (const v of game.versions) {
if (v.type === 1) { if (v.type === 1) {
const url = await this.getGameQr(this.shop, this.gameid, this.versionid) v.qr = await this.getGameQr(this.shop, game._id!, v._id!)
v.qr = [url]
} }
} }
Vue.set(this.list, i, game) Vue.set(this.list, i, game)
@ -277,8 +276,8 @@ export default class extends Vue {
} }
private showPreview(data: IGameVersion) { private showPreview(data: IGameVersion) {
if (data.type === 1) { if (data.type === 1 && data.qr) {
this.qrUrl = data.qr this.qrUrl = data.qr!
this.showViewer = true this.showViewer = true
} else if (data.url) { } else if (data.url) {
window.open(data.url, '_blank') window.open(data.url, '_blank')