From d3ef285c6d3e3490e55e39c98bf6a3926c30adc3 Mon Sep 17 00:00:00 2001 From: zoujing Date: Tue, 28 Apr 2026 15:13:16 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9Asvg=20=E7=94=9F=E4=BA=A7=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/QuickQuestions/index.vue | 32 +++++++++++++++++-- src/pages/Discovery/index.vue | 7 ++++ 2 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/pages/Discovery/components/QuickQuestions/index.vue b/src/pages/Discovery/components/QuickQuestions/index.vue index fc26b44..bc6bb08 100644 --- a/src/pages/Discovery/components/QuickQuestions/index.vue +++ b/src/pages/Discovery/components/QuickQuestions/index.vue @@ -8,7 +8,7 @@ v-for="(item, index) in recommendPostsList" :key="index" @click="sendReply(item)"> - + @@ -41,23 +41,31 @@ const props = defineProps({ { title: "小七孔古桥", subTitle: "小七孔古桥", - coverPhoto: "https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=800&q=80" + coverPhoto: "https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=800&q=80", + bgColor: '#ECFDF5', + iconColor: '#10B981' }, { title: "翠谷瀑布", subTitle: "翠谷瀑布", - coverPhoto: "https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=800&q=80" + coverPhoto: "https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=800&q=80", + bgColor: '#FFFBEB', + iconColor: '#F59E0B' }, { title: "鸳鸯湖", subTitle: "鸳鸯湖", coverPhoto: "https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=800&q=80", + bgColor: '#EFF6FF', + iconColor: '#3B82F6' }, { title: "卧龙潭", subTitle: "卧龙潭", coverPhoto: "https://images.unsplash.com/photo-1506744038136-46273834b3fb?w=800&q=80", + bgColor: '#FFFBEB', + iconColor: '#F59E0B' } ], }, @@ -71,6 +79,24 @@ const sendReply = (item) => { } uni.$emit(SEND_MESSAGE_CONTENT_TEXT, item.userInputContent); }; + +/// 生成icon +const createSvg = (bgColor = '#FFFBEB', iconColor = '#F59E0B', size = 40) => { + const svg = ` + + + + + + + + + + + `.replace(/\n\s*/g, '').trim() + return `data:image/svg+xml;utf8,${encodeURIComponent(svg)}` +} +