李志伟 hace 3 años
padre
commit
a350fbaabb

+ 1
- 1
src/components/List/index.jsx Ver fichero

127
   useEffect(() => {
127
   useEffect(() => {
128
     Taro.nextTick(() => {
128
     Taro.nextTick(() => {
129
       Taro.createSelectorQuery().select(`.${uqCls}`).node(function (res) {
129
       Taro.createSelectorQuery().select(`.${uqCls}`).node(function (res) {
130
-        contextRef.current = res.node
130
+        contextRef.current = res?.node
131
       }).exec()
131
       }).exec()
132
     })
132
     })
133
   }, [])
133
   }, [])

+ 8
- 3
src/hotel/components/shareRoom/ShareRoom.jsx Ver fichero

19
   const handelEndDate = (e) => {
19
   const handelEndDate = (e) => {
20
     setEndDate(e.detail.value)
20
     setEndDate(e.detail.value)
21
   }
21
   }
22
+  const nowDate=()=>{
23
+    var myDate = new Date();
24
+    let mouth=myDate.getUTCMonth()<9?'0'+(myDate.getUTCMonth()+1):(myDate.getUTCMonth()+1)
25
+    let day=myDate.getDate()<10?'0'+myDate.getDate():myDate.getDate
26
+    return myDate.getUTCFullYear()+'-'+mouth+'-'+day
27
+  }
22
   const handelShare = () => {
28
   const handelShare = () => {
23
     setLoading(true)
29
     setLoading(true)
24
-    var myDate = new Date();
25
     shareRoom({
30
     shareRoom({
26
       hotelId: room.hotelId,
31
       hotelId: room.hotelId,
27
       personNum: roomNum == '' ? 0 : roomNum,
32
       personNum: roomNum == '' ? 0 : roomNum,
28
       roomId: room.roomId,
33
       roomId: room.roomId,
29
-      startDate: startDate == '' ? myDate.toLocaleDateString() : startDate,
30
-      endDate: endDate == '' ? myDate.toLocaleDateString() : endDate
34
+      startDate: startDate == '' ? nowDate() : startDate,
35
+      endDate: endDate == '' ? nowDate() : endDate
31
     }).then((res) => {
36
     }).then((res) => {
32
       onFinish(res)
37
       onFinish(res)
33
       setStartDate('')
38
       setStartDate('')

+ 4
- 7
src/pages/RoomOrder/index.jsx Ver fichero

43
           return;
43
           return;
44
         }
44
         }
45
       }
45
       }
46
-      personSubmit(roomOrderId, formData).then(a => {
47
-        // Taro.navigateBack({
48
-        //   delta: 1
49
-        // })
50
-        setLoading(false)
51
-
46
+      personSubmit(roomOrderId, formData).then(a => {        
52
         Taro.reLaunch({
47
         Taro.reLaunch({
53
           url: `/pages/index/index?tab=1&roomId=${roomId}`
48
           url: `/pages/index/index?tab=1&roomId=${roomId}`
54
         })
49
         })
55
       })
50
       })
56
     })
51
     })
57
-
52
+    setTimeout(()=>{
53
+      setLoading(false)
54
+    },1000)
58
   }
55
   }
59
 
56
 
60
   useEffect(() => {
57
   useEffect(() => {

+ 4
- 0
src/pages/index/tabs/Guide.jsx Ver fichero

31
   const goContent = () => {
31
   const goContent = () => {
32
     if (roomOrderId) {
32
     if (roomOrderId) {
33
       goToRoomForm(roomOrderId).then((res) => {
33
       goToRoomForm(roomOrderId).then((res) => {
34
+        console.log(res)
34
         if (res.status !== 1 && res.personNum > 0) {
35
         if (res.status !== 1 && res.personNum > 0) {
35
           Taro.reLaunch({
36
           Taro.reLaunch({
36
             url: `/pages/RoomOrder/index?roomOrderId=${roomOrderId}&status=${res.status}&roomId=${roomId}`,
37
             url: `/pages/RoomOrder/index?roomOrderId=${roomOrderId}&status=${res.status}&roomId=${roomId}`,
43
   useDidShow(() => {
44
   useDidShow(() => {
44
     goContent()
45
     goContent()
45
   })
46
   })
47
+  useEffect(()=>{
48
+    goContent()
49
+  },[])
46
 
50
 
47
   const getGuidelist = () => {
51
   const getGuidelist = () => {
48
     setLoading(true)
52
     setLoading(true)