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({});
33 - { 32 +let itemList = ref([])
34 - name: '幼儿园上传视频', 33 +axios.get('/srv/?a=my_kg')
35 - sum: '5', 34 +.then(res => {
36 - to: '/me/donateList' 35 + if (res.data.code === 1) {
37 - }, 36 + myKgInfo.value = res.data.data;
38 - { 37 + itemList.value = [
39 - name: '家长上传视频', 38 + {
40 - sum: '2', 39 + name: '幼儿园上传视频',
41 - tag: true, 40 + sum: res.data.data.mission_num,
42 - to: '/me/message' 41 + to: '/business/myVideo'
43 - }, 42 + },
44 -] 43 + {
44 + name: '家长上传视频',
45 + sum: res.data.data.prod_num,
46 + tag: true,
47 + to: '/business/auditVideo'
48 + },
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 = () => {
...@@ -99,4 +121,4 @@ export default { ...@@ -99,4 +121,4 @@ export default {
99 text-align: center; 121 text-align: center;
100 color: white; 122 color: white;
101 } 123 }
102 -</style>
...\ No newline at end of file ...\ No newline at end of file
124 +</style>
......