Просмотр исходного кода

去处左侧栏技淘币管理,修改政策详情页

anderx лет назад: 2
Родитель
Сommit
c0d365275a

+ 10 - 10
js/admin/menu.jsx

@@ -91,14 +91,14 @@ module.exports = {
           { name: 'App推送消息管理', url: 'systemMessageOut' },
         ]
       },
-      {
-        name: '技淘币管理',
-        url: 'sub12',
-        icon: 'red-envelope',
-        children: [
-          { name: '抵用券管理', url: 'vouchers' },
-          { name: '劵面管理', url: 'coupon' },
-        ]
-      },
+      // {
+      //   name: '技淘币管理',
+      //   url: 'sub12',
+      //   icon: 'red-envelope',
+      //   children: [
+      //     { name: '抵用券管理', url: 'vouchers' },
+      //     { name: '劵面管理', url: 'coupon' },
+      //   ]
+      // },
     ]
-}
+}

+ 10 - 10
js/component/account/menu.jsx

@@ -70,14 +70,14 @@ module.exports = {
             // { name: '会员订单', url: 'memberOrderX' },
           ]
         },
-        {
-	        name: '技淘币管理',
-	        url: 'sub9',
-	        icon: 'notification',
-	        children: [
-	          { name: '券面管理', url: 'vouchers' },
-	          { name: '我的技淘币', url: 'coupon' },
-	        ]
-        }
+        // {
+	    //     name: '技淘币管理',
+	    //     url: 'sub9',
+	    //     icon: 'notification',
+	    //     children: [
+	    //       { name: '券面管理', url: 'vouchers' },
+	    //       { name: '我的技淘币', url: 'coupon' },
+	    //     ]
+        // }
     ]
-}
+}

+ 2 - 2
js/component/administration/policy/policyDesc.jsx

@@ -51,13 +51,13 @@ class DemandDesc extends React.Component {
 									handOk={this.handOk.bind(this)}
 									/>
 									:
-									<NewForm 
+									<NewForm
 										closeDesc={this.handleCancel.bind(this)}
 										data={this.props.data}
 										visible={this.state.visible}
 										handOk={this.handOk.bind(this)}
 										/>
-								} 
+								}
 						</div>
 					</div>
 				</Modal>

+ 31 - 12
js/component/administration/policy/policyForm.jsx

@@ -13,11 +13,13 @@ import {
 	Checkbox,
 	Cascader,
     Row,
-    Col
+    Col,
+	DatePicker
 } from 'antd';
 import {  splitUrl} from '@/tools.js';
 import {provinceSelect } from '@/NewDicProvinceList';
 import Editors from '@/richTextEditors';
+import moment from "moment";
 
 const PicturesWall = React.createClass({
 	getInitialState() {
@@ -72,7 +74,7 @@ const PicturesWall = React.createClass({
 		);
 	}
 });
- 
+
 const NewDetailForm = Form.create()(React.createClass({
     getInitialState() {
         return {
@@ -115,8 +117,10 @@ const NewDetailForm = Form.create()(React.createClass({
 					publishPages:thisData.publishPages?thisData.publishPages:['web_policy_main','app_policy_main'],
 					auditStatus:thisData.auditStatus,
 					edit:{content:thisData.content},
-                    pictureUrl: thisData.titleImg ? splitUrl(thisData.titleImg, ',', globalConfig.avatarHost + '/upload') : []
+                    pictureUrl: thisData.titleImg ? splitUrl(thisData.titleImg, ',', globalConfig.avatarHost + '/upload') : [],
+					releaseData: thisData.releaseDate,
                 });
+				console.log(this.state)
             }.bind(this),
         }).always(function () {
             this.setState({
@@ -131,6 +135,8 @@ const NewDetailForm = Form.create()(React.createClass({
 		e.preventDefault();
         this.props.form.validateFields((err, values) => {
 			//url转化
+			console.log(values)
+			console.log(moment(values.releaseData).format('YYYY-MM-DD'))
 			if((this.state.edit).content==undefined||!(this.state.edit).content||(this.state.edit).content=='<p><br></p>'){
 				message.warning('请填写政策正文');
 				return false;
@@ -169,7 +175,8 @@ const NewDetailForm = Form.create()(React.createClass({
 						auditStatus:index,
                         summary: values.summary,
 						province: (values.ProvinceCity)[0],
-						publishPages:publishPages
+						publishPages:publishPages,
+						releaseData:moment(values.releaseData).format('YYYY-MM-DD'),
                     }
                 }).done(function (data) {
                     this.setState({
@@ -225,9 +232,9 @@ const NewDetailForm = Form.create()(React.createClass({
 			this.props.form.resetFields();
         };
     },
-    render() {
+	render() {
         const theData = this.state.data || {};
-        const { getFieldDecorator } = this.props.form;
+		const { getFieldDecorator } = this.props.form;
         const FormItem = Form.Item
         const formItemLayout = {
             labelCol: { span: 6 },
@@ -248,7 +255,19 @@ const NewDetailForm = Form.create()(React.createClass({
 								initialValue: theData.title
 							})(<Input placeholder="请输入您的政策政策标题" maxLength={40}/>)}
 						</FormItem>
+						<FormItem className="half-item"  {...formItemLayout} label="发布日期">
+							{getFieldDecorator('releaseData',{
+								rules:[{required:true,message:"发布时间不能为空"}],
+								initialValue: theData.releaseData
+							})(<DatePicker defaultValue={moment()}
+								showTime
+										   format="YYYY-MM-DD" />)}
+
+						</FormItem>
+
+
 					</div>
+
 					<div className="clearfix">
 					    <FormItem className="half-item" {...formItemLayout} label="热门">
 							{getFieldDecorator('hot', {
@@ -272,10 +291,10 @@ const NewDetailForm = Form.create()(React.createClass({
 								initialValue: theData.sourceUrl
 							})(<Input placeholder="请输入政策来源链接" />)}
 						</FormItem>
-						<FormItem className="half-item" 
+						<FormItem className="half-item"
 							{...formItemLayout}
 							label="省-市-区"
-							> 
+							>
 							{getFieldDecorator('ProvinceCity', {
 								rules: [ { required: true, message: '此项为必填项!' } ],
 								initialValue: this.state.Province
@@ -283,7 +302,7 @@ const NewDetailForm = Form.create()(React.createClass({
 							 <Cascader options={provinceSelect()}   placeholder="选择城市" />
 							 )}
 						</FormItem>
-						
+
 					</div>
 					<div className="clearfix">
 						<FormItem  {...formItemLayouts} label="关键字">
@@ -318,14 +337,14 @@ const NewDetailForm = Form.create()(React.createClass({
 								visible={this.state.visible} />
 						</FormItem>
 					</div>
-					
+
 					{theData.createTime&&<div className="clearfix">
 						<FormItem labelCol={{ span: 3 }} wrapperCol={{ span: 18 }} label="是否发布">
 							<span>{theData.releaseStatus?'已发布':'未发布'}</span>
 						</FormItem>
 					</div>}
 					<div className="clearfix">
-						<FormItem className="full-item" 
+						<FormItem className="full-item"
 							labelCol={{ span: 3 }}
 							wrapperCol={{ span: 18 }} label="发布位置">
 							{getFieldDecorator('publishPages', {
@@ -365,7 +384,7 @@ const NewDetailForm = Form.create()(React.createClass({
 						</FormItem>
 					</div>
 				</Spin>
-			</Form>    
+			</Form>
 		</div>
         )
     }

Разница между файлами не показана из-за своего большого размера
+ 13629 - 2213
package-lock.json


+ 2 - 2
webpack-dll.config.js

@@ -10,7 +10,7 @@ let theme = {
   '@link-color': '#58a3ff'
 };
 module.exports = (function () {
-	let staticHost = 'http://172.16.0.253:80';
+	let staticHost = 'http://172.16.0.255:80';
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://statics.jishutao.com';
@@ -63,4 +63,4 @@ module.exports = (function () {
       extensions: ['.js', '.jsx']
     }
   }
-})();
+})();

+ 4 - 4
webpack.config.js

@@ -104,7 +104,7 @@ module.exports = (function () {
             template: './template/template.html',
             chunks: ['admin/index', 'vendors']
         })
-        
+
     ];
     if (!isDev) {
         //这个使用uglifyJs压缩你的js代码
@@ -121,7 +121,7 @@ module.exports = (function () {
         }));
     }
 
-    let staticHost = 'http://172.16.0.253:80';
+    let staticHost = 'http://172.16.0.255:80';
     switch (argv.env.deploy) {
         case 'test':
             staticHost = 'http://statics.jishutao.com';
@@ -156,7 +156,7 @@ module.exports = (function () {
         plugins: plugins,
         devServer: {
             disableHostCheck: true,
-            host: '172.16.0.253',
+            host: '172.16.0.255',
             port: 80,
             allowedHosts: ['127.0.0.1','192.168.0.20','192.168.0.99','192.168.0.17'],
             headers: {
@@ -164,4 +164,4 @@ module.exports = (function () {
             }
         }
     };
-})();
+})();

Разница между файлами не показана из-за своего большого размера
+ 7322 - 7325
yarn.lock