|
@@ -1,5 +1,5 @@
|
1
|
1
|
import React, { useState, useEffect } from 'react';
|
2
|
|
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, InputNumber, Checkbox, Row, Col} from 'antd';
|
|
2
|
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, InputNumber, Checkbox, Row, Col } from 'antd';
|
3
|
3
|
import { FormattedMessage } from 'umi-plugin-react/locale';
|
4
|
4
|
import XForm, { FieldTypes } from '../../../components/XForm';
|
5
|
5
|
import router from 'umi/router';
|
|
@@ -18,33 +18,33 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
|
18
|
18
|
|
19
|
19
|
|
20
|
20
|
const header = props => {
|
21
|
|
- const sampleId = props.location.query.id;
|
|
21
|
+ const sampleId = props.location.query.id;
|
22
|
22
|
const [demandData, setDemandData] = useState({})
|
23
|
23
|
const [demandNum, setDemandNum] = useState()
|
24
|
24
|
|
25
|
25
|
useEffect(() => {
|
26
|
26
|
getDemandData(sampleId);
|
27
|
|
- },[])
|
|
27
|
+ }, [])
|
28
|
28
|
|
29
|
29
|
// 查询列表
|
30
|
30
|
const getDemandData = (demandId) => {
|
31
|
|
- request({ ...apis.taH5SampleManager.taH5SampleById, urlData: {id: sampleId} }).then((data) => {
|
32
|
|
- setDemandData(data)
|
33
|
|
- setDemandNum(data.demandNum)
|
34
|
|
- props.form.setFieldsValue(data)
|
35
|
|
- })
|
|
31
|
+ request({ ...apis.taH5SampleManager.taH5SampleById, urlData: { id: sampleId } }).then((data) => {
|
|
32
|
+ setDemandData(data)
|
|
33
|
+ setDemandNum(data.demandNum)
|
|
34
|
+ props.form.setFieldsValue(data)
|
|
35
|
+ })
|
36
|
36
|
}
|
37
|
37
|
|
38
|
38
|
// 跳转到编辑
|
39
|
39
|
const toDetail = rowData => () => {
|
40
|
|
- if(rowData) {
|
|
40
|
+ if (rowData) {
|
41
|
41
|
router.push({
|
42
|
|
- pathname: '/h5SampleManager/h5Sample/add',
|
43
|
|
- query: {
|
44
|
|
- id: sampleId,
|
45
|
|
- sampleName: demandData.sampleName
|
46
|
|
- },
|
47
|
|
- });
|
|
42
|
+ pathname: '/h5SampleManager/h5Sample/add',
|
|
43
|
+ query: {
|
|
44
|
+ id: sampleId,
|
|
45
|
+ sampleName: demandData.sampleName
|
|
46
|
+ },
|
|
47
|
+ });
|
48
|
48
|
return
|
49
|
49
|
}
|
50
|
50
|
}
|
|
@@ -52,7 +52,7 @@ const header = props => {
|
52
|
52
|
router.go(-1)
|
53
|
53
|
}
|
54
|
54
|
|
55
|
|
- function viewDemand(){
|
|
55
|
+ function viewDemand() {
|
56
|
56
|
router.push({
|
57
|
57
|
pathname: '/h5SampleManager/h5Demand/list',
|
58
|
58
|
query: {
|
|
@@ -67,55 +67,60 @@ const header = props => {
|
67
|
67
|
message.info('复制成功')
|
68
|
68
|
}
|
69
|
69
|
|
70
|
|
- function handleSubmit (e) {
|
|
70
|
+ function handleSubmit(e) {
|
71
|
71
|
}
|
72
|
72
|
|
73
|
|
- function newTab(e){
|
|
73
|
+ function newTab(e) {
|
74
|
74
|
console.log(e, 'eeeeeeee')
|
75
|
75
|
const newWin = window.open('about:blank');
|
76
|
|
- newWin.location.href= e
|
|
76
|
+ newWin.location.href = e
|
77
|
77
|
}
|
78
|
78
|
|
79
|
79
|
const { getFieldDecorator } = props.form;
|
80
|
80
|
|
81
|
81
|
return (
|
82
|
82
|
<>
|
83
|
|
- <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
|
|
83
|
+ <Form labelCol={{ span: 6 }} wrapperCol={{ span: 14 }} style={{ position: 'relative' }} onSubmit={handleSubmit}>
|
84
|
84
|
<Form.Item label="样例名">
|
85
|
85
|
<span>{demandData.sampleName}</span>
|
86
|
86
|
</Form.Item>
|
87
|
87
|
{demandData.sampleTryLink != '' && demandData.sampleTryLink != null && <Form.Item label="样例体验链接">
|
88
|
|
- <span>{demandData.sampleTryLink}</span><span style={{marginLeft:'10px'}}><a onClick={(e) => copyLink(demandData.sampleTryLink)} style={{ color: 'orange' }}> <img src={copyImg} height="16px" width="14px" /> 复制链接</a></span>
|
|
88
|
+ <span>{demandData.sampleTryLink}</span><span style={{ marginLeft: '10px' }}><a onClick={(e) => copyLink(demandData.sampleTryLink)} style={{ color: 'orange' }}> <img src={copyImg} height="16px" width="14px" /> 复制链接</a></span>
|
89
|
89
|
</Form.Item>}
|
90
|
|
- {demandData.sampleTryCode != '' && demandData.sampleTryCode != null &&<Form.Item label="样例体验小程序码/二维码" help="请使用微信扫码查看样例体验">
|
91
|
|
- <img src={demandData.sampleTryCode} height="100px" width="120px" />
|
|
90
|
+ {demandData.sampleTryCode != '' && demandData.sampleTryCode != null && <Form.Item label="样例体验小程序码/二维码" help="请使用微信扫码查看样例体验">
|
|
91
|
+ <img src={demandData.sampleTryCode} height="100px" width="120px" />
|
92
|
92
|
</Form.Item>}
|
93
|
|
- {demandData.taContactList != null &&demandData.taContactList != '' && <Form.Item label="联系人">
|
94
|
|
- <span style={{color:'rgba(0, 0, 0, 0.45)', fontSize:'14px'}}>若您想在您的小程序举办类似活动,请联系以下联系人咨询,或直接点击底部的 提交需求 按钮下单,下单后与联系人沟通定制活动</span>
|
95
|
|
- <DragableUploadImageList sampleId={sampleId}></DragableUploadImageList>
|
|
93
|
+ {demandData.taContactList != null && demandData.taContactList != '' && <Form.Item label="联系人">
|
|
94
|
+ <span style={{ color: 'rgba(0, 0, 0, 0.45)', fontSize: '14px' }}>若您想在您的小程序举办类似活动,请联系以下联系人咨询,或直接点击底部的 提交需求 按钮下单,下单后与联系人沟通定制活动</span>
|
|
95
|
+ <DragableUploadImageList sampleId={sampleId}></DragableUploadImageList>
|
96
|
96
|
</Form.Item>}
|
97
|
97
|
<Form.Item label="样例内容">
|
98
|
|
- {demandData.sampleType === 'rich' ? getFieldDecorator('sampleContent')(<Wangedit contenteditable={false}/>) : getFieldDecorator('sampleContentLink')(<a href={demandData.sampleContentLink} target="_blank">{demandData.sampleContentLink}</a>)}
|
|
98
|
+ {demandData.sampleType === 'rich' ? getFieldDecorator('sampleContent')(<Wangedit contenteditable={false} />) : getFieldDecorator('sampleContentLink')(<a href={demandData.sampleContentLink} target="_blank">{demandData.sampleContentLink}</a>)}
|
99
|
99
|
</Form.Item>
|
100
|
100
|
<Form.Item wrapperCol={{ span: 15, offset: 7 }}>
|
101
|
|
- <div>
|
102
|
|
- <Button type="primary" onClick={toDetail(sampleId)} style={{marginRight:'20px'}}>
|
103
|
|
- 提交需求
|
|
101
|
+ <div style={{ margin: '0.16rem 0 0.06rem' }}>
|
|
102
|
+ <Button type="primary" onClick={toDetail(sampleId)} style={{ marginRight: '20px' }}>
|
|
103
|
+ 提交需求
|
104
|
104
|
</Button>
|
105
|
|
- <Button danger onClick={() => toCancel()} style={{marginLeft:'20px'}}>
|
106
|
|
- 取消
|
|
105
|
+ <Button danger onClick={() => toCancel()} style={{ marginLeft: '20px' }}>
|
|
106
|
+ 取消
|
107
|
107
|
</Button>
|
108
|
|
- {demandNum != 0 && <span style={{marginLeft:'25%'}}>已有{demandNum}需求单> >
|
109
|
|
- <Button danger onClick={() => viewDemand()}>
|
110
|
|
- 查看已有需求单
|
111
|
|
- </Button>
|
112
|
|
- </span>
|
113
|
|
- }
|
114
|
|
-
|
115
|
108
|
</div>
|
116
|
|
-
|
117
|
|
-
|
118
|
109
|
</Form.Item>
|
|
110
|
+ <div style={{ position: 'absolute', right: '0', bottom: '-16px' }}>
|
|
111
|
+ <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between' }}>我想办类似活动 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
|
|
112
|
+ <Button type="primary" onClick={toDetail(sampleId)} >
|
|
113
|
+ 提交需求
|
|
114
|
+ </Button>
|
|
115
|
+ </div>
|
|
116
|
+
|
|
117
|
+ {demandNum != 0 && <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between', marginTop: '10px' }}>已有{demandNum + '个'}需求单 <span style={{ margin: '0 0.1rem' }}>>></span>
|
|
118
|
+ <Button danger onClick={() => viewDemand()}>
|
|
119
|
+ 查看需求
|
|
120
|
+ </Button>
|
|
121
|
+ </div>
|
|
122
|
+ }
|
|
123
|
+ </div>
|
119
|
124
|
</Form>
|
120
|
125
|
</>
|
121
|
126
|
)
|