first add files

This commit is contained in:
2025-08-15 14:58:11 +08:00
parent 4291639d4f
commit b745cae8eb
11 changed files with 648 additions and 0 deletions

85
app.py Normal file
View File

@@ -0,0 +1,85 @@
from waitress import serve
from flask import Flask, render_template, request, redirect, url_for, jsonify
from datetime import datetime
app = Flask(__name__)
# 模拟数据库数据
company_info = {
"name": "安吉捌壹智能科技有限公司",
"slogan": "智能科技,创造未来",
"about": "捌壹智能科技有限公司成立于2020年是一家专注于人工智能、大数据分析和数字化转型的高科技企业。我们致力于为客户提供创新的技术解决方案助力企业实现数字化升级。",
"services": [
{
"name": "人工智能解决方案",
"description": "为企业提供定制化AI解决方案包括机器学习、计算机视觉和自然语言处理等。"
},
{
"name": "大数据分析",
"description": "通过先进的数据分析技术,帮助企业挖掘数据价值,优化决策过程。"
},
{
"name": "数字化转型咨询",
"description": "为企业提供全面的数字化转型战略规划和技术实施支持。"
}
],
"contact": {
"address": "中国北京市海淀区科技园路88号",
"phone": "+86 10 8888 8888",
"email": "info@baize-digital.com"
}
}
@app.route('/')
def index():
return render_template('index.html', company=company_info)
@app.route('/about')
def about():
return render_template('about.html', company=company_info)
@app.route('/services')
def services():
return render_template('services.html', company=company_info)
# @app.route('/contact', methods=['GET', 'POST'])
# def contact():
# if request.method == 'POST':
# # 这里可以添加处理联系表单的逻辑
# name = request.form.get('name')
# email = request.form.get('email')
# message = request.form.get('message')
# # 通常这里会发送邮件或保存到数据库
# print(f"收到来自 {name}({email}) 的消息: {message}")
# return redirect(url_for('contact', success=True))
# return render_template('contact.html', company=company_info, success=request.args.get('success'))
# 收到小程序,发送过来的数据,暂时在这里进行存储
@app.route('/contact', methods=['GET', 'POST'])
def contact():
if request.method == 'POST':
form_data = request.get_json() # 直接解析 JSON
# customerName = form_data.get('customerName', '')
# projectSource = form_data.get('projectSource', '')
# projectLeader = form_data.get('projectLeader', '')
# clientdemand = form_data.get('clientdemand', '')
# handovertasks = form_data.get('handovertasks', '')
# remarks = form_data.get('remarks', '')
# # 暂时保存在 txt 文件中
# # 生成文件名
# filename = "D:/ProjectManagementSystem/data/" + datetime.now().strftime("%Y%m%d_") + customerName+ "_" + projectLeader+ ".txt"
# # 要保存的内容
# content = f"文件生成时间:{datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n\n" + customerName + "\n\n" + projectSource+ "\n\n" + projectLeader+ "\n\n" + clientdemand+ "\n\n" + handovertasks+ "\n\n" + remarks
# # 写入文件
# with open(filename, "w", encoding="utf-8") as file:
# file.write(content)
return jsonify({"status": "success", "message": "提交成功"})
return render_template('contact.html', company=company_info, success=request.args.get('success'))
if __name__ == '__main__':
serve(app, host='0.0.0.0', port=777)

BIN
favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

6
gunicorn_conf.py Normal file
View File

@@ -0,0 +1,6 @@
bind = "0.0.0.0:5000"
workers = 4
worker_class = "gevent" # 使用异步 worker需安装 `gevent`
timeout = 30
accesslog = "-" # 输出到控制台
errorlog = "-"

33
index.html Normal file
View File

@@ -0,0 +1,33 @@
{% extends "base.html" %}
{% block title %}首页{% endblock %}
{% block content %}
<section class="hero">
<div class="container">
<h2>{{ company.slogan }}</h2>
<p>领先的数字技术解决方案提供商</p>
<a href="{{ url_for('services') }}" class="btn">了解我们的服务</a>
</div>
</section>
<section class="features">
<div class="container">
<h2>我们的优势</h2>
<div class="feature-grid">
<div class="feature">
<h3>创新技术</h3>
<p>采用最前沿的人工智能和大数据技术,为客户提供卓越的解决方案。</p>
</div>
<div class="feature">
<h3>专业团队</h3>
<p>由经验丰富的技术专家和行业顾问组成的团队,确保项目高质量交付。</p>
</div>
<div class="feature">
<h3>客户至上</h3>
<p>我们始终将客户需求放在首位,提供个性化的服务和解决方案。</p>
</div>
</div>
</div>
</section>
{% endblock %}

280
static/css/style.css Normal file
View File

@@ -0,0 +1,280 @@
/* 全局样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Noto Sans SC', sans-serif;
line-height: 1.6;
color: #333;
background-color: #f9f9f9;
}
.container {
width: 90%;
max-width: 1200px;
margin: 0 auto;
padding: 0 15px;
}
a {
text-decoration: none;
color: #0066cc;
}
a:hover {
color: #004499;
}
.btn {
display: inline-block;
padding: 10px 20px;
background-color: #0066cc;
color: white;
border-radius: 4px;
transition: background-color 0.3s;
}
.btn:hover {
background-color: #004499;
color: white;
}
/* 头部样式 */
header {
background-color: white;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
position: fixed;
width: 100%;
top: 0;
z-index: 1000;
}
header .container {
display: flex;
justify-content: space-between;
align-items: center;
padding: 15px 0;
}
header h1 {
font-size: 1.5rem;
font-weight: 700;
}
header h1 a {
color: #333;
}
header nav ul {
display: flex;
list-style: none;
}
header nav ul li {
margin-left: 20px;
}
header nav ul li a {
color: #333;
font-weight: 500;
}
header nav ul li a:hover {
color: #0066cc;
}
/* 主要内容区域 */
main {
margin-top: 80px;
padding: 40px 0;
}
/* 英雄区域 */
.hero {
background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/hero-bg.jpg');
background-size: cover;
background-position: center;
color: white;
text-align: center;
padding: 100px 0;
}
.hero h2 {
font-size: 2.5rem;
margin-bottom: 20px;
}
.hero p {
font-size: 1.2rem;
margin-bottom: 30px;
}
/* 特性网格 */
.features,
.services-grid,
.team-grid {
margin: 50px 0;
}
.feature-grid,
.services-grid,
.team-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 30px;
margin-top: 30px;
}
.feature,
.service,
.team-member {
background-color: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
transition: transform 0.3s;
}
.feature:hover,
.service:hover,
.team-member:hover {
transform: translateY(-5px);
}
.feature h3,
.service h3,
.team-member h3 {
margin-bottom: 15px;
color: #0066cc;
}
.position {
color: #666;
font-style: italic;
margin-bottom: 15px;
}
/* 关于页面 */
.about h2,
.services h2,
.contact h2,
.team h2,
.case-studies h2 {
text-align: center;
margin-bottom: 30px;
font-size: 2rem;
}
.subtitle {
text-align: center;
margin-bottom: 40px;
color: #666;
}
/* 联系我们页面 */
.contact-grid {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 50px;
margin-top: 40px;
}
.contact-info {
background-color: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.contact-info h3 {
margin-bottom: 20px;
color: #0066cc;
}
.contact-info p {
margin-bottom: 15px;
}
.contact-form {
background-color: white;
padding: 30px;
border-radius: 8px;
box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.form-group {
margin-bottom: 20px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: 500;
}
.form-group input,
.form-group textarea {
width: 100%;
padding: 10px;
border: 1px solid #ddd;
border-radius: 4px;
font-family: inherit;
}
.form-group textarea {
resize: vertical;
}
.success-message {
background-color: #dff0d8;
color: #3c763d;
padding: 15px;
border-radius: 4px;
margin-bottom: 20px;
text-align: center;
}
/* 页脚样式 */
footer {
background-color: #333;
color: white;
padding: 30px 0;
text-align: center;
}
footer .container {
display: flex;
justify-content: space-between;
align-items: center;
}
.footer-links a {
color: #ccc;
margin-left: 15px;
}
.footer-links a:hover {
color: white;
}
/* 响应式设计 */
@media (max-width: 768px) {
.contact-grid {
grid-template-columns: 1fr;
}
header .container {
flex-direction: column;
}
header nav ul {
margin-top: 15px;
}
header nav ul li {
margin: 0 10px;
}
}

41
templates/about.html Normal file
View File

@@ -0,0 +1,41 @@
{% extends "base.html" %}
{% block title %}关于我们{% endblock %}
{% block content %}
<section class="about">
<div class="container">
<h2>关于捌壹智能</h2>
<p>{{ company.about }}</p>
<h3>我们的使命</h3>
<p>通过创新技术推动企业数字化转型,为客户创造长期价值。</p>
<h3>我们的愿景</h3>
<p>成为全球领先的数字技术解决方案提供商,用科技改变世界。</p>
</div>
</section>
<section class="team">
<div class="container">
<h2>领导团队</h2>
<div class="team-grid">
<div class="team-member">
<h3>张明</h3>
<p class="position">创始人 & CEO</p>
<p>人工智能专家拥有15年行业经验。</p>
</div>
<div class="team-member">
<h3>李华</h3>
<p class="position">技术总监</p>
<p>大数据和云计算领域专家。</p>
</div>
<div class="team-member">
<h3>王芳</h3>
<p class="position">市场总监</p>
<p>数字营销和品牌战略专家。</p>
</div>
</div>
</div>
</section>
{% endblock %}

43
templates/base.html Normal file
View File

@@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>{{ company.name }} - {% block title %}{% endblock %}</title>
<link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
<link href="https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&display=swap"
rel="stylesheet">
</head>
<body>
<header>
<div class="container">
<h1><a href="{{ url_for('index') }}">{{ company.name }}</a></h1>
<nav>
<ul>
<li><a href="{{ url_for('index') }}">首页</a></li>
<li><a href="{{ url_for('about') }}">关于我们</a></li>
<li><a href="{{ url_for('services') }}">服务</a></li>
<li><a href="{{ url_for('contact') }}">联系我们</a></li>
</ul>
</nav>
</div>
</header>
<main>
{% block content %}{% endblock %}
</main>
<footer>
<div class="container">
<p>&copy; 2023 {{ company.name }}. 保留所有权利。</p>
<div class="footer-links">
<a href="#">隐私政策</a>
<a href="#">使用条款</a>
</div>
</div>
</footer>
</body>
</html>

49
templates/contact.html Normal file
View File

@@ -0,0 +1,49 @@
{% extends "base.html" %}
{% block title %}联系我们{% endblock %}
{% block content %}
<section class="contact">
<div class="container">
<h2>联系我们</h2>
{% if success %}
<div class="success-message">
<p>感谢您的留言!我们会尽快与您联系。</p>
</div>
{% endif %}
<div class="contact-grid">
<div class="contact-info">
<h3>联系方式</h3>
<p><strong>地址:</strong>{{ company.contact.address }}</p>
<p><strong>电话:</strong>{{ company.contact.phone }}</p>
<p><strong>邮箱:</strong>{{ company.contact.email }}</p>
<h3>工作时间</h3>
<p>周一至周五: 9:00 - 18:00</p>
<p>周六至周日: 休息</p>
</div>
<div class="contact-form">
<h3>发送消息</h3>
<form method="POST" action="{{ url_for('contact') }}">
<div class="form-group">
<label for="name">姓名</label>
<input type="text" id="name" name="name" required>
</div>
<div class="form-group">
<label for="email">邮箱</label>
<input type="email" id="email" name="email" required>
</div>
<div class="form-group">
<label for="message">消息</label>
<textarea id="message" name="message" rows="5" required></textarea>
</div>
<button type="submit" class="btn">发送消息</button>
</form>
</div>
</div>
</div>
</section>
{% endblock %}

33
templates/index.html Normal file
View File

@@ -0,0 +1,33 @@
{% extends "base.html" %}
{% block title %}首页{% endblock %}
{% block content %}
<section class="hero">
<div class="container">
<h2>{{ company.slogan }}</h2>
<p>领先的数字技术解决方案提供商</p>
<a href="{{ url_for('services') }}" class="btn">了解我们的服务</a>
</div>
</section>
<section class="features">
<div class="container">
<h2>我们的优势</h2>
<div class="feature-grid">
<div class="feature">
<h3>创新技术</h3>
<p>采用最前沿的人工智能和大数据技术,为客户提供卓越的解决方案。</p>
</div>
<div class="feature">
<h3>专业团队</h3>
<p>由经验丰富的技术专家和行业顾问组成的团队,确保项目高质量交付。</p>
</div>
<div class="feature">
<h3>客户至上</h3>
<p>我们始终将客户需求放在首位,提供个性化的服务和解决方案。</p>
</div>
</div>
</div>
</section>
{% endblock %}

40
templates/login.html Normal file
View File

@@ -0,0 +1,40 @@
{% extends "base.html" %}
{% block content %}
<div class="container mt-5">
<div class="row justify-content-center">
<div class="col-md-6 col-lg-4">
<div class="card shadow">
<div class="card-body">
<h3 class="card-title text-center mb-4">Login</h3>
{% with messages = get_flashed_messages(with_categories=true) %}
{% if messages %}
{% for category, message in messages %}
<div class="alert alert-{{ category }} alert-dismissible fade show" role="alert">
{{ message }}
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
{% endfor %}
{% endif %}
{% endwith %}
<form method="POST" action="{{ url_for('login') }}">
<div class="mb-3">
<label for="username" class="form-label">Username</label>
<input type="text" class="form-control" id="username" name="username" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">Password</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<div class="d-grid gap-2">
<button type="submit" class="btn btn-primary">Login</button>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
{% endblock %}

38
templates/services.html Normal file
View File

@@ -0,0 +1,38 @@
{% extends "base.html" %}
{% block title %}我们的服务{% endblock %}
{% block content %}
<section class="services">
<div class="container">
<h2>我们的服务</h2>
<p class="subtitle">我们提供全方位的数字技术解决方案,助力您的业务增长</p>
<div class="services-grid">
{% for service in company.services %}
<div class="service">
<h3>{{ service.name }}</h3>
<p>{{ service.description }}</p>
<a href="{{ url_for('contact') }}" class="btn">咨询详情</a>
</div>
{% endfor %}
</div>
</div>
</section>
<section class="case-studies">
<div class="container">
<h2>成功案例</h2>
<div class="case-grid">
<div class="case">
<h3>某大型零售企业AI客服系统</h3>
<p>通过我们的自然语言处理技术客户服务效率提升60%。</p>
</div>
<div class="case">
<h3>金融机构风险管理系统</h3>
<p>大数据分析帮助客户识别并减少了30%的欺诈交易。</p>
</div>
</div>
</div>
</section>
{% endblock %}