Browse Source

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

傅行帆 5 years ago
parent
commit
d05bcc8884

+ 47
- 8
src/pages/carouselFigure/advertisingList.jsx View File

@@ -49,11 +49,23 @@ const toEdit = (contentId) => () => {
49 49
       render: (image) => <img src={image} className={styles.imgSmall} />,
50 50
     },
51 51
     {
52
-      title: '类型',
52
+      title: '发布城市',
53
+      dataIndex: 'cityName',
54
+      key: 'cityName',
55
+      align: 'center',
56
+    },
57
+    {
58
+      title: '关联项目',
59
+      dataIndex: 'buildingName',
60
+      key: 'buildingName',
61
+      align: 'center',
62
+    },
63
+    {
64
+      title: '关联内容类型',
53 65
       dataIndex: 'contentType',
54 66
       key: 'contentType',
55 67
       align: 'center',
56
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
68
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : '' }</span>
57 69
     },
58 70
     // {
59 71
     //   title: '发布位置',
@@ -74,7 +86,7 @@ const toEdit = (contentId) => () => {
74 86
       dataIndex: 'status',
75 87
       key: 'status',
76 88
       align: 'center',
77
-      render: (status)=> <><span>{status == 1 ? '启用' : '停用'}</span></>
89
+      render: (status)=> <><span>{status == 1 ? '上架' : '下架'}</span></>
78 90
     },
79 91
     {
80 92
       title: '操作',
@@ -84,8 +96,9 @@ const toEdit = (contentId) => () => {
84 96
       render: (x,row) => (
85 97
         <>
86 98
           <AuthButton name="admin.extendContent.id.put" noRight={null}>
87
-            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '禁用' : '启用' }<Icon type="vertical-align-top" className={styles.edit} /></span>
88
-            <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={toEdit(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
99
+            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '下架' : '上架' }<Icon type="vertical-align-top" className={styles.edit} /></span>
100
+            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEdit(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
101
+            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}>删除<Icon type="vertical-align-top" className={styles.edit} /></span>
89 102
           </AuthButton>
90 103
         </>
91 104
       )
@@ -110,6 +123,24 @@ const toEdit = (contentId) => () => {
110 123
         });
111 124
   }
112 125
   
126
+  //删除
127
+const deleteCarouse = (contentId) => () =>{
128
+  Modal.confirm({
129
+    title: '确认删除此数据?',
130
+    okText: '确定',
131
+    cancelText: '取消',
132
+    onOk() {
133
+      request({ ...apis.carsuseFigure.deleteExtendContent,urlData:{id: contentId}}).then((data) => {
134
+            message.info('操作成功!')
135
+            getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
136
+        }).catch((err) => {
137
+            console.log(err)
138
+            message.info(err.msg || err.message)
139
+        })
140
+    },
141
+  });
142
+}
143
+
113 144
 //   停用启用
114 145
   const changeStatus = (row) => () => {
115 146
       console.log(row)
@@ -175,6 +206,11 @@ const handleSubmit = (e, props) => {
175 206
 
176 207
     <>
177 208
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
209
+      <Form.Item>
210
+          {getFieldDecorator('cityId')(
211
+             <SelectCity />,
212
+          )}
213
+        </Form.Item>
178 214
         <Form.Item>
179 215
           {getFieldDecorator('buildingId')(
180 216
             <BuildSelect />,
@@ -186,7 +222,10 @@ const handleSubmit = (e, props) => {
186 222
               <Option value="activity">活动</Option>
187 223
               <Option value="project">项目</Option>
188 224
               <Option value="news">资讯</Option>
189
-              <Option value="other">其他</Option>
225
+              <Option value="help">助力</Option>
226
+              <Option value="group">拼团</Option>
227
+              <Option value="h5">H5</Option>
228
+              <Option value="">无</Option>
190 229
             </Select>,
191 230
           )}
192 231
         </Form.Item>
@@ -201,8 +240,8 @@ const handleSubmit = (e, props) => {
201 240
         <Form.Item>
202 241
           {getFieldDecorator('status')(
203 242
             <Select style={{ width: '180px' }} placeholder="状态">
204
-              <Option value="1">启用</Option>
205
-              <Option value="0">停用</Option>
243
+              <Option value="1">已上架</Option>
244
+              <Option value="0">已下架</Option>
206 245
             </Select>,
207 246
           )}
208 247
         </Form.Item>

+ 47
- 7
src/pages/carouselFigure/carouselFigureList.jsx View File

@@ -49,11 +49,23 @@ const toEditCarouse = (contentId) => () => {
49 49
       render: (x, row) => <img src={row.image} className={row.showPosition === 'index' ? styles.imgIndex : row.showPosition === 'mall' ? styles.imgPerfect : ''} />,
50 50
     },
51 51
     {
52
-      title: '类型',
52
+      title: '发布城市',
53
+      dataIndex: 'cityName',
54
+      key: 'cityName',
55
+      align: 'center',
56
+    },
57
+    {
58
+      title: '关联项目',
59
+      dataIndex: 'buildingName',
60
+      key: 'buildingName',
61
+      align: 'center',
62
+    },
63
+    {
64
+      title: '关联内容类型',
53 65
       dataIndex: 'contentType',
54 66
       key: 'contentType',
55 67
       align: 'center',
56
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
68
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : '' }</span>
57 69
     },
58 70
     {
59 71
       title: '发布位置',
@@ -74,7 +86,7 @@ const toEditCarouse = (contentId) => () => {
74 86
       dataIndex: 'status',
75 87
       key: 'status',
76 88
       align: 'center',
77
-      render: (status)=> <><span>{status == 1 ? '启用' : '停用'}</span></>
89
+      render: (status)=> <><span>{status == 1 ? '已上架' : '已下架'}</span></>
78 90
     },
79 91
     {
80 92
       title: '操作',
@@ -84,8 +96,9 @@ const toEditCarouse = (contentId) => () => {
84 96
       render: (x,row) => (
85 97
         <>
86 98
           <AuthButton name="admin.extendContent.id.put" noRight={null}>
87
-            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '禁用' : '启用' }<Icon type="vertical-align-top" className={styles.edit} /></span>
88
-            <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={toEditCarouse(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
99
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer'}} onClick={changeStatus(row)}>{ row.status === 1 ? '下架' : '上架' }<Icon type="vertical-align-top" className={styles.edit} /></span>
100
+            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditCarouse(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
101
+            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}>删除<Icon type="vertical-align-top" className={styles.edit} /></span>
89 102
           </AuthButton>
90 103
         </>
91 104
       )
@@ -110,6 +123,24 @@ const toEditCarouse = (contentId) => () => {
110 123
         });
111 124
   }
112 125
   
126
+//删除
127
+const deleteCarouse = (contentId) => () =>{
128
+  Modal.confirm({
129
+    title: '确认删除此数据?',
130
+    okText: '确定',
131
+    cancelText: '取消',
132
+    onOk() {
133
+      request({ ...apis.carsuseFigure.deleteExtendContent,urlData:{id: contentId}}).then((data) => {
134
+            message.info('操作成功!')
135
+            getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
136
+        }).catch((err) => {
137
+            console.log(err)
138
+            message.info(err.msg || err.message)
139
+        })
140
+    },
141
+  });
142
+}
143
+
113 144
 //   停用启用
114 145
   const changeStatus = (row) => () => {
115 146
       console.log(row)
@@ -174,6 +205,11 @@ const handleSubmit = (e, props) => {
174 205
 
175 206
     <>
176 207
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
208
+        <Form.Item>
209
+          {getFieldDecorator('cityId')(
210
+             <SelectCity />,
211
+          )}
212
+        </Form.Item>
177 213
         <Form.Item>
178 214
           {getFieldDecorator('buildingId')(
179 215
             <BuildSelect />,
@@ -185,6 +221,10 @@ const handleSubmit = (e, props) => {
185 221
               <Option value="activity">活动</Option>
186 222
               <Option value="project">项目</Option>
187 223
               <Option value="news">资讯</Option>
224
+              <Option value="help">助力</Option>
225
+              <Option value="group">拼团</Option>
226
+              <Option value="h5">H5</Option>
227
+              <Option value="">无</Option>
188 228
               {/* <Option value="other">其他</Option> */}
189 229
             </Select>,
190 230
           )}
@@ -200,8 +240,8 @@ const handleSubmit = (e, props) => {
200 240
         <Form.Item>
201 241
           {getFieldDecorator('status')(
202 242
             <Select style={{ width: '180px' }} placeholder="状态">
203
-              <Option value="1">启用</Option>
204
-              <Option value="0">停用</Option>
243
+              <Option value="1">已上架</Option>
244
+              <Option value="0">已下架</Option>
205 245
             </Select>,
206 246
           )}
207 247
         </Form.Item>

+ 5
- 0
src/services/apis.js View File

@@ -587,6 +587,11 @@ export default {
587 587
       method: 'PUT',
588 588
       action: 'admin.extendContent.id.put',
589 589
     },
590
+    deleteExtendContent: {
591
+      url: `${prefix}/extendContentDelete/:id`,
592
+      method: 'PUT',
593
+      action: 'admin.extendContent.id.put',
594
+    },
590 595
     getExtendContent: {
591 596
       url: `${prefix}/extendContent/:id`,
592 597
       method: 'GET',