zlisen 4 anos atrás
pai
commit
165a3864ed

+ 2
- 2
config/dev.js Ver arquivo

@@ -4,10 +4,10 @@ module.exports = {
4 4
     NODE_ENV: '"development"'
5 5
   },
6 6
   defineConstants: {
7
-    HOST: '"http://localhost:7080"',
7
+    // HOST: '"http://localhost:7080"',
8 8
     // HOST: '"https://sgl.ycjcjy.com"',
9 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 12
     // OSS_PATH: "https://njcj.oss-cn-shanghai.aliyuncs.com/",
13 13
     // OSS_FAST_PATH: "https://njcj.oss-accelerate.aliyuncs.com/",

+ 10
- 6
src/pages/customer/index.js Ver arquivo

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

+ 3
- 5
src/pages/customer/register/index.jsx Ver arquivo

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

+ 33
- 17
src/pages/house/index.jsx Ver arquivo

@@ -20,24 +20,40 @@ const house = (props) => {
20 20
     const [userRole, setUserRole] = useState('1')
21 21
     const [pageState, setPageState] = useState('2')
22 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 59
     const onTabClick = (e) => {
@@ -56,8 +72,8 @@ const house = (props) => {
56 72
         <View >
57 73
 
58 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 77
             </Layout>
62 78
             {pageState != '1' && <Tab value={['入住指引', '房东推荐']} pageState={pageState} onClick={[(e) => setPageState('2'), (e) => setPageState('3')]}></Tab>}
63 79
 

+ 4
- 1
src/pages/share/index.jsx Ver arquivo

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