魏超 5 years ago
parent
commit
df4af2b80e

+ 1
- 1
src/pages/h5SampleManager/h5Demand/components/AddDemand.jsx View File

28
             <Button type="primary" onClick={() => sampleList()}>
28
             <Button type="primary" onClick={() => sampleList()}>
29
               查看全部样例
29
               查看全部样例
30
             </Button>
30
             </Button>
31
-            <Button type="primary" onClick={props.onCancel} style={{marginLeft:'20px'}}>
31
+            <Button onClick={props.onCancel} style={{marginLeft:'20px'}}>
32
               取消
32
               取消
33
             </Button>
33
             </Button>
34
           </Form.Item>
34
           </Form.Item>

+ 1
- 1
src/pages/h5SampleManager/h5Demand/detail.jsx View File

98
   return (
98
   return (
99
     <>
99
     <>
100
       <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
100
       <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
101
-        <Form.Item label="样例名1">
101
+        <Form.Item label="样例名">
102
           <a onClick={() => sampleDetail(demandData.sampleId)} style={{ color: 'blue' }}>{demandData.sampleName}</a>
102
           <a onClick={() => sampleDetail(demandData.sampleId)} style={{ color: 'blue' }}>{demandData.sampleName}</a>
103
         </Form.Item>
103
         </Form.Item>
104
         <Form.Item label="下单人">
104
         <Form.Item label="下单人">

+ 3
- 1
src/pages/h5SampleManager/h5Sample/add.jsx View File

84
           rules: [
84
           rules: [
85
             {
85
             {
86
               required: true,
86
               required: true,
87
-              message: '请填写联系方式',
87
+              message: '请填写正确的联系方式',
88
+              max:11,
89
+              min:11,
88
             },
90
             },
89
           ],
91
           ],
90
         })(<Input/>)}
92
         })(<Input/>)}

+ 7
- 7
src/pages/h5SampleManager/h5Sample/components/ContactInfo.jsx View File

57
             </div>
57
             </div>
58
             <div className={styles.flexItem} style={{ justifyContent: 'space-between' }}>
58
             <div className={styles.flexItem} style={{ justifyContent: 'space-between' }}>
59
               <div>
59
               <div>
60
-                {this.props.type.sex != '' && <div className={styles.flexItem}>
60
+                {this.props.type.sex != '' && this.props.type.sex != null && <div className={styles.flexItem}>
61
                   <div className={styles.left}> 性别 </div>
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>
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>}
63
                 </div>}
64
-                {this.props.type.appellation != '' && <div className={styles.flexItem}>
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>
65
                   <div className={styles.left}><img src={cardImg} height="18px" width="24px" /></div>
66
                   <div className={styles.right}>{this.props.type.appellation}</div>
66
                   <div className={styles.right}>{this.props.type.appellation}</div>
67
                 </div>}
67
                 </div>}
68
-                {this.props.type.telephone != '' && <div className={styles.flexItem}>
68
+                {this.props.type.telephone != '' && this.props.type.telephone != null && <div className={styles.flexItem}>
69
                   <div className={styles.left}> 固话 </div>
69
                   <div className={styles.left}> 固话 </div>
70
                   <div className={styles.right}>{this.props.type.telephone}</div>
70
                   <div className={styles.right}>{this.props.type.telephone}</div>
71
                 </div>}
71
                 </div>}
72
-                {this.props.type.phone != '' && <div className={styles.flexItem}>
72
+                {this.props.type.phone != '' && this.props.type.phone != null && <div className={styles.flexItem}>
73
                   <div className={styles.left}> 手机 </div>
73
                   <div className={styles.left}> 手机 </div>
74
                   <div className={styles.right}>{this.props.type.phone}</div>
74
                   <div className={styles.right}>{this.props.type.phone}</div>
75
                 </div>}
75
                 </div>}
76
-                {this.props.type.mail && <div className={styles.flexItem}>
76
+                {this.props.type.mail != '' && this.props.type.mail != null && <div className={styles.flexItem}>
77
                   <div className={styles.left}> 邮箱 </div>
77
                   <div className={styles.left}> 邮箱 </div>
78
                   <div className={styles.right}>{this.props.type.mail}</div>
78
                   <div className={styles.right}>{this.props.type.mail}</div>
79
                 </div>}
79
                 </div>}
80
-                {this.props.type.address != '' && <div className={styles.flexItem}>
80
+                {this.props.type.address != '' && this.props.type.address != null && <div className={styles.flexItem}>
81
                   <div className={styles.left}> 联系地址 </div>
81
                   <div className={styles.left}> 联系地址 </div>
82
                   <div className={styles.right}>{this.props.type.address}</div>
82
                   <div className={styles.right}>{this.props.type.address}</div>
83
                 </div>}
83
                 </div>}
84
               </div>
84
               </div>
85
-              {this.props.type.avatar != null &&
85
+              {this.props.type.avatar != null && this.props.type.avatar != '' &&
86
               <div style={{ textAlign: 'center' }}>
86
               <div style={{ textAlign: 'center' }}>
87
                 <img src={this.props.type.wxCardImg} height="80px" width="80px" />
87
                 <img src={this.props.type.wxCardImg} height="80px" width="80px" />
88
                 <p style={{ margin: ' 0px', fontSize: '0.096rem', color: '#666' }}>扫码添加微信好友</p>
88
                 <p style={{ margin: ' 0px', fontSize: '0.096rem', color: '#666' }}>扫码添加微信好友</p>

+ 7
- 2
src/pages/h5SampleManager/h5Sample/detail.jsx View File

20
 const header = props => {
20
 const header = props => {
21
   const sampleId  = props.location.query.id;
21
   const sampleId  = props.location.query.id;
22
   const [demandData, setDemandData] = useState({})
22
   const [demandData, setDemandData] = useState({})
23
+  const [demandNum, setDemandNum] = useState()
23
 
24
 
24
   useEffect(() => {
25
   useEffect(() => {
25
     getDemandData(sampleId);
26
     getDemandData(sampleId);
29
   const getDemandData = (demandId) => {
30
   const getDemandData = (demandId) => {
30
       request({ ...apis.taH5SampleManager.taH5SampleById, urlData: {id: sampleId} }).then((data) => {
31
       request({ ...apis.taH5SampleManager.taH5SampleById, urlData: {id: sampleId} }).then((data) => {
31
           setDemandData(data)
32
           setDemandData(data)
33
+          setDemandNum(data.demandNum)
32
           props.form.setFieldsValue(data)
34
           props.form.setFieldsValue(data)
33
       })
35
       })
34
   }
36
   }
103
           <Button danger  onClick={() => toCancel()} style={{marginLeft:'20px'}}>
105
           <Button danger  onClick={() => toCancel()} style={{marginLeft:'20px'}}>
104
             取消
106
             取消
105
           </Button>
107
           </Button>
106
-            <span style={{marginLeft:'25%'}}>已有需求单> ></span>
108
+          {demandNum != 0 && <span style={{marginLeft:'25%'}}>已有{demandNum}需求单> >
107
             <Button danger  onClick={() => viewDemand()}>
109
             <Button danger  onClick={() => viewDemand()}>
108
-              查看已有需求单
110
+            查看已有需求单
109
             </Button>
111
             </Button>
112
+            </span>
113
+          }
114
+            
110
           </div>
115
           </div>
111
           
116
           
112
           
117