diff --git a/public/NYC_logo.png b/public/NYC_logo.png new file mode 100644 index 0000000..0cc904f Binary files /dev/null and b/public/NYC_logo.png differ diff --git a/src/App.vue b/src/App.vue index 5b0378e..668e9c6 100644 --- a/src/App.vue +++ b/src/App.vue @@ -39,13 +39,13 @@ const handleTabChange = (tab: string) => { > 发送评估表 -
客户信息 -
+ -->
{ news: { title: '青少年成长伙伴计划评估表', desc: '通过专业的评估工具,了解孩子的成长需求', - imgUrl: 'https://forms.nycjy.cn/favicon.ico', - link: `https://forms.nycjy.cn?wecom_id=${externalUserId.value}&t=${Date.now()}` + imgUrl: 'https://sidebar.wx.nycjy.cn/NYC_logo.png', + link: `https://forms.nycjy.cn` } }) } catch (error) { diff --git a/src/components/SendPage.vue b/src/components/SendPage.vue index b02453d..a92b615 100644 --- a/src/components/SendPage.vue +++ b/src/components/SendPage.vue @@ -291,6 +291,25 @@ const closeModal = () => { setTimeout(() => { currentItem.value = null }, 300) } +const handleSend01 = async (type: FormType) => { + if (isCoolingDown.value) return + activeSendType.value = type + startTimer(8) + try { + const contact = await ww.getCurExternalContact() + const userId = contact.userId + const apiUrl = `https://liaison.nycjy.cn/api/v1/archive/form-url?user_id=${userId}&form_id=${CONFIG[type].id}` + const res = await fetch(apiUrl).then(r => r.json()) + + if (res.code === 200 && res.data?.form_url) { + await ww.sendChatMessage({ + msgtype: 'news', + news: { title: CONFIG[type].title, desc: CONFIG[type].desc, imgUrl: 'https://sidebar.wx.nycjy.cn/NYC_logo.png', link: 'https://liaison.nycjy.cn/index.html?form_id=form_8225aad48432' } + }) + } else alert('获取链接失败:' + (res.message || '未知错误')) + } catch (err) { console.error('发送流程出错:', err) } +} + const handleSend = async (type: FormType) => { if (isCoolingDown.value) return activeSendType.value = type @@ -304,7 +323,7 @@ const handleSend = async (type: FormType) => { if (res.code === 200 && res.data?.form_url) { await ww.sendChatMessage({ msgtype: 'news', - news: { title: CONFIG[type].title, desc: CONFIG[type].desc, imgUrl: 'https://forms.nycjy.cn/favicon.ico', link: res.data.form_url } + news: { title: CONFIG[type].title, desc: CONFIG[type].desc, imgUrl: 'https://sidebar.wx.nycjy.cn/NYC_logo.png', link: res.data.form_url } }) } else alert('获取链接失败:' + (res.message || '未知错误')) } catch (err) { console.error('发送流程出错:', err) }