hookehuyr

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

1 <template> 1 <template>
2 <div style="background: linear-gradient(310deg, #FDD347 0%, #FFED6D 100%); padding: 1rem; text-align: center;"> 2 <div style="background: linear-gradient(310deg, #FDD347 0%, #FFED6D 100%); padding: 1rem; text-align: center;">
3 - <van-image round width="4rem" height="4rem" src="https://lanhu.oss-cn-beijing.aliyuncs.com/SketchPng52f007e83aa3baa494a5c9947e8c5bf537f267bce528e54b104995300d55c956" /> 3 + <van-image round width="4rem" height="4rem" :src="myKgInfo.logo" />
4 - <p style="margin-top: 1rem; font-size: 1.05rem; font-weight: bold;">杨浦民办科技幼稚园</p> 4 + <p style="margin-top: 1rem; font-size: 1.05rem; font-weight: bold;">{{ myKgInfo.name }}</p>
5 </div> 5 </div>
6 <template v-for="(item, key) in itemList" :key="key"> 6 <template v-for="(item, key) in itemList" :key="key">
7 <div class="van-hairline--bottom item-list" @click="goTo(item.to)"> 7 <div class="van-hairline--bottom item-list" @click="goTo(item.to)">
...@@ -24,24 +24,46 @@ import ShortcutFixed from '@/components/ShortcutFixed/index.vue' ...@@ -24,24 +24,46 @@ import ShortcutFixed from '@/components/ShortcutFixed/index.vue'
24 import { ref, reactive, onMounted } from 'vue' 24 import { ref, reactive, onMounted } from 'vue'
25 import { useRoute, useRouter } from 'vue-router' 25 import { useRoute, useRouter } from 'vue-router'
26 import axios from '@/utils/axios'; 26 import axios from '@/utils/axios';
27 -import $ from 'jquery'
28 import { Toast } from 'vant'; 27 import { Toast } from 'vant';
29 const $route = useRoute(); 28 const $route = useRoute();
30 const $router = useRouter(); 29 const $router = useRouter();
31 30
32 -const itemList = [ 31 +const myKgInfo = ref({});
32 +let itemList = ref([])
33 +axios.get('/srv/?a=my_kg')
34 +.then(res => {
35 + if (res.data.code === 1) {
36 + myKgInfo.value = res.data.data;
37 + itemList.value = [
33 { 38 {
34 name: '幼儿园上传视频', 39 name: '幼儿园上传视频',
35 - sum: '5', 40 + sum: res.data.data.mission_num,
36 - to: '/me/donateList' 41 + to: '/business/myVideo'
37 }, 42 },
38 { 43 {
39 name: '家长上传视频', 44 name: '家长上传视频',
40 - sum: '2', 45 + sum: res.data.data.prod_num,
41 tag: true, 46 tag: true,
42 - to: '/me/message' 47 + to: '/business/auditVideo'
43 }, 48 },
44 -] 49 + ]
50 + } else {
51 + console.warn(res);
52 + Toast({
53 + icon: 'close',
54 + message: res.data.msg
55 + });
56 + }
57 +})
58 +.catch(err => {
59 + console.error(err);
60 +})
61 +
62 +const goTo = (path) => { // 跳转作品详情页
63 + $router.push({
64 + path
65 + });
66 +}
45 67
46 // 退出登录 68 // 退出登录
47 const exitLogin = () => { 69 const exitLogin = () => {
......