yangjie #47

Merged
yangqiang merged 49 commits from yangjie into master 2025-01-24 13:43:09 +08:00
2 changed files with 23 additions and 18 deletions
Showing only changes of commit 496a4dd28f - Show all commits

View File

@ -13,36 +13,42 @@ const FeedBackModel = forwardRef((_props: any, ref: any) => {
const [feedBackForm, setFeedBackForm] = useState({ const [feedBackForm, setFeedBackForm] = useState({
rateValue: 0, rateValue: 0,
otherContent: '', otherContent: '',
type: 0,
}); });
const [feedBackList, _setFeedBackList] = useState([ const [feedBackList, setFeedBackList] = useState([
{ {
text: "软件卡顿", text: "软件卡顿",
value: 2 value: 2,
active: false,
}, },
{ {
text: "设计不合理", text: "设计不合理",
value: 3 value: 3,
active: false,
}, },
{ {
text: "功能太少", text: "功能太少",
value: 4 value: 4,
active: false,
}, },
{ {
text: "通话不流畅", text: "通话不流畅",
value: 5 value: 5,
active: false,
}, },
{ {
text: "视频卡顿", text: "视频卡顿",
value: 6 value: 6,
active: false,
}, },
{ {
text: "操作麻烦", text: "操作麻烦",
value: 7 value: 7,
active: false,
}, },
{ {
text: "其他,需要手动填写", text: "其他,需要手动填写",
value: 1 value: 1,
active: false,
}, },
]); ]);
return ( return (
@ -75,11 +81,10 @@ const FeedBackModel = forwardRef((_props: any, ref: any) => {
{ {
feedBackList.map((item, index) => { feedBackList.map((item, index) => {
return ( return (
<div key={index} className={feedBackForm.type === item.value ? styles.active : ''} onClick={() => { <div key={index} className={item.active ? styles.active : ''} onClick={() => {
setFeedBackForm({ const feedBackListTemp = [...feedBackList]
...feedBackForm, feedBackListTemp[index].active = !feedBackListTemp[index].active
type: item.value setFeedBackList(feedBackListTemp)
})
}}> }}>
<span>{item.text}</span> <span>{item.text}</span>
</div> </div>
@ -88,7 +93,7 @@ const FeedBackModel = forwardRef((_props: any, ref: any) => {
} }
</div> </div>
</div> </div>
<div className={styles.feedBackModelContentList} style={{ visibility: feedBackForm.type === 1 ? 'visible' : 'hidden' }}> <div className={styles.feedBackModelContentList} style={{ visibility: feedBackList[feedBackList.length - 1].active ? 'visible' : 'hidden' }}>
<TextArea <TextArea
placeholder="填写意见" placeholder="填写意见"
value={feedBackForm.otherContent} value={feedBackForm.otherContent}
@ -107,8 +112,8 @@ const FeedBackModel = forwardRef((_props: any, ref: any) => {
onClick={() => { onClick={() => {
let parmes = { let parmes = {
score: feedBackForm.rateValue, score: feedBackForm.rateValue,
otherContent: feedBackForm.type === 1 ? feedBackForm.otherContent : '', otherContent: feedBackList[feedBackList.length - 1].active ? feedBackForm.otherContent : '',
type: feedBackForm.type, types: feedBackList.filter(row => row.active).map((item: any) => item.value),
} }
PostFeedback(parmes).then(res => { PostFeedback(parmes).then(res => {
if (res.code === 200) { if (res.code === 200) {

View File

@ -50,8 +50,8 @@ const Index: React.FC = () => {
const userInfo = JSON.parse(storage.getItem('user') as string) const userInfo = JSON.parse(storage.getItem('user') as string)
useEffect(() => { useEffect(() => {
setUser(userInfo) setUser(userInfo)
if (state?.currentSeconds >= 600) {
feedBackModelRef.current.changeModal() feedBackModelRef.current.changeModal()
if (state?.currentSeconds >= 600) {
} }
}, []) }, [])
useEffect(() => { useEffect(() => {