-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSupport.vue
121 lines (120 loc) · 2.84 KB
/
Support.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<template>
<div>
<div>
<v-row no-gutters>
<v-col cols="7" md="3">
<v-text-field
v-model="search"
clearable
solo
flat
label="Search"
prepend-inner-icon="mdi-magnify"
color="primary"
>
</v-text-field>
</v-col>
<v-spacer />
<div class="btn">
<v-btn
class="d-flex"
color="primary"
width="175"
@click="getDetails()"
>Send Query
</v-btn>
</div>
</v-row>
</div>
<h2 class="text--bold">Frequently asked questions.</h2>
<br />
<div>
<v-expansion-panels>
<query @reload-list="getDetails()" />
<v-expansion-panel
v-model="getDetails.show"
v-for="(faq, index) in faqs"
:key="index"
>
<v-expansion-panel-header>
{{ faq.question }}
</v-expansion-panel-header>
<v-expansion-panel-content class="grey--text">
{{ faq.answer }}
</v-expansion-panel-content>
</v-expansion-panel>
</v-expansion-panels>
</div>
</div>
</template>
<script>
import { mapMutations } from "vuex";
import RULES from "../../../common/fieldRules";
import Query from "../dashboard/modal/Query.vue";
// import Query from '../dashboard/modal/Query.vue';
export default {
components: { Query },
// components: Query,
name: "Support",
data() {
return {
rules: RULES,
loading: false,
faqs: [],
search: "",
};
},
computed: {},
watch: {
search(){
this.getVendorFaqs();
},
// show(v) {
// if (v) this.openModal();
// else this.closeModal();
// },
},
mounted() {
this.getVendorFaqs();
},
methods: {
...mapMutations({
queryModal: "modal/SET_QUERY",
}),
getDetails() {
this.queryModal({ show: true });
},
getVendorFaqs() {
this.loading = true;
const successHandler = (res) => {
this.faqs = res.data;
console.log("faqs", this.faqs);
this.loading = false;
};
const finallyHandler = () => {
this.loading = false;
};
let formData = {};
if (this.search) formData ["search"] = this.search;
// formData["faqs"] = this.faqs;
return this.$request(this.$keys.GET, this.$urls.faqs.get_vendor_faqs, {
params:formData,
onSuccess: successHandler,
onFinally: finallyHandler,
isTokenRequired: false,
});
},
},
openModal() {},
closeModal() {
this.loading = false;
},
};
</script>
<style scoped>
.btn {
display: flex;
align-content: right;
justify-content: end;
}
</style>