Bladeren bron

Проект модульный экзамин 2

unknown 1 maand geleden
bovenliggende
commit
71ebd4fecf
4 gewijzigde bestanden met toevoegingen van 54 en 27 verwijderingen
  1. 7 6
      nuxt3/layouts/default.vue
  2. 26 0
      nuxt3/pages/index.vue
  3. 2 2
      nuxt3/pages/signIn.vue
  4. 19 19
      nuxt3/pages/signUp.vue

+ 7 - 6
nuxt3/layouts/default.vue

@@ -9,19 +9,19 @@
 </script>
 
 <template>
-    <section class="content container-md d-flex flex-column">
+    <section class="content container-md d-flex flex-column gap-5">
         <header>
             <nav class="container p-4">
                 <ul class="d-flex justify-content-between p-0 m-0">
                     <section class="d-flex gap-3 ">
                         <li><NuxtLink to="/"><img src="../public/images/image01.webp" alt=""></NuxtLink></li>
-                        <li class="d-sm-none d-xl-flex"><NuxtLink to="">Заявки</NuxtLink></li>
-                        <li class="d-sm-none d-xl-flex"><NuxtLink to="">Создать заявку</NuxtLink></li>
+                        <li class="d-sm-none d-xl-flex"><NuxtLink to="/orders">Заявки</NuxtLink></li>
+                        <li class="d-sm-none d-xl-flex"><NuxtLink to="/create-order">Создать заявку</NuxtLink></li>
                     </section>
 
                     <section class="d-flex gap-3 ">
-                        <li class="d-sm-none d-xl-flex"><NuxtLink to="/signIn" class="btn btn-primary ">авторизация</NuxtLink></li>
-                        <li class="d-sm-none d-xl-flex"><NuxtLink to="/signUp" class="btn btn-primary">Регистрация</NuxtLink></li>
+                        <li class="d-sm-none d-xl-flex"><NuxtLink to="/signIn" class="btn btn-primary  d-flex justify-content-center align-items-center">авторизация</NuxtLink></li>
+                        <li class="d-sm-none d-xl-flex"><NuxtLink to="/signUp" class="btn btn-primary d-flex justify-content-center align-items-center">Регистрация</NuxtLink></li>
                          <button class="d-xl-none d-lg-flex navbar-toggler btn btn-primary" type="button" data-bs-toggle="offcanvas" data-bs-target="#offcanvasNavbar" aria-controls="offcanvasNavbar">
                           Меню
                             </button>
@@ -32,7 +32,7 @@
                             </div>
                             <div class="offcanvas-body">
                                 <ul class="navbar-nav justify-content-end flex-grow-1 pe-3 d-flex flex-column gap-3">
-                                    <li><NuxtLink to="/order">Заявки</NuxtLink></li>
+                                    <li><NuxtLink to="/orders">Заявки</NuxtLink></li>
                                     <li><NuxtLink to="/create-order">Создать заявку</NuxtLink></li>
                                     <li><NuxtLink to="/signIn">авторизация</NuxtLink></li>
                                  <li><NuxtLink to="/signUp">Регистрация</NuxtLink></li>
@@ -68,5 +68,6 @@
     }
     a{
         text-decoration: none;
+        text-align: center;
     }
 </style>

+ 26 - 0
nuxt3/pages/index.vue

@@ -26,6 +26,32 @@
             <span class="visually-hidden">Next</span>
         </button>
         </div>
+
+        <section class="container d-flex justify-content-between">
+            <div class="card" style="width: 18rem;">
+  <ul class="list-group list-group-flush">
+    <li class="list-group-item">Курс</li>
+    <li class="list-group-item">Програмирования</li>
+    <li class="list-group-item">Python</li>
+  </ul>
+</div>
+
+<div class="card" style="width: 18rem;">
+  <ul class="list-group list-group-flush">
+    <li class="list-group-item">Вибинар</li>
+    <li class="list-group-item">Машинный код</li>
+    <li class="list-group-item">Остновы</li>
+  </ul>
+</div>
+
+<div class="card" style="width: 18rem;">
+  <ul class="list-group list-group-flush">
+    <li class="list-group-item">Курс</li>
+    <li class="list-group-item">програмирования</li>
+    <li class="list-group-item">html, css, js</li>
+  </ul>
+</div>
+        </section>
     </section>
 </template>
 

+ 2 - 2
nuxt3/pages/signIn.vue

@@ -26,8 +26,8 @@
     <section class="d-flex justify-content-center align-items-center flex-column">
         <form @submit.prevent="submitForm()" class="d-flex flex-column gap-3">
             <h1>авторизация</h1>
-            <input type="text" placeholder="Логин" v-model="login">
-            <input type="password" placeholder="Пароль" v-model="password">
+            <input class="p-1" type="text" placeholder="Логин" v-model="login">
+            <input class="p-1" type="password" placeholder="Пароль" v-model="password">
             <button type="submit" class="btn btn-primary">Авторизироватся</button>
         </form>
     </section>

+ 19 - 19
nuxt3/pages/signUp.vue

@@ -4,21 +4,21 @@
     let errorForm = ref('');
         if(!fullname.value && !login.value && !phone.value && !email.value && !password.value){
             const submitForm = async () => {
-            try {
-                    const {data} = await $fetch('/api/signUp', {
-                        method: 'post',
-                        body: {
-                            fullname: fullname.value,
-                            login: login.value,
-                            phone: phone.value,
-                            email: email.value,
-                            password: password.value
-                        }
-                    })
-            } catch (error) {
-                    console.log('signUp', error);
+                try {
+                        const {data} = await $fetch('/api/signUp', {
+                            method: 'post',
+                            body: {
+                                fullname: fullname.value,
+                                login: login.value,
+                                phone: phone.value,
+                                email: email.value,
+                                password: password.value
+                            }
+                        })
+                } catch (error) {
+                        console.log('signUp', error);
+                }
             }
-        }
     }else{
         errorForm.value = 'Заполните все поля'         
     }
@@ -29,11 +29,11 @@
         <h1>Регистрация</h1>
         <form @submit.prevent="submitForm()" class="d-flex flex-column gap-3">
             <p>{{ errorForm }}</p>
-            <input type="text" placeholder="ФИО" v-model="fullname">
-            <input type="text" placeholder="Логин" v-model="login">
-            <input type="text" placeholder="Телифон" v-model="phone">
-            <input type="email" placeholder="Почта" v-model="email">
-            <input type="password" placeholder="Пароль" v-model="password">
+            <input class="p-1"  type="text" placeholder="ФИО" v-model="fullname">
+            <input class="p-1" type="text" placeholder="Логин" v-model="login">
+            <input class="p-1" type="text" placeholder="Телифон" v-model="phone">
+            <input class="p-1" type="email" placeholder="Почта" v-model="email">
+            <input class="p-1" type="password" placeholder="Пароль" v-model="password">
             <button type="submit" class="btn btn-primary">Зарегистрироватся</button>
         </form>
     </section>