|
@@ -14,9 +14,9 @@ const { TextArea } = Input;
|
14
|
14
|
const { Option } = Select;
|
15
|
15
|
|
16
|
16
|
let activityVisible = true
|
|
17
|
+let helpTips = ''
|
17
|
18
|
|
18
|
19
|
const setExtraData = (data) => {
|
19
|
|
- console.log(data, 'data');
|
20
|
20
|
activityVisible = data.imgType === 'index';
|
21
|
21
|
}
|
22
|
22
|
|
|
@@ -36,7 +36,21 @@ const header = props => {
|
36
|
36
|
} = props;
|
37
|
37
|
|
38
|
38
|
const imgId = props.location.query.imgId
|
39
|
|
- const [ data, setData ] = useState({'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg','imgType':'index','imgDesc':'小程序首页分享配图','imgDocument': currentUser.orgName+' 精准获客平台'})
|
|
39
|
+ const imgType = props.location.query.imgType
|
|
40
|
+
|
|
41
|
+ const [ data, setData ] = useState(imgType === 'index' ?
|
|
42
|
+ {
|
|
43
|
+ 'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg',
|
|
44
|
+ 'imgType':'index',
|
|
45
|
+ 'imgDesc':'小程序首页分享配图',
|
|
46
|
+ 'imgDocument': currentUser.orgName+' 精准获客平台'
|
|
47
|
+ } :
|
|
48
|
+ {
|
|
49
|
+ 'imgUrl':'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png',
|
|
50
|
+ 'imgType':'indexNews',
|
|
51
|
+ }
|
|
52
|
+ )
|
|
53
|
+
|
40
|
54
|
if(imgId){
|
41
|
55
|
useEffect(() => {
|
42
|
56
|
getData(imgId);
|
|
@@ -48,8 +62,10 @@ const header = props => {
|
48
|
62
|
console.log(data)
|
49
|
63
|
if (data.imgType === 'index'){
|
50
|
64
|
activityVisible = true;
|
|
65
|
+ helpTips = '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:首页分享';
|
51
|
66
|
}else{
|
52
|
67
|
activityVisible = false;
|
|
68
|
+ helpTips = '建议尺寸:80*80px,比例1:1,格式:jpg,用于:首页资讯logo'
|
53
|
69
|
}
|
54
|
70
|
setData(data)
|
55
|
71
|
})
|
|
@@ -62,7 +78,7 @@ const header = props => {
|
62
|
78
|
name: 'imgUrl',
|
63
|
79
|
type: FieldTypes.ImageUploader,
|
64
|
80
|
value: data.imgUrl,
|
65
|
|
- help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:首页分享',
|
|
81
|
+ help: helpTips,
|
66
|
82
|
rules: [
|
67
|
83
|
{required: true, message: '请选择图片'},
|
68
|
84
|
]
|
|
@@ -71,17 +87,21 @@ const header = props => {
|
71
|
87
|
label: '类型',
|
72
|
88
|
name: 'imgType',
|
73
|
89
|
type: FieldTypes.Select,
|
74
|
|
- value: 'index',
|
|
90
|
+ value: data.imgType,
|
75
|
91
|
dict: [{
|
76
|
92
|
label: '首页分享',
|
77
|
93
|
value: 'index',
|
78
|
94
|
},
|
|
95
|
+ {
|
|
96
|
+ label: '首页资讯',
|
|
97
|
+ value: 'indexNews',
|
|
98
|
+ },
|
79
|
99
|
],
|
80
|
100
|
rules: [
|
81
|
101
|
{ required: true, message: '请选择类型' },
|
82
|
102
|
],
|
83
|
103
|
},
|
84
|
|
- {
|
|
104
|
+ data.imgType === 'index' && {
|
85
|
105
|
label: '分享文案',
|
86
|
106
|
name: 'imgDocument',
|
87
|
107
|
type: FieldTypes.Text,
|