zlisen 4 years ago
parent
commit
d42b3684c1

+ 1
- 1
config/dev.js View File

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.105: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/",

+ 1
- 1
src/app.config.js View File

17
   window: {
17
   window: {
18
     backgroundTextStyle: 'light',
18
     backgroundTextStyle: 'light',
19
     navigationBarBackgroundColor: '#fff',
19
     navigationBarBackgroundColor: '#fff',
20
-    navigationBarTitleText: 'WeChat',
20
+    navigationBarTitleText: '十公里',
21
     navigationBarTextStyle: 'black'
21
     navigationBarTextStyle: 'black'
22
   },
22
   },
23
   usingComponents: {
23
   usingComponents: {

+ 6
- 1
src/app.scss View File

61
    text-align: center;
61
    text-align: center;
62
    margin: auto;
62
    margin: auto;
63
    margin-top: 90px;
63
    margin-top: 90px;
64
- }
64
+ }
65
+
66
+
67
+ .scrol{
68
+  height: calc(100vh - 173.33px)
69
+ }

+ 2
- 1
src/layout/index.jsx View File

2
 import { View, ScrollView } from '@tarojs/components'
2
 import { View, ScrollView } from '@tarojs/components'
3
 
3
 
4
 const Layout = ({ children }) => {
4
 const Layout = ({ children }) => {
5
-    return <ScrollView scrollY style={{ height: 'calc(100vh - 162rpx)' }} >
5
+    return <ScrollView className='scrol' scrollY  >
6
         <View className='page-container' >
6
         <View className='page-container' >
7
             {children}
7
             {children}
8
         </View>
8
         </View>
9
+        <View style={{height:'10rpx'}}></View>
9
     </ScrollView>
10
     </ScrollView>
10
 }
11
 }
11
 
12
 

+ 2
- 4
src/pages/account/index.jsx View File

19
 
19
 
20
 
20
 
21
   const radioHouseState = useMemo(() => props.radioHouseState, [props.radioHouseState])
21
   const radioHouseState = useMemo(() => props.radioHouseState, [props.radioHouseState])
22
-  wx.setNavigationBarTitle({
23
-    title: '民宿房源管理'
24
-  })
22
+
25
   console.log(props, radioHouseState)
23
   console.log(props, radioHouseState)
26
   useEffect(() => {
24
   useEffect(() => {
27
     setList([
25
     setList([
117
       })}
115
       })}
118
     </Layout>
116
     </Layout>
119
     {/* onClick={(e)=>(e) */}
117
     {/* onClick={(e)=>(e) */}
120
-    <Tab value={['+新增宿老板账号']} color='#ffffff' onClick={() => { Taro.navigateTo({ url: `/pages/account/edit/index` }) }} ></Tab>
118
+    <Tab value={['+新增宿老板账号']} color='#ffffff' onClick={() => { Taro.navigateTo({ url: `/pages/account/edit/index` }) }} ></Tab>
121
   </View>
119
   </View>
122
 }
120
 }
123
 
121
 

+ 1
- 1
src/pages/addimg/index.config.js View File

4
 //   },
4
 //   },
5
 
5
 
6
 export default {
6
 export default {
7
-    enableShareAppMessage: true
7
+    navigationBarTitleText: '图片列表',
8
 }
8
 }

+ 1
- 1
src/pages/adminUser/index.jsx View File

13
 import { xor } from 'lodash';
13
 import { xor } from 'lodash';
14
 
14
 
15
 const menuList = [{
15
 const menuList = [{
16
-  title: '宿老板账号管理',
16
+  title: '民宿宿老板账号管理',
17
   icon: usericon,
17
   icon: usericon,
18
   url: '/pages/account/index'
18
   url: '/pages/account/index'
19
 }, {
19
 }, {

+ 32
- 11
src/pages/guide/index.jsx View File

6
 import './index.scss'
6
 import './index.scss'
7
 import userRloe from '../../util/userRole'
7
 import userRloe from '../../util/userRole'
8
 import { useSelector } from 'react-redux'
8
 import { useSelector } from 'react-redux'
9
-import request from '@/util/request'
9
+import request,{uploadFiles } from '@/util/request'
10
 import uploadicon from '../../assets/uploadicon.png'
10
 import uploadicon from '../../assets/uploadicon.png'
11
 const guide = (props) => {
11
 const guide = (props) => {
12
 
12
 
72
                     sizeType: ['original', 'compressed'],
72
                     sizeType: ['original', 'compressed'],
73
                     sourceType: ['album',],
73
                     sourceType: ['album',],
74
                     success: (res) => {
74
                     success: (res) => {
75
-                        // tempFilePath可以作为img标签的src属性显示图片
76
-
77
-                        console.log(res)
78
-                        const tempFilePaths = res.tempFilePaths
79
-                        setImgurl(tempFilePaths[0])
75
+                                // tempFilePath可以作为img标签的src属性显示图片
76
+                                const tempFilePaths = res.tempFilePaths
77
+
78
+                        uploadFiles(tempFilePaths).then((res) => {
79
+                            console.log(res, 'uploadFiles')
80
+                            // setImgUrl(res[0])
81
+                            setImgurl(res[0])
82
+                            request({ url: `/taHouse/${houseId}`, method: 'put', data: { ...detail, desc:res[0] } }).then((res) => {
83
+                                
84
+                            })
85
+                        }).catch((e) => {
86
+                            console.log(e, 'err')
87
+                        })
88
+
89
+                        // setImgurl(tempFilePaths[0])
80
                     }
90
                     }
91
+                    // success: (res) => {
92
+                    //     // tempFilePath可以作为img标签的src属性显示图片
93
+
94
+                    //     console.log(res)
95
+                    //     const tempFilePaths = res.tempFilePaths
96
+                    //     setImgurl(tempFilePaths[0])
97
+
98
+
99
+                        
100
+                    // }
81
                 }); break;
101
                 }); break;
82
             }
102
             }
83
         }
103
         }
84
         // Taro.navigateTo({ url: `/pages/map/index?type=${type}` })
104
         // Taro.navigateTo({ url: `/pages/map/index?type=${type}` })
85
     }
105
     }
86
-    // 
106
+     const [addressName,addressDetail] = (detail.address||'').split('____')
107
+     const [parkingName,parkingDetail] = (detail.parking||'').split('____')
87
     return <View className='guide'>
108
     return <View className='guide'>
88
         {!!houseId&&<View>
109
         {!!houseId&&<View>
89
             <View className='guide-view'>
110
             <View className='guide-view'>
90
                 <Text className='guide-view-info'>房屋位置</Text>
111
                 <Text className='guide-view-info'>房屋位置</Text>
91
                 <ContainerLayout className='guide-view-layout' style={{ display: 'flex', justifyContent: 'space-between' }} onClick={() => onToMap('address')}>
112
                 <ContainerLayout className='guide-view-layout' style={{ display: 'flex', justifyContent: 'space-between' }} onClick={() => onToMap('address')}>
92
                     <View  >
113
                     <View  >
93
-                        <View className='guide-view-layout-text1' >{detail.address}</View>
94
-                        {/* <View className='guide-view-layout-text2'>{detail.lngLat}</View> */}
114
+                        <View className='guide-view-layout-text1' >{addressName}</View>
115
+                        <View className='guide-view-layout-text2'>{addressDetail}</View>
95
                     </View>
116
                     </View>
96
                     {user.role == userRloe.customer && <View style={{ float: 'right' }} onClick={() => onOpenLocation(detail.lngLat)}>
117
                     {user.role == userRloe.customer && <View style={{ float: 'right' }} onClick={() => onOpenLocation(detail.lngLat)}>
97
                         <Image className='icon' src={icon} />
118
                         <Image className='icon' src={icon} />
103
                 <Text className='guide-view-info'>停车位置</Text>
124
                 <Text className='guide-view-info'>停车位置</Text>
104
                 <ContainerLayout className='guide-view-layout' style={{ display: 'flex', justifyContent: 'space-between' }} onClick={() => onToMap('park')}>
125
                 <ContainerLayout className='guide-view-layout' style={{ display: 'flex', justifyContent: 'space-between' }} onClick={() => onToMap('park')}>
105
                     <View  >
126
                     <View  >
106
-                        <View className='guide-view-layout-text1' >{detail.parking}</View>
107
-                        {/* <View className='guide-view-layout-text2'>{detail.parkLngLat}</View> */}
127
+                        <View className='guide-view-layout-text1' >{parkingName}</View>
128
+                        <View className='guide-view-layout-text2'>{parkingDetail}</View>
108
                     </View>
129
                     </View>
109
                     {user.role == userRloe.customer && <View style={{ float: 'right' }} onClick={() => onOpenLocation(detail.parkLngLat)}>
130
                     {user.role == userRloe.customer && <View style={{ float: 'right' }} onClick={() => onOpenLocation(detail.parkLngLat)}>
110
                         <Image className='icon' src={icon} />
131
                         <Image className='icon' src={icon} />

+ 3
- 3
src/pages/house/addnewhouse/index.config.js View File

1
 export default {
1
 export default {
2
-
3
-  
4
-}
2
+ 
3
+    navigationBarTitleText: '新增房源',
4
+  }

+ 12
- 9
src/pages/house/addnewhouse/index.jsx View File

46
         })
46
         })
47
     }
47
     }
48
     const formSubmit = (e) => {
48
     const formSubmit = (e) => {
49
-        console.log(e.detail, 'formSubmit')
49
+        // console.log(e.detail, 'formSubmit')
50
+        const value = e.detail.value
50
         const data = {
51
         const data = {
51
-            ...e.detail.value,
52
+            ...value,
53
+            address: `${value.address}____${value.addressdetail}`,
54
+            parking: `${value.parking}____${value.parkingdetail}`,
52
             lngLat: `${address.latitude},${address.longitude}`,
55
             lngLat: `${address.latitude},${address.longitude}`,
53
             parkLngLat: `${address.latitude},${address.longitude}`,
56
             parkLngLat: `${address.latitude},${address.longitude}`,
57
+            
54
             desc:imgUrl,
58
             desc:imgUrl,
55
         }
59
         }
56
-        // latitude
57
-        // longitude
60
+        console.log(data,e.detail.value,'formSubmit')
58
         request({ url: '/taHouse', method: 'post', data }).then((res) => {
61
         request({ url: '/taHouse', method: 'post', data }).then((res) => {
59
             if (res.data.code == 1000)
62
             if (res.data.code == 1000)
60
                 Taro.navigateBack({
63
                 Taro.navigateBack({
103
             <Layout>
106
             <Layout>
104
 
107
 
105
                 <View className='inputstyle-view'>
108
                 <View className='inputstyle-view'>
106
-                    <Text className='title'>民宿名称</Text>
109
+                    <Text className='title'>房源名称</Text>
107
                     <Container className='inputstyle-view-card ' style={{ borderRadius: '20rpx', padding: '0 40rpx' }} >
110
                     <Container className='inputstyle-view-card ' style={{ borderRadius: '20rpx', padding: '0 40rpx' }} >
108
                         <Input name='title' placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
111
                         <Input name='title' placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
109
                     </Container>
112
                     </Container>
118
                     <Text className='title'>位置信息</Text>
121
                     <Text className='title'>位置信息</Text>
119
                     <View style={{ display: 'flex' }}>
122
                     <View style={{ display: 'flex' }}>
120
                         <Container className='inputstyle-view-card' style={{ width: '100%', borderRadius: '20rpx', padding: '0 40rpx' }}>
123
                         <Container className='inputstyle-view-card' style={{ width: '100%', borderRadius: '20rpx', padding: '0 40rpx' }}>
121
-                            <Input name='address' value={address.address} disabled placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
124
+                            <Input name='address' value={address.name} disabled placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
122
 
125
 
123
                         </Container>
126
                         </Container>
124
                         <Container className='map-view-icon' onClick={() => onChooseLocation('address')}>
127
                         <Container className='map-view-icon' onClick={() => onChooseLocation('address')}>
130
                 <View className='inputstyle-view'>
133
                 <View className='inputstyle-view'>
131
                     <Text className='title'>具体地址</Text>
134
                     <Text className='title'>具体地址</Text>
132
                     <Container className='inputstyle-view-card ' style={{ borderRadius: '20rpx', padding: '0 40rpx' }} >
135
                     <Container className='inputstyle-view-card ' style={{ borderRadius: '20rpx', padding: '0 40rpx' }} >
133
-                        <Input name='lngLat' placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
136
+                        <Input name='addressdetail' value={address.address} placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
134
                     </Container>
137
                     </Container>
135
                 </View>
138
                 </View>
136
                 <View className='inputstyle-view'>
139
                 <View className='inputstyle-view'>
137
                     <Text className='title'>停车场地址</Text>
140
                     <Text className='title'>停车场地址</Text>
138
                     <View style={{ display: 'flex' }}>
141
                     <View style={{ display: 'flex' }}>
139
                         <Container className='inputstyle-view-card' style={{ width: '100%', borderRadius: '20rpx', padding: '0 40rpx' }}>
142
                         <Container className='inputstyle-view-card' style={{ width: '100%', borderRadius: '20rpx', padding: '0 40rpx' }}>
140
-                            <Input name='parking' value={parking.address} disabled placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
143
+                            <Input name='parking' value={parking.name} disabled placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
141
 
144
 
142
                         </Container>
145
                         </Container>
143
                         <Container className='map-view-icon' onClick={() => onChooseLocation('parking')}>
146
                         <Container className='map-view-icon' onClick={() => onChooseLocation('parking')}>
149
                 <View className='inputstyle-view'>
152
                 <View className='inputstyle-view'>
150
                     <Text className='title'>具体地址</Text>
153
                     <Text className='title'>具体地址</Text>
151
                     <Container className='inputstyle-view-card ' style={{ borderRadius: '20rpx', padding: '0 40rpx' }} >
154
                     <Container className='inputstyle-view-card ' style={{ borderRadius: '20rpx', padding: '0 40rpx' }} >
152
-                        <Input name='parkLngLat' placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
155
+                        <Input name='parkingdetail' value={parking.address} placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
153
                     </Container>
156
                     </Container>
154
                 </View>
157
                 </View>
155
                 <View className='inputstyle-view'>
158
                 <View className='inputstyle-view'>

+ 2
- 3
src/pages/house/household/index.config.js View File

1
 export default {
1
 export default {
2
-
3
-  
4
-}
2
+    navigationBarTitleText: '民宿房源管理',
3
+}

+ 4
- 4
src/pages/house/index.config.js View File

1
-// export default {
2
-//     navigationStyle: "custom"
3
-    
4
-//   }
1
+export default {
2
+    // navigationStyle: "custom"
3
+    navigationBarTitleText: '',
4
+  }
5
   
5
   

+ 16
- 3
src/pages/house/index.jsx View File

6
 import Tab from '../../compents/tab/index'
6
 import Tab from '../../compents/tab/index'
7
 import Guide from '../guide/index'
7
 import Guide from '../guide/index'
8
 import Recommend from '../recommend/index'
8
 import Recommend from '../recommend/index'
9
+import roleList from '../../util/userRole'
9
 
10
 
10
 // import HouseLIst from '../house/list'
11
 // import HouseLIst from '../house/list'
11
 
12
 
13
 import request from '../../util/request'
14
 import request from '../../util/request'
14
 
15
 
15
 const house = (props) => {
16
 const house = (props) => {
17
+    
16
     const router = useRouter()
18
     const router = useRouter()
17
     const { houseId } = router.params
19
     const { houseId } = router.params
18
     const user = useSelector(state => state.user)
20
     const user = useSelector(state => state.user)
22
     const [list, setList] = useState([])
24
     const [list, setList] = useState([])
23
     const [dataSource, setDataSource] = useState([])
25
     const [dataSource, setDataSource] = useState([])
24
     const [imgSource, setImgSource] = useState([])
26
     const [imgSource, setImgSource] = useState([])
27
+
28
+    useEffect(() => {
29
+        if (user.role == roleList.landlord) {
30
+          wx.setNavigationBarTitle({
31
+            title: '民宿房源管理'
32
+          });
33
+        }
34
+        if (user.role == roleList.customer) {
35
+          wx.setNavigationBarTitle({
36
+            title: '十公里周边指南'
37
+          });
38
+        }
39
+      }, [user.role]);
40
+
25
     useDidShow(() => {
41
     useDidShow(() => {
26
         if (houseId) {
42
         if (houseId) {
27
             getDetail()
43
             getDetail()
40
         request({ url: `/taHouse/${houseId}` }).then((res) => {
56
         request({ url: `/taHouse/${houseId}` }).then((res) => {
41
             setDataSource(res.data.data)
57
             setDataSource(res.data.data)
42
 
58
 
43
-            wx.setNavigationBarTitle({
44
-                title: res.data.data.title
45
-            })
46
         })
59
         })
47
     }
60
     }
48
     
61
     

+ 1
- 1
src/pages/house/list/index.jsx View File

59
   }
59
   }
60
 
60
 
61
   useEffect(() => {
61
   useEffect(() => {
62
-    console.log(props, ref,'props, ref')
62
+
63
     getHouseList()
63
     getHouseList()
64
 
64
 
65
     Taro.nextTick(() => {
65
     Taro.nextTick(() => {

+ 6
- 6
src/pages/house/list/index.scss View File

23
       position: relative;
23
       position: relative;
24
 
24
 
25
       &-radio {
25
       &-radio {
26
-          width: 50px;
27
-          height: 50px;
26
+          width: 40px;
27
+          height: 40px;
28
         background-color: #274291;
28
         background-color: #274291;
29
         text-align: center;
29
         text-align: center;
30
-        line-height: 50px;
30
+        line-height: 40px;
31
         position: absolute;
31
         position: absolute;
32
-        border-radius: 25px;
33
-        top: -12.5px;
34
-        right: -12.5px;
32
+        border-radius: 20px;
33
+        top: -2px;
34
+        right: 2px;
35
       }
35
       }
36
 
36
 
37
       .top {
37
       .top {

+ 1
- 1
src/pages/index/index.config.js View File

1
 export default {
1
 export default {
2
-  navigationBarTitleText: '首页',
2
+  // navigationBarTitleText: '首页',
3
   
3
   
4
 }
4
 }

+ 69
- 53
src/pages/index/index.jsx View File

1
-import React, { useEffect, useMemo, useState } from 'react'
2
-import Taro,{useRouter} from '@tarojs/taro'
3
-import { useSelector, useDispatch } from 'react-redux'
4
-import { View, ScrollView } from '@tarojs/components'
5
-import Tab from '../../compents/tab/index'
6
-import Customer from '../customer/index'
7
-import Landlord from '../landlord/index'
8
-import roleList from '../../util/userRole'
9
-import './index.scss'
10
-import request from '../../util/request'
11
-import GetPhone from '@/compents/getPhone'
12
-const index = (props) => {
1
+import React, { useEffect, useMemo, useState } from "react";
2
+import Taro, { useRouter } from "@tarojs/taro";
3
+import { useSelector, useDispatch } from "react-redux";
4
+import { View, ScrollView } from "@tarojs/components";
5
+import Tab from "../../compents/tab/index";
6
+import Customer from "../customer/index";
7
+import Landlord from "../landlord/index";
8
+import roleList from "../../util/userRole";
9
+import "./index.scss";
10
+import request from "../../util/request";
11
+import GetPhone from "@/compents/getPhone";
12
+const index = props => {
13
+  const router = useRouter();
14
+
15
+  const { houseId, orderId } = router.params;
16
+  const user = useSelector(state => state.user);
17
+
18
+  console.log(user);
19
+
20
+  const dispatch = useDispatch();
13
 
21
 
14
-
15
-  const router = useRouter()
16
-
17
-  const { houseId ,orderId} = router.params
18
-  const user = useSelector(state => state.user)
19
-
20
-  console.log(user)
21
-
22
-  const dispatch = useDispatch()
22
+  useEffect(() => {
23
+    if (user.role == roleList.landlord) {
24
+      wx.setNavigationBarTitle({
25
+        title: '名宿房源管理'
26
+      });
27
+    }
28
+    if (user.role == roleList.customer) {
29
+      wx.setNavigationBarTitle({
30
+        title: '十公里周边指南'
31
+      });
32
+    }
33
+  }, [user.role]);
23
 
34
 
24
   // const [userRole, setUserRole] = useState('1')
35
   // const [userRole, setUserRole] = useState('1')
25
   // const [pageState, SetPageState] = useState('1')
36
   // const [pageState, SetPageState] = useState('1')
26
   // const [list, setList] = useState([])
37
   // const [list, setList] = useState([])
27
   // const [visible, setVisible] = useState(false)
38
   // const [visible, setVisible] = useState(false)
28
-  const [showAuthPhone, setShowAuthPhone] = useState(false)
39
+  const [showAuthPhone, setShowAuthPhone] = useState(false);
29
 
40
 
30
   useEffect(() => {
41
   useEffect(() => {
31
-    setShowAuthPhone(!user.phone)
32
-  }, [user.phone])
33
-
34
-  const onOk = (res) => {
35
-    dispatch({ type: 'LOGIN', user: res.data.data })
36
-    setShowAuthPhone(false)
37
-  }
38
-
39
-  const onCancel = (e) => {
40
-    setShowAuthPhone(false)
41
-  }
42
-
43
-  return <View className='index'>
44
-
45
-    {user.personId && <View>
46
-      <GetPhone visible={showAuthPhone} onOk={onOk} onCancel={onCancel} ></GetPhone>
47
-      {user.role == roleList.customer &&!showAuthPhone&& <Customer houseId={houseId} orderId={orderId}></Customer>}
48
-      {user.role == roleList.landlord &&!showAuthPhone&& <Landlord ></Landlord>}
49
-    </View>}
50
-
51
-
52
-
53
-
54
-
55
-    {/* {userRole == 1 ? <Register userRole={userRole} list={list} onChange={(e) => onRegisterChange(e)}></Register> :
42
+    setShowAuthPhone(!user.phone);
43
+  }, [user.phone]);
44
+
45
+  const onOk = res => {
46
+    dispatch({ type: "LOGIN", user: res.data.data });
47
+    setShowAuthPhone(false);
48
+  };
49
+
50
+  const onCancel = e => {
51
+    setShowAuthPhone(false);
52
+  };
53
+
54
+  return (
55
+    <View className="index">
56
+      {user.personId && (
57
+        <View>
58
+          <GetPhone
59
+            visible={showAuthPhone}
60
+            onOk={onOk}
61
+            onCancel={onCancel}
62
+          ></GetPhone>
63
+          {user.role == roleList.customer && !showAuthPhone && (
64
+            <Customer houseId={houseId} orderId={orderId}></Customer>
65
+          )}
66
+          {user.role == roleList.landlord && !showAuthPhone && (
67
+            <Landlord></Landlord>
68
+          )}
69
+        </View>
70
+      )}
71
+
72
+      {/* {userRole == 1 ? <Register userRole={userRole} list={list} onChange={(e) => onRegisterChange(e)}></Register> :
56
           <View>userRole={userRole} list={list} onChange={(e) => onRegisterChange(e)}
73
           <View>userRole={userRole} list={list} onChange={(e) => onRegisterChange(e)}
57
             {(userRole == 'guide' || userRole == 2) && <Guide userRole={userRole}/>}
74
             {(userRole == 'guide' || userRole == 2) && <Guide userRole={userRole}/>}
58
             {userRole == 'recommend' && <Recommend userRole={userRole}/>}
75
             {userRole == 'recommend' && <Recommend userRole={userRole}/>}
66
         }
83
         }
67
      <HouseLIst userRole={userRole} list={list} onChange={(e) => onRegisterChange(e)}></HouseLIst>  */}
84
      <HouseLIst userRole={userRole} list={list} onChange={(e) => onRegisterChange(e)}></HouseLIst>  */}
68
 
85
 
69
-
70
-
71
-    {/* </View>
86
+      {/* </View>
72
     </ScrollView>
87
     </ScrollView>
73
     <Tab value={userRole} onClick={(e) => onTabClick(e)}></Tab> */}
88
     <Tab value={userRole} onClick={(e) => onTabClick(e)}></Tab> */}
74
-  </View>
75
-}
89
+    </View>
90
+  );
91
+};
76
 
92
 
77
-export default index
93
+export default index;

+ 3
- 3
src/pages/landlord/index.jsx View File

105
 
105
 
106
     <AtFloatLayout isOpened={isOpened} onClose={() => handleClose()} style={{ zIndex: '1000' }}>
106
     <AtFloatLayout isOpened={isOpened} onClose={() => handleClose()} style={{ zIndex: '1000' }}>
107
       <View className='floatmodel' >
107
       <View className='floatmodel' >
108
-        <View onClick={() => Taro.navigateTo({ url: '/pages/house/addnewhouse/index' })}>新增房源</View>
109
-        <View onClick={() => { setIsOpened(false); setRadioHouseState(true) }}>复制房源</View>
110
-        <View style={{ color: '#d2d2d2' }} onClick={() => setIsOpened(false)}>取消</View>
108
+        <View style={{width:"50%" ,textAlign:'center'}} onClick={() => Taro.navigateTo({ url: '/pages/house/addnewhouse/index' })}>新增房源</View>
109
+        <View style={{width:"50%" ,textAlign:'center'}}  onClick={() => { setIsOpened(false); setRadioHouseState(true) }}>复制房源</View>
110
+        <View style={{width:"50%" ,textAlign:'center', color: '#d2d2d2' }} onClick={() => setIsOpened(false)}>取消</View>
111
       </View>
111
       </View>
112
 
112
 
113
     </AtFloatLayout>
113
     </AtFloatLayout>

+ 3
- 3
src/pages/map/index.config.js View File

1
 export default {
1
 export default {
2
-
3
-  
4
-}
2
+ 
3
+    navigationBarTitleText: '修改地址',
4
+  }

+ 18
- 19
src/pages/map/index.jsx View File

18
     const [userRole, setUserRole] = useState('1')
18
     const [userRole, setUserRole] = useState('1')
19
     const [pageState, setPageState] = useState('1')
19
     const [pageState, setPageState] = useState('1')
20
     const [address, setAddress] = useState({})
20
     const [address, setAddress] = useState({})
21
-    // const [lngLat, setLngLat] = useState('')
22
 
21
 
22
+    // 在onInput详细地址时有bug,不能放在adderss里,所有加了个value
23
+    const [value,setValue] = useState('')
24
+    // const [lngLat, setLngLat] = useState('')
25
+console.log(address,'setAddress')
23
     useDidShow(() => {
26
     useDidShow(() => {
24
 
27
 
25
     })
28
     })
35
         request({ url: `/taHouse/${houseId}` }).then((res) => {
38
         request({ url: `/taHouse/${houseId}` }).then((res) => {
36
             console.log(res.data.data,type, 'getDetail')
39
             console.log(res.data.data,type, 'getDetail')
37
             if (type == "address") {
40
             if (type == "address") {
41
+                const [addressName,addressDetail] = (res.data.data.address||'').split('____')
38
                 setAddress({
42
                 setAddress({
39
-                    address:res.data.data.address,
43
+                    name:addressName,
44
+                    address:addressDetail,
40
                     lngLat:res.data.data.lngLat
45
                     lngLat:res.data.data.lngLat
41
                 })
46
                 })
47
+
48
+                setValue(addressDetail)
42
                 // setAddress(res.data.data.address)
49
                 // setAddress(res.data.data.address)
43
                 // setLngLat(res.data.data.lngLat)
50
                 // setLngLat(res.data.data.lngLat)
44
             }else if (type == 'park'){
51
             }else if (type == 'park'){
45
-
52
+                const [addressName,addressDetail] = (res.data.data.parking||'').split('____')
46
                 setAddress({
53
                 setAddress({
47
-                    address:res.data.data.parking,
54
+                    name:addressName,
55
+                    address:addressDetail,
48
                     lngLat:res.data.data.parkLngLat
56
                     lngLat:res.data.data.parkLngLat
49
                 })
57
                 })
58
+                setValue(addressDetail)
50
                 // address(res.data.data)
59
                 // address(res.data.data)
51
                 // setAddress(res.data.data.parking)
60
                 // setAddress(res.data.data.parking)
52
                 // setLngLat(res.data.data.parkLngLat)
61
                 // setLngLat(res.data.data.parkLngLat)
61
         let data = {}
70
         let data = {}
62
         if (type == 'address') {
71
         if (type == 'address') {
63
             data = {
72
             data = {
64
-                address: address.address,
73
+                address: `${address.name}____${value}`,
65
                 lngLat:`${address.latitude},${address.longitude}`
74
                 lngLat:`${address.latitude},${address.longitude}`
66
             }
75
             }
67
         } else if (type == 'park') {
76
         } else if (type == 'park') {
68
             data = {
77
             data = {
69
-                parking: address.address,
78
+                parking: `${address.name}____${value}`,
70
                 parkLngLat:`${address.latitude},${address.longitude}`
79
                 parkLngLat:`${address.latitude},${address.longitude}`
71
             }
80
             }
72
         }
81
         }
79
         })
88
         })
80
     }
89
     }
81
 
90
 
82
-    const onChange = (e) => {
83
-        console.log(e, '111')
84
-        // setLngLat(e.detail.value)
85
-    }
86
     const onChooseLocation = () => {
91
     const onChooseLocation = () => {
87
         console.log(333)
92
         console.log(333)
88
         wx.chooseLocation({
93
         wx.chooseLocation({
90
                 console.log(res)
95
                 console.log(res)
91
 
96
 
92
                 setAddress(res)
97
                 setAddress(res)
98
+                setValue(res.address)
93
             },
99
             },
94
             fail: (err) => {
100
             fail: (err) => {
95
                 console.log(err)
101
                 console.log(err)
99
         })
105
         })
100
     }
106
     }
101
 
107
 
102
-
103
     return <View className='map'>
108
     return <View className='map'>
104
 
109
 
105
 
110
 
106
 
111
 
107
 
112
 
108
         <Layout>
113
         <Layout>
109
-            {/* <View className='map-view'>
110
-                <Text className='title'></Text>
111
-                <Container className='map-view-card'>
112
-                <Input placeholderClass='placeholderinput' className='input' type='text' placeholder='小区/写字楼/大厦等' />
113
-                </Container>
114
-            </View> */}
115
             <View className='map-view' >
114
             <View className='map-view' >
116
                 <Text className='title'>位置信息</Text>
115
                 <Text className='title'>位置信息</Text>
117
                 <View style={{ display: 'flex' }}>
116
                 <View style={{ display: 'flex' }}>
118
                     <Container className='map-view-card' style={{ width: '100%' }}>
117
                     <Container className='map-view-card' style={{ width: '100%' }}>
119
-                        {address.address&&<Input value={address.address} disabled placeholderClass='placeholderinput' className='input' type='text' placeholder='' />}
118
+                        {address.address&&<Input value={address.name} disabled placeholderClass='placeholderinput' className='input' type='text' placeholder='' />}
120
 
119
 
121
                     </Container>
120
                     </Container>
122
                     <Container className='map-view-icon' onClick={() => onChooseLocation()}>
121
                     <Container className='map-view-icon' onClick={() => onChooseLocation()}>
128
             <View className='map-view'>
127
             <View className='map-view'>
129
                 <Text className='title'>具体地址</Text>
128
                 <Text className='title'>具体地址</Text>
130
                 <Container className='map-view-card'>
129
                 <Container className='map-view-card'>
131
-                    <Input  onInput={onChange} placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
130
+                    <Input value={value} onInput={(e)=>setValue(e.detail.value)} placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
132
                 </Container>
131
                 </Container>
133
             </View>
132
             </View>
134
         </Layout>
133
         </Layout>

+ 1
- 1
src/pages/material/index.config.js View File

1
 export default {
1
 export default {
2
 
2
 
3
-  
3
+  navigationBarTitleText: '选择分类标签',
4
 }
4
 }

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

72
             true && list.map((x) => {
72
             true && list.map((x) => {
73
                 return <View className='recommend-view'>
73
                 return <View className='recommend-view'>
74
                     <ContainerLayout className='recommend-view-layout'  >
74
                     <ContainerLayout className='recommend-view-layout'  >
75
-                        {id != x.surroundId ? <View className='recommend-view-card' style={{ height: "300rpx",overflow:'hidden' }}>
75
+                        {id != x.surroundId ? <View className='recommend-view-card' style={userRloe.customer == user.role ? { height: "300rpx",overflow:'hidden' }:''}>
76
 
76
 
77
                             <Image className='recommend-view-img' mode='widthFix' src={x.image} ></Image>
77
                             <Image className='recommend-view-img' mode='widthFix' src={x.image} ></Image>
78
 
78
 
79
 
79
 
80
                             {userRloe.customer == user.role ? <Image className='icon' src={more} onClick={() => onClick(x)}></Image>
80
                             {userRloe.customer == user.role ? <Image className='icon' src={more} onClick={() => onClick(x)}></Image>
81
 
81
 
82
-                                : <Image className='icon' src={deleteicon} style={{ width: '40rpx' }} onClick={() => onClick(x)}></Image>
82
+                                : <Image className='icon' src={deleteicon} mode='widthFix' style={{ width: '40rpx' }} onClick={() => onClick(x)}></Image>
83
                             }
83
                             }
84
 
84
 
85
-
86
-
87
                         </View> :
85
                         </View> :
88
-                            <View style={{ height: "700rpx" }}>
86
+                            <View  >
89
                                 <Image className='recommend-view-img' mode='widthFix' src={x.image}></Image>
87
                                 <Image className='recommend-view-img' mode='widthFix' src={x.image}></Image>
90
 
88
 
91
                             </View>
89
                             </View>

+ 1
- 1
src/pages/recommend/index.scss View File

5
     position: relative;
5
     position: relative;
6
     &-card{
6
     &-card{
7
       width: 100%;
7
       width: 100%;
8
-      height: 420px;
8
+      // height: 420px;
9
     }
9
     }
10
     &-img{
10
     &-img{
11
       width: 100%;
11
       width: 100%;

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

1
-// onShareAppMessage: function () {
2
-// return custom share data when user share.
3
-//     console.log('44444444')
4
-//   },
5
 
1
 
6
 export default {
2
 export default {
3
+    navigationBarTitleText: '分享',
7
     enableShareAppMessage: true
4
     enableShareAppMessage: true
8
 }
5
 }

+ 3
- 3
src/pages/wifi/index.config.js View File

1
 export default {
1
 export default {
2
-
3
-  
4
-}
2
+ 
3
+    navigationBarTitleText: '修改wifi',
4
+  }

+ 3
- 0
src/reducers/user.js View File

37
     case 'LOGIN': {
37
     case 'LOGIN': {
38
 
38
 
39
       if (action.user.shopKeeperList && action.user.shopKeeperList.length) {
39
       if (action.user.shopKeeperList && action.user.shopKeeperList.length) {
40
+          wx.setNavigationBarTitle({
41
+            title: '民宿房源管理'
42
+          })
40
         return {
43
         return {
41
           ...state,
44
           ...state,
42
           ...action.user,
45
           ...action.user,