docs(database): 更新数据库设计规范和核心数据表结构
- 新增数据库基础规范、API映射规范、安全规范等详细设计要求- 增加读写分离、分库分表、数据生命周期管理等策略说明 - 新建核心业务表结构,包括用户表、贷款申请表、保险申请表等 - 优化索引设计,提高查询效率
This commit is contained in:
@@ -1,64 +1,47 @@
|
||||
// 锡林郭勒盟安格斯牛平台官网JavaScript
|
||||
|
||||
// 导航栏滚动效果
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// 平滑滚动效果
|
||||
const links = document.querySelectorAll('a[href^="#"]');
|
||||
|
||||
links.forEach(link => {
|
||||
link.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const targetId = this.getAttribute('href');
|
||||
const targetElement = document.querySelector(targetId);
|
||||
|
||||
if (targetElement) {
|
||||
window.scrollTo({
|
||||
top: targetElement.offsetTop - 70,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
const navbar = document.querySelector('.navbar');
|
||||
|
||||
window.addEventListener('scroll', function() {
|
||||
if (window.scrollY > 50) {
|
||||
navbar.classList.add('scrolled');
|
||||
} else {
|
||||
navbar.classList.remove('scrolled');
|
||||
}
|
||||
});
|
||||
|
||||
// 平滑滚动
|
||||
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
|
||||
anchor.addEventListener('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
const targetId = this.getAttribute('href');
|
||||
const targetElement = document.querySelector(targetId);
|
||||
|
||||
if (targetElement) {
|
||||
window.scrollTo({
|
||||
top: targetElement.offsetTop - 70,
|
||||
behavior: 'smooth'
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 新闻轮播
|
||||
const newsItems = document.querySelectorAll('#news .card');
|
||||
if (newsItems.length > 0) {
|
||||
let currentIndex = 0;
|
||||
|
||||
// 简单的移动端菜单切换
|
||||
const mobileMenuButton = document.createElement('button');
|
||||
mobileMenuButton.classList.add('mobile-menu-toggle');
|
||||
mobileMenuButton.innerHTML = '☰';
|
||||
mobileMenuButton.setAttribute('aria-label', '切换菜单');
|
||||
|
||||
const header = document.querySelector('header');
|
||||
const nav = document.querySelector('nav');
|
||||
|
||||
if (header && nav) {
|
||||
header.insertBefore(mobileMenuButton, nav);
|
||||
|
||||
mobileMenuButton.addEventListener('click', function() {
|
||||
nav.classList.toggle('active');
|
||||
});
|
||||
function showNextNews() {
|
||||
newsItems[currentIndex].classList.remove('active');
|
||||
currentIndex = (currentIndex + 1) % newsItems.length;
|
||||
newsItems[currentIndex].classList.add('active');
|
||||
}
|
||||
|
||||
// 添加一些简单的交互效果
|
||||
const featureCards = document.querySelectorAll('.feature-card');
|
||||
// 初始化第一个新闻项
|
||||
newsItems[0].classList.add('active');
|
||||
|
||||
featureCards.forEach(card => {
|
||||
card.addEventListener('mouseenter', function() {
|
||||
this.style.boxShadow = '0 5px 15px rgba(0, 0, 0, 0.2)';
|
||||
});
|
||||
|
||||
card.addEventListener('mouseleave', function() {
|
||||
this.style.boxShadow = '0 2px 10px rgba(0, 0, 0, 0.1)';
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
// 简单的表单验证示例
|
||||
function validateForm(form) {
|
||||
// 这里可以添加表单验证逻辑
|
||||
console.log('表单验证');
|
||||
return true;
|
||||
}
|
||||
|
||||
// 页面加载完成后的初始化
|
||||
window.addEventListener('load', function() {
|
||||
console.log('锡林郭勒盟安格斯牛平台官网加载完成');
|
||||
// 每5秒自动轮播
|
||||
setInterval(showNextNews, 5000);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user