diff --git a/src/forge/Information/Component/UserAward.jsx b/src/forge/Information/Component/UserAward.jsx index ee896a5b..daa1b179 100644 --- a/src/forge/Information/Component/UserAward.jsx +++ b/src/forge/Information/Component/UserAward.jsx @@ -1,20 +1,32 @@ import React, { useEffect, useState } from 'react'; -import { Modal, Form, Input, Button } from 'antd'; +import { Modal, Button } from 'antd'; -const { TextArea } = Input; import IconImg from '../img/user/icon1.png'; -import { getImageUrl } from 'educoder' +import { applyAward } from '../api'; import '../indexUser.scss'; -function UserAward({ visible , onCancel , onSure , type , username , choosed , history , showCompeleteDialog , user }) { - +function UserAward({ visible , onCancel , onSure , member , id }) { + const [ loading , setLoading ] = useState(false); + const [ score , setScore ] = useState(0); + const [ scoreLeft , setScoreLeft ] = useState(0); + useEffect(()=>{ - },[visible]) + if(visible && member && member.zonePointsAccount && member.zonePointsAccount.availablePoints) { + setScore(member.zonePointsAccount.availablePoints); + setScoreLeft(member.zonePointsAccount.availablePoints - 200); + } + },[visible, member]) function onOk() { + setLoading(true); + applyAward(id).then(res => { + if (res && res.data && res.data.code === 200) { + onSure(res.data.msg); + } + }).finally(() => { setLoading(false) }) } return( @@ -36,14 +48,14 @@ function UserAward({ visible , onCancel , onSure , type , username , choosed , h footer={
- +
} okText="确定" cancelText="取消" >
-

您将消耗兑换「专属电子荣誉证书」,当前可用积分 3,456 分,兑换后剩余 3,256 分。积分扣除后将自动生成证书,无法退回,请确认操作。请确认是否兑换专属电子荣誉证书?

+

您将消耗兑换「专属电子荣誉证书」,当前可用积分 {score.toLocaleString()} 分,兑换后剩余 {scoreLeft.toLocaleString()} 分。积分扣除后将自动生成证书,无法退回,请确认操作。请确认是否兑换专属电子荣誉证书?

) diff --git a/src/forge/Information/Component/applyAcitvity.jsx b/src/forge/Information/Component/applyAcitvity.jsx new file mode 100644 index 00000000..61b52df1 --- /dev/null +++ b/src/forge/Information/Component/applyAcitvity.jsx @@ -0,0 +1,133 @@ +import React, { useEffect, useState } from 'react'; +import { Modal, Form, Input, Button, Row, Col } from 'antd'; + +import { doApplyActivity } from '../api'; + +const { TextArea } = Input; + +import IconImg from '../img/user/icon1.png'; +import '../indexUser.scss'; + +function ApplyActivity({ visible, onCancel, onSure, form, member, zoneName, }) { + const [loading, setLoading] = useState(false); + const { getFieldDecorator, validateFields } = form; + + useEffect(() => { + if (visible) { + } + }, [visible]); + + function onOk() { + validateFields((err, values) => { + if (!err) { + setLoading(true); + const data = Object.assign({}, values, { zoneId: member.zoneId }); + doApplyActivity(data).then(res => { + if (res && res.data && res.data.code === 200) { + onSure(res.data.msg); + } + }).finally(() => { setLoading(false) }); + } + }); + } + + function closeHandler() { + // form.resetFields(); + onCancel(); + } + + return( + } + className="qa_modal" + visible={visible} + title={
+ 头像 +
+

+ 专家一对一答疑 +

+

{zoneName} · 线下参观/沙龙报名

+
+
} + closable={true} + width={672} + footer={ +
+ + +
+ } + okText="确定" + cancelText="取消" + > +
+
+ +
+

申请将冻结对应积分,服务达成后正式扣除;若关闭申请,积分将退回

+
+
+
+ + + + {getFieldDecorator('realName', { + rules: [ + { + required: true, + message: '请输入真实姓名' + } + ], + })( + , + )} + + + + + {getFieldDecorator('phone', { + rules: [ + { + required: true, + message: '请输入联系电话' + } + ], + })( + , + )} + + + + + {getFieldDecorator('description')( +