chooseSchool.vue
1.54 KB
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
<template>
<div class="choose-school-page content-bg">
<div class="modify-top"></div>
<div style="height: 1rem;"></div>
<template v-for="(item, key) in schoolList" :key="key">
<right-side-list
@on-click="onClick(item)"
:avatar="item.logo">
{{ item.name }}
</right-side-list>
</template>
<div style="height: 2rem;"></div>
</div>
</template>
<script setup>
import RightSideList from '@/components/RightSideList/index.vue'
import { ref, onMounted } from 'vue';
import axios from '@/utils/axios';
import $ from 'jquery'
import { useRoute, useRouter } from 'vue-router'
import { Toast } from 'vant';
const $route = useRoute();
const $router = useRouter();
const schoolList = ref([])
onMounted(() => {
// 获取幼儿园列表页
axios.get('/srv/?a=kg_list')
.then(res => {
if (res.data.code === 1) {
schoolList.value = res.data.data;
} else {
console.warn(res);
Toast({
icon: 'close',
message: res.data.msg
});
}
})
.catch(err => {
console.error(err);
})
})
// 跳转幼儿园爱心书籍列表页
const onClick = (item) => {
$router.push({
path: '/client/chooseBook',
query: {
kg_id: item.id
}
});
}
</script>
<script>
import mixin from 'common/mixin'
import { mainStore } from '@/store'
import { storeToRefs } from 'pinia'
export default {
mixins: [mixin.init],
data () {
return {
}
},
mounted () {
},
methods: {
}
}
</script>
<style lang="less" scoped>
@import url('@css/content-bg.less');
</style>