update
This commit is contained in:
+51
-14
@@ -71,43 +71,80 @@
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
|
||||
<FormKit type="form" @submit="edit" :incomplete-message="false" :actions="false">
|
||||
<div class="relative items-center gap-[5vw] md:gap-0 grid grid-cols-1 md:grid-cols-2 mt-[2vw] w-full md:w-[65%]">
|
||||
<div class="flex flex-col space-y-[0.2vw] mb-[0.5vw]">
|
||||
<label for="" class="text-[3.19vw] md:text-[0.833vw] font-[400]">شماره موبایل</label>
|
||||
<input
|
||||
:value="authUser?.phone"
|
||||
type="text"
|
||||
class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw] px-[1vw]"
|
||||
<input type="text" name="name"
|
||||
:value="authUser?.phone"
|
||||
readonly
|
||||
class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw] px-[1vw]"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-[0.2vw] mb-[0.5vw]">
|
||||
<label for="" class="text-[3.19vw] md:text-[0.833vw] font-[400]"
|
||||
>نام و نام خانوادگی</label
|
||||
>
|
||||
<input
|
||||
<FormKit
|
||||
name="name"
|
||||
:value="authUser?.name"
|
||||
type="text"
|
||||
class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw]"
|
||||
input-class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw] px-[1vw]"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-[0.2vw]">
|
||||
<label for="" class="text-[3.19vw] md:text-[0.833vw] font-[400]">نام کاربری</label>
|
||||
<FormKit
|
||||
name="userName"
|
||||
:value="authUser?.userName"
|
||||
type="text"
|
||||
input-class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw] px-[1vw]"
|
||||
/>
|
||||
</div>
|
||||
<div class="flex flex-col space-y-[0.2vw]">
|
||||
<label for="" class="text-[3.19vw] md:text-[0.833vw] font-[400]">ایمیل</label>
|
||||
<input
|
||||
<FormKit
|
||||
name="email"
|
||||
:value="authUser?.email"
|
||||
type="text"
|
||||
class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw]"
|
||||
input-class="bg-[#F5F5F5] h-[13.59vw] md:h-[2.969vw] w-full md:w-[19.01vw] rounded-[2.564vw] md:rounded-[0.521vw] px-[1vw]"
|
||||
/>
|
||||
</div>
|
||||
<button
|
||||
class="text-[3.59vw] md:text-[0.833vw] absolute md:left-[1vw] top-[80vw] md:top-[11vw] greenButton h-[13.59vw] md:h-[2.813vw] w-full md:w-[8.438vw] rounded-[2.564vw] md:rounded-[0.521vw] flexBox px-0"
|
||||
>
|
||||
ثبت اطلاعات
|
||||
</button>
|
||||
<FormKit
|
||||
input-class="
|
||||
text-[3.59vw] md:text-[0.833vw] absolute md:left-[1vw] top-[80vw] md:top-[11vw] greenButton h-[13.59vw]
|
||||
md:h-[2.813vw] w-full md:w-[8.438vw] rounded-[2.564vw] md:rounded-[0.521vw] flexBox px-0
|
||||
"
|
||||
type="submit">
|
||||
ویرایش
|
||||
</FormKit>
|
||||
</div>
|
||||
</FormKit>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
<script setup>
|
||||
import { useToast } from 'vue-toastification'
|
||||
const toast = useToast()
|
||||
const { authUser } = useAuth();
|
||||
const loading = ref(false)
|
||||
|
||||
const edit = async(formData) => {
|
||||
console.log('form :',formData);
|
||||
try {
|
||||
loading.value = true;
|
||||
await $fetch('/api/user/update', {
|
||||
method: 'PUT',
|
||||
body: formData
|
||||
})
|
||||
// toast.success("ویرایش اطلاعات شما باموفقیت انجام شد");
|
||||
location.reload()
|
||||
} catch (error) {
|
||||
toast.error(error)
|
||||
} finally {
|
||||
loading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
@@ -385,7 +385,6 @@ import { useToast } from 'vue-toastification'
|
||||
const toast = useToast()
|
||||
|
||||
const { data: tickets, refresh: load } = await useFetch("/api/ticket");
|
||||
console.log('cli tick', tickets);
|
||||
const loading = ref(false);
|
||||
const addTicketForm = ref(false);
|
||||
const subject = ref(null);
|
||||
@@ -401,12 +400,13 @@ const sendTicket = async () => {
|
||||
const data = await useFetch("/api/ticket", {
|
||||
method: "POST",
|
||||
body: {
|
||||
subject,
|
||||
subject: subject.value,
|
||||
},
|
||||
});
|
||||
subject.value = '';
|
||||
addTicketForm.value = false;
|
||||
load()
|
||||
addTicketForm.value = false;
|
||||
subject.value = null;
|
||||
console.log('تیکت',data);
|
||||
|
||||
};
|
||||
|
||||
@@ -424,9 +424,6 @@ const openTicket = async (data) => {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
const {data: single, refresh: reload} = await useFetch("/api/ticket/id", {
|
||||
method: "POST",
|
||||
body: {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="courses">
|
||||
<div >
|
||||
<home-page-courses-sectionCategories />
|
||||
<courses-pageCourses-list />
|
||||
<!-- <courses-pageCourses-list /> -->
|
||||
<courses-pagePagination />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user