From c6def26b5215fa9345d0e83b6a1a45942e54c4f3 Mon Sep 17 00:00:00 2001 From: Pine Date: Fri, 28 Aug 2026 17:20:10 +0800 Subject: [PATCH] =?UTF-8?q?feat(miniprogram):=20OSS=E7=9B=B4=E9=93=BE?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0+=E8=B5=84=E8=AE=AF=E4=BA=92=E5=8A=A8+?= =?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=87=8D=E8=AE=BE=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - API 基址支持 TARO_APP_API_BASE 覆盖;头像/入驻资料上传带 dir 业务目录(OSS 路径规范) - 资讯详情:真实点赞(计数)/微信分享(openType=share+useShareAppMessage)/留言;封面 3.35:1 裁切;顶部色条修复 - 发布者徽章(官方/园区/OPC 三款渐变胶囊);头像有则显示无则不留位 - 动作按钮纯图标化并入留言标题行;留言区胶囊输入+渐变发送键 --- miniprogram/config/index.js | 5 ++++- miniprogram/src/app.config.js | 4 ++-- miniprogram/src/app.scss | 18 +++++++++++++++++- miniprogram/src/components/skeleton/index.scss | 5 +++-- miniprogram/src/pages/booking/index.jsx | 2 +- miniprogram/src/pages/booking/index.scss | 15 +++++++++++---- miniprogram/src/pages/mine/index.jsx | 8 +++++--- miniprogram/src/pages/mine/index.scss | 7 +++++++ miniprogram/src/pages/scan-login/index.jsx | 6 +++--- miniprogram/src/pages/test/index.jsx | 4 ++-- miniprogram/src/pages/test/index.scss | 15 ++++++++------- miniprogram/src/utils/api.js | 2 +- miniprogram/src/utils/home.js | 4 ++-- miniprogram/src/utils/parks.js | 3 ++- 14 files changed, 68 insertions(+), 30 deletions(-) diff --git a/miniprogram/config/index.js b/miniprogram/config/index.js index 7513b64..05aa159 100644 --- a/miniprogram/config/index.js +++ b/miniprogram/config/index.js @@ -11,7 +11,10 @@ const config = { alias: { '@': path.resolve(__dirname, '..', 'src') }, - defineConstants: {}, + defineConstants: { + // 构建时可覆盖 API 基址:TARO_APP_API_BASE=http://192.168.1.3:8090 yarn dev:weapp + 'process.env.TARO_APP_API_BASE': JSON.stringify(process.env.TARO_APP_API_BASE || ''), + }, copy: { patterns: [], options: {} }, framework: 'react', compiler: { type: 'webpack5', prebundle: { enable: false } }, diff --git a/miniprogram/src/app.config.js b/miniprogram/src/app.config.js index 1828deb..bfefb59 100644 --- a/miniprogram/src/app.config.js +++ b/miniprogram/src/app.config.js @@ -1,7 +1,7 @@ export default { pages: [ - 'pages/booking/index', 'pages/index/index', + 'pages/booking/index', 'pages/test/index', 'pages/policy/index', 'pages/plan/index', @@ -36,9 +36,9 @@ export default { backgroundColor: '#ffffff', borderStyle: 'white', list: [ + { pagePath: 'pages/index/index', text: '首页' }, { pagePath: 'pages/booking/index', text: '活动' }, { pagePath: 'pages/test/index', text: '测评' }, - { pagePath: 'pages/index/index', text: '首页' }, { pagePath: 'pages/content/index', text: '资讯' }, { pagePath: 'pages/mine/index', text: '我的' } ] diff --git a/miniprogram/src/app.scss b/miniprogram/src/app.scss index e3033be..85604b4 100644 --- a/miniprogram/src/app.scss +++ b/miniprogram/src/app.scss @@ -116,7 +116,9 @@ page { -ms-overflow-style: none; scrollbar-width: none; } } .btn-ghost { - background: rgba(255, 255, 255, 0.7); + background: rgba(255, 255, 255, 0.55); + backdrop-filter: blur(20px) saturate(160%); + -webkit-backdrop-filter: blur(20px) saturate(160%); color: #5a6aa3; border: 1px solid rgba(99, 132, 255, 0.22); border-radius: 999px; @@ -130,6 +132,15 @@ page { -ms-overflow-style: none; scrollbar-width: none; } border: none; } +/* 禁用态:微信原生 button[disabled] 浅底浅字会盖掉单类样式(特异度更高),这里显式压回可读配色 */ +.btn-main[disabled], .btn-main.button-disabled, +.btn-ghost[disabled], .btn-ghost.button-disabled { + background: rgba(120, 140, 220, 0.14); + color: #8b97c4; + border: 1px solid rgba(99, 132, 255, 0.12); + box-shadow: none; +} + .section-head { font-size: 32px; font-weight: 700; @@ -378,3 +389,8 @@ page { -ms-overflow-style: none; scrollbar-width: none; } border-color: rgba(99, 132, 255, 0.16) !important; color: #3a4672 !important; } + +/* 发布者徽章图标(官方/园区/OPC) */ +.ic-shield { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5'%3E%3Cpath d='M12 3l8 3v5c0 5-3.5 8-8 10-4.5-2-8-5-8-10V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5'%3E%3Cpath d='M12 3l8 3v5c0 5-3.5 8-8 10-4.5-2-8-5-8-10V6z'/%3E%3Cpath d='M9 12l2 2 4-4'/%3E%3C/svg%3E"); } +.ic-landmark { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5'%3E%3Cpath d='M3 10l9-6 9 6'/%3E%3Cpath d='M5 10v9M9.5 10v9M14.5 10v9M19 10v9M3 20h18'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5'%3E%3Cpath d='M3 10l9-6 9 6'/%3E%3Cpath d='M5 10v9M9.5 10v9M14.5 10v9M19 10v9M3 20h18'/%3E%3C/svg%3E"); } +.ic-users { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M15.5 5a3.5 3.5 0 0 1 0 6.6'/%3E%3Cpath d='M17.5 14.4a6.5 6.5 0 0 1 4 5.6'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2.5'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2.5 20a6.5 6.5 0 0 1 13 0'/%3E%3Cpath d='M15.5 5a3.5 3.5 0 0 1 0 6.6'/%3E%3Cpath d='M17.5 14.4a6.5 6.5 0 0 1 4 5.6'/%3E%3C/svg%3E"); } diff --git a/miniprogram/src/components/skeleton/index.scss b/miniprogram/src/components/skeleton/index.scss index 8cf5f54..9009607 100644 --- a/miniprogram/src/components/skeleton/index.scss +++ b/miniprogram/src/components/skeleton/index.scss @@ -1,7 +1,8 @@ .sk { position: relative; overflow: hidden; - background: #1d1d24; + /* 亮色玻璃底:白色半透明 + 流光(旧暗色 #1d1d24 在浅色页面上呈黑块,已废弃) */ + background: rgba(255, 255, 255, 0.6); border-radius: 8rpx; } .sk::after { @@ -9,7 +10,7 @@ position: absolute; top: 0; left: 0; right: 0; bottom: 0; transform: translateX(-100%); - background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.06), transparent); + background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent); animation: sk-shimmer 1.4s ease-in-out infinite; } .sk-round { border-radius: 50%; } diff --git a/miniprogram/src/pages/booking/index.jsx b/miniprogram/src/pages/booking/index.jsx index 261e406..eff0704 100644 --- a/miniprogram/src/pages/booking/index.jsx +++ b/miniprogram/src/pages/booking/index.jsx @@ -129,7 +129,7 @@ export default function Booking() { ))} {loaded && filtered.map((e) => renderCard(e))} - {loaded && filtered.length === 0 && !err && 暂无该类型活动,切换筛选看看。} + {loaded && filtered.length === 0 && !err && 暂无该类型活动,切换筛选看看。} {err && {err}} ); diff --git a/miniprogram/src/pages/booking/index.scss b/miniprogram/src/pages/booking/index.scss index 4106512..4b6bb7d 100644 --- a/miniprogram/src/pages/booking/index.scss +++ b/miniprogram/src/pages/booking/index.scss @@ -74,12 +74,12 @@ } .cell-tags { position: absolute; top: 14rpx; left: 14rpx; display: flex; gap: 8rpx; } .ev-tag { - font-size: 20rpx; font-weight: 700; color: #000; background: rgba(255,255,255,0.55); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); + font-size: 20rpx; font-weight: 700; color: #23315c; background: rgba(255,255,255,0.92); border-radius: 999px; padding: 3rpx 14rpx; } -.ev-tag.alt { background: rgba(91,140,255,0.92); color: #23315c; } -.ev-tag.mode { background: rgba(0,0,0,0.5); color: #23315c; } -.ev-tag.mode.online { background: rgba(140,200,255,0.7); color: #0a0d22; } +.ev-tag.alt { background: #5b8cff; color: #fff; } +.ev-tag.mode { background: rgba(20,28,54,0.78); color: #fff; } +.ev-tag.mode.online { background: rgba(140,200,255,0.92); color: #0a1a3a; } .cell-body { padding: 18rpx 18rpx 20rpx; } .cell-name { @@ -124,3 +124,10 @@ .mk-count-cell .num { font-family: 'BubbledotICG', monospace; font-size: 56rpx; color: #23315c; line-height: 1; } .mk-count-cell .unit { font-size: 22rpx; color: #4a5580; } .mk-count-name { display: block; position: relative; z-index: 2; font-size: 30rpx; font-weight: 600; color: #23315c; } + +/* 空状态提示:垂直留白 + 居中 */ +.bk-empty { + display: block; + text-align: center; + padding: 120rpx 40rpx; +} diff --git a/miniprogram/src/pages/mine/index.jsx b/miniprogram/src/pages/mine/index.jsx index 3ce71a7..1f56806 100644 --- a/miniprogram/src/pages/mine/index.jsx +++ b/miniprogram/src/pages/mine/index.jsx @@ -5,6 +5,7 @@ import { useTabIndex } from '@/utils/tab'; import { isAuthed, getUser, logout, wxLogin, phoneLogin, bindPhone, sendCode, wxPhoneBind, updateProfile, getMe } from '@/utils/auth'; import { getMyBookings, checkIn, parseIso, BK_STATUS_OPTIONS, BK_TOPIC_OPTIONS, BK_SOURCE_OPTIONS } from '@/utils/booking'; import { getMyAdmission } from '@/utils/parks'; +import { API_BASE } from '@/utils/api'; import Skeleton from '@/components/skeleton'; import CountdownBox from '@/components/CountdownBox'; import './index.scss'; @@ -231,9 +232,10 @@ export default function Mine() { try { const token = Taro.getStorageSync('pine_token') || ''; const up = await Taro.uploadFile({ - url: 'https://opc.pinesound.cn/api/upload', + url: `${API_BASE}/api/upload`, filePath: tempPath, name: 'file', + formData: { dir: 'avatar' }, header: { Authorization: `Bearer ${token}` } }); const data = JSON.parse(up.data || '{}'); @@ -451,7 +453,7 @@ export default function Mine() { - 任务广场请到 Web 端或桌面端查看 + 任务广场请到 Web 端或桌面端查看 {/* 我的园区:未入驻 → 申请入驻 + OPC认证;已入驻 → 园区信息 + OPC认证 + 转园 */} @@ -466,7 +468,7 @@ export default function Mine() { if (!admitted) { return ( - 暂未入驻园区,可申请入驻并完成 OPC 认证。 + 暂未入驻园区,可申请入驻并完成 OPC 认证。 diff --git a/miniprogram/src/pages/mine/index.scss b/miniprogram/src/pages/mine/index.scss index ec21a8f..4de39e9 100644 --- a/miniprogram/src/pages/mine/index.scss +++ b/miniprogram/src/pages/mine/index.scss @@ -403,3 +403,10 @@ .mk-btnrow { display: flex; gap: 16rpx; margin-top: 18rpx; flex-wrap: wrap; } .mk-hint { margin-top: 12rpx; font-size: 24rpx; color: #8a8a93; display: block; line-height: 1.5; } .mk-hint:first-child { margin-top: 0; } + +/* 提示文案对齐「还没有报名记录。」样式:muted 尺寸 + 卡内居中 */ +.mk-center-hint { + display: block; + text-align: center; + padding: 16rpx 0; +} diff --git a/miniprogram/src/pages/scan-login/index.jsx b/miniprogram/src/pages/scan-login/index.jsx index 8d06e0f..7d1ba56 100644 --- a/miniprogram/src/pages/scan-login/index.jsx +++ b/miniprogram/src/pages/scan-login/index.jsx @@ -126,9 +126,9 @@ export default function ScanLogin() { ) : ( <> - 确认扫码操作 - 确认使用当前微信账号在你操作的端口完成登录 / 绑定? - {scene && 请求 #{scene.slice(0, 12)}} + 确认登录 + 确认使用当前账号完成登录或绑定? + {scene && 请确认是您正在操作} )} diff --git a/miniprogram/src/pages/test/index.jsx b/miniprogram/src/pages/test/index.jsx index 8ad2ed1..fc2388e 100644 --- a/miniprogram/src/pages/test/index.jsx +++ b/miniprogram/src/pages/test/index.jsx @@ -108,7 +108,7 @@ export default function Test() { Start - 一个人,也可以是一家公司。测评会回答四件事:我适不适合做 OPC · 该选什么赛道 · 适合什么角色 · 怎么和 AI 协作。完成约 5–10 分钟,结果即时生成。 + 一个人,也可以是一家公司。5–10 分钟,看清你的 OPC 赛道、角色与 AI 协作方式。 setVersion('quick')}> @@ -161,7 +161,7 @@ export default function Test() { - 第 {q.id} 题 + 第 {current + 1} 题 {ans && 已答} {q.question} diff --git a/miniprogram/src/pages/test/index.scss b/miniprogram/src/pages/test/index.scss index 1ff3874..4fcbd01 100644 --- a/miniprogram/src/pages/test/index.scss +++ b/miniprogram/src/pages/test/index.scss @@ -48,9 +48,9 @@ /* ---------- 欢迎 ---------- */ .ot-intro { display: block; - font-size: 28rpx; - color: #4a5580; - line-height: 1.75; + font-size: 24rpx; /* 辅助说明降一档,减少视觉比重 */ + color: #8a94b8; + line-height: 1.7; margin-bottom: 24rpx; } @@ -321,7 +321,7 @@ .ot-code { font-family: 'BubbledotICG', monospace; font-size: 60rpx; - color: #23315c; + color: #dfe6ff; /* 深色 hero 卡上提亮,保证对比度 */ letter-spacing: 4rpx; line-height: 1; } @@ -396,9 +396,10 @@ .ot-weak { font-size: 24rpx; - color: #f5d9a0; - background: rgba(245, 217, 160, 0.08); - border: 1rpx dashed rgba(245, 217, 160, 0.4); + color: #8a5a00; /* 浅黄底上换深琥珀,保证对比度 */ + font-weight: 600; + background: rgba(245, 200, 90, 0.28); + border: 1rpx dashed rgba(190, 140, 30, 0.55); border-radius: 12px; padding: 16rpx 22rpx; margin-bottom: 8rpx; diff --git a/miniprogram/src/utils/api.js b/miniprogram/src/utils/api.js index 970d31f..1c98ddc 100644 --- a/miniprogram/src/utils/api.js +++ b/miniprogram/src/utils/api.js @@ -4,7 +4,7 @@ import { cached } from './cache'; // API 基址 // - 开发:指向本地 web 后端(project.config.json 需 urlCheck:false) // - 生产:真实备案 HTTPS 域名(小程序要求) -const API_BASE = 'https://opc.pinesound.cn'; // 云超服 FastAPI 后端(备案 HTTPS 域名) +export const API_BASE = process.env.TARO_APP_API_BASE || 'https://opc.pinesound.cn'; // 云超服 FastAPI 后端(备案 HTTPS 域名;开发可用 TARO_APP_API_BASE 覆盖) /** * 统一请求封装(对齐 web 端 fetch 契约) diff --git a/miniprogram/src/utils/home.js b/miniprogram/src/utils/home.js index 0b6620b..230b7e4 100644 --- a/miniprogram/src/utils/home.js +++ b/miniprogram/src/utils/home.js @@ -9,8 +9,8 @@ export const MK_HERO = { headline: ['ONE PERSON', 'DESIGNED TO EVOLVE'], subhead: '我们落地在昆明市大学生创业园。每周有免费公益课和线下沙龙,讲透「一个人 + AI 怎么开一家公司」。先来听一场,交个朋友。', - ctaPrimary: { label: '预约公益课 / 沙龙', tab: '/pages/booking/index' }, - ctaSecondary: { label: '先做 OPC 测评', tab: '/pages/test/index' } + ctaPrimary: { label: '预约', tab: '/pages/booking/index' }, + ctaSecondary: { label: '测评', tab: '/pages/test/index' } }; export const MK_TRUST = [ diff --git a/miniprogram/src/utils/parks.js b/miniprogram/src/utils/parks.js index ac36be6..1ec26b8 100644 --- a/miniprogram/src/utils/parks.js +++ b/miniprogram/src/utils/parks.js @@ -1,7 +1,7 @@ import Taro from '@tarojs/taro'; import { request } from './api'; -const API_BASE = 'https://opc.pinesound.cn'; +import { API_BASE } from './api'; /** 平台可见园区列表(选择园区用,公开) */ export async function getParks() { @@ -29,6 +29,7 @@ export async function uploadParkDoc(filePath, name = 'file') { url: `${API_BASE}/api/upload`, filePath, name, + formData: { dir: 'park-admission' }, header: { Authorization: `Bearer ${token}` }, }); const data = JSON.parse(up.data || '{}');