Kaynağa Gözat

Merge branch 'dev'

魏超 5 yıl önce
ebeveyn
işleme
f624f3cf7e

+ 1
- 9
config/config.js Dosyayı Görüntüle

@@ -139,13 +139,5 @@ export default {
139 139
   },
140 140
   chainWebpack: webpackPlugin,
141 141
 
142
-  proxy: {
143
-    ...proxy,
144
-    '/gaode_amap': { // 高德地图
145
-      // target: 'http://192.168.0.11:8080/',
146
-      target: 'https://restapi.amap.com/v3/',
147
-      changeOrigin: true,
148
-      pathRewrite: { '^/gaode_amap': '' },
149
-    },
150
-  },
142
+  proxy,
151 143
 };

+ 46
- 0
config/routes.js Dosyayı Görüntüle

@@ -623,6 +623,52 @@ export default [
623 623
               },
624 624
             ],
625 625
           },
626
+          {
627
+            path: '/h5SampleManager',
628
+            name: 'H5样例管理',
629
+            component: '../layouts/BlankLayout',
630
+            routes: [
631
+              {
632
+                path: '/h5SampleManager/h5Sample/list',
633
+                name: 'H5样例',
634
+                component: './h5SampleManager/h5Sample/list',
635
+              },
636
+              {
637
+                path: '/h5SampleManager/h5Sample/detail',
638
+                name: '详情',
639
+                hideInMenu: true,
640
+                component: './h5SampleManager/h5Sample/detail',
641
+              },
642
+              {
643
+                path: '/h5SampleManager/h5Sample/add',
644
+                name: '提交需求',
645
+                hideInMenu: true,
646
+                component: './h5SampleManager/h5Sample/add',
647
+              },
648
+              {
649
+                path: '/h5SampleManager/h5Demand/list',
650
+                name: 'H5需求单',
651
+                component: './h5SampleManager/h5Demand/list',
652
+              },
653
+              // {
654
+              //   path: '/drainageSampleManager/drainageDemand/add',
655
+              //   name: '新增需求单',
656
+              //   component: './drainageSampleManager/drainageDemand/add',
657
+              // },
658
+              {
659
+                path: '/h5SampleManager/h5Demand/detail',
660
+                name: '详情',
661
+                hideInMenu: true,
662
+                component: './h5SampleManager/h5Demand/detail',
663
+              },
664
+              {
665
+                path: '/h5SampleManager/h5Demand/edit',
666
+                name: '修改需求',
667
+                hideInMenu: true,
668
+                component: './h5SampleManager/h5Demand/edit',
669
+              },
670
+            ],
671
+          },
626 672
           // {
627 673
           //   path: '/miniapp',
628 674
           //   name: '小程序管理',

+ 2
- 0
package.json Dosyayı Görüntüle

@@ -62,8 +62,10 @@
62 62
     "react-copy-to-clipboard": "^5.0.1",
63 63
     "react-document-title": "^2.0.3",
64 64
     "react-dom": "^16.8.6",
65
+    "react-slick": "^0.25.2",
65 66
     "react-zmage": "^0.8.5",
66 67
     "redux": "^4.0.1",
68
+    "swiper": "^5.3.6",
67 69
     "umi": "^2.13.3",
68 70
     "umi-plugin-pro-block": "^1.3.2",
69 71
     "umi-plugin-react": "^1.9.5",

BIN
src/assets/boy.png Dosyayı Görüntüle


BIN
src/assets/card.png Dosyayı Görüntüle


BIN
src/assets/close.png Dosyayı Görüntüle


BIN
src/assets/copy.png Dosyayı Görüntüle


BIN
src/assets/girl.png Dosyayı Görüntüle


+ 2
- 0
src/components/DragableUploadImageList/index.jsx Dosyayı Görüntüle

@@ -77,6 +77,7 @@ class ImageListUpload extends React.Component {
77 77
 
78 78
   render() {
79 79
     const { previewVisible, previewImage } = this.state;
80
+    const { multiple = false } = this.props;
80 81
     const fileList = this.getFileList();
81 82
 
82 83
     const uploadButton = (
@@ -93,6 +94,7 @@ class ImageListUpload extends React.Component {
93 94
         <Upload
94 95
           listType="picture-card"
95 96
           showUploadList={false}
97
+          multiple={multiple}
96 98
           onPreview={this.handlePreview}
97 99
           onChange={this.handleChange}
98 100
           { ...uploaderProps }

+ 2
- 0
src/components/Wangedit/Wangedit.jsx Dosyayı Görüntüle

@@ -11,6 +11,7 @@ class Wangedit extends React.Component {
11 11
     super(props, context);
12 12
     this.state = {
13 13
       html: undefined,
14
+      contenteditable: props.contenteditable == false ? false : true
14 15
     }
15 16
     this.editor = undefined;
16 17
   }
@@ -77,6 +78,7 @@ class Wangedit extends React.Component {
77 78
     }
78 79
 
79 80
     this.editor.create()
81
+    this.editor.$textElem.attr('contenteditable',this.state.contenteditable);
80 82
     this.editor.customConfig.uploadImgShowBase64 = true
81 83
     this.editor.txt.html(this.props.value)
82 84
   }

+ 3
- 1
src/models/login.js Dosyayı Görüntüle

@@ -20,7 +20,9 @@ const Model = {
20 20
         type: 'changeLoginStatus',
21 21
         payload: response,
22 22
       }); // Login successfully
23
-            
23
+
24
+      window.localStorage.setItem('showSwiperIndex', 1)
25
+
24 26
       const urlParams = new URL(window.location.href);
25 27
       const params = getPageQuery();
26 28
       let { redirect } = params;

+ 3
- 1
src/pages/Welcome.jsx Dosyayı Görüntüle

@@ -3,6 +3,7 @@ import { Card, Typography, Alert, Row, Col } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import EchartsTest from '../components/EchartsTest';
5 5
 import IndexEcharts from './indexEcharts/index';
6
+import Swiper from './swiper/index';
6 7
 import router from 'umi/router';
7 8
 import request from '../utils/request';
8 9
 import apis from '../services/apis';
@@ -63,11 +64,12 @@ const welcome = (props) => {
63 64
             boxShadow: '0px  0.106rem 14px -15px rgba(107,130,230,1)',
64 65
             borderRadius: '12px', width: '32%',
65 66
           }}>
66
-            <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0',cursor: 'pointer' }}>最近7天新增 </span>
67
+            <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0', cursor: 'pointer' }}>最近7天新增 </span>
67 68
             <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy', lineHeight: '100px' }}>{data.selectRecentlyCount || '0'}</span>
68 69
           </div>
69 70
         }
70 71
       </div>
72
+      <Swiper />
71 73
       <IndexEcharts style={{ width: '100%' }} onReData={(e) => redata(e)} checkData={checkData}></IndexEcharts>
72 74
     </>
73 75
   )

+ 1
- 1
src/pages/activity/drainage/DrainageList.jsx Dosyayı Görüntüle

@@ -483,7 +483,7 @@ const header = (props) => {
483 483
   //打开新页面
484 484
   const openIndexImg = () => {
485 485
     const newWin=window.open('about:blank');
486
-    newWin.location.href="https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1575977446224-1.png"
486
+    newWin.location.href="http://njcj.oss-cn-shanghai.aliyuncs.com/%E6%A1%88%E4%BE%8B.png"
487 487
   }
488 488
   
489 489
   const { getFieldDecorator } = props.form;

+ 1
- 1
src/pages/building/list/add/components/base.jsx Dosyayı Görüntüle

@@ -447,7 +447,7 @@ function AddBuilding(props) {
447 447
             {getFieldDecorator('avatarImage', {
448 448
               rules: [{ required: true, message: '请选择项目主图' }],
449 449
             })(
450
-              <DragableUploadImageList />,
450
+              <DragableUploadImageList multiple={true} />,
451 451
             )}
452 452
           </Form.Item>
453 453
           <Form.Item label="楼盘封面图" help="建议图片尺寸:750*420px,比例16:9,格式:jpg,用于楼盘列表">

+ 45
- 0
src/pages/h5SampleManager/h5Demand/components/AddDemand.jsx Dosyayı Görüntüle

@@ -0,0 +1,45 @@
1
+import React, { PureComponent, useState, useEffect } from 'react'
2
+import { Modal, Row, Col, Table, Pagination, Button, Form, Input,message } from 'antd'
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import router from 'umi/router';
5
+import AuthButton from '@/components/AuthButton';
6
+
7
+// import Style from './style.less'
8
+// import HotBlock from '../HotBlock'
9
+import apis from '../../../../services/apis';
10
+import request from '../../../../utils/request';
11
+
12
+const BatchDel = props => {
13
+
14
+    function sampleList(record) {
15
+        router.push({
16
+          pathname: '/h5SampleManager/h5Sample/list',
17
+        })
18
+    }
19
+
20
+  return (
21
+    <>
22
+      <Modal footer={null} title="新增需求单" visible={props.visible} onCancel={props.onCancel} width={600}>
23
+        <div style={{textAlign:'center', marginBottom:'15px'}}>
24
+            <span style={{fontSize:'15px'}}>请到H5样例中筛选并查看详情后从详情提交需求单</span><br/>
25
+        </div>
26
+        <Form >
27
+          <Form.Item wrapperCol={{ span: 15, offset: 8 }}>
28
+            <Button type="primary" onClick={() => sampleList()}>
29
+              查看全部样例
30
+            </Button>
31
+            <Button onClick={props.onCancel} style={{marginLeft:'20px'}}>
32
+              取消
33
+            </Button>
34
+          </Form.Item>
35
+        </Form>
36
+        
37
+        
38
+      </Modal>
39
+    </>
40
+  );
41
+}
42
+
43
+const WrappedBase = Form.create({ name: 'BatchDel' })(BatchDel);
44
+
45
+export default WrappedBase

+ 56
- 0
src/pages/h5SampleManager/h5Demand/components/BatchDel.jsx Dosyayı Görüntüle

@@ -0,0 +1,56 @@
1
+import React, { PureComponent, useState, useEffect } from 'react'
2
+import { Modal, Row, Col, Table, Pagination, Button, Form, Input,message } from 'antd'
3
+// import EnDash from '../EnDash'
4
+import AuthButton from '@/components/AuthButton';
5
+
6
+// import Style from './style.less'
7
+// import HotBlock from '../HotBlock'
8
+import apis from '../../../../services/apis';
9
+import request from '../../../../utils/request';
10
+
11
+const BatchDel = props => {
12
+  const taRaiseRecords = props.demandIds;
13
+  function handleSubmit (e) {
14
+    e.preventDefault();
15
+    props.form.validateFields((err, values) => {
16
+      if (!err){
17
+        request({ ...apis.taH5SampleManager.batchDelDemands, data: { taH5Demands: taRaiseRecords }, }).then((data) => {
18
+          const resultMessage = '操作成功,其中'+data.successNum+'条成功删除,'+data.failNum+'条非作废/提交状态未删除。'
19
+          message.info(resultMessage)
20
+          props.onSuccess(false);
21
+        }).catch((err) => {
22
+          message.info(err.msg || err.message)
23
+        })
24
+      }
25
+    });
26
+  }
27
+
28
+  const { getFieldDecorator } = props.form;
29
+
30
+  return (
31
+    <>
32
+      <Modal footer={null} title="确认删除" visible={props.visible} onCancel={props.onCancel} width={600}>
33
+        <div style={{textAlign:'center', marginBottom:'30px'}}><span style={{fontSize:'20px'}}>确认将所选{taRaiseRecords.length}条数据删除?</span></div>
34
+        <div style={{textAlign:'center', marginBottom:'15px'}}>
35
+            <span style={{fontSize:'15px'}}>可删除条件:需求单状态 为已提交或作废</span><br/>
36
+        </div>
37
+        <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
38
+          <Form.Item wrapperCol={{ span: 15, offset: 10 }}>
39
+            <Button type="primary" htmlType="submit" >
40
+              确定
41
+            </Button>
42
+            <Button onClick={props.onCancel} style={{marginLeft:'20px'}}>
43
+              取消
44
+            </Button>
45
+          </Form.Item>
46
+        </Form>
47
+        
48
+        
49
+      </Modal>
50
+    </>
51
+  );
52
+}
53
+
54
+const WrappedBase = Form.create({ name: 'BatchDel' })(BatchDel);
55
+
56
+export default WrappedBase

+ 137
- 0
src/pages/h5SampleManager/h5Demand/detail.jsx Dosyayı Görüntüle

@@ -0,0 +1,137 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, InputNumber, Checkbox, Row, Col} from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import XForm, { FieldTypes } from '../../../components/XForm';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import apis from '../../../services/apis';
8
+import request from '../../../utils/request';
9
+import AuthButton from '@/components/AuthButton';
10
+import Wangedit from '../../../components/Wangedit/Wangedit'
11
+import TextArea from 'antd/lib/input/TextArea';
12
+
13
+const { Option } = Select;
14
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15
+
16
+
17
+const header = props => {
18
+  const demandId  = props.location.query.id;
19
+  const [demandData, setDemandData] = useState({})
20
+
21
+  useEffect(() => {
22
+    getDemandData(demandId);
23
+  },[])
24
+
25
+  // 查询列表
26
+  const getDemandData = (demandId) => {
27
+      request({ ...apis.taH5SampleManager.taH5DemandById, urlData: {id: demandId} }).then((data) => {
28
+          setDemandData(data)
29
+          props.form.setFieldsValue(data)
30
+      })
31
+  }
32
+
33
+  // 跳转到编辑
34
+  const toDetail = rowData => () => {
35
+    if(rowData) {
36
+      router.push({
37
+      pathname: '/h5SampleManager/h5Demand/edit',
38
+      query: {
39
+        id: demandId,
40
+      },
41
+    });
42
+      return
43
+    }
44
+  }
45
+
46
+  function sampleDetail(sampleId){
47
+    request({ ...apis.taH5SampleManager.taH5SampleById, urlData: { id: sampleId } }).then((data) => {
48
+      router.push({
49
+        pathname: '/h5SampleManager/h5Sample/detail',
50
+        query: {
51
+          id: sampleId,
52
+        },
53
+      });
54
+    }).catch(err => {
55
+      message.info("该H5样例已取消发布或已删除")
56
+    })
57
+  }
58
+
59
+  function handleSubmit (e) {
60
+    e.preventDefault();
61
+    props.form.validateFields((err, values) => {
62
+      if (!err){
63
+        console.log(values,'valuesvaluesvalues')
64
+        if (values.payType == 'onLine' && (values.payDescriptionOnline == '' || values.payDescriptionOnline == null)){
65
+            message.info("请填写线上缴费说明");
66
+            return;
67
+        }
68
+        if (values.payType == 'offLine' && (values.payDescriptionOffline == '' || values.payDescriptionOffline == null)){
69
+          message.info("请填写线下缴费说明");
70
+          return;
71
+        }
72
+        if ((values.payType == 'onLine' && (values.payDescriptionOnline == '' || values.payDescriptionOnline == null)) ||
73
+            (values.payType == 'offLine' && (values.payDescriptionOffline == '' || values.payDescriptionOffline == null))){
74
+          message.info("请填写缴费说明");
75
+          return;
76
+        }
77
+        
78
+        let {liveTime, ...submitValue} = values
79
+        if (values.raiseStartTime > values.raiseEndTime){
80
+          message.info("认筹结束时间大于认筹开始时间")
81
+          return;
82
+        }
83
+        submitValue.raiseStartTime = moment(submitValue.raiseStartTime).format('YYYY-MM-DD HH:mm:ss')
84
+        submitValue.raiseEndTime = moment(submitValue.raiseEndTime).format('YYYY-MM-DD HH:mm:ss')
85
+        submitValue.payType = values.payType.toString();
86
+        submitValue.raisePrice = submitValue.raisePrice * 100;
87
+        request({ ...apis.house.addRaise, data: { ...submitValue },}).then((data) => {
88
+          message.info("保存成功")
89
+          router.push({
90
+            pathname: '/house/raise/list',
91
+          });
92
+        }).catch((err) => {
93
+          message.info(err.msg || err.message)
94
+        })
95
+      }
96
+    });
97
+  }
98
+
99
+  const { getFieldDecorator } = props.form;
100
+
101
+  return (
102
+    <>
103
+      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
104
+        <Form.Item label="样例名">
105
+          <a onClick={() => sampleDetail(demandData.sampleId)} style={{ color: 'blue' }}>{demandData.sampleName}</a>
106
+        </Form.Item>
107
+        <Form.Item label="下单人">
108
+          <span>{demandData.orderer}</span>
109
+        </Form.Item>
110
+        <Form.Item label="联系方式">
111
+        <span>{demandData.phone}</span>
112
+        </Form.Item>
113
+        <Form.Item label="下单时间">
114
+        <span>{`${moment(demandData.createDate).format('YYYY-MM-DD HH:mm')}`}</span>
115
+        </Form.Item>
116
+        <Form.Item label="更新时间">
117
+        <span>{`${moment(demandData.updateDate).format('YYYY-MM-DD HH:mm')}`}</span>
118
+        </Form.Item>
119
+        <Form.Item label="需求单状态">
120
+        <span>{demandData.demandStatus === 1 ? "已提交": demandData.demandStatus === 2 ?"处理中":demandData.demandStatus === 3?"已交付":"作废"}</span>
121
+        </Form.Item>
122
+        <Form.Item label="需求描述">
123
+          {getFieldDecorator('demandContent')(<Wangedit contenteditable={false}/>)}
124
+        </Form.Item>
125
+        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
126
+          <Button type="primary"  onClick={toDetail(demandId)} style={{marginRight:'20px'}}>
127
+            修改需求
128
+          </Button>
129
+        </Form.Item>
130
+      </Form>
131
+    </>
132
+  )
133
+}
134
+
135
+const WrappedHeader = Form.create({ name: 'header' })(header);
136
+
137
+export default WrappedHeader

+ 69
- 0
src/pages/h5SampleManager/h5Demand/detail.less Dosyayı Görüntüle

@@ -0,0 +1,69 @@
1
+.searchBox {
2
+    font-size: 20px;
3
+    color: red;
4
+    display: flex;
5
+    display: flex;
6
+    align-items: center;
7
+    justify-content: space-between;
8
+    .searchItem {
9
+      min-width: 20px;
10
+      margin-right: 20px;
11
+      text-align: left;
12
+      .anticon-down {
13
+        float: right !important;
14
+      }
15
+    }
16
+  }
17
+  .addBtn {
18
+    padding: 0 30px;
19
+    height: 36px;
20
+    background-color: #50be00;
21
+    color: #fff;
22
+    margin: 30px 0;
23
+  }
24
+  .touxiang {
25
+    width: 93px;
26
+    height: 93px;
27
+  }
28
+  .ant-table-column-title {
29
+    font-weight: 600;
30
+  }
31
+  
32
+  .about {
33
+    padding: 0 30px;
34
+    height: 36px;
35
+    margin: 30px 0;
36
+    margin-left:8px;
37
+  }
38
+  
39
+  .selectName {
40
+    font-size: 14px;
41
+    padding: 0 10px;
42
+    height: 36px;
43
+    color: rgb(10, 10, 10);
44
+    margin: 30px 0;
45
+  }
46
+  
47
+  .inpuit {
48
+    width:50%;
49
+  }
50
+  
51
+  .inpuitTxt {
52
+    width:70%;
53
+  }
54
+  
55
+  
56
+  .formButton{
57
+    margin-left: 12% 
58
+  }
59
+  
60
+  .divInput{
61
+    float: 'left'; 
62
+    width: 500
63
+  }
64
+  .brokerTable{
65
+    padding: 0 30px;
66
+    height: 36px;
67
+    margin: 30px 0;
68
+  }
69
+  

+ 87
- 0
src/pages/h5SampleManager/h5Demand/edit.jsx Dosyayı Görüntüle

@@ -0,0 +1,87 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import Wangedit from '../../../components/Wangedit/Wangedit'
5
+import router from 'umi/router';
6
+import channels from './detail.less';
7
+import apis from '../../../services/apis';
8
+import request from '../../../utils/request'
9
+
10
+const { TextArea } = Input;
11
+const { Option } = Select;
12
+
13
+const header = props => {
14
+
15
+  // eslint-disable-next-line react-hooks/rules-of-hooks
16
+  useEffect(() => {
17
+    getById()
18
+  }, [])
19
+  
20
+  
21
+  // 查询当前信息
22
+  function getById(params) {
23
+    request({ ...apis.taH5SampleManager.taH5DemandById, urlData: { id: props.location.query.id } }).then((data) => {
24
+      props.form.setFieldsValue(data)
25
+  }).catch((err) => {
26
+      console.log(err)
27
+      message.info(err.msg || err.message)
28
+  })
29
+  }
30
+
31
+  // 编辑
32
+  function editDemandById(data) {
33
+    console.log('datadata',data)
34
+    console.log('props.location.query.id', props.location.query.id)
35
+    request({ ...apis.taH5SampleManager.updateH5DemandById, urlData: { id: props.location.query.id }, data: { ...data } }).then((data) => {
36
+      router.go(-1)
37
+  }).catch((err) => {
38
+      console.log(err)
39
+      message.info(err.msg || err.message)
40
+  })
41
+  }
42
+
43
+
44
+  function handleSubmit(e) {
45
+    e.preventDefault();
46
+    props.form.validateFields((err, values) => {
47
+      if (!err) {
48
+        console.log('values', values)
49
+        if (values.demandContent == '<p><br></p>'){
50
+          message.info("请填写需求内容")
51
+          return
52
+        }
53
+        editDemandById({ ...values })
54
+      }
55
+    });
56
+  }
57
+  function go() {
58
+    router.push({
59
+      pathname: '/h5SampleManager/h5Demand/list',
60
+    });
61
+  }
62
+
63
+  const { getFieldDecorator } = props.form;
64
+
65
+  return (
66
+  <>
67
+        <Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
68
+        <Form.Item label="修改需求" help="注意,修改的需求可能会大幅增加开发时间,请在增加前和联系人确认,若需求对应开发工作量较大,可能需要重新评估报价和开发周期,因此,建议一次性提交完全部需求">
69
+          {getFieldDecorator('sampleName')(<Input disabled={true}/>)}
70
+        </Form.Item>
71
+        <Form.Item label="需求描述" style={{marginTop:'20px'}}>
72
+          {getFieldDecorator('demandContent', {
73
+            rules: [{ required: true, message: '请输入需求描述' }],
74
+          })(<Wangedit />)}
75
+        </Form.Item>
76
+        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
77
+          <Button type="primary" htmlType="submit">
78
+            保存
79
+          </Button>
80
+          <Button className={channels.formButton}  onClick={() => router.go(-1)}>取消</Button>
81
+        </Form.Item>
82
+      </Form>
83
+  </>
84
+)
85
+}
86
+const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
87
+export default WrappedNormalLoginForm

+ 250
- 0
src/pages/h5SampleManager/h5Demand/list.jsx Dosyayı Görüntüle

@@ -0,0 +1,250 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import SelectCity from '../../../components/SelectButton/CitySelect'
8
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
9
+import apis from '../../../services/apis';
10
+import request from '../../../utils/request';
11
+import BatchDel from './components/BatchDel';
12
+import AddDemand from './components/AddDemand';
13
+import AuthButton from '@/components/AuthButton';
14
+
15
+const { Option } = Select;
16
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17
+
18
+const header = props => {
19
+  const sampleId  = props.location.query.id;
20
+  const sampleName = props.location.query.sampleName;
21
+  const [data, setData] = useState({})
22
+  const [demend, setDemend] = useState({})
23
+  const [demandIds, setDemandIds] = useState([])
24
+  const [batchDel, setBatchDel] = useState({visable:false,demandIds:''})
25
+  const [addDemand, setAddDemand] = useState({visable:false})
26
+
27
+  useEffect(() => {
28
+    if(sampleId){
29
+      getList({ pageNum: 1, pageSize: 10, sampleId: sampleId });
30
+    }else{
31
+      getList({ pageNum: 1, pageSize: 10});
32
+    }
33
+    
34
+  }, [])
35
+
36
+  // 查询列表
37
+  const getList = (params) => {
38
+    console.log(params);
39
+    request({ ...apis.taH5SampleManager.taH5Demand, params: { ...params } }).then((data) => {
40
+      console.log(data)
41
+      setData(data)
42
+    })
43
+  }
44
+
45
+  // 跳转到编辑
46
+  const toDetail = rowData => () => {
47
+    if(rowData) {
48
+      router.push({
49
+      pathname: '/h5SampleManager/h5Demand/detail',
50
+      query: {
51
+        id: rowData.demandId,
52
+      },
53
+    });
54
+      return
55
+    }
56
+  }
57
+
58
+  /**
59
+   *
60
+   *
61
+   * @param {*} props
62
+   * @returns
63
+   */
64
+
65
+  const columns = [
66
+    {
67
+      title: '样例名',
68
+      dataIndex: 'sampleName',
69
+      key: 'sampleName',
70
+      align: 'center',
71
+    },
72
+    {
73
+      title: '下单人',
74
+      dataIndex: 'orderer',
75
+      key: 'orderer',
76
+      align: 'center',
77
+      
78
+    },
79
+    {
80
+      title: '联系方式',
81
+      dataIndex: 'phone',
82
+      key: 'phone',
83
+      align: 'center',
84
+    },
85
+    {
86
+      title: '下单时间',
87
+      dataIndex: 'createDate',
88
+      key: 'createDate',
89
+      align: 'center',
90
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>
91
+    },
92
+    {
93
+      title: '需求单状态',
94
+      dataIndex: 'demandStatus',
95
+      key: 'demandStatus',
96
+      align: 'center',
97
+      render: (text, records) => {
98
+        if (records.demandStatus === 1) { return '已提交' }
99
+        if (records.demandStatus === 2) { return '处理中' }
100
+        if (records.demandStatus === 3) { return '已交付' }
101
+        if (records.demandStatus === 4) { return '作废' }
102
+      },
103
+    },
104
+    {
105
+      title: '操作',
106
+      dataIndex: 'handle',
107
+      key: 'handle',
108
+      align: 'center',
109
+      render: (text, record) => (
110
+        <AuthButton name="admin.h5Demand.detail.get" noRight={null}>
111
+          <a style={{ color: '#66B3FF' }} onClick={toDetail(record)} >查看详情</a>
112
+        </AuthButton>
113
+      ),
114
+    },
115
+  ];
116
+  
117
+  const rowSelection = {
118
+    onChange: (selectedRowKeys, selectedRows) => {
119
+      console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
120
+      setDemandIds(selectedRows)
121
+    },
122
+  };
123
+
124
+  const changePageNum = pageNumber => {
125
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
126
+  }
127
+
128
+  // 提交事件
129
+  const handleSubmit = (e, props) => {
130
+    e.preventDefault();
131
+    props.form.validateFields((err, values) => {
132
+      if (!err) {
133
+        
134
+        if (values.startCreateDate != null){
135
+          values.startCreateDate = moment(values.startCreateDate).format('YYYY-MM-DD HH:mm:ss')
136
+        }
137
+        if (values.endCreateDate != null){
138
+          values.endCreateDate = moment(values.endCreateDate).format('YYYY-MM-DD HH:mm:ss')
139
+        }
140
+        getList({ pageNum: 1, pageSize: 10, ...values })
141
+      }
142
+    });
143
+  }
144
+
145
+  //重置搜索
146
+  function handleReset () {
147
+    props.form.resetFields();
148
+    getList({ pageNum: 1, pageSize: 10 })
149
+  }
150
+
151
+  function showBatchDel(e){
152
+  
153
+    if (demandIds.length <= 0){
154
+      message.info("请选择数据");
155
+      return;
156
+    }
157
+    setBatchDel(e);
158
+    if(!e.visable){
159
+      getList()
160
+    }
161
+  }
162
+
163
+  function addDemandInfo(e){
164
+    setAddDemand(e);
165
+  }
166
+
167
+  const { getFieldDecorator } = props.form
168
+  return (
169
+
170
+    <>
171
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
172
+        <Form.Item>
173
+          {getFieldDecorator('sampleName',{
174
+            initialValue: sampleName
175
+          })(
176
+            <Input
177
+            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
178
+            placeholder="样例名"
179
+          />,
180
+          )}
181
+        </Form.Item>
182
+        <Form.Item>
183
+          {getFieldDecorator('orderer')(
184
+            <Input
185
+            prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
186
+            placeholder="下单人"
187
+          />,
188
+          )}
189
+        </Form.Item>
190
+        <Form.Item>
191
+          {getFieldDecorator('phone')(
192
+            <Input
193
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
194
+              placeholder="联系方式"
195
+            />,
196
+          )}
197
+        </Form.Item>
198
+        <Form.Item>
199
+          {getFieldDecorator('startCreateDate')(
200
+            <DatePicker showTime={{ format: 'HH:mm:ss' }} placeholder="下单时间开始时间"/>,
201
+          )}
202
+        </Form.Item>
203
+        <Form.Item>
204
+          {getFieldDecorator('endCreateDate')(
205
+            <DatePicker showTime={{ format: 'HH:mm:ss' }} placeholder="下单时间结束时间"/>,
206
+          )}
207
+        </Form.Item>  
208
+        <Form.Item>
209
+          {getFieldDecorator('demandStatus')(
210
+            <Select style={{ width: '180px' }} placeholder="需求单状态">
211
+                <option value="">全部</option>
212
+                <option value="1">已提交</option>
213
+                <option value="2">处理中</option>
214
+                <option value="3">已交付</option>
215
+                <option value="4">作废</option>
216
+            </Select>
217
+          )}
218
+        </Form.Item>
219
+        <Form.Item>
220
+            <AuthButton name="admin.taShareActivity.search" noRight={null}>
221
+                <Button type="primary" htmlType="submit" className={styles.searchBtn}>
222
+                    搜索
223
+                </Button>
224
+            </AuthButton>
225
+            <AuthButton name="admin.taShareActivity.search" noRight={null}>
226
+                <Button style={{ marginLeft: 8 }} onClick={handleReset}>
227
+                        重置
228
+                </Button>
229
+            </AuthButton>
230
+        </Form.Item>
231
+      </Form>
232
+      <AuthButton name="admin.h5Demand.add.post" noRight={null}>
233
+        <Button type="danger" onClick={() => addDemandInfo({visable:true})} className={styles.addBtn}>新增</Button>
234
+      </AuthButton>
235
+      <AuthButton name="admin.h5Demand.del" noRight={null}>
236
+        <Button type="primary" onClick={() => showBatchDel({visable:true, demandIds: demandIds})} className={styles.addBtn} style={{marginLeft:'30px'}}>删除</Button>
237
+      </AuthButton>
238
+      <AddDemand visible={addDemand.visable} onCancel={() => addDemandInfo({visable:false})}></AddDemand>
239
+      <BatchDel visible={batchDel.visable} demandIds={batchDel.demandIds} onCancel={() => showBatchDel({visable:false, demandIds: ''})} onSuccess={() => showBatchDel({visable:false, demandIds:'' })}/>
240
+      <Table rowSelection={rowSelection}
241
+        style={{marginTop:'30px'}} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
242
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
243
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
244
+      </div>
245
+    </>
246
+  )
247
+}
248
+const WrappedHeader = Form.create({ name: 'header' })(header);
249
+
250
+export default WrappedHeader

+ 111
- 0
src/pages/h5SampleManager/h5Sample/add.jsx Dosyayı Görüntüle

@@ -0,0 +1,111 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, InputNumber, Checkbox, Row, Col} from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import XForm, { FieldTypes } from '../../../components/XForm';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import apis from '../../../services/apis';
8
+import request from '../../../utils/request';
9
+import AuthButton from '@/components/AuthButton';
10
+import Wangedit from '../../../components/Wangedit/Wangedit'
11
+import TextArea from 'antd/lib/input/TextArea';
12
+
13
+const { Option } = Select;
14
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15
+
16
+
17
+const header = props => {
18
+  const sampleId  = props.location.query.id;
19
+  const sampleName  = props.location.query.sampleName;
20
+  const [sampleData, setSampleData] = useState({})
21
+
22
+//   useEffect(() => {
23
+//     getSampleData(sampleId);
24
+//   },[])
25
+
26
+//   // 查询列表
27
+//   const getSampleData = (demandId) => {
28
+//       request({ ...apis.taH5SampleManager.taH5DemandById, urlData: {id: demandId} }).then((data) => {
29
+//           setDemandData(data)
30
+//           props.form.setFieldsValue(data)
31
+//       })
32
+//   }
33
+
34
+  // 跳转到编辑
35
+  const toDetail = rowData => () => {
36
+    if(rowData) {
37
+      router.push({
38
+      pathname: '/h5SampleManager/h5Demand/edit',
39
+      query: {
40
+        id: demandId,
41
+      },
42
+    });
43
+      return
44
+    }
45
+  }
46
+
47
+  function handleSubmit (e) {
48
+    e.preventDefault();
49
+    props.form.validateFields((err, values) => {
50
+      if (!err){
51
+        values.sampleId = sampleId
52
+        values.sampleName = sampleName
53
+        request({ ...apis.taH5SampleManager.addTaH5Demand, data: { ...values },}).then((data) => {
54
+          message.info("保存成功")
55
+          router.go(-1);
56
+        }).catch((err) => {
57
+          message.info(err.msg || err.message)
58
+        })
59
+      }
60
+    });
61
+  }
62
+
63
+  const { getFieldDecorator } = props.form;
64
+
65
+  return (
66
+    <>
67
+      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
68
+        <Form.Item label="样例名">
69
+          {/* {getFieldDecorator('sampleName')(<Input disabled={true}/>)} */}
70
+          <span>{sampleName}</span>
71
+        </Form.Item>
72
+        <Form.Item label="下单人">
73
+          {getFieldDecorator('orderer',{
74
+          rules: [
75
+            {
76
+              required: true,
77
+              message: '请填写下单人',
78
+            },
79
+          ],
80
+        })(<Input maxLength={20}/>)}
81
+        </Form.Item>
82
+        <Form.Item label="联系方式">
83
+          {getFieldDecorator('phone',{
84
+          rules: [
85
+            {
86
+              required: true,
87
+              message: '请填写正确的联系方式',
88
+              // max:11,
89
+              // min:11,
90
+              pattern: new RegExp('^1[0-9]{10}$'),
91
+            },
92
+          ],
93
+        })(<Input/>)}
94
+        </Form.Item>
95
+        <Form.Item label="需求描述">
96
+          <span style={{color:'rgba(0, 0, 0, 0.45)', fontSize:'14px'}}>请在下方填写定制化内容,如替换样例中的企业名称、logo文案等,如暂不确定,可先不填,提交后可在H5需求单详情中继续修改</span>
97
+          {getFieldDecorator('demandContent')(<Wangedit />)}
98
+        </Form.Item>
99
+        <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
100
+            <Button type="primary" htmlType="submit">保存</Button>
101
+            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
102
+            <Button onClick={() => router.go(-1)}>取消</Button>
103
+         </Form.Item>
104
+      </Form>
105
+    </>
106
+  )
107
+}
108
+
109
+const WrappedHeader = Form.create({ name: 'header' })(header);
110
+
111
+export default WrappedHeader

+ 258
- 0
src/pages/h5SampleManager/h5Sample/components/ContactInfo.jsx Dosyayı Görüntüle

@@ -0,0 +1,258 @@
1
+import React, { useEffect, useState } from 'react'
2
+import { Button, Radio, Icon, Form, Input, Row, Col, Modal, notification, Checkbox, Select, InputNumber } from 'antd';
3
+import { render } from 'react-dom';
4
+import request from '../../../../utils/request';
5
+import apis from '../../../../services/apis';
6
+import styles from './style.less';
7
+import cardImg from '../../../../assets/card.png';
8
+import girlImg from '../../../../assets/girl.png';
9
+import boyImg from '../../../../assets/boy.png';
10
+
11
+
12
+const formItemLayout = {
13
+  labelCol: {
14
+    xs: { span: 24 },
15
+    sm: { span: 3 },
16
+  },
17
+  wrapperCol: {
18
+    xs: { span: 24 },
19
+    sm: { span: 16 },
20
+  },
21
+};
22
+
23
+/**
24
+ * 项目类型 form 表单子组件
25
+ *
26
+ * @param {*} props
27
+ */
28
+class TypeForm extends React.Component {
29
+
30
+  componentDidMount() {
31
+    console.log(this.props.type, 'this.props.type')
32
+    this.props.form.setFieldsValue(this.props.type)
33
+  }
34
+
35
+  onChange(e, name) {
36
+    // console.log(e)
37
+    this.props.form.validateFieldsAndScroll((err, values) => {
38
+      if (!err) {
39
+        this.props.onSuccess(values)
40
+      }
41
+    });
42
+  }
43
+
44
+  close() {
45
+    this.props.onClose(this.props.form.getFieldsValue(['buildingTypeId']))
46
+  }
47
+
48
+  render() {
49
+    const { getFieldDecorator } = this.props.form;
50
+
51
+    return (
52
+      <>
53
+        <Col span={24} className={styles.card} >
54
+          <Form {...formItemLayout} style={{ padding: '30px 26px' }}>
55
+            <div className={styles.flexItem}>
56
+              <img src={this.props.type.avatar} height="50px" width="50px" style={{ borderRadius: '50%', margin: ' 0 7px 0 10px' }} /><span>{this.props.type.contactName}</span>
57
+            </div>
58
+            <div className={styles.flexItem} style={{ justifyContent: 'space-between' }}>
59
+              <div>
60
+                {this.props.type.sex != '' && this.props.type.sex != null && <div className={styles.flexItem}>
61
+                  <div className={styles.left}> 性别 </div>
62
+                  <div className={styles.right} style={{ display: 'flex', alignItems: 'center' }}>{this.props.type.sex == '1' ? '男' : '女'}<img src={this.props.type.sex == '1' ? boyImg : girlImg} height="16px" width="16px" style={{ marginLeft: '5px' }} /></div>
63
+                </div>}
64
+                {this.props.type.appellation != '' && this.props.type.appellation != null && <div className={styles.flexItem}>
65
+                  <div className={styles.left}><img src={cardImg} height="18px" width="24px" /></div>
66
+                  <div className={styles.right}>{this.props.type.appellation}</div>
67
+                </div>}
68
+                {this.props.type.telephone != '' && this.props.type.telephone != null && <div className={styles.flexItem}>
69
+                  <div className={styles.left}> 固话 </div>
70
+                  <div className={styles.right}>{this.props.type.telephone}</div>
71
+                </div>}
72
+                {this.props.type.phone != '' && this.props.type.phone != null && <div className={styles.flexItem}>
73
+                  <div className={styles.left}> 手机 </div>
74
+                  <div className={styles.right}>{this.props.type.phone}</div>
75
+                </div>}
76
+                {this.props.type.mail != '' && this.props.type.mail != null && <div className={styles.flexItem}>
77
+                  <div className={styles.left}> 邮箱 </div>
78
+                  <div className={styles.right}>{this.props.type.mail}</div>
79
+                </div>}
80
+                {this.props.type.address != '' && this.props.type.address != null && <div className={styles.flexItem}>
81
+                  <div className={styles.left}> 联系地址 </div>
82
+                  <div className={styles.right}>{this.props.type.address}</div>
83
+                </div>}
84
+              </div>
85
+              {this.props.type.wxCardImg != null && this.props.type.wxCardImg != '' &&
86
+              <div style={{ textAlign: 'center' }}>
87
+                <img src={this.props.type.wxCardImg} height="80px" width="80px" />
88
+                <p style={{ margin: ' 0px', fontSize: '0.096rem', color: '#666' }}>扫码添加微信好友</p>
89
+                <p sstyle={{ margin: ' 0px', fontSize: '0.096rem', color: '#666' }}>备注H5活动咨询</p>
90
+              </div>}
91
+            </div>
92
+          </Form>
93
+        </Col>
94
+      </>
95
+    )
96
+  }
97
+}
98
+
99
+const WrappedTypeForm = Form.create({ name: 'TypeForm' })(TypeForm);
100
+
101
+/**
102
+ *项目类型组件
103
+ *
104
+ * @param {*} props
105
+ */
106
+class ProjectTypeBody extends React.Component {
107
+
108
+  constructor(props) {
109
+    super(props)
110
+    this.state = {
111
+      one: false,
112
+      projectType: [],
113
+      defaultCheckboxValue: [], // 多选框默认选中的值
114
+      visible: true,
115
+      data: [],
116
+      sampleId: props.sampleId,
117
+      // data: [{ buildingTypeId: '1', buildingTypeName: '公寓', price: '10', decoration: '全包', rightsYear: '10', status: '1' }, { buildingTypeId: '2', buildingTypeName: '住宅', price: '10', decoration: '全包', rightsYear: '10', status: '1' }, { buildingTypeId: '3', buildingTypeName: '太平房', price: '10', decoration: '全包', rightsYear: '10', status: '1' }],
118
+    }
119
+  }
120
+
121
+  componentDidMount() {
122
+    this.getList({ pageNum: 1, pageSize: 999 })
123
+  }
124
+
125
+  componentDidUpdate(prevProps) {
126
+    // 典型用法(不要忘记比较 props):
127
+    if (this.props.value !== prevProps.data && !this.state.one) {
128
+      this.setValue()
129
+      this.setState({ one: true })
130
+    }
131
+  }
132
+
133
+  onSuccess = (values, item) => {
134
+    const newData = this.getNewProjectType(values)
135
+    this.setState({ data: newData })
136
+    if (typeof this.props.onChange === 'function') {
137
+      this.props.onChange(newData)
138
+    }
139
+  }
140
+
141
+  onCheckboxChange = checkedValues => {
142
+    const checked = (`${checkedValues}` || '').split(',')
143
+    const { projectType } = this.state
144
+    const buildingType = projectType.filter(item => checked.includes(`${item.buildingTypeId}`))
145
+
146
+    const tempDate = buildingType.map(item => ({ buildingTypeId: item.buildingTypeId, buildingTypeName: item.buildingTypeName, startPrice: null, endPrice: null, priceType: "average", decoration: null, rightsYear: null, status: '1' }))
147
+    const updateProjectDate = this.updateProjectType(tempDate)
148
+    console.log('updateProjectDate: ', updateProjectDate)
149
+    this.setState({ data: updateProjectDate })
150
+    this.setState({ defaultCheckboxValue: updateProjectDate.map(item => item.buildingTypeId) })
151
+  }
152
+
153
+  onClose = e => {
154
+    console.log(2)
155
+    const { data } = this.state
156
+    console.log('onClose——data: ', data)
157
+    console.log('onClose: ', e.buildingTypeId)
158
+    const buildingType = data.filter(item => e.buildingTypeId !== item.buildingTypeId)
159
+    console.log('onClose——data111: ', buildingType)
160
+    this.setState({ data: buildingType })
161
+    this.setState({ defaultCheckboxValue: buildingType.map(item => item.buildingTypeId) })
162
+    if (typeof this.props.onChange === 'function') {
163
+      this.props.onChange(buildingType)
164
+    }
165
+  }
166
+
167
+  getNewProjectType = values => {
168
+    const data = []
169
+    this.state.data.map(item => {
170
+      if (item.buildingTypeId === values.buildingTypeId) {
171
+        data.push(values)
172
+      } else {
173
+        data.push(item)
174
+      }
175
+    })
176
+    console.log('getNewProjectType', getNewProjectType)
177
+    return data
178
+  }
179
+
180
+  updateProjectType = values => {
181
+    // 获取所有复选框选中的id
182
+    const valueIdArray = values.map(item => item.buildingTypeId)
183
+    // console.log('valueIdArray: ', valueIdArray)
184
+
185
+    // 获取 data 中已经赋值的数据  交集
186
+    const valueData = this.state.data.filter(item => valueIdArray.includes(item.buildingTypeId))
187
+    // console.log('valueData: ', valueData)
188
+
189
+    // 获取 非 data中数据(也就是没有赋值),交集
190
+    const trueValueArr = valueData.map(item => item.buildingTypeId)
191
+    const trueValueData = values.filter(item => !trueValueArr.includes(item.buildingTypeId))
192
+
193
+    // console.log('trueValueData: ', trueValueData)
194
+
195
+    // 把两个 数组的值,合并返回
196
+    return valueData.concat(trueValueData)
197
+  }
198
+
199
+  getList = params => {
200
+    request({ ...apis.taH5SampleManager.taContactList, urlData: { id: this.state.sampleId } }).then(res => {
201
+      this.setState({ data: res.records })
202
+      console.log(this.state.data, 'data');
203
+    }).catch(err => {
204
+      this.openNotificationWithIcon('error', err.message)
205
+    })
206
+  }
207
+
208
+  setValue = () => {
209
+    let tempData = []
210
+    let tempCheckboxValue = []
211
+    const { value } = this.props
212
+    // console.log('value: ', value)
213
+    if (value !== undefined && value !== null) {
214
+      tempData = value
215
+      tempCheckboxValue = tempData.map(item => item.buildingTypeId)
216
+      this.setState({ defaultCheckboxValue: tempCheckboxValue })
217
+      this.setState({ data: tempData })
218
+    }
219
+  }
220
+
221
+  openNotificationWithIcon = (type, message) => {
222
+    notification[type]({
223
+      message,
224
+      description: '',
225
+    })
226
+  }
227
+
228
+  handleOk = e => {
229
+    this.setState({
230
+      visible: false,
231
+    });
232
+  };
233
+
234
+  handleCancel = e => {
235
+    this.setState({
236
+      visible: false,
237
+    });
238
+  };
239
+
240
+  showMadel = () => {
241
+    this.setState({ visible: true })
242
+    this.getList({ pageNum: 1, pageSize: 999 })
243
+  }
244
+
245
+  render() {
246
+    return (
247
+      <>
248
+        <Row type="flex" justify="space-between">
249
+          {
250
+            this.state.data.map(item => <WrappedTypeForm type={item} key={item.buildingTypeId} onSuccess={(e) => this.onSuccess(e, item)} onClose={(e) => this.onClose(e)} />)
251
+          }
252
+        </Row>
253
+      </>
254
+    )
255
+  }
256
+}
257
+
258
+export default ProjectTypeBody

+ 26
- 0
src/pages/h5SampleManager/h5Sample/components/style.less Dosyayı Görüntüle

@@ -0,0 +1,26 @@
1
+.card{
2
+    position: relative;
3
+    border: 1px solid #eee;
4
+    margin-top: 16px;
5
+    min-width: 480px;
6
+    box-shadow: 0px 0px 10px 4px rgba(0;0;0;0.12);
7
+    border-radius: 6px;
8
+   
9
+    .flexItem{
10
+        display: flex;
11
+        align-items: center;
12
+        .left{
13
+            font-size: 0.096rem;
14
+            color: #666;
15
+            width: 0.4rem;
16
+            text-align: right;
17
+            line-height: 0.2rem;
18
+            margin-right: 0.2rem;
19
+        }
20
+        .right{
21
+            font-size: 0.1rem;
22
+            color: #333;
23
+            text-align: right;
24
+        }
25
+    }
26
+}

+ 140
- 0
src/pages/h5SampleManager/h5Sample/detail.jsx Dosyayı Görüntüle

@@ -0,0 +1,140 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, InputNumber, Checkbox, Row, Col } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import XForm, { FieldTypes } from '../../../components/XForm';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+import apis from '../../../services/apis';
8
+import request from '../../../utils/request';
9
+import AuthButton from '@/components/AuthButton';
10
+import Wangedit from '../../../components/Wangedit/Wangedit'
11
+import DragableUploadImageList from './components/ContactInfo'
12
+import TextArea from 'antd/lib/input/TextArea';
13
+import copy from 'copy-to-clipboard';
14
+import copyImg from '../../../assets/copy.png';
15
+
16
+const { Option } = Select;
17
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
18
+
19
+
20
+const header = props => {
21
+  const sampleId = props.location.query.id;
22
+  const [demandData, setDemandData] = useState({})
23
+  const [demandNum, setDemandNum] = useState()
24
+
25
+  useEffect(() => {
26
+    getDemandData(sampleId);
27
+  }, [])
28
+
29
+  // 查询列表
30
+  const getDemandData = (demandId) => {
31
+    request({ ...apis.taH5SampleManager.taH5SampleById, urlData: { id: sampleId } }).then((data) => {
32
+      setDemandData(data)
33
+      setDemandNum(data.demandNum)
34
+      props.form.setFieldsValue(data)
35
+    })
36
+  }
37
+
38
+  // 跳转到编辑
39
+  const toDetail = rowData => () => {
40
+
41
+    request({ ...apis.taH5SampleManager.taH5SampleById, urlData: { id: sampleId } }).then((data) => {
42
+      if (rowData) {
43
+        router.push({
44
+          pathname: '/h5SampleManager/h5Sample/add',
45
+          query: {
46
+            id: sampleId,
47
+            sampleName: demandData.sampleName
48
+          },
49
+        });
50
+        return
51
+      }
52
+    }).catch(err => {
53
+      message.info("该H5样例已取消发布或已删除")
54
+    })
55
+
56
+    
57
+  }
58
+  const toCancel = () => {
59
+    router.go(-1)
60
+  }
61
+
62
+  function viewDemand() {
63
+    router.push({
64
+      pathname: '/h5SampleManager/h5Demand/list',
65
+      query: {
66
+        id: sampleId,
67
+        sampleName: demandData.sampleName,
68
+      },
69
+    });
70
+  }
71
+
72
+  //打开新页面
73
+  const copyLink = (e) => {
74
+    copy(e)
75
+    message.info('复制成功')
76
+  }
77
+
78
+  function handleSubmit(e) {
79
+  }
80
+
81
+  function newTab(e) {
82
+    console.log(e, 'eeeeeeee')
83
+    const newWin = window.open('about:blank');
84
+    newWin.location.href = e
85
+  }
86
+
87
+  const { getFieldDecorator } = props.form;
88
+
89
+  return (
90
+    <>
91
+      <Form labelCol={{ span: 6 }} wrapperCol={{ span: 14 }} style={{ position: 'relative' }} onSubmit={handleSubmit}>
92
+        <Form.Item label="样例名">
93
+          <span>{demandData.sampleName}</span>
94
+        </Form.Item>
95
+        {demandData.sampleTryLink != '' && demandData.sampleTryLink != null && <Form.Item label="样例体验链接" help="请复制发送到手机,用手机微信打开,PC端打开样式比例与手机端不同,以手机端为准">
96
+          <span>{demandData.sampleTryLink}</span><span style={{ marginLeft: '10px' }}><a onClick={(e) => copyLink(demandData.sampleTryLink)} style={{ color: 'orange' }}> <img src={copyImg} height="16px" width="14px" /> 复制链接</a></span>
97
+        </Form.Item>}
98
+        {demandData.sampleTryCode != '' && demandData.sampleTryCode != null && <Form.Item label="样例体验小程序码/二维码" help="请使用微信扫码查看样例体验">
99
+          <img src={demandData.sampleTryCode} height="100px" width="120px" />
100
+        </Form.Item>}
101
+        {demandData.taContactList != null && demandData.taContactList != '' && <Form.Item label="联系人">
102
+          <span style={{ color: 'rgba(0, 0, 0, 0.45)', fontSize: '14px' }}>若您想在您的小程序举办类似活动,请联系以下联系人咨询,或直接点击底部的 提交需求 按钮下单,下单后与联系人沟通定制活动</span>
103
+          <DragableUploadImageList sampleId={sampleId}></DragableUploadImageList>
104
+        </Form.Item>}
105
+        <Form.Item label="样例内容">
106
+          {demandData.sampleType === 'link' && <div><span style={{ color: 'rgba(0, 0, 0, 0.45)', fontSize: '14px' }}>点击链接查看内容</span><br/></div>}
107
+          {demandData.sampleType === 'rich' ? getFieldDecorator('sampleContent')(<div dangerouslySetInnerHTML={{ __html: demandData.sampleContent}}></div>) : getFieldDecorator('sampleContentLink')(<a style={{ color: "blue" }} href={demandData.sampleContentLink} target="_blank" >{demandData.sampleContentLink}</a>)}
108
+        </Form.Item>
109
+        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
110
+          <div style={{ margin: '0.16rem 0 0.06rem' }}>
111
+            <Button type="primary" onClick={toDetail(sampleId)} style={{ marginRight: '20px' }}>
112
+              提交需求
113
+          </Button>
114
+            <Button danger onClick={() => toCancel()} style={{ marginLeft: '20px' }}>
115
+              取消
116
+          </Button>
117
+          </div>
118
+        </Form.Item>
119
+        <div style={{ position: 'fixed', right: '0.4rem', bottom: '6%' }}>
120
+          <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between' }}>我想办类似活动 <span style={{ color: '#EF273A', margin: '0 0.1rem' }}>>></span>
121
+            <Button type="primary" onClick={toDetail(sampleId)} >
122
+              提交需求
123
+              </Button>
124
+          </div>
125
+
126
+          {demandNum != 0 && <div style={{ display: 'flex', alignItems: 'center', minWidth: '1.1rem', justifyContent: 'space-between', marginTop: '10px' }}>已有{demandNum + '个'}需求单 <span style={{ margin: '0 0.1rem' }}>>></span>
127
+            <Button danger onClick={() => viewDemand()}>
128
+              查看需求
129
+            </Button>
130
+          </div>
131
+          }
132
+        </div>
133
+      </Form>
134
+    </>
135
+  )
136
+}
137
+
138
+const WrappedHeader = Form.create({ name: 'header' })(header);
139
+
140
+export default WrappedHeader

+ 198
- 0
src/pages/h5SampleManager/h5Sample/list.jsx Dosyayı Görüntüle

@@ -0,0 +1,198 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, message, Col, Pagination, Alert, notification, Modal } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import Styles from './style.less';
7
+import { router } from 'umi';
8
+import AuthButton from '@/components/AuthButton';
9
+import SelectCity from '../../../components/SelectButton/CitySelect'
10
+
11
+
12
+const { Option } = Select;
13
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
14
+const { Meta } = Card;
15
+
16
+const tempDate = [{ code: 's101' }]
17
+
18
+function openNotificationWithIcon(type, message) {
19
+  notification[type]({
20
+    message,
21
+    description:
22
+      '',
23
+  });
24
+}
25
+
26
+/**
27
+ *卡片
28
+ *
29
+ * @returns
30
+ */
31
+function CartBody(props) {
32
+  const { data } = props
33
+
34
+  function toEdi(record) {
35
+    router.push({
36
+      pathname: '/h5SampleManager/h5Sample/detail',
37
+      query: {
38
+        id: record.sampleId,
39
+      },
40
+    })
41
+  }
42
+  const tagList = data.tag.split(',')
43
+
44
+  // src={((data.buildingImg && data.buildingImg[0]) || {}).url}background: `url(${item.caseCoverImg})` style={{ background: `url(((data.buildingImg && data.buildingImg[0]) || {}).url)` }}
45
+  const { buildingImg } = data
46
+  console.log("buildingImg1: ", data.coverImg)
47
+  return (
48
+    <Card
49
+      hoverable
50
+      onClick={() => toEdi(data)}
51
+      style={{ minWidth: '330px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
52
+    // cover={}
53
+    // bodyStyle={{ padding: '10px 20px' }}
54
+    >
55
+      {/* 因为 background 方式设置图片背景,如果 图片url 存在空格或者其他特殊字符,导致显示不出来,需要进行 encodeURI(xxx) 转码 */}
56
+      {tagList.length > 0 && <div className={Styles.recommderTagBox}>
57
+        {tagList.map((tag, index) =>
58
+          <span key={index + 'tag'} style={index % 2 == 0 ? { background: '#4886FF' } : { background: '#34BD28' }} className={Styles.recommderTag}>{tag}</span>
59
+        )}
60
+      </div>
61
+
62
+      }
63
+      <img className={Styles.cover} style={{ backgroundImage: `url('` + data.coverImg + `')` }}   ></img>
64
+      <p className={Styles.cardText} style={{ padding: '0.05rem 0.096rem' }}>
65
+        {/* <span className={Styles.title}>样例名</span> */}
66
+        <span style={{ textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }}>{data.sampleName}</span>
67
+      </p>
68
+    </Card>
69
+  )
70
+}
71
+
72
+/**
73
+ *
74
+ *
75
+ * @param {*} props
76
+ * @returns
77
+ */
78
+function body(props) {
79
+  const { getFieldDecorator } = props.form
80
+
81
+  // eslint-disable-next-line react-hooks/rules-of-hooks
82
+  const [dataSource, setDataSource] = useState({ records: [], size: 0 })
83
+
84
+  // eslint-disable-next-line react-hooks/rules-of-hooks
85
+  useEffect(() => {
86
+    getList({ pageNum: 1, pageSize: 9 })
87
+  }, [])
88
+
89
+  function getList(params) {
90
+    // 网路请求
91
+    request({ ...apis.taH5SampleManager.taH5Sample, params: { ...params } }).then(res => {
92
+      setDataSource(res)
93
+      console.log("res:", res)
94
+    }).catch(err => {
95
+      // eslint-disable-next-line no-unused-expressions
96
+      <Alert
97
+        style={{
98
+          marginBottom: 24,
99
+        }}
100
+        message={err}
101
+        type="error"
102
+        showIcon
103
+      />
104
+    })
105
+  }
106
+
107
+  // 提交事件
108
+  function handleSubmit(e) {
109
+    e.preventDefault();
110
+    props.form.validateFields((err, values) => {
111
+      if (!err) {
112
+        // eslint-disable-next-line no-console
113
+        console.log('提交数据: ', values)
114
+        const { startDate } = values
115
+        if (values.startDate !== undefined) {
116
+
117
+          values.startDate = `${moment(startDate).format('YYYY-MM-DDT00:00:00.000')}Z`
118
+        }
119
+        getList({ pageNum: 1, pageSize: 9, ...values })
120
+      }
121
+    });
122
+  }
123
+
124
+  // Change 事件
125
+  function handleSelectChange(e) {
126
+    // eslint-disable-next-line no-console
127
+    console.log(e)
128
+  }
129
+
130
+  // 分页
131
+  function onChange(pageNumber) {
132
+    // eslint-disable-next-line react-hooks/rules-of-hooks
133
+    getList({ pageNum: pageNumber, pageSize: 9, ...props.form.getFieldsValue() })
134
+  }
135
+
136
+
137
+  /**
138
+   * 重置搜索
139
+   */
140
+  function handleReset() {
141
+    props.form.resetFields();
142
+    getList({ pageNum: 1, pageSize: 9 })
143
+  }
144
+
145
+  function onSuccess() {
146
+    getList({ pageNum: 1, pageSize: 9 })
147
+  }
148
+
149
+
150
+  return (
151
+    <>
152
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
153
+        <Form.Item>
154
+          {getFieldDecorator('sampleName')(
155
+            <Input
156
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
157
+              placeholder="样例名"
158
+            />,
159
+          )}
160
+        </Form.Item>
161
+        <Form.Item>
162
+          {getFieldDecorator('tag')(
163
+            <Input
164
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
165
+              placeholder="标签"
166
+            />,
167
+          )}
168
+        </Form.Item>
169
+        <Form.Item>
170
+          <Button type="primary" htmlType="submit">
171
+            搜索
172
+            </Button>
173
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
174
+            重置
175
+            </Button>
176
+        </Form.Item>
177
+      </Form>
178
+
179
+      {/* 卡片内容,显示楼盘项目  */}
180
+      <Row style={{ padding: ' 0 10px' }}>
181
+        {
182
+          dataSource.records.map((item, _) => (
183
+            <Col span={8}>
184
+              <CartBody data={item} key={item.buildingId} onSuccess={() => onSuccess()} />
185
+            </Col>
186
+          ))
187
+        }
188
+      </Row>
189
+      {/* 分页 */}
190
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
191
+        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} pageSize={dataSource.size} />
192
+      </div>
193
+    </>
194
+  );
195
+}
196
+const WrappedBody = Form.create({ name: 'body' })(body);
197
+
198
+export default WrappedBody

+ 56
- 0
src/pages/h5SampleManager/h5Sample/style.css Dosyayı Görüntüle

@@ -0,0 +1,56 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  border-radius: 4px;
14
+  border: 0px;
15
+  margin: 10px 0px;
16
+}
17
+.cardText {
18
+  font-size: 0.106rem;
19
+  color: #333;
20
+  line-height: 1.5;
21
+  display: flex;
22
+  align-items: center;
23
+  position: relative;
24
+  margin-bottom: 0.08rem;
25
+}
26
+.cardItem {
27
+  font-size: 0.106rem;
28
+  font-weight: 400;
29
+  color: #666;
30
+  display: flex;
31
+  align-items: center;
32
+  line-height: 1.5;
33
+  font-size: 0.106rem;
34
+  margin-bottom: 0.08rem;
35
+
36
+}
37
+.ediText {
38
+  font-size: 0.106rem;
39
+  color: #ff925c;
40
+  position: absolute;
41
+  right: 0;
42
+}
43
+.title {
44
+  display: inline-block;
45
+  width: 0.54rem;
46
+  justify-content: space-between;
47
+  text-align: justify;
48
+  text-align-last: justify;
49
+}
50
+.address {
51
+  width: 400px;
52
+  height: 24px;
53
+  text-overflow: ellipsis;
54
+  white-space: nowrap;
55
+  overflow: hidden;
56
+}

+ 338
- 0
src/pages/h5SampleManager/h5Sample/style.less Dosyayı Görüntüle

@@ -0,0 +1,338 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  border-radius: 4px;
14
+  border: 0px;
15
+  margin: 10px 0px;
16
+}
17
+.cardText {
18
+  font-size: 0.096rem;
19
+  color: #333;
20
+  display: flex;
21
+  align-items: center;
22
+  position: relative;
23
+}
24
+
25
+.cardItem{
26
+  font-size: 0.106rem;
27
+  font-weight: 400;
28
+  color: #666;
29
+  display: flex;
30
+  align-items: center;  
31
+  margin-bottom: 0.08rem;
32
+  .title{
33
+    display: inline-block;
34
+    width: 0.58rem;
35
+  
36
+    min-width: 0.58rem;
37
+    justify-content: space-between;
38
+    text-align: justify;
39
+    text-align-last:justify
40
+  }
41
+  
42
+}
43
+// .cardText{
44
+//   font-size: 0.106rem;
45
+//   font-weight: 400;
46
+//   color: #666;
47
+//   display: flex;
48
+//   align-items: center;  
49
+//   margin-bottom: 0.08rem;
50
+//   .title{
51
+//     display: inline-block;
52
+//     width: 0.58rem;
53
+  
54
+//     min-width: 0.58rem;
55
+//     justify-content: space-between;
56
+//     text-align: justify;
57
+//     text-align-last:justify
58
+//   }
59
+  
60
+// }
61
+.ediText {
62
+  font-size: 0.106rem;
63
+  color: #ff925c;
64
+  position: absolute;
65
+  right: 0;
66
+
67
+}
68
+
69
+
70
+.address { 
71
+  width: 400px;
72
+  height: 24px; 
73
+  text-overflow: ellipsis; 
74
+  white-space: nowrap;
75
+  overflow: hidden;
76
+}
77
+.cover{
78
+  width: 100%;
79
+
80
+  padding-bottom: 66.8%;
81
+  background-size: 100% 100% !important;
82
+ 
83
+  border-radius: 12px 12px 0 0;
84
+  
85
+    // height: '14vw';
86
+}
87
+.recommderTagBox{
88
+  position: absolute;
89
+  width: 100%;
90
+  bottom: 0.33rem;
91
+  text-align: right;
92
+
93
+}
94
+.recommderTag{
95
+ 
96
+  color: #fff;
97
+  line-height: 0.13rem;
98
+  // width: 0.4rem;
99
+  background:rgba(52,189,40,1);
100
+  text-align: center;
101
+  border-radius: 4px;
102
+  font-size: 0.09rem;
103
+  display: inline-block;
104
+  margin-left: 0.1rem;
105
+  padding: 0 0.08rem;
106
+  margin-top: 10px;
107
+
108
+}
109
+.SubmitButton {
110
+  background: rgba(239,39,58,1);
111
+  border-radius: 7px;
112
+  border: 0px;
113
+}
114
+.text {
115
+  color: rgba(239,39,58,1);
116
+}
117
+.SelectFrom {
118
+  width: 180px;
119
+  background: #ffffff;
120
+  border-radius: 7px;
121
+  border: 1px solid #dbdbdb;
122
+}
123
+.addButton {
124
+  background: #50be00;
125
+  border-radius: 4px;
126
+  border: 0px;
127
+  margin: 10px 0px;
128
+}
129
+
130
+.cardItem{
131
+  color: #666;
132
+  display: flex;
133
+  align-items: center; 
134
+  line-height: 1.5;
135
+  font-size: 0.106rem;
136
+  margin-bottom: 0.08rem; 
137
+}
138
+.ediText {
139
+  font-size: 0.106rem;
140
+  color: #ff925c;
141
+  line-height: 24px;
142
+  position: absolute;
143
+  right: 0;
144
+}
145
+.title{
146
+  display: inline-block;
147
+  width:  0.54rem;
148
+  justify-content: space-between;
149
+  text-align: justify;
150
+  text-align-last:justify
151
+}
152
+
153
+.address { 
154
+  width: 400px;
155
+  height: 24px; 
156
+  text-overflow: ellipsis; 
157
+  white-space: nowrap;
158
+  overflow: hidden;
159
+}
160
+
161
+.pitchButton { 
162
+  border-color: rgba(255,126,72,1);
163
+  background-color: rgba(255,126,72,1);
164
+  color: rgba(255,255,255,1); 
165
+}
166
+.noButton {
167
+  border-color: rgba(255,126,72,1);
168
+  color: rgba(255,126,72,1);
169
+}
170
+.displayS {
171
+  display: none;
172
+}
173
+
174
+
175
+// 客户详情样式
176
+.cardBox{
177
+  display: flex;
178
+  .leftBox{
179
+    width:1000px;
180
+    min-width:350px;
181
+    height:1000px;
182
+    background:rgba(255,255,255,1);
183
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
184
+    border-radius:8px;
185
+    display: inline-block;
186
+    margin-right: 30px;
187
+    padding: 30px;
188
+    overflow: hidden;
189
+  }
190
+  .rightBox{
191
+    width:865px;
192
+    min-width:342px;
193
+    height:290px;
194
+    background:rgba(255,255,255,1);
195
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
196
+    border-radius:8px;
197
+    display: inline-block;
198
+    margin-right: 30px;
199
+    padding: 30px;
200
+    overflow: hidden;
201
+  }
202
+  .rightBox{
203
+    width:-webkit-fill-available;
204
+    height:315px;
205
+    min-width: 100%;
206
+    background:rgba(255,255,255,1);
207
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
208
+    border-radius:8px;
209
+    display: inline-block;
210
+    padding: 30px;
211
+    overflow: hidden;
212
+    position: relative;
213
+  }
214
+  .rightBoxCentre{
215
+    width:865px;
216
+    height:345px;
217
+    min-width: 60%;
218
+    background:rgba(255,255,255,1);
219
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
220
+    border-radius:8px;
221
+    display: inline-block;
222
+    padding: 30px;
223
+    overflow: hidden;
224
+    position: relative;
225
+  }
226
+  .leftBoxCentre{
227
+    width:100%;
228
+    height:345px;
229
+    background:rgba(255,255,255,1);
230
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
231
+    border-radius:8px;
232
+    display: inline-block;
233
+    padding: 30px;
234
+    overflow: hidden;
235
+    position: relative;
236
+  }
237
+  .tit{
238
+    font-size:0.15rem;
239
+    font-weight:600;
240
+    color:#222;
241
+    margin: 10px 0 0 0;
242
+  }
243
+  .flexBox{
244
+    display: flex;
245
+    align-items: end;
246
+  }
247
+  .touxiang{
248
+    width: 120px;
249
+    width: 120px;
250
+    border-radius: 6px;
251
+    margin: 30px 0 20px 0;
252
+  }
253
+  .touxiangphoto{
254
+    width: 80px;
255
+    height: 80px;
256
+    margin: 38px 0 0px 0;
257
+  }
258
+  .infoItem{
259
+    color:#666;
260
+    font-size: 0.1rem;
261
+    margin: 0 0 30px 0;
262
+    
263
+  }
264
+  .rightItem{
265
+    color:#666;
266
+    font-size: 0.1rem;
267
+    margin: 0 0 15px 0;
268
+  }
269
+  .right{
270
+    width: 25%;
271
+    min-width: 1.3rem;
272
+    margin-left: 0.1rem;
273
+    padding-top: 0.3rem;
274
+    // position: absolute;
275
+    // top:108px;
276
+    // left:170px;
277
+  }
278
+  .rightphone{
279
+  
280
+    position: absolute;
281
+    top:108px;
282
+    left:170px;
283
+  }
284
+  .left{
285
+    position: absolute;
286
+    top:108px;
287
+    left:60%;
288
+  
289
+  }
290
+  .rightInfo{
291
+    width: 25%;
292
+    min-width: 1.3rem;
293
+    margin-right: 0.1rem;
294
+    padding-top: 0.3rem;
295
+    // position: absolute;
296
+    // top:108px;
297
+    // left:80%;
298
+  }
299
+
300
+  .Centered{
301
+    width: 25%;
302
+    // position: absolute;
303
+    // top:108px;
304
+    // left:30%;
305
+    min-width: 1.3rem;
306
+    margin: 0 0 15px 0;
307
+    color:#666;
308
+    font-size: 0.1rem;
309
+    padding-top: 0.3rem;
310
+  }
311
+
312
+  .rightCentered{
313
+    // position: absolute;
314
+    // top:108px;
315
+    // left:55%;
316
+    width: 25%;
317
+    min-width: 1.3rem;
318
+    margin: 0 0 15px 0;
319
+    padding-top: 0.3rem;
320
+    color:#666;
321
+    font-size: 0.1rem;
322
+  }
323
+  
324
+}
325
+.recordBox{
326
+  width:100%;
327
+  background:rgba(255,255,255,1);
328
+  box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
329
+  border-radius:8px;
330
+  margin-top: 30px;
331
+  padding: 30px;
332
+  .tableName{
333
+    font-size:24px;
334
+    font-weight:600;
335
+    color:#222;
336
+  }
337
+}
338
+

+ 53
- 0
src/pages/h5SampleManager/h5Sample/style.wxss Dosyayı Görüntüle

@@ -0,0 +1,53 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.SelectFrom {
7
+  width: 180px;
8
+  background: #ffffff;
9
+  border-radius: 7px;
10
+  border: 1px solid #dbdbdb;
11
+}
12
+.addButton {
13
+  border-radius: 4px;
14
+  border: 0px;
15
+  margin: 10px 0px;
16
+}
17
+.cardText {
18
+  font-size: 0.106rem;
19
+  color: #333;
20
+  line-height: 24px;
21
+  display: flex;
22
+  align-items: center;
23
+  position: relative;
24
+}
25
+.cardItem {
26
+  font-size: 0.106rem;
27
+  font-weight: 400;
28
+  color: #666;
29
+  display: flex;
30
+  align-items: center;
31
+  margin-bottom: 0.08rem;
32
+}
33
+.ediText {
34
+  font-size: 0.106rem;
35
+  color: #ff925c;
36
+  position: absolute;
37
+  right: 0;
38
+  margin-bottom: 0.08rem;
39
+}
40
+.title {
41
+  display: inline-block;
42
+   width: 0.54rem;
43
+  justify-content: space-between;
44
+  text-align: justify;
45
+  text-align-last: justify;
46
+}
47
+.address {
48
+  width: 400px;
49
+  height: 24px;
50
+  text-overflow: ellipsis;
51
+  white-space: nowrap;
52
+  overflow: hidden;
53
+}

+ 123
- 0
src/pages/swiper/index.jsx Dosyayı Görüntüle

@@ -0,0 +1,123 @@
1
+import React, { useState, useRef, Alert } from "react";
2
+import Swiper from 'swiper';
3
+import router from 'umi/router';
4
+import request from '../../utils/request'
5
+import apis from '../../services/apis';
6
+import styles from './style.less'
7
+import closeImg from '../../assets/close.png';
8
+import classNames from 'classnames';
9
+import 'swiper/css/swiper.min.css';
10
+
11
+const storageKey = 'showSwiperIndex';
12
+
13
+class swiper extends React.Component {
14
+    constructor(props) {
15
+        super(props);
16
+        this.state = {
17
+            visible: true,
18
+            bannerList: []
19
+        }
20
+
21
+        this.slider = null
22
+    }
23
+
24
+    componentDidMount() {
25
+        this.getbannerList({ pageNumber: 1, pageSize: 999, type: 'sample' })
26
+
27
+
28
+    }
29
+
30
+
31
+    getbannerList(params) {
32
+
33
+        request({ ...apis.indexEcharts.indexBanner, params: { ...params } }).then(res => {
34
+            this.setState({ bannerList: res.records || [] }, () => {
35
+                const bannerShow = window.localStorage.getItem(storageKey)
36
+
37
+                if (bannerShow) {
38
+                    //swiper初始化
39
+                    const { bannerList } = this.state
40
+                    if (bannerList.length > 1) {
41
+                        this.swiper = new Swiper('.swiper-container', {
42
+                            slidesPerView: 1,
43
+                            loop: true,
44
+                            autoplay: {
45
+                                disableOnInteraction: false,
46
+                            },
47
+                            touchRatio: 1.5,
48
+                            pagination: {
49
+                                el: '.swiper-pagination',
50
+                                bulletElement: 'li',
51
+                                clickable: true,
52
+                                bulletActiveClass: 'antd-pro-pages-swiper-style-active',
53
+                            },
54
+                            observer: true,
55
+                            observeParents: true,
56
+                        })
57
+                    } else {
58
+                        this.swiper = new Swiper('.swiper-container', {
59
+                            loop: false,
60
+                            observer: true,
61
+                            observeParents: true,
62
+                        })
63
+                    }
64
+
65
+                }
66
+            })
67
+        }).catch(err => {
68
+
69
+            <Alert
70
+                style={{
71
+                    marginBottom: 24,
72
+                }}
73
+                message={err}
74
+                type="error"
75
+                showIcon
76
+            />
77
+        })
78
+    }
79
+    handleSwiperItem(item) {
80
+        const aTag = document.createElement('a')
81
+
82
+        aTag.setAttribute('href', `${window.location.origin}${window.location.pathname}#/h5SampleManager/h5Sample/detail?id=${item.targetId}`);
83
+        aTag.setAttribute('target', '_blank')
84
+        document.body.appendChild(aTag)
85
+        aTag.click();
86
+
87
+    }
88
+
89
+    closeSwiper() {
90
+        this.setState({
91
+            visible: false
92
+        })
93
+        window.localStorage.removeItem(storageKey)
94
+    }
95
+    render() {
96
+
97
+        const { visible, bannerList } = this.state
98
+        const showSwiper = window.localStorage.getItem(storageKey)
99
+        return (
100
+            <>
101
+                {bannerList.length > 0 && visible && showSwiper && <div className={styles.mask}>
102
+                    <div className={styles.content}>
103
+                        <img src={closeImg} alt="" className={styles.close} onClick={() => this.closeSwiper()} />
104
+                        <div className={classNames(['swiper-container', styles.carousel])}  >
105
+                            <div className={classNames(['swiper-wrapper', styles.carousel])} >
106
+                                {bannerList.map((item, index) =>
107
+                                    <div key={'swiper' + index} className={classNames(['swiper-slide', styles.carouselItem])} onClick={() => this.handleSwiperItem(item)}>
108
+                                        <img style={{ width: '100%', height: '100%', borderRadius: '10px' }} src={item.noticeImg} alt="" />
109
+                                        <div className={styles.title}>{item.title}</div>
110
+                                    </div>
111
+                                )}
112
+                            </div>
113
+                            <div className={classNames(['swiper-pagination', styles.dots])}  ></div>
114
+                        </div>
115
+                    </div>
116
+                </div>}
117
+            </>
118
+        )
119
+    }
120
+}
121
+
122
+
123
+export default swiper

+ 88
- 0
src/pages/swiper/style.less Dosyayı Görüntüle

@@ -0,0 +1,88 @@
1
+.mask{
2
+    width: 100vw;
3
+    height: 100vh;
4
+    background-color: rgba(0,0,0,0.32);
5
+    position: fixed;
6
+    z-index: 999;
7
+    top: 0;
8
+    left: 0;
9
+}
10
+
11
+.content{
12
+    width: 32vw;
13
+    min-width: 757px;
14
+    height: 21.3vw;
15
+    min-height: 504px;
16
+    position: absolute;
17
+    left: 50%;
18
+    top: 110px;
19
+    transform: translateX(-50%);
20
+    border-radius: 10px;
21
+    .close{
22
+        width: 40px;
23
+        height: 40px;
24
+        position: absolute;
25
+        top: -22px;
26
+        right: -22px;
27
+        z-index: 9;
28
+    }
29
+}
30
+
31
+.dots{
32
+    position: absolute;
33
+    bottom: 11px;
34
+    width: 100%;
35
+    padding: 0;
36
+    margin: 0;
37
+    list-style: none;
38
+    text-align: center;
39
+    li {
40
+        position: relative;
41
+        display: inline-block;
42
+        width: 14px;
43
+        height: 2px;
44
+        margin: 0 3px;
45
+        padding: 0;
46
+        cursor: pointer;
47
+        background: #fff;
48
+        opacity: 0.6;
49
+        &.active{
50
+            width: 16px;
51
+            height: 3px;
52
+            background: #fff;
53
+            opacity: 1;
54
+        }
55
+    }
56
+}
57
+.carousel {
58
+    width: 32vw;
59
+    min-width: 757px;
60
+    height: 21.3vw;
61
+    min-height: 504px;
62
+    border-radius: 10px;
63
+    // overflow: hidden;
64
+    
65
+    .carouselItem{
66
+        width: 32vw;
67
+        min-width: 757px;
68
+        height: 21.3vw;
69
+        min-height: 504px;
70
+        position: relative;
71
+        display: inline-block;
72
+        .title{
73
+            font-size: 0.12rem;
74
+            color: #fff;
75
+            position: absolute;
76
+            display: block;
77
+            width: 100%;
78
+            height: 0.16rem;
79
+            bottom: 30px ;
80
+            padding: 0 40px;
81
+            text-align: center;
82
+            overflow: hidden;
83
+            white-space: nowrap;
84
+            text-overflow: ellipsis;
85
+
86
+        }
87
+    }
88
+}

+ 791
- 745
src/services/apis.js
Dosya farkı çok büyük olduğundan ihmal edildi
Dosyayı Görüntüle