From efc51486d552dba453cb8707cbc3039a91fead8c Mon Sep 17 00:00:00 2001 From: linbin <495561397@qq.com> Date: Fri, 1 Aug 2025 18:23:11 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=AF=E5=88=86=E8=AF=A6=E6=83=85=EF=BC=8C?= =?UTF-8?q?=E6=88=90=E9=95=BF=E5=80=BC=E8=AF=A6=E6=83=85=E9=83=BD=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- new_web/merchant/CLAUDE.md | 370 +++++++++++----------- new_web/merchant/css/coupon-modal.css | 123 ------- new_web/merchant/js/level-edit.js | 12 - new_web/merchant/js/member-detail.js | 307 +++++++++++++++++- new_web/merchant/pages/coupon-modal.html | 128 +++++++- new_web/merchant/pages/level-edit.html | 125 ++++++++ new_web/merchant/pages/member-detail.html | 327 ++++++++++--------- 7 files changed, 894 insertions(+), 498 deletions(-) delete mode 100644 new_web/merchant/css/coupon-modal.css diff --git a/new_web/merchant/CLAUDE.md b/new_web/merchant/CLAUDE.md index 787c1ed..ca586cb 100644 --- a/new_web/merchant/CLAUDE.md +++ b/new_web/merchant/CLAUDE.md @@ -1,258 +1,242 @@ -# 信息管理系统原型项目 +# 信息管理系统演示项目开发约束 -## 🚨 核心开发约束(必须严格遵守) +## 🎯 项目定位 + +**这是一个纯演示项目**,重点在于展示清晰的布局设计和流畅的交互体验。项目不包含实际的业务功能,所有数据均为模拟数据,主要用于: +- 界面原型展示 + +## 🚨 核心架构约束(必须严格遵守) + +### CSS内嵌原则 - 项目核心约束 +**所有页面专用CSS必须内嵌到对应的HTML文件中** + +#### ✅ 强制要求 + +1. **CSS内容集成** - 每个页面的专用样式必须写在页面HTML底部的` ``` -#### Step 3: 创建JavaScript功能文件 +#### Step 3: 创建JavaScript文件(可选) ```bash -# 在js/目录创建功能逻辑 +# 在js/目录创建功能文件 js/feature-name.js ``` -#### Step 4: JavaScript模块标准结构 +#### Step 4: JavaScript文件标准结构 ```javascript -// js/feature-name.js - /** - * 功能模块名称 + * 页面功能模块 * 功能描述 */ // 页面初始化函数(必需) function initFeatureName() { - console.log('功能模块已初始化'); - // 如果需要CSS,动态加载 - loadFeatureCSS(); - // 其他初始化逻辑 -} - -// 加载专用CSS(如需要) -function loadFeatureCSS() { - if (!document.getElementById('featureCSS')) { - const link = document.createElement('link'); - link.id = 'featureCSS'; - link.rel = 'stylesheet'; - link.href = 'css/feature-name.css'; - document.head.appendChild(link); - } + console.log('页面已初始化'); + // 初始化逻辑,不包含CSS加载 } // 功能函数 function someFunction() { - // 功能实现,仅处理逻辑 - // 需要HTML时使用fetch加载 + // 功能实现 } // 暴露到全局作用域供HTML调用 window.someFunction = someFunction; - -// 页面清理函数(可选) -function cleanupFeatureName() { - // 清理事件监听器等 -} ``` -### 2. 动态内容加载规范 +### 2. CSS样式处理规范 -#### HTML内容加载 +#### 内嵌CSS标准写法 +```html + +``` + +#### CSS组织原则 +1. **样式分组** - 按布局、组件、交互、响应式分组编写 +2. **注释清晰** - 每个样式区块添加注释说明 +3. **命名规范** - 使用语义化的CSS类名 +4. **优先级管理** - 避免使用!important,合理利用CSS优先级 + +### 3. 页面集成规范 + +#### 动态加载页面内容 ```javascript -// 正确的HTML加载方式 -async function loadHTMLContent() { +// 正确的页面加载方式 +async function loadPageHTML() { try { - const response = await fetch('pages/content.html'); + const response = await fetch('pages/feature-name.html'); const htmlContent = await response.text(); document.getElementById('container').innerHTML = htmlContent; + // 页面加载完成,CSS自动生效 } catch (error) { - console.error('加载失败:', error); + console.error('页面加载失败:', error); } } ``` -#### CSS样式加载 -```javascript -// 正确的CSS加载方式 -function loadCSS(cssFile, id) { - if (!document.getElementById(id)) { - const link = document.createElement('link'); - link.id = id; - link.rel = 'stylesheet'; - link.href = `css/${cssFile}`; - document.head.appendChild(link); - } -} -``` +## 🎨 样式系统规范 -### 3. 文件命名规范 -- **页面文件**: `pages/功能名称.html` (kebab-case) -- **样式文件**: `css/功能名称.css` (kebab-case) -- **脚本文件**: `js/功能名称.js` (kebab-case) -- **初始化函数**: `init[功能名称CamelCase]()` -- **CSS ID**: `功能名称CSS` (CamelCase) +### 全局样式职责 +- `styles.css`: 仅包含框架级别的通用样式 + - 基础reset样式 + - 通用组件样式(按钮、表单等) + - 布局框架样式 + - 公共工具类 -## 架构特点 +### 页面样式职责 +- 每个页面HTML中的` \ No newline at end of file diff --git a/new_web/merchant/pages/level-edit.html b/new_web/merchant/pages/level-edit.html index 2d536bd..5239f08 100644 --- a/new_web/merchant/pages/level-edit.html +++ b/new_web/merchant/pages/level-edit.html @@ -325,4 +325,129 @@ .level-edit-table th:nth-child(7) { width: 80px; } /* 开启生日优惠券 */ .level-edit-table th:nth-child(8) { width: 100px; } /* 生日优惠券操作 */ .level-edit-table th:nth-child(9) { width: 80px; } /* 开启生日双倍积分 */ + +/* 优惠券弹窗样式 */ +.modal-overlay { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; + background-color: rgba(0, 0, 0, 0.5); + display: flex; + justify-content: center; + align-items: center; + z-index: 1000; +} + +.modal-content { + background: white; + border-radius: 8px; + width: 400px; + max-width: 90vw; + max-height: 90vh; + overflow-y: auto; +} + +.modal-header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20px; + border-bottom: 1px solid #eee; +} + +.modal-header h3 { + margin: 0; + font-size: 18px; + color: #333; +} + +.modal-close { + background: none; + border: none; + font-size: 24px; + cursor: pointer; + color: #999; + padding: 0; + width: 30px; + height: 30px; + display: flex; + align-items: center; + justify-content: center; +} + +.modal-close:hover { + color: #333; +} + +.modal-body { + padding: 20px; +} + +.modal-footer { + display: flex; + justify-content: flex-end; + gap: 10px; + padding: 20px; + border-top: 1px solid #eee; +} + +.form-group { + margin-bottom: 16px; +} + +.form-group label { + display: block; + margin-bottom: 8px; + font-weight: 500; + color: #333; +} + +.required { + color: #e74c3c; + margin-right: 4px; +} + +.input-with-dropdown { + position: relative; + display: flex; +} + +.input-with-dropdown .form-input { + flex: 1; + padding-right: 40px; +} + +.dropdown-btn { + position: absolute; + right: 8px; + top: 50%; + transform: translateY(-50%); + background: none; + border: none; + cursor: pointer; + color: #666; + font-size: 12px; +} + +.btn-secondary { + background-color: #f8f9fa; + color: #6c757d; + border: 1px solid #dee2e6; +} + +.btn-secondary:hover { + background-color: #e9ecef; +} + +.btn-primary { + background-color: #007bff; + color: white; + border: 1px solid #007bff; +} + +.btn-primary:hover { + background-color: #0056b3; +} \ No newline at end of file diff --git a/new_web/merchant/pages/member-detail.html b/new_web/merchant/pages/member-detail.html index ce38c29..74b4c24 100644 --- a/new_web/merchant/pages/member-detail.html +++ b/new_web/merchant/pages/member-detail.html @@ -72,122 +72,39 @@