ปรับ style button / responsive
All checks were successful
frontend-action / build-image (push) Successful in 48s

This commit is contained in:
2024-04-26 14:37:34 +07:00
parent 5fc473780c
commit c53dca42c7
4 changed files with 29 additions and 14 deletions

View File

@@ -111,6 +111,7 @@ export default {
// location.reload(); // location.reload();
this.$store.commit("setUsername", ""); this.$store.commit("setUsername", "");
this.$store.commit("setImg", ""); this.$store.commit("setImg", "");
this.$store.commit("setCheckPage", "");
this.$router.push("/"); this.$router.push("/");
}, },
}, },

View File

@@ -7,7 +7,7 @@
<v-img <v-img
:aspect-ratio="1" :aspect-ratio="1"
src="../assets/logo-title.png" src="../assets/logo-title.png"
width="600" width="600"
@click="$router.push('/')" @click="$router.push('/')"
></v-img> ></v-img>
</v-col> </v-col>
@@ -24,7 +24,7 @@
style="color: #0f470f" style="color: #0f470f"
size="large" size="large"
height="80" height="80"
to="/login" @click="checkPage"
> >
<span class="text-normal">เขาสระบบสำหรบผแสดงตนแล</span> <span class="text-normal">เขาสระบบสำหรบผแสดงตนแล</span>
</v-btn> </v-btn>
@@ -33,7 +33,11 @@
</div> </div>
</div> </div>
<div style="position: relative" class="bg-curve" id="started"> <div style="position: relative" class="bg-curve" id="started">
<v-row style="height: 100%;width: 90%;" align="center" class="text-center ma-auto" > <v-row
style="height: 100%; width: 90%"
align="center"
class="text-center ma-auto"
>
<v-col cols="12" md="" class="text-normal mb-10"> <v-col cols="12" md="" class="text-normal mb-10">
<div class="text-center text-white py-5"> <div class="text-center text-white py-5">
<div class="text-title my-3">ใครสมคร สว.ไดาง</div> <div class="text-title my-3">ใครสมคร สว.ไดาง</div>
@@ -63,7 +67,7 @@
></v-img> ></v-img>
</v-btn> </v-btn>
</div> </div>
<br> <br />
</v-col> </v-col>
<!-- <v-col cols="12" md="" class="mt-0 mt-md-10 mt-lg-10" > <!-- <v-col cols="12" md="" class="mt-0 mt-md-10 mt-lg-10" >
<v-btn <v-btn
@@ -116,6 +120,12 @@ export default {
computed: { computed: {
...mapGetters(["getUsername"]), ...mapGetters(["getUsername"]),
}, },
methods: {
checkPage() {
this.$store.commit("setCheckPage", true);
this.$router.push("/login");
},
},
}; };
</script> </script>
<style> <style>

View File

@@ -3,15 +3,20 @@ import { createStore } from "vuex";
export default createStore({ export default createStore({
state: { state: {
username:"", username:"",
img:"" img:"",
checkPage:""
}, },
getters: { getters: {
getUsername: (state) => { getUsername: (state) => {
return state.username return state.username
}, },
getImg: (state) => { getImg: (state) => {
return state.img return state.img
}, },
getCheckPage: (state) => {
return state.checkPage
},
}, },
mutations: { mutations: {
setUsername: (state, payload) => { setUsername: (state, payload) => {
@@ -20,6 +25,9 @@ export default createStore({
setImg: (state, payload) => { setImg: (state, payload) => {
state.img = payload; state.img = payload;
}, },
setCheckPage: (state, payload) => {
state.checkPage = payload;
},
}, },
actions: { actions: {
setLocalStorageValue(data) { setLocalStorageValue(data) {

View File

@@ -80,7 +80,7 @@
</v-form> </v-form>
</v-card> </v-card>
</div> </div>
<div v-if="getUsername" class="text-normal text-center py-10"> <div v-if="getUsername&&getCheckPage" class="text-normal text-center py-10">
<v-icon <v-icon
icon="mdi-alert-circle-outline" icon="mdi-alert-circle-outline"
size="35" size="35"
@@ -89,7 +89,7 @@
คุณเข้าสู่ระบบอยู่แล้ว คุณเข้าสู่ระบบอยู่แล้ว
<div class="mt-10"> <div class="mt-10">
<v-btn elevated color="#DD6C31" class="text-normal ma-6" height="85" to="/"> <v-btn elevated color="#DD6C31" class="text-normal ma-6" height="85" to="/" width="300">
<span class="text-normal"> กลับหน้าหลัก</span> <span class="text-normal"> กลับหน้าหลัก</span>
<v-img <v-img
@@ -102,9 +102,10 @@
<v-btn <v-btn
elevated elevated
color="#DD6C31" color="#DD6C31"
class="text-normal btn-w ma-6" class="text-normal ma-6"
height="85" height="85"
to="/search" to="/search"
width="300"
> >
<v-img <v-img
:aspect-ratio="1" :aspect-ratio="1"
@@ -123,7 +124,7 @@ import { mapGetters } from "vuex";
import { client } from "@/utils/trpc"; import { client } from "@/utils/trpc";
export default { export default {
computed: { computed: {
...mapGetters(["getUsername", "getImg"]), ...mapGetters(["getUsername", "getImg","getCheckPage"]),
}, },
data: () => ({ data: () => ({
form1: false, form1: false,
@@ -149,12 +150,7 @@ export default {
localStorage.setItem("img", data.image); localStorage.setItem("img", data.image);
this.$store.commit("setUsername", data.firstName); this.$store.commit("setUsername", data.firstName);
this.$store.commit("setImg", data.image); this.$store.commit("setImg", data.image);
// this.$emitter.emit("loginUser", data.firstName );
this.$router.push("/"); this.$router.push("/");
// location.reload();
// this.$store.dispatch('setLocalStorageValue',data.firstName)
}) })
.catch((error) => { .catch((error) => {
alert("ไม่สามารถโหลดข้อมูลได้"); alert("ไม่สามารถโหลดข้อมูลได้");