Преглед изворни кода

Merge branch 'dev' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager into dev

傅行帆 пре 5 година
родитељ
комит
a78636fa26

+ 4
- 1
src/components/GlobalHeader/AvatarDropdown.jsx Прегледај датотеку

@@ -42,10 +42,12 @@ class AvatarDropdown extends React.Component {
42 42
   }
43 43
 
44 44
   render() {
45
+    console.log(this.props, 'props')
45 46
     const {
46 47
       currentUser = {
47 48
         avatar: '',
48 49
         userName: '',
50
+        miniAppName: '',
49 51
       },
50 52
       menu,
51 53
     } = this.props;
@@ -80,7 +82,8 @@ class AvatarDropdown extends React.Component {
80 82
         <HeaderDropdown overlay={menuHeaderDropdown}>
81 83
             <span className={`${styles.action} ${styles.account}`}>
82 84
               <Avatar size="small" className={styles.avatar} src={currentUser.avatar === null ? currentUser.photo:currentUser.avatar} alt="avatar" />
83
-              <span className={styles.name}>{currentUser.userName}</span>
85
+              <span className={styles.name}>{currentUser.loginName}</span>
86
+              <span className={styles.name}>欢迎登录{currentUser.miniAppName}</span>
84 87
             </span>
85 88
         </HeaderDropdown>
86 89
 

+ 25
- 5
src/pages/carouselFigure/customImg/edit.jsx Прегледај датотеку

@@ -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,

+ 9
- 5
src/pages/carouselFigure/customImg/list.jsx Прегледај датотеку

@@ -26,18 +26,22 @@ function header(props) {
26 26
         if(data.records.length > 0){
27 27
           setData(data.records)
28 28
         }else{
29
-          setData([{'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg','imgType':'index','imgDesc':'小程序首页分享配图'}])
29
+          setData([
30
+            {'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg','imgType':'index','imgDesc':'小程序首页分享配图'},
31
+            {'imgUrl':'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png','imgType':'indexNews','imgDesc':'首页资讯logo'}
32
+          ])
30 33
         }
31 34
         
32 35
     })
33 36
   }
34 37
   
35 38
     // 跳转到编辑商品
36
-  const toEditCustom = (imgId) => () => {
39
+  const toEditCustom = (imgId, imgType) => () => {
37 40
     router.push({
38 41
       pathname: '/carouselFigure/customImg/edit',
39 42
       query: {
40
-        imgId
43
+        imgId,
44
+        imgType:imgType
41 45
       },
42 46
     });
43 47
   }
@@ -55,7 +59,7 @@ function header(props) {
55 59
         <Column title="类型" dataIndex="imgType" key="imgType" 
56 60
         render={(text, record) => (
57 61
           <span>
58
-            {record.imgType === 'index' ?'首页分享':'请编辑'}
62
+            {record.imgType === 'index' ?'首页分享': record.imgType === 'indexNews' ? '首页资讯' : '请编辑'}
59 63
           </span>
60 64
           )}
61 65
         />
@@ -65,7 +69,7 @@ function header(props) {
65 69
         key="handle" 
66 70
         render={(text, record) => (
67 71
           <AuthButton name="admin.custom.put" noRight={null}>
68
-            <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditCustom(record.imgId)}>
72
+            <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditCustom(record.imgId, record.imgType)}>
69 73
               编辑<Icon type="form" className={styles.edit} />
70 74
             </span>
71 75
           </AuthButton>