|
|
@@ -2,50 +2,55 @@
|
|
2
|
2
|
w-card.profile-card-list--card.xs12.pa12
|
|
3
|
3
|
header.xs12.w-flex.column.center
|
|
4
|
4
|
NamePlate(
|
|
5
|
|
- :pid="card.pid"
|
|
6
|
|
- :name="card.name"
|
|
7
|
|
- :pronouns="card.pronouns"
|
|
8
|
|
- :role="card.role"
|
|
9
|
|
- :is-list="isList"
|
|
10
|
|
- :is-paired="isPaired"
|
|
|
5
|
+ :is-list='isList'
|
|
|
6
|
+ :is-paired='isPaired'
|
|
|
7
|
+ :name='card.name'
|
|
|
8
|
+ :pid='card.pid'
|
|
|
9
|
+ :pronouns='card.pronouns'
|
|
|
10
|
+ :role='card.role'
|
|
11
|
11
|
)
|
|
12
|
|
-
|
|
13
|
|
- w-button.text-upper.xs12.pa6(v-if="isPaired && !isList")
|
|
14
|
|
- w-icon(xl).mr1 mdi mdi-chat
|
|
|
12
|
+
|
|
|
13
|
+ w-button.text-upper.xs12.pa6(v-if='isPaired && !isList')
|
|
|
14
|
+ w-icon.mr1(xl) mdi mdi-chat
|
|
15
|
15
|
| start chat
|
|
16
|
|
-
|
|
17
|
|
- template(v-if="!isList")
|
|
18
|
|
- SummaryBar(
|
|
19
|
|
- :is-tab="isPaired"
|
|
20
|
|
- :tab-content="card.summary"
|
|
21
|
|
- )
|
|
22
|
|
- TagList(v-if="!isPaired || isList")
|
|
|
16
|
+
|
|
|
17
|
+ template(v-if='!isList')
|
|
|
18
|
+ SummaryBar(:is-tab='isPaired' :tab-content='card.summary')
|
|
|
19
|
+ TagList(v-if='!isPaired || isList')
|
|
23
|
20
|
|
|
24
|
21
|
article.xs12.w-flex.column.justify-space-between
|
|
25
|
22
|
AspectBar(
|
|
26
|
|
- v-if="!isPaired || isList"
|
|
27
|
|
- v-for="aspect in aspects"
|
|
28
|
|
- :labels="aspect.labels"
|
|
29
|
|
- :percentage="aspect.percentage"
|
|
30
|
|
- :key="aspect.name"
|
|
|
23
|
+ :key='aspect.name'
|
|
|
24
|
+ :labels='aspect.labels'
|
|
|
25
|
+ :percentage='aspect.percentage'
|
|
|
26
|
+ v-for='aspect in aspects'
|
|
|
27
|
+ v-if='!isPaired || isList'
|
|
31
|
28
|
)
|
|
32
|
|
-
|
|
33
|
|
- footer(v-if="!isList && !isPaired")
|
|
|
29
|
+
|
|
|
30
|
+ footer(v-if='!isList && !isPaired')
|
|
34
|
31
|
.pa12
|
|
35
|
32
|
p {{ card.summary.about.tab }}
|
|
36
|
|
- PairingButton(v-if="!isPaired")
|
|
|
33
|
+ PairingButton(@pair='onPair' @pass='onPass' v-if='!isPaired')
|
|
37
|
34
|
</template>
|
|
38
|
35
|
|
|
39
|
36
|
<script setup>
|
|
40
|
37
|
import { ref } from 'vue'
|
|
|
38
|
+import { useRouter } from 'vue-router'
|
|
|
39
|
+import {
|
|
|
40
|
+ updateQueueByProfileId,
|
|
|
41
|
+ postMembershipByProfileId,
|
|
|
42
|
+ currentProfile,
|
|
|
43
|
+} from '../services'
|
|
|
44
|
+
|
|
41
|
45
|
import NamePlate from './NamePlate.vue'
|
|
42
|
46
|
import AspectBar from './AspectBar.vue'
|
|
43
|
47
|
import SummaryBar from './SummaryBar.vue'
|
|
44
|
48
|
import TagList from './TagList.vue'
|
|
45
|
49
|
import PairingButton from './PairingButton.vue'
|
|
46
|
50
|
|
|
47
|
|
-const isPaired = ref(true)
|
|
48
|
|
-// const isPaired = ref(false)
|
|
|
51
|
+const router = useRouter()
|
|
|
52
|
+// const isPaired = ref(true)
|
|
|
53
|
+const isPaired = ref(false)
|
|
49
|
54
|
|
|
50
|
55
|
const props = defineProps({
|
|
51
|
56
|
card: {
|
|
|
@@ -62,6 +67,21 @@ const props = defineProps({
|
|
62
|
67
|
default: true,
|
|
63
|
68
|
},
|
|
64
|
69
|
})
|
|
|
70
|
+
|
|
|
71
|
+const onPair = async () => {
|
|
|
72
|
+ const group = await postMembershipByProfileId({
|
|
|
73
|
+ profileId: currentProfile.id.value,
|
|
|
74
|
+ targetId: props.card.pid,
|
|
|
75
|
+ })
|
|
|
76
|
+ updateQueueByProfileId(currentProfile.id.value, props.card.pid, false)
|
|
|
77
|
+ console.warn('created grouping:', group)
|
|
|
78
|
+ console.log('is grouping a match?:', group.membershipMatch.hasMatch)
|
|
|
79
|
+ router.push({ name: 'HomeView' })
|
|
|
80
|
+}
|
|
|
81
|
+const onPass = async () => {
|
|
|
82
|
+ updateQueueByProfileId(currentProfile.id.value, props.card.pid, true)
|
|
|
83
|
+ router.push({ name: 'HomeView' })
|
|
|
84
|
+}
|
|
65
|
85
|
</script>
|
|
66
|
86
|
|
|
67
|
87
|
<style lang="sass">
|