|
@@ -1,14 +1,57 @@
|
|
-import React from 'react'
|
|
|
|
|
|
+import React, { useState } from 'react'
|
|
import { Steps } from 'tdesign-react'
|
|
import { Steps } from 'tdesign-react'
|
|
import MeasurementStep from '../../components/Steps/MeasurementStep'
|
|
import MeasurementStep from '../../components/Steps/MeasurementStep'
|
|
|
|
+import '../../assets/css/talking.css'
|
|
|
|
|
|
const { StepItem } = Steps
|
|
const { StepItem } = Steps
|
|
|
|
|
|
|
|
+const problems = [
|
|
|
|
+ {
|
|
|
|
+ ques: '忙碌了一天回到家中,已经很疲惫了,你会',
|
|
|
|
+ options: ['再累也要收拾整齐了再去睡', '扔下包倒头就睡下']
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ ques: '你常会站在对方角度去思考而模糊了自己的立场',
|
|
|
|
+ options: ['是的', '不是']
|
|
|
|
+ },
|
|
|
|
+ {
|
|
|
|
+ ques: '若我有时间和金钱,我的朋友邀请我到国外或者异地度假,并且在一天前才通知,我会',
|
|
|
|
+ options: ['必须先检查我的时间表', '立即收拾行装']
|
|
|
|
+ }
|
|
|
|
+]
|
|
|
|
+
|
|
export default function Talking() {
|
|
export default function Talking() {
|
|
|
|
+ const [count, setCount] = useState(0);
|
|
|
|
+
|
|
|
|
+ const changeProblems = (type) => {
|
|
|
|
+ console.log(type);
|
|
|
|
+ if (type == 'add') {
|
|
|
|
+ setCount(count + 1)
|
|
|
|
+ } else {
|
|
|
|
+ setCount(count - 1)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<>
|
|
<>
|
|
<div style={{ padding: '10px 20px' }}>
|
|
<div style={{ padding: '10px 20px' }}>
|
|
<MeasurementStep current={0} />
|
|
<MeasurementStep current={0} />
|
|
|
|
+ <div className='question-box'>
|
|
|
|
+ <p>Count: {count}</p>
|
|
|
|
+ <h3>{problems[count] ? problems[count].ques : ''}?</h3>
|
|
|
|
+ <div className='question-option'>
|
|
|
|
+ 111
|
|
|
|
+ {problems[0].options.map((tag, index) => (
|
|
|
|
+ <span key={index} onClick={changeProblems('add')}>{tag}</span>
|
|
|
|
+ ))}
|
|
|
|
+ </div>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <div className='question-bar'>
|
|
|
|
+ <span onClick={() => setCount(count - 1)}>上一题</span>
|
|
|
|
+ <span>1/3</span>
|
|
|
|
+ <span onClick={() => setCount(count + 1)}>下一题</span>
|
|
|
|
+ </div>
|
|
</div>
|
|
</div>
|
|
</>
|
|
</>
|
|
)
|
|
)
|