浏览代码

:recycle: removing cruft | tweaking nav and layou to look more like mock-up | added top nav

tags/0.0.1^2
J 3 年前
父节点
当前提交
cf715bce3a

+ 1
- 1
frontend/index.html 查看文件

@@ -6,7 +6,7 @@
6 6
         <title>Vite App</title>
7 7
     </head>
8 8
     <body>
9
-        <div id="app" style="width:90%;margin:5%;"></div>
9
+        <div id="app"></div>
10 10
         <script>
11 11
             // DUMB shim
12 12
             var global = window

+ 4
- 1
frontend/src/App.vue 查看文件

@@ -1,5 +1,7 @@
1 1
 <template lang="pug">
2 2
 w-app
3
+    TopNav(@on-open="openDrawer = !openDrawer")
4
+
3 5
     w-drawer(v-model="openDrawer")
4 6
         SideBar(@updatePid="setPid" :pid="profile.id.value")
5 7
         
@@ -14,6 +16,7 @@ w-app
14 16
 <script>
15 17
 import 'wave-ui/dist/wave-ui.css'
16 18
 import SideBar from './components/SideBar.vue'
19
+import TopNav from './components/TopNav.vue'
17 20
 
18 21
 import { currentProfile } from './services'
19 22
 import { surveyFactory } from './utils'
@@ -22,7 +25,7 @@ const DEV_MODE = import.meta.env.VITE_DEV == 'true'
22 25
 const DEV_PID = 45
23 26
 
24 27
 export default {
25
-    components: { SideBar },
28
+    components: { TopNav, SideBar },
26 29
     data: () => ({
27 30
         sliderVal: 1,
28 31
         openDrawer: false,

+ 15
- 15
frontend/src/components/MainNav.vue 查看文件

@@ -1,25 +1,25 @@
1 1
 <template lang="pug">
2
-w-toolbar.mt6.py1.no-grow(bottom)
3
-    router-link.w-flex.column(:to='`/chats`')
4
-        w-button.pa5.bdrsr.bd1.sh1(bg-color='primary' disabled)
5
-            w-icon.mr1(xl) mdi mdi-forum
6
-            p.text-upper active chats
7
-    router-link.w-flex.column(:to='`/matches`')
8
-        w-button.pa5.bdrsr.bd1.sh1(bg-color='primary')
9
-            w-icon.mr1(xl) mdi mdi-tooltip-account
10
-            p.text-upper pending matches
2
+w-toolbar.mt6.py1(bottom fixed)
11 3
     router-link.w-flex.column(:to='`/`')
12
-        w-button.pa5.bdrsr.bd1.sh1(bg-color='primary')
4
+        w-button.pa8(bg-color='primary')
13 5
             w-icon.mr1(xl) mdi mdi-home
14
-            p.text-upper home queue
6
+            //- p.text-upper home queue
7
+    router-link.w-flex.column(:to='`/matches`')
8
+        w-button.pa8(bg-color='primary')
9
+            w-icon.mr1(xl) mdi mdi-tooltip-account
10
+            //- p.text-upper pending matches
11
+    router-link.w-flex.column(:to='`/chats`')
12
+        w-button.pa8(bg-color='primary' disabled)
13
+            w-icon.mr1(xl) mdi mdi-forum
14
+            //- p.text-upper active chats
15 15
     router-link.w-flex.column(:to='`/survey`')
16
-        w-button.pa5.bdrsr.bd1.sh1(bg-color='primary')
16
+        w-button.pa8(bg-color='primary')
17 17
             w-icon.mr1(xl) mdi mdi-account-check
18
-            p.text-upper survey
18
+            //- p.text-upper survey
19 19
     router-link.w-flex.column(:to='`/settings`')
20
-        w-button.pa5.bdrsr.bd1.sh1(bg-color='primary' disabled)
20
+        w-button.pa8(bg-color='primary' disabled)
21 21
             w-icon.mr1(xl) mdi mdi-cog
22
-            p.text-upper settings
22
+            //- p.text-upper settings
23 23
 </template>
24 24
 
25 25
 <script>

+ 4
- 1
frontend/src/components/ProfileCard.vue 查看文件

@@ -1,6 +1,7 @@
1 1
 <template lang="pug">
2 2
 w-card.profile-card-list--card.xs12.pa12
3 3
     header.xs12.w-flex.column.center
4
+        h1(v-if="isPaired && !isList") some other field
4 5
         NamePlate(:pid="card.pid" :name="card.name" :role="card.role" :is-list="isList")
5 6
         template(v-if="!isList")
6 7
             SummaryBar
@@ -21,13 +22,15 @@ w-card.profile-card-list--card.xs12.pa12
21 22
 </template>
22 23
 
23 24
 <script setup>
24
-import { computed } from 'vue'
25
+import { ref } from 'vue'
25 26
 import NamePlate from './NamePlate.vue'
26 27
 import AspectBar from './AspectBar.vue'
27 28
 import SummaryBar from './SummaryBar.vue'
28 29
 import TagList from './TagList.vue'
29 30
 import PairingButton from './PairingButton.vue'
30 31
 
32
+const isPaired = ref(true1
33
+
31 34
 const props = defineProps({
32 35
     card: {
33 36
         type: Object,

+ 23
- 0
frontend/src/components/TopNav.vue 查看文件

@@ -0,0 +1,23 @@
1
+<template lang="pug">
2
+w-toolbar.w-flex.align-center.justify-between(top fixed)
3
+    router-link.w-flex.column.no-grow(v-if="$route.params.pid" :to='`/`')
4
+        w-button.pa4(bg-color='transparent')
5
+            w-icon.mr1(md) mdi mdi-arrow-left
6
+    
7
+    w-button.pa4(v-if="!$route.params.pid" bg-color='transparent' @click="$emit('on-open')")
8
+        w-icon.mr1(md) mdi mdi-cog
9
+
10
+    router-link.w-flex.column(:to='`/`')
11
+        p.text-upper.text-center {{$route.path}} {{$route.params}}
12
+
13
+    router-link.w-flex.column.no-grow(v-if="!$route.params.pid" :to='`/search`')
14
+        w-button.pa4(bg-color='transparent' disabled)
15
+            w-icon.mr1(md) mdi mdi-magnify
16
+                //- p.text-upper settings
17
+</template>
18
+
19
+<script>
20
+export default {
21
+    name: 'TopNav',
22
+}
23
+</script>

+ 1
- 1
frontend/src/router/index.js 查看文件

@@ -33,7 +33,7 @@ const routes = [
33 33
         meta: { requiresAuth: true, requiresCompleteProfile: true },
34 34
     },
35 35
     {
36
-        path: '/chat/:tid',
36
+        path: '/chat/:pid',
37 37
         component: ChatView,
38 38
         meta: {
39 39
             requiresAuth: true,

+ 1
- 1
frontend/src/views/ChatView.vue 查看文件

@@ -22,7 +22,7 @@ main.view--chat
22 22
         input(v-model="toSend" @keyup.enter="sendMessage")
23 23
         button(@click="sendMessage") send
24 24
 
25
-    p(v-else-if="profile.isLoggedIn && !target") No match found between profile {{ $route.params.tid }} and {{profile.id}}... 
25
+    p(v-else-if="profile.isLoggedIn && !target") No match found between profile {{ $route.params.pid }} and {{profile.id}}... 
26 26
     p(v-else) Loading...
27 27
 
28 28
     MainNav

+ 0
- 5
frontend/src/views/HomeView.vue 查看文件

@@ -29,11 +29,6 @@ main.view--home
29 29
                 type='password'
30 30
             )
31 31
 
32
-        SummaryBar
33
-        TagList(:icon='{ family: "mdi", shape: "heart" }')
34
-        AspectBar
35
-        PairingButton
36
-
37 32
     MainNav
38 33
 </template>
39 34
 

正在加载...
取消
保存