Bladeren bron

新需求

weichaochao 5 jaren geleden
bovenliggende
commit
09c91979e2

+ 23
- 7
src/pages/activity/liveActivity/edit/components/base.jsx Bestand weergeven

@@ -42,7 +42,7 @@ const header = props => {
42 42
 
43 43
   const cancelPage = () =>{
44 44
     router.push({
45
-      pathname: '/activity/liveActivity/list',
45
+      pathname: '/activity/liveActivity/list/index    ',
46 46
     });
47 47
   }
48 48
 
@@ -56,6 +56,12 @@ const header = props => {
56 56
     props.form.validateFields((err, values) => {
57 57
       if (!err){
58 58
         let {liveTime, ...submitValue} = values
59
+        console.log(submitValue.status, 'submitValue.status = 1submitValue.status = 1')
60
+        if (submitValue.status == '已发布'){
61
+          submitValue.status = 1
62
+        }else{
63
+          submitValue.status = 0
64
+        }
59 65
         if(null != liveTime && liveTime.length > 0){
60 66
           const [liveStartDate, livenEndDate] = liviTime
61 67
           submitValue.liveStartDate = moment(liveStartDate).format('YYYY-MM-DD HH:mm:ss');
@@ -83,21 +89,24 @@ const header = props => {
83 89
       <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
84 90
         <Form.Item label="所属城市">
85 91
           {getFieldDecorator('cityId', {
92
+            initialValue: liveActivityData.cityId,
86 93
             rules: [{ required: true, message: ' 请输入所属城市' }],
87 94
           })(<CitySelect3 buildingId={props.form.getFieldValue('buildingId')}/>)}
88 95
         </Form.Item>
89 96
         <Form.Item label="所属楼盘">
90 97
           {getFieldDecorator('buildingId', {
98
+            initialValue: liveActivityData.buildingId,
91 99
             rules: [{ required: true, message: ' 请输入所属楼盘' }],
92 100
           })(<BuildSelect2 cityId={props.form.getFieldValue('cityId')}/>)}
93 101
         </Form.Item>
94 102
         <Form.Item label="直播活动标题">
95 103
           {getFieldDecorator('liveActivityTitle', {
104
+            initialValue: liveActivityData.liveActivityTitle,
96 105
             rules: [{ required: true, message: '请输入直播活动标题' }],
97 106
           })(<Input maxLength={20} placeholder="给直播活动起个名字" />)}
98 107
         </Form.Item>
99
-        <Form.Item label="直播时间">
100
-            {getFieldDecorator('liveTime', {
108
+        {/* <Form.Item label="直播时间">
109
+            {getFieldDecorator('liveTime', { initialValue : liveActivityData.liveStartDate ? moment(liveActivityData.liveStartDate, 'YYYY-MM-DD HH:mm:ss') : null,
101 110
               rules: [
102 111
                 {
103 112
                   required: true,
@@ -105,9 +114,10 @@ const header = props => {
105 114
                 },
106 115
               ],
107 116
             })(<RangePicker style={{ width: '500px' }}format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
108
-        </Form.Item>
117
+        </Form.Item> */}
109 118
         <Form.Item label="直播小程序">
110 119
           {getFieldDecorator('liveApp', {
120
+              initialValue: liveActivityData.liveApp,
111 121
               rules: [{ required: true, message: '请选择直播小程序' }],
112 122
             })(<Select placeholder="选择在哪个平台直播" style={{ width: '300px' }}>
113 123
             <Option value="1">腾讯NOW直播(推荐)</Option>
@@ -119,11 +129,13 @@ const header = props => {
119 129
         </Form.Item>
120 130
         <Form.Item label="房间参数">
121 131
           {getFieldDecorator('liveRoomParam', {
132
+            initialValue: liveActivityData.liveRoomParam,
122 133
             rules: [{ required: true, message: '请输入房间参数' }],
123 134
           })(<Input maxLength={1000} placeholder="请下载文档查看如何获取" style={{width:'680px'}}/>)}<a href="http://njcj.oss-cn-shanghai.aliyuncs.com/%E7%9B%B4%E6%92%AD%E6%88%BF%E9%97%B4%E5%8F%B7%E8%8E%B7%E5%8F%96%E6%95%99%E7%A8%8B(1).docx" style={{ color: 'blue' }}> 不知道怎么填?查看说明</a>
124 135
         </Form.Item>
125 136
         <Form.Item label="封面图1" help="建议尺寸:750px*420px,比例16:9,格式:jpg,用于:活动列表">
126 137
               {getFieldDecorator('listImg', {
138
+                  initialValue: liveActivityData.listImg,
127 139
                   rules: [{ required: true, message: '请上传封面图1' }],
128 140
               })(
129 141
                 <ImageUpload />,
@@ -131,6 +143,7 @@ const header = props => {
131 143
         </Form.Item>  
132 144
         <Form.Item label="封面图2" help="建议尺寸:750*250,比例3:1,格式:jpg,用于:项目详情页">
133 145
               {getFieldDecorator('detailImg', {
146
+                  initialValue: liveActivityData.detailImg,
134 147
                   rules: [{ required: true, message: '请上传封面图2' }],
135 148
               })(
136 149
                 <ImageUpload />,
@@ -138,13 +151,15 @@ const header = props => {
138 151
         </Form.Item>  
139 152
         <Form.Item label="详情图" help="格式:jpg,用于:直播活动详情页,点击可跳转到直播间">
140 153
               {getFieldDecorator('detailTypeImg', {
154
+                  initialValue: liveActivityData.detailTypeImg,
141 155
                   rules: [{ required: true, message: '请上传详情图' }],
142 156
               })(
143 157
                 <ImageUpload />,
144 158
               )}<a href="http://njcj.oss-cn-shanghai.aliyuncs.com/%E7%9B%B4%E6%92%AD%E6%88%BF%E9%97%B4%E5%8F%B7%E8%8E%B7%E5%8F%96%E6%95%99%E7%A8%8B(1).docx" style={{ color: 'blue' }}> 查看详情图示例</a>
145 159
         </Form.Item>      
146 160
         <Form.Item label="权重">
147
-              {getFieldDecorator('detailImg', {
161
+              {getFieldDecorator('weight', {
162
+                  initialValue: liveActivityData.weight,
148 163
                   rules: [{ required: true, message: '请设置权重' }],
149 164
               })(
150 165
                 <InputNumber placeholder="权重越大越靠前" style={{width:'150px'}}/>
@@ -152,10 +167,11 @@ const header = props => {
152 167
         </Form.Item>
153 168
         <Form.Item label="发布状态">
154 169
           {getFieldDecorator('status', {
170
+              initialValue: liveActivityData.status == 1 ? '已发布' : '未发布',
155 171
               rules: [{ required: true, message: '请选择发布状态' }],
156 172
             })(<Select placeholder="发布状态" style={{ width: '300px' }}>
157
-            <Option value="0"></Option>
158
-            <Option value="1"></Option>
173
+            <Option value="0">未发布</Option>
174
+            <Option value="1">已发布</Option>
159 175
           </Select>)}
160 176
         </Form.Item>
161 177
         <Form.Item wrapperCol={{ span: 15, offset: 7 }}>

+ 6
- 6
src/pages/activity/liveActivity/edit/components/poster.jsx Bestand weergeven

@@ -25,13 +25,13 @@ const Poster = props => {
25 25
   const [posterId, setPosterId] = useState('')
26 26
 
27 27
   const [building, setBuilding] = useState({ buildingImg: [{ url: '' }] })
28
-  const salesBatchId = props.salesBatchId.batchId
29
-  if (salesBatchId) {
28
+  const liveActivityId = props.liveActivityId.liveId
29
+  if (liveActivityId) {
30 30
     // eslint-disable-next-line react-hooks/rules-of-hooks
31 31
     useEffect(() => {
32 32
       request({
33 33
         ...apis.activity.poster,
34
-        params: { targetId: salesBatchId, targetType: 'live' },
34
+        params: { targetId: liveActivityId, targetType: 'live' },
35 35
       }).then(data => {
36 36
         if (data.length > 0) {
37 37
           setPosterId(data[0].posterId)
@@ -68,7 +68,7 @@ const Poster = props => {
68 68
   }
69 69
 
70 70
   const submitPoster = () => {
71
-    if (salesBatchId) {
71
+    if (liveActivityId) {
72 72
       if (!imgValue) {
73 73
         message.error('请选择海报图片')
74 74
         return
@@ -78,7 +78,7 @@ const Poster = props => {
78 78
         request({
79 79
           ...apis.activity.updatePoster,
80 80
           urlData: { id: posterId },
81
-          data: { targetId: salesBatchId, targetType: 'house', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
81
+          data: { targetId: liveActivityId, targetType: 'live', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
82 82
         }).then(() => {
83 83
           message.info('保存成功')
84 84
         }).catch(err => {
@@ -87,7 +87,7 @@ const Poster = props => {
87 87
       } else {
88 88
         request({
89 89
           ...apis.activity.addPoster,
90
-          data: { targetId: salesBatchId, targetType: 'house', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
90
+          data: { targetId: liveActivityId, targetType: 'live', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
91 91
         }).then(data => {
92 92
           setPosterId(data.posterId)
93 93
           message.info('保存成功')

+ 12
- 11
src/pages/activity/liveActivity/edit/components/share.jsx Bestand weergeven

@@ -19,24 +19,25 @@ const Share = props => {
19 19
   const [inputValue, changeInput] = useState('')
20 20
   const [imgValue, changeImg] = useState('')
21 21
   const [shareContentId, setShareContentId] = useState('')
22
-  const salesBatchId = props.salesBatchId.batchId
23
-  if (salesBatchId) {
22
+  const liveActivityId = props.liveActivityId.liveId
23
+  if (liveActivityId) {
24 24
     // eslint-disable-next-line react-hooks/rules-of-hooks
25 25
     useEffect(() => {
26 26
       request({
27 27
         ...apis.activity.shareContent,
28
-        params: { targetId: salesBatchId, targetType: 'live' },
28
+        params: { targetId: liveActivityId, targetType: 'live' },
29 29
       }).then(data => {
30 30
         if (data.length > 0) {
31 31
           setShareContentId(data[0].shareContentId)
32 32
           changeImg(data[0].shareContentImg)
33 33
           changeInput(data[0].shareContentTitle)
34
-        }else{
35
-          changeInput("诚挚邀您在线选房购房~");
36
-          request({ ...apis.house.getTaSalesBatch, urlData: {id: salesBatchId} }).then((data) => {
37
-            changeImg(data.aerialViewImg);
38
-        })
39 34
         }
35
+        // else{
36
+        //   changeInput("诚挚邀您在线选房购房~");
37
+        //   request({ ...apis.house.getTaSalesBatch, urlData: {id: salesBatchId} }).then((data) => {
38
+        //     changeImg(data.aerialViewImg);
39
+        // })
40
+        // }
40 41
       }).catch(err => {
41 42
         message.info(err.msg || err.message)
42 43
       })
@@ -56,12 +57,12 @@ const Share = props => {
56 57
   }
57 58
 
58 59
   const submitShare = () => {
59
-    if (salesBatchId) {
60
+    if (liveActivityId) {
60 61
       if (shareContentId) {
61 62
         request({
62 63
           ...apis.activity.updateShareContent,
63 64
           urlData: { id: shareContentId },
64
-          data: { targetId: salesBatchId, shareContentType: 'live', shareContentImg: imgValue,shareContentTitle: inputValue },
65
+          data: { targetId: liveActivityId, shareContentType: 'live', shareContentImg: imgValue,shareContentTitle: inputValue },
65 66
         }).then(data => {
66 67
           message.info('保存成功')
67 68
         }).catch(err => {
@@ -70,7 +71,7 @@ const Share = props => {
70 71
        } else {
71 72
         request({
72 73
           ...apis.activity.addShareContent,
73
-          data: { targetId: salesBatchId, shareContentType: 'house', shareContentImg: imgValue,shareContentTitle: inputValue },
74
+          data: { targetId: liveActivityId, shareContentType: 'live', shareContentImg: imgValue,shareContentTitle: inputValue },
74 75
         }).then(data => {
75 76
           setShareContentId(data.shareContentId)
76 77
           message.info('保存成功')

+ 7
- 7
src/pages/activity/liveActivity/edit/components/shareRecord.jsx Bestand weergeven

@@ -15,10 +15,10 @@ const { TextArea } = Input;
15 15
 const header = (props) => {
16 16
   const [ data, setData ] = useState({})
17 17
   const [page, changePage] = useState({})
18
-  const salesBatchId = props.salesBatchId.batchId
18
+  const liveActivityId = props.liveActivityId.liveId
19 19
 
20 20
   useEffect(() => {
21
-    getList({ pageNum: 1, pageSize: 10, salesBatchId : salesBatchId});
21
+    getList({ pageNum: 1, pageSize: 10, liveActivityId : liveActivityId});
22 22
   },[])
23 23
 
24 24
   // 查询列表
@@ -76,15 +76,15 @@ const header = (props) => {
76 76
     },
77 77
     {
78 78
       title: '分享内容',
79
-      dataIndex: 'salesBatchName',
80
-      key: 'salesBatchName',
79
+      dataIndex: 'liveActivityTitle',
80
+      key: 'liveActivityTitle',
81 81
       align: 'center',
82
-      render: (x, row) => <span>{ row.liveActivityTitle }的房源列表</span>
82
+      render: (x, row) => <span>直播活动{ row.liveActivityTitle }的活动详情</span>
83 83
     },
84 84
   ];
85 85
   
86 86
   const changePageNum = (pageNumber) => {
87
-      getList({ pageNum: pageNumber, pageSize: 10, salesBatchId : salesBatchId, ...props.form.getFieldsValue() })
87
+      getList({ pageNum: pageNumber, pageSize: 10, liveActivityId : liveActivityId, ...props.form.getFieldsValue() })
88 88
   }
89 89
 
90 90
   // 提交事件
@@ -93,7 +93,7 @@ const handleSubmit = (e, props) => {
93 93
     props.form.validateFields((err, values) => {
94 94
       if (!err) {
95 95
         console.log('提交数据: ', values)
96
-        getList({ pageNum: 1, pageSize: 10, salesBatchId : salesBatchId,  ...values })
96
+        getList({ pageNum: 1, pageSize: 10, liveActivityId : liveActivityId,  ...values })
97 97
       }
98 98
     });
99 99
   }

+ 8
- 9
src/pages/activity/liveActivity/edit/components/visitRecord.jsx Bestand weergeven

@@ -15,16 +15,15 @@ const { TextArea } = Input;
15 15
 const header = (props) => {
16 16
   const [ data, setData ] = useState({})
17 17
   // const [page, changePage] = useState({})
18
-  const salesBatchId = props.salesBatchId.batchId
18
+  const liveActivityId = props.liveActivityId.liveId
19 19
 
20 20
   useEffect(() => {
21
-    console.log(salesBatchId, 'salesBatchId')
22
-    getList({ pageNum: 1, pageSize: 10, salesBatchId : salesBatchId});
21
+    getList({ pageNum: 1, pageSize: 10, liveActivityId : liveActivityId});
23 22
   },[])
24 23
 
25 24
   // 查询列表
26 25
   const getList = (params) => {
27
-    request({ ...apis.house.taHouseVisit, salesBatchId : salesBatchId, params: { ...params },}).then((data) => {
26
+    request({ ...apis.taliveActivity.taLiveVisit, liveActivityId : liveActivityId, params: { ...params },}).then((data) => {
28 27
         console.log(data)
29 28
         setData(data)
30 29
     })
@@ -77,15 +76,15 @@ const header = (props) => {
77 76
     // },
78 77
     {
79 78
       title: '访问内容',
80
-      dataIndex: 'salesBatchName',
81
-      key: 'salesBatchName',
79
+      dataIndex: 'liveActivityTitle',
80
+      key: 'liveActivityTitle',
82 81
       align: 'center',
83
-      render: (x, row) => <span>{ row.salesBatchName }的房源列表</span>
82
+      render: (x, row) => <span>直播活动{ row.liveActivityTitle }的活动详情</span>
84 83
     },
85 84
   ];
86 85
   
87 86
   const changePageNum = (pageNumber) => {
88
-      getList({ pageNum: pageNumber, pageSize: 10, salesBatchId : salesBatchId, ...props.form.getFieldsValue() })
87
+      getList({ pageNum: pageNumber, pageSize: 10, liveActivityId : liveActivityId, ...props.form.getFieldsValue() })
89 88
   }
90 89
 
91 90
   // 提交事件
@@ -94,7 +93,7 @@ const handleSubmit = (e, props) => {
94 93
     props.form.validateFields((err, values) => {
95 94
       if (!err) {
96 95
         console.log('提交数据: ', values)
97
-        getList({ pageNum: 1, pageSize: 10, salesBatchId: salesBatchId, ...values})
96
+        getList({ pageNum: 1, pageSize: 10, liveActivityId: liveActivityId, ...values})
98 97
       }
99 98
     });
100 99
   }

+ 1
- 1
src/pages/activity/liveActivity/list/index.jsx Bestand weergeven

@@ -88,7 +88,7 @@ const header = props => {
88 88
       dataIndex: 'liveActivityTitle',
89 89
       key: 'liveActivityTitle',
90 90
       align: 'center',
91
-      render:  (x, row) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={toAddLive(row)}>{row.liveActivityTitle}</span></>,
91
+      // render:  (x, row) => <><span style={{color: 'blue',cursor: 'pointer'}} onClick={toAddLive(row)}>{row.liveActivityTitle}</span></>,
92 92
     },
93 93
     {
94 94
       title: '所属城市',

+ 6
- 1
src/services/apis.js Bestand weergeven

@@ -1201,6 +1201,11 @@ export default {
1201 1201
     method: 'GET',
1202 1202
     action: 'admin.taLiveShare.get',
1203 1203
   },
1204
+  taLiveVisit:{
1205
+    url: `${prefix}/taLiveVisit`,
1206
+    method: 'GET',
1207
+    action: 'admin.taLiveVisit.get',
1208
+  },
1204 1209
   addTaLiveActivity: {
1205 1210
     method: 'POST',
1206 1211
     url: `${prefix}/taLiveActivity`,
@@ -1214,7 +1219,7 @@ export default {
1214 1219
   getTaLiveActivity:{
1215 1220
     url: `${prefix}/taLiveActivity/:id`,
1216 1221
     method: 'get',
1217
-    action: 'admin.taLiveActivity.put',
1222
+    action: 'admin.taLiveActivity.get',
1218 1223
   },
1219 1224
   taLiveActivity: {
1220 1225
     method: 'GET',