From e6c7ffa46c488c71afd9e291e7eb0a0ff5108a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Tue, 30 Jun 2026 18:18:38 +0800 Subject: [PATCH] =?UTF-8?q?fix(index):=20=E4=BC=98=E5=8C=96=E5=A4=96?= =?UTF-8?q?=E9=93=BE=E6=8F=90=E7=A4=BA=E5=8F=8A=E5=88=A0=E9=99=A4=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E5=92=A8=E8=AF=A2=E6=A8=A1=E6=9D=BF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 替换小程序内外链打开方式提示为弹窗提醒用户手动复制 - 删除复制咨询模板功能及相关按钮 - 修改联系我们文案,突出直接电话沟通或需求反馈 - 移除无用导入的复制文本工具函数copyText --- .workbuddy/memory/2026-06-30.md | 12 ++++++++++++ src/pages/index/index.tsx | 29 ++++++++--------------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.workbuddy/memory/2026-06-30.md b/.workbuddy/memory/2026-06-30.md index c995460..4e269eb 100644 --- a/.workbuddy/memory/2026-06-30.md +++ b/.workbuddy/memory/2026-06-30.md @@ -47,3 +47,15 @@ - **原因**: 项目没有声明微信小程序原生全局对象 `wx` 的类型 - **修复**: 在 `types/global.d.ts` 中添加 `declare const wx: any;` 全局类型声明 - **验证**: `tsc` 不再报 `common.ts` 相关错误,`npx taro build --type weapp` 构建成功 + +## 去掉首页「复制咨询模板」按钮及复制逻辑 + +- **问题**: `wx.setClipboardData` 在小程序开发者工具中报 `no permission` 错误,且审核对复制功能敏感 +- **修复**: + - 移除 `src/pages/index/index.tsx` 中的 `copyConsultTemplate` 函数 + - 删除「复制咨询模板」按钮,只保留「电话咨询」 + - 修改联系我们区域文案,去掉「复制咨询模板」相关描述 + - `openMaybeLink` 中外链不再调用 `copyText`,改为 `Taro.showModal` 提示用户手动复制到浏览器打开 + - 移除首页对 `copyText` 的 import +- **验证**: `npx taro build --type weapp` 构建成功,首页无复制相关调用 +- **备注**: 项目其他页面仍有复制功能(如礼品卡分享、优惠券分享、订单号复制、密钥复制等),如需要可继续逐个移除 diff --git a/src/pages/index/index.tsx b/src/pages/index/index.tsx index 46a50d8..3d2b2ed 100644 --- a/src/pages/index/index.tsx +++ b/src/pages/index/index.tsx @@ -3,7 +3,6 @@ import { View, Text } from '@tarojs/components' import { useMemo, useState } from 'react' import { Button } from '@nutui/nutui-react-taro' import { useConfig } from '@/hooks/useConfig' -import { copyText } from '@/utils/common' import './index.scss' function Home() { @@ -76,28 +75,19 @@ function Home() { Taro.navigateTo({ url }) return } - // 外链在小程序内无法直接打开,复制链接降低认知成本 + // 小程序内无法直接打开外链,提示用户手动复制到浏览器 if (/^https?:\/\//i.test(abs)) { - copyText(abs) + Taro.showModal({ + title: '提示', + content: '该链接需要在浏览器中打开,请点击确认后手动复制链接访问。', + showCancel: false, + confirmText: '知道了' + }) return } Taro.showToast({ title: '请在 PC 端访问该入口', icon: 'none', duration: 1600 }) } - const copyConsultTemplate = () => { - const tel = config?.tel ? `\n联系电话:${config.tel}` : '' - const text = - '【需求咨询】\n' + - '1) 想开通哪些产品:企业官网 / 电商 / 小程序 / 其他\n' + - '2) 是否需要模板/插件市场:是 / 否\n' + - '3) 是否需要“支付即开通”:是 / 否\n' + - '4) 交付方式:SaaS / 私有化 / 混合\n' + - '5) 合规/部署要求:\n' + - '6) 期望上线时间:\n' + - tel - copyText(text) - } - const callPhone = () => { const tel = (config?.tel || '').trim() if (!tel) { @@ -456,7 +446,7 @@ function Home() { 联系我们 - 复制咨询模板或直接电话沟通,我们会按你的业务场景给出产品组合、开通链路与部署方案(SaaS/私有化)。 + 直接电话沟通或留下需求,我们会按你的业务场景给出产品组合、开通链路与部署方案(SaaS/私有化)。 @@ -492,9 +482,6 @@ function Home() { -