Files
ns2.0/templates/app_detail.html

492 lines
11 KiB
HTML
Executable File

{% extends "base.html" %}
{% block content %}
<div class="app-detail-container">
<div class="app-header">
<div style="display: flex; justify-content: flex-start; margin-bottom: 15px;">
<a href="{{ request.referrer or url_for('index') }}" class="back-link">
<i class="fas fa-arrow-left"></i>
返回
</a>
</div>
<div class="app-basic-info">
<div class="app-icon">
{% if 'http' in app.icon_path %}
<img src="{{ app.icon_path }}" alt="{{ app.name }}">
{% else %}
<img src="{{ url_for('static', filename='uploads/' + app.icon_path) }}" alt="{{ app.name }}">
{% endif %}
</div>
<div class="app-title">
<div class="title-row">
<div class="title-info">
<h1>{{ app.name }}</h1>
<span class="category-tag">{{ category.name }}</span>
</div>
<div class="action-buttons">
{% if app.visit_url %}
<a href="{{ app.visit_url }}" class="visit-button" target="_blank">
<i class="fas fa-external-link-alt"></i>
访问
</a>
{% endif %}
{% if app.download_url %}
<a href="{{ app.download_url }}" class="download-button" target="_blank">
<i class="fas fa-download"></i>
下载
</a>
{% endif %}
</div>
</div>
</div>
</div>
</div>
<div class="app-content">
<div class="app-section">
<h2>应用描述</h2>
<div class="description">{{ app.description or '暂无描述' }}</div>
</div>
<div class="app-section">
<h2>应用信息</h2>
<div class="info-list">
<div class="info-item">
<label>支持平台</label>
<span class="platform-support">
{% if not app.platform %}
<span class="platform-tag mobile">
<i class="fas fa-mobile-alt"></i> 手机端
</span>
{% else %}
{% if 'mobile' in app.platform.split(',') %}
<span class="platform-tag mobile">
<i class="fas fa-mobile-alt"></i> 手机端
</span>
{% endif %}
{% if 'tablet' in app.platform.split(',') %}
<span class="platform-tag tablet">
<i class="fas fa-tablet-alt"></i> 平板端
</span>
{% endif %}
{% endif %}
</span>
</div>
<div class="info-item">
<label>版本</label>
<span>{{ app.version or '暂无' }}</span>
</div>
<div class="info-item">
<label>更新日期</label>
<span>
{% if app.update_date %}
{% if app.update_date is string %}
{{ app.update_date[:10] }}
{% else %}
{{ app.update_date.strftime('%Y-%m-%d') }}
{% endif %}
{% elif app.created_at %}
{% if app.created_at is string %}
{{ app.created_at[:10] }}
{% else %}
{{ app.created_at.strftime('%Y-%m-%d') }}
{% endif %}
{% else %}
暂无
{% endif %}
</span>
</div>
<div class="info-item">
<label>开发者</label>
<span>{{ app.developer or '暂无' }}</span>
</div>
</div>
</div>
<div class="download-section">
<a href="{{ app.download_url }}" class="download-button" target="_blank">
<i class="fas fa-download"></i>
下载
</a>
</div>
</div>
</div>
<style>
.app-detail-container {
max-width: 800px;
margin: 0 auto;
padding: 15px;
}
.app-header {
background: #fff;
padding: 15px;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
margin-bottom: 15px;
}
.back-link {
display: inline-flex;
align-items: center;
color: #666;
text-decoration: none;
padding: 6px 12px;
border-radius: 6px;
background: #fff;
transition: all 0.3s ease;
margin: 0;
}
.back-link i {
margin-right: 8px;
}
.back-link:hover {
background: #eee;
color: #333;
}
.app-basic-info {
display: flex;
align-items: center;
gap: 15px;
}
.app-icon {
width: 80px;
height: 80px;
}
.app-icon img {
width: 100%;
height: 100%;
border-radius: 16px;
object-fit: cover;
}
.app-title h1 {
margin: 0 0 6px 0;
font-size: 22px;
}
.category-tag {
background: #f0f0f0;
padding: 2px 8px;
border-radius: 12px;
font-size: 12px;
color: #666;
display: inline-flex;
align-items: center;
justify-content: center;
line-height: 1.4;
width: fit-content;
min-width: min-content;
max-width: max-content;
}
.app-content {
background: #fff;
padding: 15px;
border-radius: 12px;
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.app-section {
margin-bottom: 20px;
}
.app-section h2 {
font-size: 16px;
margin: 0 0 8px 0;
color: #333;
padding: 0;
}
.info-list {
display: flex;
flex-direction: column;
gap: 8px;
margin-top: 8px;
}
.info-item {
background: #f8f9fa;
padding: 10px;
border-radius: 6px;
display: flex;
justify-content: space-between;
align-items: center;
}
.info-item label {
font-size: 12px;
color: #666;
}
.info-item span {
font-size: 14px;
color: #333;
}
.description {
line-height: 1.5;
color: #444;
white-space: pre-wrap;
font-size: 14px;
text-align: left;
padding: 0;
margin: 0;
word-break: break-word;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
.download-section {
display: none;
}
.download-button {
display: inline-flex;
align-items: center;
gap: 8px;
background: #007AFF;
color: white;
text-decoration: none;
padding: 8px 16px;
border-radius: 20px;
font-size: 14px;
transition: all 0.3s ease;
white-space: nowrap;
flex-shrink: 0;
margin-left: auto;
}
.download-button:hover {
background: #0056b3;
}
.download-button i {
font-size: 14px;
}
.title-row {
display: flex;
justify-content: space-between;
align-items: flex-start;
width: 100%;
gap: 15px;
}
.title-info {
display: flex;
flex-direction: column;
gap: 6px;
flex: 1;
min-width: 0;
}
.app-title {
flex: 1;
min-width: 0;
}
.action-buttons {
display: flex;
gap: 10px;
margin-left: auto;
}
.visit-button {
display: inline-flex;
align-items: center;
gap: 8px;
background: #34C759; /* 使用不同的颜色区分 */
color: white;
text-decoration: none;
padding: 8px 16px;
border-radius: 20px;
font-size: 14px;
transition: all 0.3s ease;
white-space: nowrap;
flex-shrink: 0;
}
.visit-button:hover {
background: #2FB350;
}
.download-button {
display: inline-flex;
align-items: center;
gap: 8px;
background: #007AFF;
color: white;
text-decoration: none;
padding: 8px 16px;
border-radius: 20px;
font-size: 14px;
transition: all 0.3s ease;
white-space: nowrap;
flex-shrink: 0;
}
.download-button:hover {
background: #0056b3;
}
.visit-button i,
.download-button i {
font-size: 14px;
}
.platform-support {
display: flex;
gap: 10px;
}
.platform-tag {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 10px;
border-radius: 15px;
font-size: 12px;
background: #f5f5f7;
}
.platform-tag.mobile {
color: #007AFF;
background: rgba(0, 122, 255, 0.1);
}
.platform-tag.tablet {
color: #5856D6;
background: rgba(88, 86, 214, 0.1);
}
.platform-tag i {
font-size: 12px;
}
/* 暗色模式样式 */
[data-theme="dark"] .app-detail-container {
background: #1a1a1a;
}
[data-theme="dark"] .app-header {
background: #242424;
}
[data-theme="dark"] .back-link {
color: #ccc;
background: #333;
}
[data-theme="dark"] .back-link:hover {
background: #444;
color: #fff;
}
[data-theme="dark"] .app-title h1 {
color: #fff;
}
[data-theme="dark"] .category-tag {
background: #333;
color: #ccc;
}
[data-theme="dark"] .app-content {
background: #242424;
}
[data-theme="dark"] .app-section h2 {
color: #fff;
}
[data-theme="dark"] .description {
color: #ccc;
}
[data-theme="dark"] .info-item {
background: #333;
}
[data-theme="dark"] .info-item label {
color: #999;
}
[data-theme="dark"] .info-item span {
color: #fff;
}
[data-theme="dark"] .platform-tag {
background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .platform-tag.mobile {
background: rgba(0, 122, 255, 0.2);
}
[data-theme="dark"] .platform-tag.tablet {
background: rgba(88, 86, 214, 0.2);
}
.floating-buttons {
position: fixed;
bottom: 40px;
right: 20px;
z-index: 1000;
display: flex;
flex-direction: column;
gap: 10px;
}
.theme-toggle {
width: 40px;
height: 40px;
border-radius: 50%;
border: none;
background: #fff;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all 0.3s ease;
padding: 0;
}
.theme-toggle:hover {
transform: scale(1.1);
}
/* 暗色模式样式 */
[data-theme="dark"] .theme-toggle {
background: #333;
color: #fff;
}
/* 响应式调整 */
@media (max-width: 768px) {
.floating-buttons {
bottom: 30px;
right: 15px;
gap: 8px;
}
.theme-toggle {
width: 36px;
height: 36px;
}
}
</style>
<script>
document.querySelector('.back-link').addEventListener('click', function(e) {
e.preventDefault();
window.history.back();
});
</script>
{% endblock %}