吃个甘蔗嚼一年 3 年之前
父節點
當前提交
024e21080f
共有 2 個文件被更改,包括 13 次插入6 次删除
  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 查看文件

@@ -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 查看文件

@@ -43,7 +43,7 @@ export default withLayout((props) => {
43 43
 
44 44
   const onRoomMap = () => {
45 45
     Taro.chooseLocation().then((res) => {
46
-      setRoomModel({ ...roomModel, location: res.longitude + ',' + res.latitude,locName: res.name })
46
+      setRoomModel({ ...roomModel, location: res.longitude + ',' + res.latitude, locName: res.name })
47 47
     })
48 48
   }
49 49
 
@@ -51,15 +51,23 @@ export default withLayout((props) => {
51 51
 
52 52
   const onParkMap = () => {
53 53
     Taro.chooseLocation().then((res) => {
54
-      setRoomModel({ ...roomModel, parkingLocation: res.longitude + ',' + res.latitude, pkLocName: res.name  })
54
+      setRoomModel({ ...roomModel, parkingLocation: res.longitude + ',' + res.latitude, pkLocName: res.name })
55 55
     })
56 56
   }
57 57
   const sumbit = () => {
58 58
     if (
59
+      roomModel.roomName != null &&
59 60
       roomModel.roomName != '' &&
61
+
62
+      roomModel.address != null &&
60 63
       roomModel.address != '' &&
64
+
65
+      roomModel.location != null &&
61 66
       roomModel.location != '' &&
67
+
68
+      roomModel.weight != null &&
62 69
       roomModel.weight != ''
70
+
63 71
     ) {
64 72
       const seveices = roomId ? updateRoom : saveRoom
65 73
       seveices(roomModel, roomId).then(() => {
@@ -204,7 +212,7 @@ export default withLayout((props) => {
204 212
               <mp-cell>
205 213
                 <View className='roomloc'>
206 214
                   <Label style={{ color: '#666', lineHeight: '30px' }} onClick={onRoomMap} >{roomModel.locName || '请选择定位'}</Label>
207
-                  <Textarea style={{height:'60px',width:'100%'}} onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address} placeholder='请输入房屋位置(必填)' />
215
+                  <Textarea style={{ height: '60px', width: '100%' }} onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address} placeholder='请输入房屋位置(必填)' />
208 216
                   <Label style={{ display: 'none' }} >{isError(roomModel.location) ? '房间定位(必填)' : roomModel.location}</Label>
209 217
                   <Image className='location' src={GPS} onClick={onRoomMap} />
210 218
                 </View>
@@ -216,8 +224,8 @@ export default withLayout((props) => {
216 224
                   <mp-cell>
217 225
                     <View className='roomloc'>
218 226
                       <Label style={{ color: '#666', lineHeight: '30px' }} onClick={onParkMap}>{roomModel.pkLocName || '请选择定位'}</Label>
219
-                      <Textarea  style={{height:'60px',width:'100%'}} onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress} placeholder='请输入停车场位置' />
220
-                      <Label style={{display: 'none' }}>{isError(roomModel.parkingLocation) ? '停车场定位' : roomModel.parkingLocation}</Label>
227
+                      <Textarea style={{ height: '60px', width: '100%' }} onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress} placeholder='请输入停车场位置' />
228
+                      <Label style={{ display: 'none' }}>{isError(roomModel.parkingLocation) ? '停车场定位' : roomModel.parkingLocation}</Label>
221 229
                       <Image className='location' src={GPS} onClick={onParkMap} />
222 230
                     </View>
223 231
                   </mp-cell>