hookehuyr

✨ feat(B端我的): API联调

<template>
<div style="background: linear-gradient(310deg, #FDD347 0%, #FFED6D 100%); padding: 1rem; text-align: center;">
<van-image round width="4rem" height="4rem" src="https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng52f007e83aa3baa494a5c9947e8c5bf537f267bce528e54b104995300d55c956" />
<p style="margin-top: 1rem; font-size: 1.05rem; font-weight: bold;">杨浦民办科技幼稚园</p>
<van-image round width="4rem" height="4rem" :src="myKgInfo.logo" />
<p style="margin-top: 1rem; font-size: 1.05rem; font-weight: bold;">{{ myKgInfo.name }}</p>
</div>
<template v-for="(item, key) in itemList" :key="key">
<div class="van-hairline--bottom item-list" @click="goTo(item.to)">
......@@ -24,24 +24,46 @@ import ShortcutFixed from '@/components/ShortcutFixed/index.vue'
import { ref, reactive, onMounted } from 'vue'
import { useRoute, useRouter } from 'vue-router'
import axios from '@/utils/axios';
import $ from 'jquery'
import { Toast } from 'vant';
const $route = useRoute();
const $router = useRouter();
const itemList = [
{
name: '幼儿园上传视频',
sum: '5',
to: '/me/donateList'
},
{
name: '家长上传视频',
sum: '2',
tag: true,
to: '/me/message'
},
]
const myKgInfo = ref({});
let itemList = ref([])
axios.get('/srv/?a=my_kg')
.then(res => {
if (res.data.code === 1) {
myKgInfo.value = res.data.data;
itemList.value = [
{
name: '幼儿园上传视频',
sum: res.data.data.mission_num,
to: '/business/myVideo'
},
{
name: '家长上传视频',
sum: res.data.data.prod_num,
tag: true,
to: '/business/auditVideo'
},
]
} else {
console.warn(res);
Toast({
icon: 'close',
message: res.data.msg
});
}
})
.catch(err => {
console.error(err);
})
const goTo = (path) => { // 跳转作品详情页
$router.push({
path
});
}
// 退出登录
const exitLogin = () => {
......@@ -99,4 +121,4 @@ export default {
text-align: center;
color: white;
}
</style>
\ No newline at end of file
</style>
......