feat: PageFront 국가방침 출력

This commit is contained in:
2023-03-09 02:20:21 +09:00
parent ba27c95653
commit abccc7c268
+29 -3
View File
@@ -61,7 +61,10 @@
</div>
<div class="onlineNations">접속중인 국가: {{ globalInfo.onlineNations }}</div>
<div class="onlineUsers">접속자</div>
<div class="nationNotice">국가 방침</div>
<div class="nationNotice">국가 방침
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="nationInfo" class="nationNoticeBody" v-html="nationInfo.nationNotice.msg" />
</div>
<div id="ingameBoard">
<!-- TODO: 운영자 툴바는 어디에?-->
<div class="mapView">
@@ -215,7 +218,7 @@ import CityBasicCard from "./components/CityBasicCard.vue";
import NationBasicCard from "./components/NationBasicCard.vue";
import GeneralBasicCard from "./components/GeneralBasicCard.vue";
import MessagePanel from "./components/MessagePanel.vue";
import type { GeneralListItemP1 } from "./defs/API/Nation";
import type { NationInfoFull } from "./defs/API/Nation";
import type { MapResult, NationStaticItem } from "./defs";
import { formatTime } from "./util/formatTime";
import { calcTournamentTerm } from "./utilGame";
@@ -428,7 +431,7 @@ const frontInfo = ref<GetFrontInfoResponse>();
const globalInfo = ref<GetFrontInfoResponse["global"]>({} as GetFrontInfoResponse["global"]);
const generalInfo = ref<GetFrontInfoResponse["general"]>();
const nationStaticInfo = ref<NationStaticItem>();
const nationInfo = ref<NationInfoFull>();
let generalInfoLock = false;
watch(refreshCounter, async () => {
@@ -470,6 +473,23 @@ watch(refreshCounter, async () => {
}
});
watch(refreshCounter, async () => {
try {
const response = await SammoAPI.Nation.GetNationInfo({full: true});
console.log('nation', response);
if(!response.isFull){
throw 'NationInfo 반환값 에러';
}
nationInfo.value = response;
} catch (e) {
console.error(e);
toasts.danger({
title: "국가 정보 갱신 실패",
body: `${e}`,
});
}
});
const map = ref<MapResult>();
const cityPosition = getCityPosition();
@@ -532,6 +552,12 @@ watch(refreshCounter, async () => {
display: grid;
}
.nationNoticeBody{
:deep(p) {
min-height: 1em;
}
}
@include media-500px {
#outBlock {
position: absolute;