增加轮播配置

This commit is contained in:
BianLzhaoMin 2025-01-16 09:47:21 +08:00
parent 1a7375cb61
commit 7897692898
3 changed files with 32 additions and 10 deletions

View File

@ -21,6 +21,9 @@ export const getLeaseInfoByIdApi = (data: any = {}) => {
export const getAreaApi = (areaCode: any) => {
return get(`/material-mall/maType/getArea?areaCode=${areaCode}`,)
}
export const getSwiperListApi = () => {
return get(`/material-mall/bm_slide_show/list`, {})
}
// 立即接单
export const setAcceptByIdApi = (data: any = {}) => {
return post('/material-mall/ma-lease/accept', data)

View File

@ -75,7 +75,10 @@ const handlerLogin = async () => {
if (route.query && route.query.redirect) {
router.push(decodeURIComponent(route.query.redirect))
} else {
router.push('/home')
// router.push('/home')
router.push({
name: 'home',
})
}
}
}

View File

@ -2,7 +2,7 @@
import EquipCard from 'components/equipCard.vue'
import EquipCardNew from 'components/equipCardNew/index.vue'
import NavMenu from 'components/Navmenu/index.vue'
import { getGoodsClassListApi, getCompanyListApi } from 'http/api/home'
import { getGoodsClassListApi, getCompanyListApi, getSwiperListApi } from 'http/api/home'
import { useStore } from 'store/user'
import { mainStore } from 'store/main'
import { getHotList } from 'http/api/equip'
@ -14,6 +14,7 @@ import swiper_2 from '../../assets/img/home/swiper02.png'
import swiper_3 from '../../assets/img/home/swiper03.png'
import swiper_4 from '../../assets/img/home/swiper04.png'
import swiper_5 from '../../assets/img/home/swiper05.png'
import { el } from 'element-plus/es/locale'
const { getCompanyList, getGoodsClassList } = userClass()
const router: any = useRouter()
@ -140,6 +141,24 @@ const onSelectItem = (type: number) => {
}
selectOptions.value = false
}
const swiperList = ref([])
//
const getSwiperListData = async () => {
const res: any = await getSwiperListApi()
swiperList.value = res.rows
// console.log(res, '')
}
const onClickSwiper = (item: any) => {
if (item.slideLink) {
window.open(item.slideLink, '_blank')
} else {
router.push({ name: 'equipList' })
}
}
getSwiperListData()
</script>
<template>
@ -261,19 +280,16 @@ const onSelectItem = (type: number) => {
<div class="swiper-img">
<el-carousel :interval="5000" arrow="always" style="height: 100%">
<el-carousel-item
v-for="(item, index) in loopList"
v-for="(item, index) in swiperList"
:key="index"
style="height: 100%"
>
<el-image
style="width: 100%; height: 100%"
:src="item"
v-if="item.delFlag == 0"
style="width: 100%; height: 100%; cursor: pointer"
:src="item.slidePicture"
fit="cover"
@click="
() => {
router.push({ name: 'equipList' })
}
"
@click="onClickSwiper(item)"
/>
</el-carousel-item>
</el-carousel>