diff --git a/src/pages/Setting/Feedback/index.module.scss b/src/pages/Setting/Feedback/index.module.scss index 7279fff..4aca75b 100644 --- a/src/pages/Setting/Feedback/index.module.scss +++ b/src/pages/Setting/Feedback/index.module.scss @@ -46,7 +46,8 @@ line-height: 80rpx; // box-shadow: -10rpx 13rpx $primary-color; background-color: $primary-color; - margin-top: 70rpx; + margin-top: 30rpx; + margin-bottom: 10rpx; } } @@ -64,6 +65,16 @@ } } +.promise_text { + font-size: 26rpx; + color: #bfbbbb; +} + +.from { + display: flex; + justify-content: flex-end; +} + page { /* 覆盖field宽度 */ --form-label-width: 100rpx; diff --git a/src/pages/Setting/Feedback/index.tsx b/src/pages/Setting/Feedback/index.tsx index f6f5344..47c3740 100644 --- a/src/pages/Setting/Feedback/index.tsx +++ b/src/pages/Setting/Feedback/index.tsx @@ -1,4 +1,4 @@ -import { View, Button } from '@tarojs/components' +import { View, Button, Text } from '@tarojs/components' import React, { useCallback, useState } from 'react' import { Field, Textarea, Input } from '@taroify/core' import { goTo, showModal, showToast, trackFeedbackContent } from 'src/utils' @@ -6,7 +6,7 @@ import './index.module.scss' const Index = () => { const [text, setText] = useState('') - const [phone, setPhone] = useState(0) + const [email, setEmail] = useState('') const clickBtn = useCallback(async () => { if (text.length <= 0) { @@ -14,6 +14,13 @@ const Index = () => { return } + if (email.length > 0) { + if (!/\w+@\w+(\.\w+)+/.test(email)) { + showToast('您填写的邮箱有误') + return + } + } + const res = await showModal({ title: '反馈一下🤔', content: '您提出的宝贵建议我们会仔细斟酌,请附上您的联系方式方便采纳后与您联系🫡', @@ -24,14 +31,15 @@ const Index = () => { console.log('提交') trackFeedbackContent({ - user_phone: phone ?? 0, + user_phone: 0, + user_email: email, user_feedback: text, }) showToast('反馈成功,即将返回上一页!') setTimeout(() => { goTo({ methodType: 'navigateBack' }) }, 1000) - }, [phone, text]) + }, [email, text]) return ( @@ -50,7 +58,7 @@ const Index = () => { onChange={({ detail: { value } }) => setText(value)} /> - + { borderRadius: '10rpx', paddingLeft: '10rpx', }} - placeholder='请输入手机号' - type='number' - onChange={({ detail: { value } }) => setPhone(value as unknown as number)} + placeholder='请输入邮箱' + onChange={({ detail: { value } }) => setEmail(value)} /> + + 您提供的联系方式我们会妥善保管,我们承诺仅用于系统升级的后续沟通跟进,不会将您的信息以任何种形式外借、售卖、展示给任何人,以防您的信息泄漏 + + -- 24.5.20 研发团队宣✊ diff --git a/src/utils/perfTrack/business.ts b/src/utils/perfTrack/business.ts index 5819924..6233b3c 100644 --- a/src/utils/perfTrack/business.ts +++ b/src/utils/perfTrack/business.ts @@ -86,16 +86,28 @@ type TTrackUserFeedback = Pick & { user_feedback?: string /** 用户手机号 */ user_phone?: number + /** 邮箱 */ + user_email?: string } /** 上报用户反馈信息 */ -export const trackFeedbackContent = ({ user_feedback, user_phone }: TTrackUserFeedback) => { - /*#__PURE__ */ console.log(' === 运行时用户反馈埋点上报 === ', user_feedback, user_phone) +export const trackFeedbackContent = ({ + user_feedback, + user_phone, + user_email, +}: TTrackUserFeedback) => { + /*#__PURE__ */ console.log( + ' === 运行时用户反馈埋点上报 === ', + user_feedback, + user_phone, + user_email, + ) trackEvent({ eventId: BUSINESS_EVENT_MAP.USER_FEEDBACK, extraParams: { user_feedback, user_phone, + user_email, }, }) }