V2EX phli 的所有回复 第 1 页 / 共 3 页
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX    phli    全部回复第 1 页 / 共 3 页
回复总数  56
1  2  3  
@ricardowu97 龙猫云
这是 gemini 3.1 pro 网页端生成的。
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" cOntent="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>极简天气 H5</title>
<script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
<style>
/* 隐藏滚动条但保留滚动功能 */
.no-scrollbar::-webkit-scrollbar {
display: none;
}
.no-scrollbar {
-ms-overflow-style: none;
scrollbar-width: none;
}
</style>
</head>
<body class="bg-gradient-to-br from-blue-100 to-blue-300 min-h-screen flex items-center justify-center p-4">

<div id="app" class="bg-white/80 backdrop-blur-md rounded-3xl shadow-xl w-full max-w-sm p-6 overflow-hidden">
<div class="relative mb-6">
<input
v-model="searchCity"
@keyup.enter="getWeather"
type="text"
placeholder="输入城市名称,如:北京"
class="w-full bg-white/90 px-4 py-3 rounded-xl shadow-sm focus:outline-none focus:ring-2 focus:ring-blue-400 transition-all text-gray-700"
>
<button
@click="getWeather"
class="absolute right-2 top-2 bottom-2 bg-blue-500 hover:bg-blue-600 text-white px-4 rounded-lg transition-colors font-medium"
>
查询
</button>
</div>

<div v-if="loading" class="text-center py-10">
<div class="animate-spin rounded-full h-8 w-8 border-b-2 border-blue-500 mx-auto"></div>
<p class="text-gray-500 mt-3 text-sm">正在获取天气数据...</p>
</div>

<div v-else-if="errorMessage" class="text-center py-8 text-red-500 bg-red-50 rounded-xl">
{{ errorMessage }}
</div>

<div v-else-if="weatherData" class="fade-in">
<div class="text-center mb-6">
<h2 class="text-3xl font-bold text-gray-800 tracking-wider">{{ weatherData.city }}</h2>
<p class="text-gray-500 mt-1">{{ weatherData.date }}</p>
</div>

<div class="flex items-center justify-center mb-6">
<span class="text-6xl mr-4">{{ weatherData.icon }}</span>
<div>
<div class="text-5xl font-black text-gray-800">{{ weatherData.temp }}°C</div>
<div class="text-xl text-gray-600 mt-1 font-medium">{{ weatherData.description }}</div>
</div>
</div>

<div class="grid grid-cols-2 gap-4">
<div class="bg-white/60 p-3 rounded-xl flex items-center">
<span class="text-2xl mr-2"></span>
<div>
<div class="text-xs text-gray-500">湿度</div>
<div class="font-bold text-gray-700">{{ weatherData.humidity }}%</div>
</div>
</div>
<div class="bg-white/60 p-3 rounded-xl flex items-center">
<span class="text-2xl mr-2"></span>
<div>
<div class="text-xs text-gray-500">风速</div>
<div class="font-bold text-gray-700">{{ weatherData.windSpeed }} km/h</div>
</div>
</div>
<div class="bg-white/60 p-3 rounded-xl flex items-center">
<span class="text-2xl mr-2"></span>
<div>
<div class="text-xs text-gray-500">体感温度</div>
<div class="font-bold text-gray-700">{{ weatherData.feelsLike }}°C</div>
</div>
</div>
<div class="bg-white/60 p-3 rounded-xl flex items-center">
<span class="text-2xl mr-2"></span>
<div>
<div class="text-xs text-gray-500">能见度</div>
<div class="font-bold text-gray-700">{{ weatherData.visibility }} km</div>
</div>
</div>
</div>
</div>

<div v-else class="text-center py-12 opacity-50">
<span class="text-6xl block mb-4"></span>
<p class="text-gray-500">搜索你关心的城市天气</p>
</div>
</div>

<script>
const { createApp, ref, onMounted } = Vue;

createApp({
setup() {
const searchCity = ref('');
const weatherData = ref(null);
const loading = ref(false);
const errorMessage = ref('');

// 模拟天气数据映射(用于演示)
const mockIcOns= { '晴': '', '多云': '', '阴': '', '雨': '', '雪': '' };

const getWeather = async () => {
if (!searchCity.value.trim()) return;

loading.value = true;
errorMessage.value = '';
weatherData.value = null;

try {
// [开发建议]
// 此处应替换为真实的接口请求,例如和风天气 (QWeather) 或 OpenWeatherMap
// const API_KEY = 'your_api_key';
// const respOnse= await fetch(`https://devapi.qweather.com/v7/weather/now?location=${searchCity.value}&key=${API_KEY}`);
// const data = await response.json();

// 模拟 API 延迟
await new Promise(resolve => setTimeout(resolve, 800));

// 模拟数据结构拦截与拼装
if (searchCity.value.length > 10) {
throw new Error('未找到该城市信息');
}

const randomTemp = Math.floor(Math.random() * 30) + 5;
const descriptiOns= ['晴', '多云', '雨', '阴'];
const desc = descriptions[Math.floor(Math.random() * descriptions.length)];

weatherData.value = {
city: searchCity.value,
date: new Date().toLocaleDateString('zh-CN', { month: 'long', day: 'numeric', weekday: 'long' }),
temp: randomTemp,
feelsLike: randomTemp + (Math.floor(Math.random() * 4) - 2),
description: desc,
icon: mockIcons[desc],
humidity: Math.floor(Math.random() * 50) + 30,
windSpeed: Math.floor(Math.random() * 20) + 5,
visibility: Math.floor(Math.random() * 10) + 5
};
} catch (error) {
errorMessage.value = error.message || '获取天气信息失败,请稍后重试';
} finally {
loading.value = false;
}
};

// 初始加载默认城市
onMounted(() => {
searchCity.value = '北京';
getWeather();
});

return {
searchCity,
weatherData,
loading,
errorMessage,
getWeather
};
}
}).mount('#app');
</script>
</body>
</html>
4 月 27 日
回复了 bigbigeggs 创建的主题 VPS 大家的梯子还好么
https://www.duyaoss.com/ 这里面找下吧。刚别的大佬推给我的,价格不贵还很稳
@Wangpfzzz 感谢。找了个便宜的 15 一个月的,速度很快,连美区也都很稳
看着呢牛逼的样子,先 star 再说
3 月 31 日
回复了 bigbigeggs 创建的主题 VPS 大家的梯子还好么
最近好多节点都挂了。。。咋回事
@fj19 别推 macmini 了。。根本不行。。
来自站点:Terminal.Pub ,我的 id 是:2131
2024 年 7 月 4 日
回复了 phli 创建的主题 信息安全 大神们看看这是啥病毒!
@patrickyoung 别的机器中的毒,我只是放在这不重要的服务器上了。感谢
2024 年 7 月 4 日
回复了 phli 创建的主题 信息安全 大神们看看这是啥病毒!
@proxytoworld 感谢。
2024 年 7 月 3 日
回复了 phli 创建的主题 信息安全 大神们看看这是啥病毒!
还有一个 http://116.198.228.200/yy.zip
2024 年 7 月 3 日
回复了 phli 创建的主题 信息安全 大神们看看这是啥病毒!
@proxytoworld http://116.198.228.200/xx.zip 这是病毒文件 谢谢
2024 年 7 月 3 日
回复了 zuzippo 创建的主题 生活 你的房子跌了多少啦?
济南跌的很少。。因为本放价就不高。省会倒数的了。政府控价控的严保住了刚需的钱袋子。。
2024 年 7 月 3 日
回复了 zuzippo 创建的主题 生活 你的房子跌了多少啦?
济南 153 买的,140 能卖出去。跌的不多。17 年买的那套现在还能持平利息啥的。18 年小县城 6400 买的,6200 卖的,赔了利息+装修=15w 。
@nilai 嗯 hdp 对应版本只到了 2.7.5 就没再更新。
@tiiis
@nilai
@brucewsl 开源版的大型集群部署是不是很麻烦? 有啥集群相关部署软件么? 主要还是技术不到位折腾开源的怕搞不定,各种版本适配啥的比较复杂。
@nilai Ambari 就是 Hortonworks 的平台的管理软件。
2024 年 3 月 13 日
回复了 fcyxp 创建的主题 济南 济南有没有熟悉前后端想要兼职的 v 友
这价格。。。来回章丘油费都去一半了。有这能力的基本 20K 以上,日新基本 1K 以上,你这 120 一节课开玩笑吧。 在校大学生辅导小学一节课才这个价。
其实就是阅历少,只会闷头苦干。 学历高有啥用不如有个牛逼的爹告诉你咋做生意能赚钱。
2024 年 1 月 24 日
回复了 ysicing 创建的主题 程序员 爱奇艺是不是利用家宽进行网络扫描
垃圾爱奇艺,开了会员还不能 1080p 投屏。会员到期永远不会再买了。
1  2  3  
About     Help     Advertise     Blog     API     FAQ     Solana     4442 Online   Highest 6679       Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 63ms UTC 00:59 PVG 08:59 LAX 17:59 JFK 20:59
Do have faith in what you're doing.
ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86