Przeglądaj źródła

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

李志伟 3 lat temu
rodzic
commit
007098b585

+ 0
- 1
src/components/List/index.jsx Wyświetl plik

126
   useImperativeHandle(ref, () => ({
126
   useImperativeHandle(ref, () => ({
127
     context: contextRef.current,
127
     context: contextRef.current,
128
   }))
128
   }))
129
-
130
   return (
129
   return (
131
     <ScrollView
130
     <ScrollView
132
       {...leftProps}
131
       {...leftProps}

+ 13
- 5
src/hotel/pages/landlord/addRoom/addRoom.jsx Wyświetl plik

34
 
34
 
35
   const onRoomMap = () => {
35
   const onRoomMap = () => {
36
     Taro.chooseLocation().then((res) => {
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
   const onParkMap = () => {
41
   const onParkMap = () => {
42
     Taro.chooseLocation().then((res) => {
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
   const sumbit = () => {
46
   const sumbit = () => {
47
     if (
47
     if (
48
+      roomModel.roomName != null &&
48
       roomModel.roomName != '' &&
49
       roomModel.roomName != '' &&
50
+
51
+      roomModel.address != null &&
49
       roomModel.address != '' &&
52
       roomModel.address != '' &&
53
+
54
+      roomModel.location != null &&
50
       roomModel.location != '' &&
55
       roomModel.location != '' &&
56
+
57
+      roomModel.weight != null &&
51
       roomModel.weight != ''
58
       roomModel.weight != ''
59
+
52
     ) {
60
     ) {
53
       const seveices = roomId ? updateRoom : saveRoom
61
       const seveices = roomId ? updateRoom : saveRoom
54
       seveices(roomModel, roomId).then(() => {
62
       seveices(roomModel, roomId).then(() => {
193
               <mp-cell>
201
               <mp-cell>
194
                 <View className='roomloc'>
202
                 <View className='roomloc'>
195
                   <Label style={{ color: '#666', lineHeight: '30px' }} onClick={onRoomMap} >{roomModel.locName || '请选择定位'}</Label>
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
                   <Label style={{ display: 'none' }} >{isError(roomModel.location) ? '房间定位(必填)' : roomModel.location}</Label>
205
                   <Label style={{ display: 'none' }} >{isError(roomModel.location) ? '房间定位(必填)' : roomModel.location}</Label>
198
                   <Image className='location' src={GPS} onClick={onRoomMap} />
206
                   <Image className='location' src={GPS} onClick={onRoomMap} />
199
                 </View>
207
                 </View>
205
                   <mp-cell>
213
                   <mp-cell>
206
                     <View className='roomloc'>
214
                     <View className='roomloc'>
207
                       <Label style={{ color: '#666', lineHeight: '30px' }} onClick={onParkMap}>{roomModel.pkLocName || '请选择定位'}</Label>
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
                       <Image className='location' src={GPS} onClick={onParkMap} />
218
                       <Image className='location' src={GPS} onClick={onParkMap} />
211
                     </View>
219
                     </View>
212
                   </mp-cell>
220
                   </mp-cell>