首页显示
This commit is contained in:
parent
3ce3363085
commit
59061ffb42
|
|
@ -1,10 +0,0 @@
|
||||||
|
|
||||||
import { get, post, put, del } from '../utils/request';
|
|
||||||
|
|
||||||
export const bannerList = (data : any) => get('/user/v1/banner.list', data);
|
|
||||||
|
|
||||||
export const register = (data : any) => post('/power/drv', data);
|
|
||||||
|
|
||||||
export const updateUser = (data : any) => put('/power/drv', data);
|
|
||||||
|
|
||||||
export const deleteUser = (data : any) => del('/power/drv', data);
|
|
||||||
|
|
@ -2,12 +2,4 @@ import { get, post, put, del } from '../utils/request';
|
||||||
|
|
||||||
export const newMessage = (data : any = {}) => get('v1/message/new/count', data);
|
export const newMessage = (data : any = {}) => get('v1/message/new/count', data);
|
||||||
|
|
||||||
export const register = (data : any) => post('/power/drv', data);
|
export const bannerList = (data : any = {}) => get('v2/banner/list', data);
|
||||||
|
|
||||||
export const updateUser = (data : any) => put('/power/drv', data);
|
|
||||||
|
|
||||||
export const deleteUser = (data : any) => del('/power/drv', data);
|
|
||||||
|
|
||||||
export const captcha = (data : any) => get('v1/captcha', data);
|
|
||||||
|
|
||||||
export const login = (data : any) => post('v1/login', data);
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
<template #right>
|
<template #right>
|
||||||
<view class="li-flex-center li-mr-25">
|
<view class="li-flex-center li-mr-25">
|
||||||
<text class="ri-qr-scan-2-line li-text-48"></text>
|
<text class="ri-qr-scan-2-line li-text-48"></text>
|
||||||
<view class="li-ml-25 pt-10">
|
<view class="li-ml-25 pt-10" @click="switchPage()">
|
||||||
<wd-badge :hidden="messageCount > 0 ? false:true" :modelValue="messageCount" top='15' right="-4"
|
<wd-badge :hidden="messageCount > 0 ? false:true" :modelValue="messageCount" top='15' right="-4"
|
||||||
:max='99'>
|
:max='99'>
|
||||||
<text class="ri-notification-line li-text-48"></text>
|
<text class="ri-notification-line li-text-48"></text>
|
||||||
|
|
@ -93,14 +93,11 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {
|
|
||||||
bannerList
|
|
||||||
} from '@/api/banner';
|
|
||||||
import {
|
import {
|
||||||
userInfo
|
userInfo
|
||||||
} from '@/api/login';
|
} from '@/api/login';
|
||||||
import {
|
import {
|
||||||
newMessage
|
newMessage, bannerList
|
||||||
} from '@/api/message';
|
} from '@/api/message';
|
||||||
import {
|
import {
|
||||||
ref
|
ref
|
||||||
|
|
@ -216,7 +213,6 @@
|
||||||
const handleClick = (e) => {
|
const handleClick = (e) => {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
|
|
||||||
const onChange = (e) => {
|
const onChange = (e) => {
|
||||||
console.log(e)
|
console.log(e)
|
||||||
}
|
}
|
||||||
|
|
@ -245,12 +241,13 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const getBannerList = () => {
|
const switchPage = () => {
|
||||||
const res = bannerList({ position: 2 })
|
// 课程详情
|
||||||
|
uni.switchTab({
|
||||||
|
url: '/pages/message/index'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const loadmore = (e) => {
|
const loadmore = (e) => {
|
||||||
console.log(e);
|
console.log(e);
|
||||||
}
|
}
|
||||||
|
|
@ -262,13 +259,16 @@
|
||||||
|
|
||||||
// 加载页面数据
|
// 加载页面数据
|
||||||
const loadData = (async () => {
|
const loadData = (async () => {
|
||||||
var mess = await newMessage()
|
// 未读信息数量
|
||||||
|
const mess = await newMessage()
|
||||||
messageCount.value = mess.data.count
|
messageCount.value = mess.data.count
|
||||||
|
// 轮播加载
|
||||||
|
const banner = await bannerList({ position: 5 })
|
||||||
|
swiperList.value = banner.data.map((item: { image: String; })=>item.image)
|
||||||
})
|
})
|
||||||
|
|
||||||
onLoad(() => {
|
onLoad(() => {
|
||||||
loadData()
|
loadData()
|
||||||
// getBannerList()
|
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue