zlisen 4 年之前
父節點
當前提交
cff432ee24
共有 2 個文件被更改,包括 23 次插入23 次删除
  1. 2
    2
      config/dev.js
  2. 21
    21
      src/pages/share/index.jsx

+ 2
- 2
config/dev.js 查看文件

4
     NODE_ENV: '"development"'
4
     NODE_ENV: '"development"'
5
   },
5
   },
6
   defineConstants: {
6
   defineConstants: {
7
-    HOST: '"http://localhost:7080"',
7
+    // HOST: '"http://localhost:7080"',
8
     // HOST: '"https://sgl.ycjcjy.com"',
8
     // HOST: '"https://sgl.ycjcjy.com"',
9
-    // HOST: '"http://192.168.31.68:7080"',
9
+    HOST: '"http://192.168.31.68:7080"',
10
     // HOST: '"http://192.168.211.181:7080"',
10
     // HOST: '"http://192.168.211.181:7080"',
11
  
11
  
12
     // OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
12
     // OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",

+ 21
- 21
src/pages/share/index.jsx 查看文件

1
-import React, { useEffect, useMemo, useState } from 'react'
1
+import React, { useEffect, useState } from 'react'
2
 import Taro, { useShareAppMessage, useRouter } from "@tarojs/taro";
2
 import Taro, { useShareAppMessage, useRouter } from "@tarojs/taro";
3
-import { useSelector, } from 'react-redux'
4
-import { View, Input, Text, Image, Picker, Button } from '@tarojs/components'
5
-import { AtModal, AtModalHeader, AtModalContent, AtModalAction } from "taro-ui"
3
+import { View, Input, Text, Picker, Button } from '@tarojs/components'
4
+import { AtModal, AtModalHeader, AtModalAction } from "taro-ui"
6
 import Layout from '../../layout/index'
5
 import Layout from '../../layout/index'
7
 import Tab from '../../compents/tab/index'
6
 import Tab from '../../compents/tab/index'
8
 import Container from '../../compents/container/index'
7
 import Container from '../../compents/container/index'
9
-import locationicon from '../../assets/locationicon.png'
10
 import './index.scss'
8
 import './index.scss'
11
 import request from '../../util/request';
9
 import request from '../../util/request';
12
 
10
 
17
 //     }
15
 //     }
18
 // })
16
 // })
19
 
17
 
20
-const index = (props) => {
21
-
22
-
23
-
18
+const Index = () => {
24
     const router = useRouter()
19
     const router = useRouter()
25
-
26
     const { houseId } = router.params
20
     const { houseId } = router.params
27
-
28
-    const user = useSelector(state => state.user)
29
-
30
-    const [userRole, setUserRole] = useState('1')
31
-    const [pageState, setPageState] = useState('1')
32
-    const [list, setList] = useState([])
33
     const [personNum, setPersonNum] = useState()
21
     const [personNum, setPersonNum] = useState()
34
     const [startTime, setStartTime] = useState('')
22
     const [startTime, setStartTime] = useState('')
35
     const [endTime, setEndTime] = useState('')
23
     const [endTime, setEndTime] = useState('')
24
+    // const [data,setData] = useState({})
36
     const [shareObj, setShareObj] = useState()
25
     const [shareObj, setShareObj] = useState()
37
     const [showShareModal, setShowShareModal] = useState(false)
26
     const [showShareModal, setShowShareModal] = useState(false)
38
-    
27
+
28
+    useEffect(() => {
29
+        request({ url: "/taHouseSetting/last", params: { houseId } }).then((res) => {
30
+            if (res.data.data) {
31
+                setPersonNum(res.data.data.personNum)
32
+                setStartTime(res.data.data.startDate)
33
+                setEndTime(res.data.data.endDate)
34
+            }
35
+        })
36
+        // eslint-disable-next-line react-hooks/exhaustive-deps
37
+    }, [])
38
+
39
     const onTimeChange = (e) => {
39
     const onTimeChange = (e) => {
40
         setStartTime(e.detail.value)
40
         setStartTime(e.detail.value)
41
     }
41
     }
42
 
42
 
43
     const handleShareReady = () => {
43
     const handleShareReady = () => {
44
-        
44
+
45
         const data = {
45
         const data = {
46
             houseId,
46
             houseId,
47
             personNum,
47
             personNum,
48
             startDate: startTime,
48
             startDate: startTime,
49
             endDate: endTime
49
             endDate: endTime
50
         }
50
         }
51
-        
51
+
52
         Taro.showLoading({
52
         Taro.showLoading({
53
             title: '正在生成分享内容,请稍后...'
53
             title: '正在生成分享内容,请稍后...'
54
         })
54
         })
90
 
90
 
91
     }
91
     }
92
 
92
 
93
-    useShareAppMessage(() => {   
93
+    useShareAppMessage(() => {
94
         return shareObj
94
         return shareObj
95
     })
95
     })
96
 
96
 
137
     </View>
137
     </View>
138
 }
138
 }
139
 
139
 
140
-export default index
140
+export default Index