Add notification pending payment

This commit is contained in:
Amir
2022-10-15 23:14:58 +08:00
parent aa7dece42d
commit c38b4aded7
+50 -8
View File
@@ -1,22 +1,64 @@
<template>
<Message severity="warn" :closable="false"
>Tahniah, bidaan anda menang!
<a class="ml-1 text-blue" @click="toResult()" href="#"
><span class="underline">Selesaikan pembayaran sekarang.</span></a
></Message
>
<div v-if="isSuccess">
<div v-if="notPay">
<Message severity="warn" :closable="false"
>Tahniah, bidaan anda menang!
<a class="ml-1 text-blue" @click="toResult()" href="#">
<span class="underline">Selesaikan pembayaran sekarang.</span>
</a>
</Message>
</div>
</div>
<div v-else></div>
</template>
<script>
import axios from "axios";
export default {
data() {
return {};
return {
isSuccess: false,
notPay: false,
};
},
mounted: function () {
this.getLelong();
},
mounted: function () {},
methods: {
resultStatus() {
// "/resultStatus/" + localStorage.getItem("id") + "/" + this.lelongId,
},
getLelong() {
this.loading = true;
axios
.get("/resultLelong", {
headers: {
Authorization: "Bearer " + localStorage.getItem("token"),
},
params: {
user_id: localStorage.getItem("id"),
},
})
.then((response) => {
this.loading = false;
console.log(response);
if (response.data.success === true) {
this.isSuccess = true;
if (response.data.lelong[0].status == null) {
this.notPay = true;
} else {
this.notPay = false;
}
} else {
this.isSuccess = false;
}
})
.catch((error) => {
console.log(error);
});
},
toResult() {
this.$router.push({ name: "result" });
},