Skip to content

Commit

Permalink
Merge pull request #38 from HXTIA/fix_24_5_19-bugs-ydq
Browse files Browse the repository at this point in the history
fix: 反馈界面增加个保法声明文案
  • Loading branch information
HardenSG authored May 20, 2024
2 parents 2843684 + 3e48a98 commit 62eb93b
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 12 deletions.
13 changes: 12 additions & 1 deletion src/pages/Setting/Feedback/index.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -64,6 +65,16 @@
}
}

.promise_text {
font-size: 26rpx;
color: #bfbbbb;
}

.from {
display: flex;
justify-content: flex-end;
}

page {
/* 覆盖field宽度 */
--form-label-width: 100rpx;
Expand Down
29 changes: 20 additions & 9 deletions src/pages/Setting/Feedback/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,26 @@
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'
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) {
showToast('您还没有填写内容')
return
}

if (email.length > 0) {
if (!/\w+@\w+(\.\w+)+/.test(email)) {
showToast('您填写的邮箱有误')
return
}
}

const res = await showModal({
title: '反馈一下🤔',
content: '您提出的宝贵建议我们会仔细斟酌,请附上您的联系方式方便采纳后与您联系🫡',
Expand All @@ -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 (
<View className='feedback_wrapper'>
<View className='title_banner' />
Expand All @@ -50,7 +58,7 @@ const Index = () => {
onChange={({ detail: { value } }) => setText(value)}
/>
</Field>
<Field label='手机号'>
<Field label='邮箱'>
<Input
style={{
backgroundColor: 'rgba(245, 245, 245, 1)',
Expand All @@ -60,14 +68,17 @@ const Index = () => {
borderRadius: '10rpx',
paddingLeft: '10rpx',
}}
placeholder='请输入手机号'
type='number'
onChange={({ detail: { value } }) => setPhone(value as unknown as number)}
placeholder='请输入邮箱'
onChange={({ detail: { value } }) => setEmail(value)}
/>
</Field>
<Button className='btn' onClick={clickBtn}>
提交
我已知悉 提交
</Button>
<View className='promise_text'>
您提供的联系方式我们会妥善保管,我们承诺仅用于系统升级的后续沟通跟进,不会将您的信息以任何种形式外借、售卖、展示给任何人,以防您的信息泄漏
</View>
<View className='promise_text from'>-- 24.5.20 研发团队宣✊</View>
</View>
<View className='bg' />
</View>
Expand Down
16 changes: 14 additions & 2 deletions src/utils/perfTrack/business.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,16 +86,28 @@ type TTrackUserFeedback = Pick<TTrackEventParams, 'extraParams'> & {
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,
},
})
}

0 comments on commit 62eb93b

Please sign in to comment.