zlisen 4 years ago
parent
commit
165a3864ed

+ 2
- 2
config/dev.js View File

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/",
13
     // OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",
13
     // OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",

+ 10
- 6
src/pages/customer/index.js View File

27
   }
27
   }
28
 
28
 
29
   useEffect(() => {
29
   useEffect(() => {
30
+    
30
     if(props.orderId){
31
     if(props.orderId){
31
       request({url: `/taHouseOrder/${props.orderId}`,}).then(res=>{
32
       request({url: `/taHouseOrder/${props.orderId}`,}).then(res=>{
32
         const data = res.data.data
33
         const data = res.data.data
34
+        console.log(data,'props.orderId')
33
         setOrderInfo(data)
35
         setOrderInfo(data)
34
-        regUnFinished(data.status !== 1)
36
+        setRegUnFinished(data.status !== 1)
35
       })
37
       })
36
     }
38
     }
37
   }, [props.orderId])
39
   }, [props.orderId])
43
   }, [props.orderId, regUnFinished])
45
   }, [props.orderId, regUnFinished])
44
   
46
   
45
   useEffect(() => {
47
   useEffect(() => {
48
+    console.log(props.houseId && (!props.orderId || !regUnFinished),'data')
46
     if(props.houseId && (!props.orderId || !regUnFinished)){
49
     if(props.houseId && (!props.orderId || !regUnFinished)){
47
       request({url: `/taHouse/${props.houseId}`,}).then(res=>{
50
       request({url: `/taHouse/${props.houseId}`,}).then(res=>{
48
         const data = res.data.data
51
         const data = res.data.data
52
+        console.log(data,'data')
49
         setHouseInfo(data)
53
         setHouseInfo(data)
50
         setPageState('2')
54
         setPageState('2')
51
       })
55
       })
59
   }, [props.houseId, props.orderId, regUnFinished])
63
   }, [props.houseId, props.orderId, regUnFinished])
60
  
64
  
61
   return (
65
   return (
62
-    <View className='index'>
66
+    <View className='index' >
63
       {pageState=='1'&&<Register oderId={orderId} dataSource={orderInfo} onFinished={handleRegisterFinished}></Register>}
67
       {pageState=='1'&&<Register oderId={orderId} dataSource={orderInfo} onFinished={handleRegisterFinished}></Register>}
64
 
68
 
65
-      <Layout>
69
+      {pageState!='1'&&<Layout>
66
         {pageState=='2'&&<Guide houseId={houseId} dataSource={houseInfo}></Guide>  }
70
         {pageState=='2'&&<Guide houseId={houseId} dataSource={houseInfo}></Guide>  }
67
         {pageState=='3'&&<Recommend houseId={houseId} dataSource={surroundList}></Recommend>  }
71
         {pageState=='3'&&<Recommend houseId={houseId} dataSource={surroundList}></Recommend>  }
68
-      </Layout>
69
-    
70
-      {!!houseId && (
72
+      </Layout>}
73
+    {/* !!houseId&& */}
74
+      {pageState!='1' && (
71
         <Tab
75
         <Tab
72
           value={['入住指引','房东推荐']}
76
           value={['入住指引','房东推荐']}
73
           pageState={pageState}
77
           pageState={pageState}

+ 3
- 5
src/pages/customer/register/index.jsx View File

2
 import './register.scss'
2
 import './register.scss'
3
 import { View, Text, Input } from '@tarojs/components'
3
 import { View, Text, Input } from '@tarojs/components'
4
 import ContainerLayout from '../../../compents/container/index'
4
 import ContainerLayout from '../../../compents/container/index'
5
-import { AtInput } from 'taro-ui'
5
+// import { AtInput } from 'taro-ui'
6
 import Tab from '../../../compents/tab'
6
 import Tab from '../../../compents/tab'
7
 import Layout from '../../../layout'
7
 import Layout from '../../../layout'
8
 import request from '@/util/request'
8
 import request from '@/util/request'
55
 
55
 
56
   return (
56
   return (
57
     <View className='register-user'>
57
     <View className='register-user'>
58
-      <Text>入住人{props.index}</Text>
58
+      <Text>入住人{props.index+1}</Text>
59
       <ContainerLayout className='register-user-from'>
59
       <ContainerLayout className='register-user-from'>
60
         {console.log(name,phone,'name,phone')}
60
         {console.log(name,phone,'name,phone')}
61
         <Input name="name" className='register-user-from-input' value={name} onInput={handeNameChange} placeholder='姓名' type='text' />
61
         <Input name="name" className='register-user-from-input' value={name} onInput={handeNameChange} placeholder='姓名' type='text' />
67
 
67
 
68
 const register = (props) => {
68
 const register = (props) => {
69
 
69
 
70
-  const { orderId } = props
71
-
72
   let [list, setList] = useState([])
70
   let [list, setList] = useState([])
73
   useEffect(() => {
71
   useEffect(() => {
74
     if (props.dataSource) {
72
     if (props.dataSource) {
116
     setList([...list])
114
     setList([...list])
117
   }
115
   }
118
 
116
 
119
-  return <View className='register'>
117
+  return <View className='register' >
120
     <Layout>
118
     <Layout>
121
       {list.map((x, index) => {
119
       {list.map((x, index) => {
122
         let inx = index
120
         let inx = index

+ 33
- 17
src/pages/house/index.jsx View File

20
     const [userRole, setUserRole] = useState('1')
20
     const [userRole, setUserRole] = useState('1')
21
     const [pageState, setPageState] = useState('2')
21
     const [pageState, setPageState] = useState('2')
22
     const [list, setList] = useState([])
22
     const [list, setList] = useState([])
23
-    useEffect(() => {
23
+    const [dataSource, setDataSource] = useState([])
24
+    const [imgSource, setImgSource] = useState([])
25
+    useDidShow(() => {
26
+        if (houseId) {
27
+            getDetail()
28
+        }
29
+    })
24
 
30
 
25
-        setList([
26
-            {
27
-                name: 'zhou',
28
-                phone: '177'
29
-            },
30
-            {
31
-                name: 'zhou',
32
-                phone: '177'
33
-            },
34
-            {
35
-                name: 'zhou',
36
-                phone: '177'
37
-            }
38
-        ])
31
+    useEffect(() => {
32
+        getImageList()
39
     }, [])
33
     }, [])
40
 
34
 
35
+    const getImageList=()=>{
36
+        request({url:'/taHouseSurround',params:{houseId:houseId}}).then((res)=>{
37
+            const {records,...page} =res.data.data  
38
+            setImgSource(records)
39
+        })
40
+    }
41
+    // useEffect(() => {
42
+    //     console.log(houseId, 'params33')
43
+    //     if (houseId) {
44
+    //         getDetail()
45
+    //     }
46
+
47
+    // }, [])
48
+    const getDetail = () => {
49
+        request({ url: `/taHouse/${houseId}` }).then((res) => {
50
+            setDataSource(res.data.data)
51
+
52
+            wx.setNavigationBarTitle({
53
+                title: res.data.data.title
54
+            })
55
+        })
56
+    }
41
     
57
     
42
 
58
 
43
     const onTabClick = (e) => {
59
     const onTabClick = (e) => {
56
         <View >
72
         <View >
57
 
73
 
58
             <Layout>
74
             <Layout>
59
-                {pageState == '2' && <Guide houseId={houseId}></Guide>}
60
-                {pageState == '3' && <Recommend houseId={houseId}></Recommend>}
75
+                {pageState == '2' && <Guide houseId={houseId} dataSource={dataSource}></Guide>}
76
+                {pageState == '3' && <Recommend houseId={houseId} dataSource={imgSource}></Recommend>}
61
             </Layout>
77
             </Layout>
62
             {pageState != '1' && <Tab value={['入住指引', '房东推荐']} pageState={pageState} onClick={[(e) => setPageState('2'), (e) => setPageState('3')]}></Tab>}
78
             {pageState != '1' && <Tab value={['入住指引', '房东推荐']} pageState={pageState} onClick={[(e) => setPageState('2'), (e) => setPageState('3')]}></Tab>}
63
 
79
 

+ 4
- 1
src/pages/share/index.jsx View File

52
         ])
52
         ])
53
     }, [])
53
     }, [])
54
     useShareAppMessage(res => {
54
     useShareAppMessage(res => {
55
-        console.log('3333')
55
+        Taro.showLoading({
56
+            title: '分享中',
57
+          })
56
         if (res.from === 'button') {
58
         if (res.from === 'button') {
57
             // 来自页面内转发按钮
59
             // 来自页面内转发按钮
58
             console.log(res.target)
60
             console.log(res.target)
70
                 console.log(data.taHouseOrder.orderId)
72
                 console.log(data.taHouseOrder.orderId)
71
                 const { orderId } = data.taHouseOrder
73
                 const { orderId } = data.taHouseOrder
72
                 return request({ url: `/taHouse/${houseId}/share` }).then(res => {
74
                 return request({ url: `/taHouse/${houseId}/share` }).then(res => {
75
+                    Taro.hideLoading()
73
                     return {
76
                     return {
74
                         title: '分享到微信',
77
                         title: '分享到微信',
75
                         path: `/pages/index/index?houseId=${houseId}&personNum=${personNum}&startTime=${startTime}&endTime=${endTime}&orderId=${orderId}`
78
                         path: `/pages/index/index?houseId=${houseId}&personNum=${personNum}&startTime=${startTime}&endTime=${endTime}&orderId=${orderId}`