Browse Source

Merge branch 'dev' of http://git.ycjcjy.com/shigongli/miniapp-v2 into dev

李志伟 3 years ago
parent
commit
007098b585
2 changed files with 13 additions and 6 deletions
  1. 0
    1
      src/components/List/index.jsx
  2. 13
    5
      src/hotel/pages/landlord/addRoom/addRoom.jsx

+ 0
- 1
src/components/List/index.jsx View File

@@ -126,7 +126,6 @@ export default React.forwardRef((props, ref) => {
126 126
   useImperativeHandle(ref, () => ({
127 127
     context: contextRef.current,
128 128
   }))
129
-
130 129
   return (
131 130
     <ScrollView
132 131
       {...leftProps}

+ 13
- 5
src/hotel/pages/landlord/addRoom/addRoom.jsx View File

@@ -34,21 +34,29 @@ export default withLayout((props) => {
34 34
 
35 35
   const onRoomMap = () => {
36 36
     Taro.chooseLocation().then((res) => {
37
-      setRoomModel({ ...roomModel, location: res.longitude + ',' + res.latitude,locName: res.name })
37
+      setRoomModel({ ...roomModel, location: res.longitude + ',' + res.latitude, locName: res.name })
38 38
     })
39 39
   }
40 40
   
41 41
   const onParkMap = () => {
42 42
     Taro.chooseLocation().then((res) => {
43
-      setRoomModel({ ...roomModel, parkingLocation: res.longitude + ',' + res.latitude, pkLocName: res.name  })
43
+      setRoomModel({ ...roomModel, parkingLocation: res.longitude + ',' + res.latitude, pkLocName: res.name })
44 44
     })
45 45
   }
46 46
   const sumbit = () => {
47 47
     if (
48
+      roomModel.roomName != null &&
48 49
       roomModel.roomName != '' &&
50
+
51
+      roomModel.address != null &&
49 52
       roomModel.address != '' &&
53
+
54
+      roomModel.location != null &&
50 55
       roomModel.location != '' &&
56
+
57
+      roomModel.weight != null &&
51 58
       roomModel.weight != ''
59
+
52 60
     ) {
53 61
       const seveices = roomId ? updateRoom : saveRoom
54 62
       seveices(roomModel, roomId).then(() => {
@@ -193,7 +201,7 @@ export default withLayout((props) => {
193 201
               <mp-cell>
194 202
                 <View className='roomloc'>
195 203
                   <Label style={{ color: '#666', lineHeight: '30px' }} onClick={onRoomMap} >{roomModel.locName || '请选择定位'}</Label>
196
-                  <Textarea style={{height:'60px',width:'100%'}} onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address} placeholder='请输入房屋位置(必填)' />
204
+                  <Textarea style={{ height: '60px', width: '100%' }} onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address} placeholder='请输入房屋位置(必填)' />
197 205
                   <Label style={{ display: 'none' }} >{isError(roomModel.location) ? '房间定位(必填)' : roomModel.location}</Label>
198 206
                   <Image className='location' src={GPS} onClick={onRoomMap} />
199 207
                 </View>
@@ -205,8 +213,8 @@ export default withLayout((props) => {
205 213
                   <mp-cell>
206 214
                     <View className='roomloc'>
207 215
                       <Label style={{ color: '#666', lineHeight: '30px' }} onClick={onParkMap}>{roomModel.pkLocName || '请选择定位'}</Label>
208
-                      <Textarea  style={{height:'60px',width:'100%'}} onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress} placeholder='请输入停车场位置' />
209
-                      <Label style={{display: 'none' }}>{isError(roomModel.parkingLocation) ? '停车场定位' : roomModel.parkingLocation}</Label>
216
+                      <Textarea style={{ height: '60px', width: '100%' }} onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress} placeholder='请输入停车场位置' />
217
+                      <Label style={{ display: 'none' }}>{isError(roomModel.parkingLocation) ? '停车场定位' : roomModel.parkingLocation}</Label>
210 218
                       <Image className='location' src={GPS} onClick={onParkMap} />
211 219
                     </View>
212 220
                   </mp-cell>