feat,fix,wip: 버그 수정, 연장 시간 로직 변경
This commit is contained in:
@@ -17,8 +17,8 @@
|
||||
<div class="col-4 col-md-2 bg2">종료시점</div>
|
||||
<div class="col-4 col-md-2">{{ currentAuction.auction.closeDate }}</div>
|
||||
|
||||
<div class="col-4 col-md-2 bg2">연장 허용</div>
|
||||
<div class="col-4 col-md-2">{{ currentAuction.auction.remainCloseDateExtensionCnt }}회</div>
|
||||
<div class="col-4 col-md-2 bg2">최대지연</div>
|
||||
<div class="col-4 col-md-2">{{ currentAuction.auction.availableLatestBidCloseDate }}</div>
|
||||
</div>
|
||||
<div class="bg1">입찰자 목록</div>
|
||||
<div class="row gx-0 bg2">
|
||||
@@ -42,7 +42,7 @@
|
||||
:step="1"
|
||||
></NumberInputWithInfo>
|
||||
</div>
|
||||
<div><BButton @click="bidAuction">입찰</BButton></div>
|
||||
<div class="col"><BButton @click="bidAuction">입찰</BButton></div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -74,10 +74,12 @@ type AuctionItemInfo = UniqueItemAuctionList["list"][0];
|
||||
const currentAuctionID = ref<number>();
|
||||
const currentAuction = ref<UniqueItemAuctionDetail | undefined>(undefined);
|
||||
const bidAmount = ref<number>(5000);
|
||||
watch(currentAuctionID, async (auctionID) => {
|
||||
if (auctionID === undefined) {
|
||||
|
||||
async function refreshDetail() {
|
||||
if (currentAuctionID.value === undefined) {
|
||||
return;
|
||||
}
|
||||
const auctionID = currentAuctionID.value;
|
||||
try {
|
||||
currentAuction.value = await SammoAPI.Auction.GetUniqueItemAuctionDetail({ auctionID });
|
||||
} catch (e) {
|
||||
@@ -89,6 +91,9 @@ watch(currentAuctionID, async (auctionID) => {
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
watch(currentAuctionID, () => {
|
||||
void refreshDetail();
|
||||
});
|
||||
const auctionList = ref(new Map<number, AuctionItemInfo>());
|
||||
const obfuscatedName = ref("");
|
||||
@@ -115,26 +120,26 @@ async function refresh() {
|
||||
}
|
||||
}
|
||||
|
||||
async function bidAuction(){
|
||||
if(currentAuction.value === undefined){
|
||||
async function bidAuction() {
|
||||
if (currentAuction.value === undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const amount = bidAmount.value;
|
||||
const auctionInfo = currentAuction.value.auction;
|
||||
|
||||
if(confirm(`${auctionInfo.title}에 ${amount}유산포인트를 입찰하시겠습니까?`)){
|
||||
try{
|
||||
if (confirm(`${auctionInfo.title}에 ${amount}유산포인트를 입찰하시겠습니까?`)) {
|
||||
try {
|
||||
await SammoAPI.Auction.BidUniqueAuction({ auctionID: auctionInfo.id, amount });
|
||||
toasts.success({
|
||||
title: "성공",
|
||||
body: "입찰이 완료되었습니다.",
|
||||
});
|
||||
await refresh();
|
||||
}catch(e){
|
||||
void refreshDetail();
|
||||
void refresh();
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
if(isString(e)){
|
||||
if (isString(e)) {
|
||||
toasts.danger({
|
||||
title: "에러",
|
||||
body: e,
|
||||
|
||||
Reference in New Issue
Block a user