|
|
@@ -0,0 +1,92 @@
|
|
|
+<template>
|
|
|
+ <div class="alexp" v-loading="loading">
|
|
|
+ <div v-for="i in listData" :key="i.id" class="areaL">
|
|
|
+ <div class="tit">{{ i.name }}</div>
|
|
|
+ <div class="con">
|
|
|
+ <div v-for="l in i.ch" :key="l" class="conL" @click="gotoPage(l)">
|
|
|
+ <!-- <div>{{ l.name }}</div>
|
|
|
+ <div>{{ l.bri }}</div> -->
|
|
|
+ <img :src="l.img" alt="">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import axios from 'axios';
|
|
|
+import { ref,onMounted } from 'vue';
|
|
|
+
|
|
|
+
|
|
|
+const listData = ref([])
|
|
|
+const loading = ref(false)
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ requestUser()
|
|
|
+})
|
|
|
+// 拉取用户信息并处理
|
|
|
+const requestUser = () => {
|
|
|
+ loading.value = true
|
|
|
+
|
|
|
+ axios.get(`https://pbl.cocorobo.cn/api/pbl/selectAiExp?cl=1`)
|
|
|
+ .then(res => {
|
|
|
+ console.log(res);
|
|
|
+ let data = res.data
|
|
|
+ data[0].forEach(item1 => {
|
|
|
+ // 在第二个数组中查找匹配的数据
|
|
|
+ const matchedItems = data[1].filter(item2 => item2.levA === item1.id);
|
|
|
+ // 将匹配的数据存入ch属性
|
|
|
+ item1.ch = matchedItems;
|
|
|
+ });
|
|
|
+ listData.value = data[0]
|
|
|
+ loading.value = false
|
|
|
+ })
|
|
|
+ .catch(err=>{
|
|
|
+ console.log(err);
|
|
|
+ loading.value = false
|
|
|
+ })
|
|
|
+};
|
|
|
+const gotoPage = (val)=>{
|
|
|
+ window.open(val.link, "_blank")
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.alexp{
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 20px;
|
|
|
+ .areaL{
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ gap: 5px;
|
|
|
+ }
|
|
|
+ .tit{
|
|
|
+ font-size: 16px;
|
|
|
+ color: #000;
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+ .con{
|
|
|
+ display: grid;
|
|
|
+ grid-template-columns: repeat(6, 1fr);
|
|
|
+ // grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
|
|
|
+ gap: 0px;
|
|
|
+ .conL{
|
|
|
+ flex: 1;
|
|
|
+ box-sizing: border-box;
|
|
|
+ // background: #fff;
|
|
|
+ // border-radius: 10px;
|
|
|
+ display: flex;
|
|
|
+ cursor: pointer;
|
|
|
+ flex-direction: column;
|
|
|
+ justify-content: space-between;
|
|
|
+ img{
|
|
|
+ width: 100%;
|
|
|
+ object-fit: cover;
|
|
|
+ cursor: pointer;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|