diff --git a/miniprogram/app.wxss b/miniprogram/app.wxss index d898461..f9c216b 100644 --- a/miniprogram/app.wxss +++ b/miniprogram/app.wxss @@ -1,51 +1,229 @@ page { background-color: #f5f5f5; - font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; + font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 28rpx; color: #333333; } -.container { - padding: 24rpx; - min-height: 100vh; +.page-header { + padding: 80rpx 40rpx 32rpx; + text-align: center; + color: #ffffff; } -.section-title { +.page-header-title { + font-size: 36rpx; + font-weight: 600; + margin-bottom: 8rpx; +} + +.page-header-subtitle { + font-size: 26rpx; + opacity: 0.9; +} + +.page-header-pink { + background-color: #E6508C; +} + +.page-header-green { + background-color: #52c41a; +} + +.page-header-blue { + background-color: #006699; +} + +.page-header-gold { + background-color: #DCB982; +} + +.page-header-gradient { + background: linear-gradient(135deg, #E6508C 0%, #DCB982 100%); +} + +.page-content { + padding: 32rpx; +} + +.page-title { font-size: 32rpx; font-weight: 600; - margin-bottom: 20rpx; -} - -.card { - background-color: #ffffff; - border-radius: 16rpx; - padding: 32rpx; - margin-bottom: 20rpx; - box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.05); + color: #333333; + text-align: center; + margin-bottom: 28rpx; } .btn-primary { - background-color: #333333; + display: block; + width: 100%; + padding: 28rpx 32rpx; + background: #E6508C; color: #ffffff; - border-radius: 12rpx; - padding: 24rpx 40rpx; - text-align: center; + border: none; + border-radius: 20rpx; font-size: 30rpx; - font-weight: 500; + font-weight: 600; + text-align: center; + margin-bottom: 20rpx; +} + +.btn-primary::after { + border: none; } .btn-primary:active { - opacity: 0.8; + opacity: 0.85; +} + +.btn-primary-green { + background: #E6508C; +} + +.btn-primary-gold { + background: #DCB982; +} + +.btn-primary-red { + background: #ff4d4f; } .btn-secondary { - background-color: #ffffff; - color: #333333; - border: 2rpx solid #333333; - border-radius: 12rpx; - padding: 24rpx 40rpx; + display: block; + width: 100%; + padding: 28rpx 32rpx; + background: #ffffff; + color: #E6508C; + border: 4rpx solid #E6508C; + border-radius: 20rpx; + font-size: 28rpx; + font-weight: 500; text-align: center; + margin-bottom: 20rpx; +} + +.btn-secondary::after { + border: none; +} + +.btn-secondary-gold { + color: #DCB982; + border-color: #DCB982; +} + +.status-badge { + display: inline-block; + padding: 6rpx 20rpx; + border-radius: 20rpx; + font-size: 24rpx; + color: #ffffff; +} + +.status-badge-green { + background-color: #52c41a; +} + +.status-badge-gold { + background-color: #FAAD14; +} + +.device-card { + background: linear-gradient(135deg, #fdf2f8 0%, #ffffff 100%); + border: 4rpx solid #E6508C; + border-radius: 28rpx; + padding: 40rpx; + text-align: center; + margin-bottom: 28rpx; +} + +.device-icon { + width: 100rpx; + height: 100rpx; + background: #E6508C; + border-radius: 50%; + margin: 0 auto 20rpx; + display: flex; + align-items: center; + justify-content: center; + color: #ffffff; + font-size: 52rpx; +} + +.device-name { font-size: 30rpx; + color: #333333; + margin-bottom: 12rpx; +} + +.device-battery { + display: flex; + align-items: center; + justify-content: center; + gap: 8rpx; + margin-top: 16rpx; + font-size: 26rpx; + color: #666666; +} + +.success-icon { + width: 140rpx; + height: 140rpx; + background: #52c41a; + border-radius: 50%; + margin: 0 auto 32rpx; + display: flex; + align-items: center; + justify-content: center; + color: #ffffff; + font-size: 80rpx; +} + +.success-title { + font-size: 44rpx; + color: #333333; + font-weight: 600; + text-align: center; + margin-bottom: 16rpx; +} + +.tip-card { + background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%); + border: 2rpx solid #DCB982; + border-radius: 24rpx; + padding: 28rpx; + margin-bottom: 28rpx; + display: flex; + align-items: center; + gap: 20rpx; +} + +.tip-card-icon { + font-size: 52rpx; + flex-shrink: 0; +} + +.tip-card-title { + font-size: 28rpx; + color: #333333; + font-weight: 600; + margin-bottom: 6rpx; +} + +.tip-card-sub { + font-size: 26rpx; + color: #666666; +} + +.info-tip { + background: #f0f9ff; + border-radius: 20rpx; + padding: 24rpx; + margin-bottom: 24rpx; + font-size: 26rpx; + color: #006699; + display: flex; + align-items: center; + gap: 16rpx; } .text-muted { @@ -56,89 +234,7 @@ page { text-align: center; } -.text-primary { - color: #333333; -} - -.text-success { - color: #52c41a; -} - -.text-warning { - color: #faad14; -} - -.text-error { - color: #ff4d4f; -} - -.mt-10 { margin-top: 10rpx; } .mt-20 { margin-top: 20rpx; } .mt-30 { margin-top: 30rpx; } -.mb-10 { margin-bottom: 10rpx; } .mb-20 { margin-bottom: 20rpx; } .mb-30 { margin-bottom: 30rpx; } -.p-20 { padding: 20rpx; } - -.flex-row { - display: flex; - flex-direction: row; - align-items: center; -} - -.flex-between { - display: flex; - justify-content: space-between; - align-items: center; -} - -.flex-center { - display: flex; - justify-content: center; - align-items: center; -} - -.flex-1 { - flex: 1; -} - -.divider { - height: 1rpx; - background-color: #eeeeee; - margin: 20rpx 0; -} - -.badge { - display: inline-block; - padding: 4rpx 16rpx; - border-radius: 8rpx; - font-size: 22rpx; - color: #ffffff; -} - -.badge-success { - background-color: #52c41a; -} - -.badge-error { - background-color: #ff4d4f; -} - -.badge-warning { - background-color: #faad14; -} - -.empty-state { - padding: 120rpx 40rpx; - text-align: center; -} - -.empty-state .empty-icon { - font-size: 80rpx; - margin-bottom: 20rpx; -} - -.empty-state .empty-text { - color: #999999; - font-size: 28rpx; -} diff --git a/miniprogram/pages/auto-scan/auto-scan.json b/miniprogram/pages/auto-scan/auto-scan.json index cad0ea6..8fbb710 100644 --- a/miniprogram/pages/auto-scan/auto-scan.json +++ b/miniprogram/pages/auto-scan/auto-scan.json @@ -1,3 +1,4 @@ { + "navigationStyle": "custom", "navigationBarTitleText": "自动扫描" } diff --git a/miniprogram/pages/auto-scan/auto-scan.wxml b/miniprogram/pages/auto-scan/auto-scan.wxml index 0e2f834..a4750ef 100644 --- a/miniprogram/pages/auto-scan/auto-scan.wxml +++ b/miniprogram/pages/auto-scan/auto-scan.wxml @@ -1,19 +1,28 @@ - - - {{scanning ? '面部扫描中' : '扫描完成'}} - - {{scanning ? '请保持设备贴合面部' : ''}} + + + 自动扫描 + 正在识别面部... - - 扫描结果 - - {{item.region}} - {{item.pd}} + + 自动扫描面部区域 + + + + + - - - 设置护理参数 + 请将面罩对准面部 + + + 正在扫描... {{regionData.length || 3}} 个区域 + + + + {{item.region}} + + + diff --git a/miniprogram/pages/auto-scan/auto-scan.wxss b/miniprogram/pages/auto-scan/auto-scan.wxss index c0b7d16..e73c1df 100644 --- a/miniprogram/pages/auto-scan/auto-scan.wxss +++ b/miniprogram/pages/auto-scan/auto-scan.wxss @@ -1,8 +1,79 @@ -.scan-result-item { - padding: 16rpx 0; - border-bottom: 1rpx solid #f0f0f0; +.scan-container { + position: relative; + width: 320rpx; + height: 400rpx; + margin: 40rpx auto; } -.scan-result-item:last-child { - border-bottom: none; +.face-outline { + width: 100%; + height: 100%; + border: 6rpx solid #e5e5e5; + border-radius: 50% 50% 45% 45%; + position: relative; + overflow: hidden; +} + +.scan-line { + position: absolute; + left: 10rpx; + right: 10rpx; + height: 6rpx; + background: linear-gradient(90deg, transparent, #E6508C, #DCB982, #E6508C, transparent); + animation: scan 2s ease-in-out infinite; +} + +@keyframes scan { + 0% { top: 0; opacity: 0.5; } + 50% { opacity: 1; } + 100% { top: calc(100% - 6rpx); opacity: 0.5; } +} + +.scan-hint { + text-align: center; + font-size: 26rpx; + color: #666666; + margin-bottom: 24rpx; +} + +.scan-progress { + text-align: center; + background: #f0f9ff; + padding: 16rpx 28rpx; + border-radius: 24rpx; + font-size: 26rpx; + color: #006699; + display: inline-block; + margin: 0 auto; +} + +.highlight { + color: #E6508C; + font-weight: 600; +} + +.detected-tags { + text-align: center; + margin-top: 24rpx; +} + +.detected-tag { + background: #fdf2f8; + border: 2rpx solid #E6508C; + color: #E6508C; + padding: 10rpx 24rpx; + border-radius: 24rpx; + font-size: 24rpx; + display: inline-block; + margin: 6rpx; + animation: tagPulse 1s ease-in-out; +} + +@keyframes tagPulse { + 0%, 100% { transform: scale(1); } + 50% { transform: scale(1.05); } +} + +.btn-primary::after { + border: none; } diff --git a/miniprogram/pages/bind-success/bind-success.json b/miniprogram/pages/bind-success/bind-success.json index 189c71a..e7358e6 100644 --- a/miniprogram/pages/bind-success/bind-success.json +++ b/miniprogram/pages/bind-success/bind-success.json @@ -1,3 +1,4 @@ { + "navigationStyle": "custom", "navigationBarTitleText": "绑定成功" } diff --git a/miniprogram/pages/bind-success/bind-success.wxml b/miniprogram/pages/bind-success/bind-success.wxml index 5ddf7c4..71c9a3e 100644 --- a/miniprogram/pages/bind-success/bind-success.wxml +++ b/miniprogram/pages/bind-success/bind-success.wxml @@ -1,9 +1,23 @@ - - - - 绑定成功 - 设备已成功绑定到您的账号 - 已自动发放 {{trialDays}} 天试用 - 开始使用 + + + 绑定成功 + 设备已成功绑定 + + + + + + 绑定成功! + + + + 🎁 + + 恭喜获得7天智能模式试用 + 体验结束后可订阅继续使用 + + + + diff --git a/miniprogram/pages/bind-success/bind-success.wxss b/miniprogram/pages/bind-success/bind-success.wxss index 95f767c..da899f0 100644 --- a/miniprogram/pages/bind-success/bind-success.wxss +++ b/miniprogram/pages/bind-success/bind-success.wxss @@ -1,10 +1,8 @@ -.success-icon { - width: 120rpx; - height: 120rpx; - border-radius: 50%; - background-color: #52c41a; - color: #ffffff; - font-size: 64rpx; - line-height: 120rpx; - margin: 40rpx auto; +.success-area { + text-align: center; + padding: 60rpx 0; +} + +.tip-card-body { + flex: 1; } diff --git a/miniprogram/pages/ble-connect/ble-connect.json b/miniprogram/pages/ble-connect/ble-connect.json index 4fa52fe..c8dd77a 100644 --- a/miniprogram/pages/ble-connect/ble-connect.json +++ b/miniprogram/pages/ble-connect/ble-connect.json @@ -1,3 +1,4 @@ { + "navigationStyle": "custom", "navigationBarTitleText": "蓝牙连接" } diff --git a/miniprogram/pages/ble-connect/ble-connect.wxml b/miniprogram/pages/ble-connect/ble-connect.wxml index ec11568..bf43594 100644 --- a/miniprogram/pages/ble-connect/ble-connect.wxml +++ b/miniprogram/pages/ble-connect/ble-connect.wxml @@ -1,28 +1,30 @@ - - - - {{state === 'scanning' ? '正在扫描设备...' : state === 'connecting' ? '正在连接设备...' : state === 'binding' ? '正在绑定设备...' : '连接失败'}} + + + 蓝牙连接 + {{state === 'scanning' ? '正在搜索设备...' : state === 'connecting' ? '正在连接设备...' : state === 'binding' ? '正在绑定...' : '连接失败'}} + + + + + 📡 + 请确保手机蓝牙已开启 - - 请确保设备已开机且在附近 - - - 设备ID: {{deviceId}} - - - 正在写入绑定信息... - - - {{error}} + + + 搜索中... - - + + 💆 + 光子美容仪-{{deviceId}} + 连接中 - - 重试 + + ⚠️ + {{error || '连接失败'}} + diff --git a/miniprogram/pages/ble-connect/ble-connect.wxss b/miniprogram/pages/ble-connect/ble-connect.wxss index aa1cdd6..7841312 100644 --- a/miniprogram/pages/ble-connect/ble-connect.wxss +++ b/miniprogram/pages/ble-connect/ble-connect.wxss @@ -1,18 +1,78 @@ -.loading-spinner { - padding: 40rpx 0; - display: flex; - justify-content: center; +.search-card { + background: linear-gradient(135deg, #fdf2f8 0%, #ffffff 100%); + border: 4rpx dashed #e5e5e5; + border-radius: 28rpx; + padding: 40rpx; + text-align: center; + margin-bottom: 28rpx; } -.spinner { - width: 64rpx; - height: 64rpx; - border: 6rpx solid #eeeeee; - border-top-color: #333333; +.search-icon { + width: 100rpx; + height: 100rpx; + background: #cccccc; border-radius: 50%; - animation: spin 0.8s linear infinite; + margin: 0 auto 16rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 48rpx; + color: #ffffff; } -@keyframes spin { - to { transform: rotate(360deg); } +.search-icon.pulsing { + animation: pulse 1s infinite; +} + +@keyframes pulse { + 0%, 100% { opacity: 1; } + 50% { opacity: 0.5; } +} + +.search-text { + font-size: 30rpx; + color: #333333; +} + +.found-card { + background: linear-gradient(135deg, #fdf2f8 0%, #ffffff 100%); + border: 4rpx solid #E6508C; + border-radius: 28rpx; + padding: 40rpx; + text-align: center; + margin-bottom: 28rpx; +} + +.found-icon { + width: 100rpx; + height: 100rpx; + background: #E6508C; + border-radius: 50%; + margin: 0 auto 16rpx; + display: flex; + align-items: center; + justify-content: center; + font-size: 48rpx; + color: #ffffff; +} + +.found-name { + font-size: 30rpx; + color: #333333; + margin-bottom: 12rpx; +} + +.retry-btn { + display: inline-block; + background: #E6508C; + color: #ffffff; + border: none; + border-radius: 20rpx; + padding: 16rpx 48rpx; + font-size: 28rpx; + margin-top: 16rpx; +} + +.retry-btn::after { + border: none; } diff --git a/miniprogram/pages/history/history.js b/miniprogram/pages/history/history.js index 99734c4..9afd4fd 100644 --- a/miniprogram/pages/history/history.js +++ b/miniprogram/pages/history/history.js @@ -5,6 +5,8 @@ Page({ data: { records: [], total: 0, + totalHours: 0, + monthCount: 0, page: 1, pageSize: 20, loading: true, @@ -41,18 +43,30 @@ Page({ page: page, page_size: self.data.pageSize }).then(function (data) { + var totalMs = 0 + var now = new Date() + var monthStart = new Date(now.getFullYear(), now.getMonth(), 1) + var monthCount = 0 + var records = (data.records || []).map(function (r) { var durationMin = Math.floor((r.total_duration_ms || 0) / 60000) + totalMs += (r.total_duration_ms || 0) r.duration_text = durationMin + '分钟' r.region_names = ble.getRegionName(r.regions || 0).join('、') r.wavelength_name = ble.getWavelengthName(r.wavelength || 2) r.date_text = r.start_time ? r.start_time.slice(0, 10) : '' + + if (r.start_time && new Date(r.start_time) >= monthStart) { + monthCount++ + } return r }) self.setData({ records: refresh ? records : self.data.records.concat(records), total: data.total || 0, + totalHours: Math.round(totalMs / 3600000), + monthCount: monthCount, page: page, loading: false, loadingMore: false diff --git a/miniprogram/pages/history/history.json b/miniprogram/pages/history/history.json index 0fcc4c7..733e3df 100644 --- a/miniprogram/pages/history/history.json +++ b/miniprogram/pages/history/history.json @@ -1,3 +1,5 @@ { - "navigationBarTitleText": "护理记录" + "navigationBarTitleText": "护理记录", + "navigationBarBackgroundColor": "#E6508C", + "navigationBarTextStyle": "white" } diff --git a/miniprogram/pages/history/history.wxml b/miniprogram/pages/history/history.wxml index d39d207..e449f31 100644 --- a/miniprogram/pages/history/history.wxml +++ b/miniprogram/pages/history/history.wxml @@ -1,26 +1,38 @@ - - - 加载中... + + + 护理记录 + 查看历史护理数据 - - 📑 - 暂无护理记录 - - - - 共 {{total}} 条记录 - - - - {{item.date_text}} - {{item.duration_text}} + + + + {{total}} + 累计次数 + + + {{totalHours}}h + 累计时长 + + + {{monthCount}} + 本月次数 - {{item.region_names}} - - 加载更多... + 最近记录 + + + {{item.date_text}} + {{item.mode === 1 ? '✨ 智能' : '🔄 普通'}} + {{item.duration_text}} + + + 📃 + 暂无护理记录 + + + 加载更多... diff --git a/miniprogram/pages/history/history.wxss b/miniprogram/pages/history/history.wxss index e764761..43ab6c2 100644 --- a/miniprogram/pages/history/history.wxss +++ b/miniprogram/pages/history/history.wxss @@ -1,22 +1,94 @@ -.record-count { - font-size: 24rpx; +.stats-row { + display: flex; + gap: 16rpx; + margin-bottom: 28rpx; } -.record-card { - padding: 24rpx 32rpx; +.stat-card { + flex: 1; + background: #f8f8f8; + border-radius: 20rpx; + padding: 20rpx 12rpx; + text-align: center; +} + +.stat-value { + font-size: 40rpx; + font-weight: 600; + color: #E6508C; +} + +.stat-label { + font-size: 22rpx; + color: #999999; + margin-top: 4rpx; +} + +.section-title { + font-size: 28rpx; + font-weight: 600; + color: #333333; + margin-bottom: 20rpx; +} + +.record-item { + display: flex; + align-items: center; + padding: 24rpx; + margin-bottom: 12rpx; + background: #ffffff; + border-radius: 20rpx; + box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.04); } .record-date { - font-size: 28rpx; - font-weight: 500; -} - -.record-duration { font-size: 26rpx; + font-weight: 500; color: #333333; + flex: 1; } -.record-regions { +.record-mode { + font-size: 20rpx; + padding: 4rpx 14rpx; + border-radius: 12rpx; +} + +.record-mode.smart { + background: #fdf2f8; + color: #E6508C; +} + +.record-mode.normal { + background: #f0f0f0; + color: #666666; +} + +.record-details { + font-size: 22rpx; + color: #999999; + margin-left: 12rpx; +} + +.empty-state { + text-align: center; + padding: 120rpx 40rpx; +} + +.empty-icon { + font-size: 80rpx; + display: block; + margin-bottom: 16rpx; +} + +.empty-text { + color: #999999; + font-size: 28rpx; +} + +.loading-more { + text-align: center; font-size: 24rpx; - margin-top: 4rpx; + color: #999999; + padding: 20rpx 0; } diff --git a/miniprogram/pages/index/index.json b/miniprogram/pages/index/index.json index dac4751..7758deb 100644 --- a/miniprogram/pages/index/index.json +++ b/miniprogram/pages/index/index.json @@ -1,3 +1,5 @@ { - "navigationBarTitleText": "首页" + "navigationBarTitleText": "首页", + "navigationBarBackgroundColor": "#E6508C", + "navigationBarTextStyle": "white" } diff --git a/miniprogram/pages/index/index.wxml b/miniprogram/pages/index/index.wxml index 69a08f9..cc8d40b 100644 --- a/miniprogram/pages/index/index.wxml +++ b/miniprogram/pages/index/index.wxml @@ -1,52 +1,30 @@ - - - - 添加设备 - 您还没有绑定设备 - 扫码添加设备 + + + 首页 + 光子美容仪 + + + + + 📱 + 还没有绑定设备 + - - - - {{deviceName}} - - - {{connected ? '已连接' : bleState === 'scanning' ? '扫描中...' : bleState === 'connecting' ? '连接中...' : '未连接'}} - - - - - {{battery}}% + + + 💆 + {{deviceName || '我的光面膜'}} + 已连接 + 未连接 + + 🔋 + 电量 {{battery}}% - - 连接设备 - - - - 设备状态: {{modeState}} - - - - - - - 订阅状态 - - - {{subscription.status === 1 ? '试用中' : '已订阅'}} · 剩余 {{subRemaining}} 天 - - 未订阅 - - - - - - - - 开始护理 + + diff --git a/miniprogram/pages/index/index.wxss b/miniprogram/pages/index/index.wxss index 7c59bfd..6af5421 100644 --- a/miniprogram/pages/index/index.wxss +++ b/miniprogram/pages/index/index.wxss @@ -1,23 +1,20 @@ -.device-name { - font-size: 32rpx; - font-weight: 600; - margin-bottom: 8rpx; +.empty-device { + text-align: center; + padding: 120rpx 40rpx; } -.device-status { - font-size: 24rpx; +.empty-icon { + font-size: 120rpx; + display: block; + margin-bottom: 24rpx; } -.battery-area { +.empty-text { + color: #999999; font-size: 28rpx; - color: #333333; } -.arrow { - font-size: 28rpx; - color: #cccccc; -} - -.sub-card:active { - background-color: #f9f9f9; +.btn-primary::after, +.btn-secondary::after { + border: none; } diff --git a/miniprogram/pages/login/login.wxml b/miniprogram/pages/login/login.wxml index 80ad673..f2956b7 100644 --- a/miniprogram/pages/login/login.wxml +++ b/miniprogram/pages/login/login.wxml @@ -1,16 +1,22 @@ -