diff --git a/miniprogram/src/app.scss b/miniprogram/src/app.scss index 71a177b..a2c2130 100644 --- a/miniprogram/src/app.scss +++ b/miniprogram/src/app.scss @@ -343,3 +343,16 @@ page { -ms-overflow-style: none; scrollbar-width: none; } color: #ffd28a; margin-top: 24px; } + +/* 通用线性图标(CSS mask SVG,仿 lucide;禁用 emoji 图标) */ +.ic { + display: inline-block; width: 36rpx; height: 36rpx; background-color: currentColor; + -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; -webkit-mask-size: contain; + mask-repeat: no-repeat; mask-position: center; mask-size: contain; +} +.ic-play { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M5 3l14 9-14 9V3z'/%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='%23fff'%3E%3Cpath d='M5 3l14 9-14 9V3z'/%3E%3C/svg%3E"); } +.ic-heart { -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'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.6l-1-1a5.5 5.5 0 0 0-7.8 7.8l1 1L12 21l7.8-7.6 1-1a5.5 5.5 0 0 0 0-7.8z'/%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'%3E%3Cpath d='M20.8 4.6a5.5 5.5 0 0 0-7.8 0L12 5.6l-1-1a5.5 5.5 0 0 0-7.8 7.8l1 1L12 21l7.8-7.6 1-1a5.5 5.5 0 0 0 0-7.8z'/%3E%3C/svg%3E"); } +.ic-check { -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='M20 6L9 17l-5-5'/%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='M20 6L9 17l-5-5'/%3E%3C/svg%3E"); } +.ic-thumb { -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'%3E%3Cpath d='M7 10v12M15 5.9s0-1-.5-2a1.5 1.5 0 0 0-2.8 1C12.4 6.6 11 10 11 10h6a2 2 0 0 1 2 2.5l-1.4 5.6a2 2 0 0 1-2 1.5H7M15 6l2-1.5a1.5 1.5 0 0 1 2.7 1.3L18 13M7 22H4a2 2 0 0 1-2-2V12a2 2 0 0 1 2-2h3'/%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'%3E%3Cpath d='M7 10v12M15 5.9s0-1-.5-2a1.5 1.5 0 0 0-2.8 1C12.4 6.6 11 10 11 10h6a2 2 0 0 1 2 2.5l-1.4 5.6a2 2 0 0 1-2 1.5H7M15 6l2-1.5a1.5 1.5 0 0 1 2.7 1.3L18 13M7 22H4a2 2 0 0 1-2-2V12a2 2 0 0 1 2-2h3'/%3E%3C/svg%3E"); } +.ic-share { -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'%3E%3Cpath d='M4 12v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7M16 6l-4-4-4 4M12 2v13'/%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'%3E%3Cpath d='M4 12v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7M16 6l-4-4-4 4M12 2v13'/%3E%3C/svg%3E"); } +.ic-cmt { -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'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%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'%3E%3Cpath d='M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z'/%3E%3C/svg%3E"); } diff --git a/miniprogram/src/pages/content-detail/index.jsx b/miniprogram/src/pages/content-detail/index.jsx index a811126..8f4dab0 100644 --- a/miniprogram/src/pages/content-detail/index.jsx +++ b/miniprogram/src/pages/content-detail/index.jsx @@ -61,7 +61,7 @@ export default function ContentDetail() { {item.title} {item.publisher_avatar ? : } - {author} + {author} {rw(item.created_at)} @@ -87,13 +87,13 @@ export default function ContentDetail() { {item.publisher_avatar ? : } - {author} + {author} - setLike((v) => !v)}>👍{like ? 1 : 0} - 转发 - setFav((v) => !v)}> - 留言 + setLike((v) => !v)}>{like ? 1 : 0} + 转发 + setFav((v) => !v)}> + 留言 @@ -103,7 +103,7 @@ export default function ContentDetail() { 留言 setDraft(e.detail.value)} /> - 😊🖼 + {comments.length === 0 diff --git a/miniprogram/src/pages/content-detail/index.scss b/miniprogram/src/pages/content-detail/index.scss index e026e31..3ca8327 100644 --- a/miniprogram/src/pages/content-detail/index.scss +++ b/miniprogram/src/pages/content-detail/index.scss @@ -7,7 +7,9 @@ .cd-ava { width: 36rpx; height: 36rpx; border-radius: 50%; background: linear-gradient(135deg, #555, #333); flex-shrink: 0; } .cd-ava2 { width: 44rpx; height: 44rpx; border-radius: 50%; background: linear-gradient(135deg, #555, #333); flex-shrink: 0; } .cd-author { font-size: 25rpx; color: #c4c2c3; display: inline-flex; align-items: center; gap: 4rpx; } -.cd-badge { font-size: 22rpx; color: #26a69a; } +.cd-badge-ic { width: 22rpx; height: 22rpx; color: #26a69a; margin-left: 6rpx; } +.cd-act-ic { width: 34rpx; height: 34rpx; color: #cfcfd2; } +.cd-act-ic.on { color: #3b82f6; } .cd-meta-line { display: flex; align-items: center; gap: 8rpx; padding: 8rpx 28rpx 0; } .cd-meta-at { font-size: 23rpx; color: #7c7c80; } .cd-dot { font-size: 23rpx; color: #6d6d72; } diff --git a/miniprogram/src/pages/content/index.jsx b/miniprogram/src/pages/content/index.jsx index ba4a761..f93c268 100644 --- a/miniprogram/src/pages/content/index.jsx +++ b/miniprogram/src/pages/content/index.jsx @@ -65,7 +65,7 @@ function CardBig({ it, go, liked, onLike }) { go(it.id)}> {img ? : {m.label[0]}} - {it.video && } + {it.video && } go(it.id)}>{it.title} @@ -75,7 +75,7 @@ function CardBig({ it, go, liked, onLike }) { · {timeAgo(it.created_at)} { e.stopPropagation(); onLike(it.id); }}> - {liked ? '♥' : '♡'} + @@ -104,8 +104,6 @@ export default function ContentIndex() { const goQuiz = () => Taro.navigateTo({ url: '/pages/policy/index' }); const toggleLike = (id) => setLiked((m) => ({ ...m, [id]: !m[id] })); - const featured = (i) => i % 3 === 0; - return ( {/* 类别分段 */} @@ -127,7 +125,7 @@ export default function ContentIndex() { {loaded ? ( items.length === 0 ? 暂无{CONTENT_CATS.find((c) => c.key === cat)?.label || ''}内容 - : items.map((it, i) => featured(i) + : items.map((it) => it.card_mode === "big" ? : ) ) : ( diff --git a/miniprogram/src/pages/content/index.scss b/miniprogram/src/pages/content/index.scss index 636301f..e20f887 100644 --- a/miniprogram/src/pages/content/index.scss +++ b/miniprogram/src/pages/content/index.scss @@ -43,10 +43,11 @@ .ct-cover-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; } .ct-play { position: relative; z-index: 2; } .ct-play { - width: 72rpx; height: 72rpx; border-radius: 50%; background: rgba(255,255,255,.9); - color: #111; font-size: 30rpx; display: flex; align-items: center; justify-content: center; + position: relative; z-index: 2; width: 72rpx; height: 72rpx; border-radius: 50%; background: rgba(255,255,255,.9); + color: #111; display: flex; align-items: center; justify-content: center; box-shadow: 0 4rpx 16rpx rgba(0,0,0,.4); } +.ct-play .ic { width: 38rpx; height: 38rpx; color: #111; } .ct-card-bd { padding: 20rpx 22rpx 8rpx; } .ct-card-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; @@ -54,8 +55,8 @@ } .ct-card-ad { display: flex; align-items: center; gap: 8rpx; margin-top: 16rpx; padding-bottom: 22rpx; } .ct-like { margin-left: auto; width: 56rpx; height: 56rpx; border-radius: 50%; background: #1d1d22; display: flex; align-items: center; justify-content: center; } -.ct-like-ic { font-size: 30rpx; color: #9b9b9b; } -.ct-like.on .ct-like-ic { color: #ff3b5c; } +.ct-like .ic { width: 30rpx; height: 30rpx; color: #9b9b9b; } +.ct-like.on .ic { color: #ff3b5c; } .ct-like.on { background: #2a1520; } .ct-empty { padding: 80rpx 0; text-align: center; font-size: 26rpx; color: #8e8e8e; }