This commit is contained in:
xvv 2024-07-23 16:36:42 +08:00
parent 2fdf43309c
commit 63b12cba04
2 changed files with 22 additions and 2 deletions

View File

@ -8,3 +8,11 @@ export function getTab(query) {
params: query params: query
}) })
} }
export function getbanner(id) {
return request({
url: '/api/category/'+id,
method: 'get',
})
}

View File

@ -294,9 +294,9 @@
</template> </template>
<script> <script>
import { Swiper, SwiperSlide } from "vue-awesome-swiper"; import { Swiper, SwiperSlide, } from "vue-awesome-swiper";
import "/src/components/swiper/css/swiper.min.css"; import "/src/components/swiper/css/swiper.min.css";
import { getTab } from "@/api/gw/home"; import { getTab,getbanner } from "@/api/gw/home";
export default { export default {
components: { components: {
Swiper, Swiper,
@ -322,6 +322,8 @@ export default {
{ name: '合作企业' }, { name: '合作企业' },
{ name: '联系我们' }, { name: '联系我们' },
], ],
imgUrl:'https://f382b38516.zicp.fun',
bannerlist:[],
isMounted: false, isMounted: false,
swiperOptions: { swiperOptions: {
navigation: { navigation: {
@ -414,6 +416,16 @@ export default {
getTab().then(response => { getTab().then(response => {
if(response.code == 200){ if(response.code == 200){
this.tablist = response.data; this.tablist = response.data;
getbanner(response.data[0].id).then(res => {
if(res.code == 200){
let list = res.data[3].children.list
for (let i = 0; i < list.length; i++) {
this.bannerlist.push(this.imgUrl+list[i].imgUrl)
}
console.log(this.bannerlist)
}
});
} }
}); });