更改笔顺码版权相关和热搜ALL

This commit is contained in:
ZtRXR 2023-09-02 13:00:29 +08:00
parent a80ac8fae1
commit 142db58619
4 changed files with 67 additions and 2 deletions

View File

@ -0,0 +1,49 @@
<script setup lang="ts">
const props = defineProps({
fromWeb:String,
limit:Number,
hours:Number
})
interface TopHots{
id:number,
times:number,
word:string,
lastTime: string,
fromWeb: {
id: number,
name: string,
fromUrl: string,
searchUrl: string
}
}
const rawData:TopHots[] = await $fetch(`https://data.zziyu.cn/hot/top/${props.fromWeb}?limit=${props.limit}&hours=${props.hours}`)
const data:TopHots[] = []
rawData.forEach(d=>{
let newD= d;
let aDate = new Date(Date.parse(d.lastTime))
newD.lastTime=aDate.toLocaleString()
data.push(newD)
})
</script>
<template>
<client-only>
<el-table :data="data" style="width: 75%;margin: 10px;margin-bottom: 15px" :table-layout="'fixed'">
<el-table-column prop="word" :label="props.fromWeb+'热搜'" width="180" />
<el-table-column prop="lastTime" label="最后上榜" width="180" />
<el-table-column prop="times" label="上榜次数" />
</el-table>
</client-only>
</template>
<style scoped>
</style>

View File

@ -9,7 +9,6 @@ if (route.params.WebName==undefined){
</script> </script>
<template> <template>
Data father {{}}
<NuxtPage></NuxtPage> <NuxtPage></NuxtPage>
</template> </template>

15
pages/data/all.vue Normal file
View File

@ -0,0 +1,15 @@
<script setup lang="ts">
const getWebArr:string[] = await $fetch("https://data.zziyu.cn/hot/webs")
</script>
<template>
<div style="display: flex;align-items: center;justify-content: center">
<DataTimesTop v-for="(item,index) in getWebArr" :fromWeb="item" :limit="5" :hours="2" :key="index"></DataTimesTop>
</div>
</template>
<style scoped>
</style>

View File

@ -4,7 +4,9 @@
<template> <template>
<!-- <Title>定义笔顺码</Title>--> <!-- <Title>定义笔顺码</Title>-->
<div class="aboutBody" style="display: flex;justify-content: center">
<div class="aboutBody" style="display: flex;justify-content: center;flex-direction: column;align-items: center ">
<h1>本网站的所有资源来源于 吴之林 主编的 笔顺码字典 一书 如有侵权立即下线</h1>
<div class="tableList"> <div class="tableList">
<figure class="wp-block-table"> <figure class="wp-block-table">
<table> <table>