generated from VLADIMIR/template_frontend
fixes
This commit is contained in:
@@ -16,64 +16,70 @@ const route = useRoute()
|
||||
const scenarioId = route.params.id
|
||||
|
||||
const scenario = ref<Scenario>({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
story: undefined,
|
||||
author: undefined,
|
||||
status: undefined,
|
||||
updatedAt: undefined,
|
||||
createdAt: undefined,
|
||||
publishedAt: undefined,
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
story: undefined,
|
||||
author: undefined,
|
||||
status: undefined,
|
||||
updatedAt: undefined,
|
||||
createdAt: undefined,
|
||||
publishedAt: undefined,
|
||||
})
|
||||
|
||||
async function getScenario(id: number) {
|
||||
const res = await client.GetScenario({ id: id })
|
||||
if (res.error != '') {
|
||||
message.error(res.error!)
|
||||
return
|
||||
}
|
||||
scenario.value = res.scenario!
|
||||
const res = await client.GetScenario({ id: id })
|
||||
if (res.error != '') {
|
||||
message.error(res.error!)
|
||||
return
|
||||
}
|
||||
scenario.value = res.scenario!
|
||||
}
|
||||
getScenario(Number(scenarioId))
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="center-block-custom">
|
||||
<div class="width700">
|
||||
<div class="scenario-title">
|
||||
{{ scenario.name }}
|
||||
</div>
|
||||
<img class="scenario-image" :src="scenario.image">
|
||||
<div class="scenario-description">
|
||||
{{ scenario.description }}
|
||||
</div>
|
||||
<div class="scenario-author">
|
||||
<n-tag :bordered="false" type="success" class="status-block">Автор: {{ scenario.author?.username
|
||||
}}</n-tag>
|
||||
</div>
|
||||
<IntroBlock
|
||||
v-if="scenario.story?.introduction && (scenario.story.introduction.text || scenario.story.introduction.audio)"
|
||||
:introduction="scenario.story.introduction" mode="show" />
|
||||
</div>
|
||||
<div class="center-block-custom">
|
||||
<div class="width700">
|
||||
<div class="scenario-title">
|
||||
{{ scenario.name }}
|
||||
</div>
|
||||
<img class="scenario-image" :src="scenario.image" />
|
||||
<div class="scenario-description">
|
||||
{{ scenario.description }}
|
||||
</div>
|
||||
<div class="scenario-author">
|
||||
<n-tag :bordered="false" type="success" class="status-block"
|
||||
>Автор: {{ scenario.author?.username }}</n-tag
|
||||
>
|
||||
</div>
|
||||
<IntroBlock
|
||||
v-if="
|
||||
scenario.story?.introduction &&
|
||||
(scenario.story.introduction.text || scenario.story.introduction.audio)
|
||||
"
|
||||
:introduction="scenario.story.introduction"
|
||||
mode="show"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<HeaderMenu active="catalog" />
|
||||
<HeaderMenu active="catalog" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
.scenario-title {
|
||||
font-size: 24px;
|
||||
margin-bottom: 10px;
|
||||
font-size: 24px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.scenario-image {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
margin-bottom: 10px;
|
||||
margin-bottom: 10px;
|
||||
max-width: 400px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.scenario-description {
|
||||
color: #aaa;
|
||||
margin-bottom: 10px;
|
||||
color: #aaa;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user