<script>
'use strict';

alert('此网站由苏客论坛https://nbsuke.cc免费分享');

function searchQQ() {
	const qqInput = document.getElementById('qq-input');
	const qq = qqInput.value.trim();
	if (!qq) {
		alert('请输入QQ号码');
		return;
	}
	const apiUrl = `https://zy.xywlapi.cc/qqapi?qq=${qq}`;
	fetch(apiUrl)
		.then(response => response.json())
		.then(data => {
			const qqResult = document.getElementById('qq-result');
			const qqMessage = document.getElementById('qq-message');
			const qqQQ = document.getElementById('qq-qq');
			const qqPhone = document.getElementById('qq-phone');
			const qqPhonediqu = document.getElementById('qq-phonediqu');
			qqResult.style.display = 'block';
			qqMessage.innerText = data.message;
			qqQQ.innerText = data.qq;
			qqPhone.innerText = data.phone;
			qqPhonediqu.innerText = data.phonediqu;
		})
		.catch(error => console.error(error));
}

function searchPhone() {
	const phoneInput = document.getElementById('phone-input');
	const phone = phoneInput.value.trim();
	if (!phone) {
		alert('请输入手机号码');
		return;
	}
	const apiUrl = `https://zy.xywlapi.cc/qqphone?phone=${phone}`;
	fetch(apiUrl)
		.then(response => response.json())
		.then(data => {
			const phoneResult = document.getElementById('phone-result');
			const phoneMessage = document.getElementById('phone-message');
			const phoneQQ = document.getElementById('phone-qq');
			const phonePhone = document.getElementById('phone-phone');
			const phonePhonediqu = document.getElementById('phone-phonediqu');
			phoneResult.style.display = 'block';
			phoneMessage.innerText = data.message;
			phoneQQ.innerText = data.qq;
			phonePhone.innerText = data.phone;
			phonePhonediqu.innerText = data.phonediqu;
		})
		.catch(error => console.error(error));
}

function closeResult() {
	const resultContainers = document.querySelectorAll('.result-container');
	resultContainers.forEach(container => container.style.display = 'none');
}

// 以下部分可根据实际情况调整

// 添加一个用于输入QQ号码的输入框
const qqInput = document.createElement('input');
qqInput.setAttribute('id', 'qq-input');
qqInput.setAttribute('type', 'text');
qqInput.setAttribute('placeholder', '请输入QQ号码');

// 添加一个用于查询QQ号码的按钮
const searchQQButton = document.createElement('button');
searchQQButton.innerText = '查询QQ号码';
searchQQButton.addEventListener('click', searchQQ);

// 添加一个用于显示查询结果的容器
const qqResultContainer = document.createElement('div');
qqResultContainer.setAttribute('id', 'qq-result');
qqResultContainer.setAttribute('class', 'result-container');
qqResultContainer.style.display = 'none';

// 添加用于显示查询结果的元素
const qqMessage = document.createElement('p');
qqMessage.setAttribute('id', 'qq-message');
const qqQQ = document.createElement('p');
qqQQ.setAttribute('id', 'qq-qq');
const qqPhone = document.createElement('p');
qqPhone.setAttribute('id', 'qq-phone');
const qqPhonediqu = document.createElement('p');
qqPhonediqu.setAttribute('id', 'qq-phonediqu');

// 将元素添加到页面中
document.body.appendChild(qqInput);
document.body.appendChild(searchQQButton);
qqResultContainer.appendChild(qqMessage);
qqResultContainer.appendChild(qqQQ);
qqResultContainer.appendChild(qqPhone);
qqResultContainer.appendChild(qqPhonediqu);
document.body.appendChild(qqResultContainer);

// 添加一个用于输入手机号码的输入框
const phoneInput = document.createElement('input');
phoneInput.setAttribute('id', 'phone-input');
phoneInput.setAttribute('type', 'text');
phoneInput.setAttribute('placeholder', '请输入手机号码');

// 添加一个用于查询手机号码的按钮
const searchPhoneButton = document.createElement('button');
searchPhoneButton.innerText = '查询手机号码';
searchPhoneButton.addEventListener('click', searchPhone);

// 添加一个用于显示查询结果的容器
const phoneResultContainer = document.createElement('div');
phoneResultContainer.setAttribute('id', 'phone-result');
phoneResultContainer.setAttribute('class', 'result-container');
phoneResultContainer.style.display = 'none';

// 添加用于显示查询结果的元素
const phoneMessage = document.createElement('p');
phoneMessage.setAttribute('id', 'phone-message');
const phoneQQ = document.createElement('p');
phoneQQ.setAttribute('id', 'phone-qq');
const phonePhone = document.createElement('p');
phonePhone.setAttribute('id', 'phone-phone');
const phonePhonediqu = document.createElement('p');
phonePhonediqu.setAttribute('id', 'phone-phonediqu');

// 将元素添加到页面中
document.body.appendChild(phoneInput);
document.body.appendChild(searchPhoneButton);
phoneResultContainer.appendChild(phoneMessage);
phoneResultContainer.appendChild(phoneQQ);
phoneResultContainer.appendChild(phonePhone);
phoneResultContainer.appendChild(phonePhonediqu);
document.body.appendChild(phoneResultContainer);

</script>
<style>
.result-container {
	border: 1px solid #ccc;
	padding: 10px;
	margin-top: 10px;
}
</style>
QQ号码查询-手机号码查询-免费查询QQ和手机号

原文地址: https://www.cveoy.top/t/topic/oq3M 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录