zlisen vor 4 Jahren
Ursprung
Commit
84bc458cbd

+ 1
- 0
src/app.config.js Datei anzeigen

@@ -4,6 +4,7 @@ export default {
4 4
     'pages/house/index',
5 5
     'pages/map/index',
6 6
     'pages/wifi/index',
7
+    'pages/housename/index',
7 8
     'pages/share/index',
8 9
     'pages/house/addnewhouse/index',
9 10
     'pages/house/household/index',

+ 80
- 0
src/compents/navcustom/index.jsx Datei anzeigen

@@ -0,0 +1,80 @@
1
+import Taro from "@tarojs/taro";
2
+import React, { useEffect, useMemo, useState } from "react";
3
+import { View, Image, Text } from "@tarojs/components";
4
+import usericon from "../../assets/usericon.png";
5
+
6
+const NavCustom = props => {
7
+  const { houseInfo={} } = props;
8
+  const {taShop={}} =houseInfo
9
+  const [navStyle, setNavStyle] = useState({});
10
+
11
+  useEffect(() => {
12
+    console.log(Taro.getMenuButtonBoundingClientRect(), "-------");
13
+    setNavStyle(Taro.getMenuButtonBoundingClientRect());
14
+  }, []);
15
+  return (
16
+    <View
17
+      style={{
18
+        height: navStyle.bottom + 10,
19
+        width: "100%",
20
+        display: "flex",
21
+        background: "#fff"
22
+      }}
23
+    >
24
+      {houseInfo && (
25
+        <View
26
+          style={{
27
+            width: navStyle.left,
28
+            display: "flex",
29
+            background: "#fff",
30
+            paddingLeft: 10,
31
+            paddingBottom: 10,
32
+            margin: 0,
33
+            alignItems: "flex-end"
34
+          }}
35
+        >
36
+          <View
37
+            style={{
38
+              width: navStyle.right - navStyle.left,
39
+              height: 40,
40
+              borderRadius: 20,
41
+           
42
+            }}
43
+          >
44
+            {taShop.logo && (
45
+              <Image
46
+                className="guide-view-img"
47
+                // mode="widthFix"
48
+                style={{
49
+                  width: 40,
50
+                  height: 40,
51
+                  borderRadius: 20,
52
+                  margin:0,
53
+                  background: "#000"
54
+                }}
55
+                src={taShop.logo}
56
+              ></Image>
57
+            )}
58
+          </View>
59
+
60
+          <View
61
+            style={{
62
+              textAlign: "center",
63
+              width: navStyle.left - 50,
64
+              marginTop: navStyle.top,
65
+            //   height: navStyle.height,
66
+            //   lineHeight: `${navStyle.height}px`
67
+            }}
68
+          >
69
+           <view>{taShop.name||'十公里周边指南'}</view>
70
+           {/* <view style={{fontSize:'24rpx',color:'#7b7b7b'}}>{houseInfo.title}</view> */}
71
+              
72
+              
73
+           {/* <Text></Text>  */}
74
+          </View>
75
+        </View>
76
+      )}
77
+    </View>
78
+  );
79
+};
80
+export default NavCustom;

+ 7
- 2
src/layout/index.jsx Datei anzeigen

@@ -1,8 +1,13 @@
1 1
 import React from 'react';
2
+import Taro from '@tarojs/taro'
2 3
 import { View, ScrollView } from '@tarojs/components'
3 4
 
4
-const Layout = ({ children }) => {
5
-    return <ScrollView className='scrol' scrollY  >
5
+const Layout = ({ children,type }) => {
6
+
7
+  const navStyle =  Taro.getMenuButtonBoundingClientRect()
8
+
9
+console.log(`calc(100vh - 42.5px - ${navStyle.bottom}px -10px)`,'`calc(100vh - 42.5px - ${navStyle.bottom}px -10px)`')
10
+    return <ScrollView className='scrol' scrollY  style={type=='custom'?{height:`calc(100vh - 42.5px - ${navStyle.bottom}px - 10px)`}:undefined} >
6 11
         <View className='page-container' >
7 12
             {children}
8 13
         </View>

+ 10
- 3
src/pages/customer/index.js Datei anzeigen

@@ -1,15 +1,17 @@
1 1
 import React, { useEffect, useMemo, useState } from 'react'
2
+import Taro from '@tarojs/taro'
2 3
 import { useSelector } from 'react-redux'
3
-import { View, ScrollView } from '@tarojs/components'
4
+import { View, Image,Text } from '@tarojs/components'
4 5
 import  Layout from '../../layout/index'
5 6
 import Tab from '../../compents/tab/index'
6 7
 import Register from './register/index'
7 8
 import Guide from '../guide/index'
8 9
 import Recommend from '../recommend/index'
9
-// import HouseLIst from '../house/list'
10
+import NavCustom from '../../compents/navcustom'
10 11
 
11 12
 import './index.scss'
12 13
 import request from '../../util/request'
14
+import usericon from '../../assets/usericon.png'
13 15
 
14 16
 const index = (props) => {
15 17
   const {houseId,orderId} = props
@@ -22,6 +24,7 @@ const index = (props) => {
22 24
   const [surroundList, setSurroundList] = useState()
23 25
   const [regUnFinished, setRegUnFinished] = useState(true)
24 26
 
27
+
25 28
   const handleRegisterFinished = () => {
26 29
     setRegUnFinished(false)
27 30
   }
@@ -64,15 +67,19 @@ const index = (props) => {
64 67
  
65 68
   return (
66 69
     <View className='index' >
70
+
71
+<NavCustom houseInfo={houseInfo}></NavCustom>
67 72
       {pageState=='1'&&<Register oderId={orderId} dataSource={orderInfo} onFinished={handleRegisterFinished}></Register>}
68 73
 
69
-      {pageState!='1'&&<Layout>
74
+      {pageState!='1'&&<Layout type='custom'>
75
+
70 76
         {pageState=='2'&&<Guide houseId={houseId} dataSource={houseInfo}></Guide>  }
71 77
         {pageState=='3'&&<Recommend houseId={houseId} dataSource={surroundList}></Recommend>  }
72 78
       </Layout>}
73 79
     {/* !!houseId&& */}
74 80
       {pageState!='1' && (
75 81
         <Tab
82
+        styleType='tab'
76 83
           value={['入住指引','房东推荐']}
77 84
           pageState={pageState}
78 85
           onClick={[(e) => setPageState('2'),(e) => setPageState('3')]} />

+ 16
- 0
src/pages/guide/index.jsx Datei anzeigen

@@ -71,6 +71,11 @@ const guide = props => {
71 71
       case "wifi":
72 72
         Taro.navigateTo({ url: `/pages/wifi/index?houseId=${houseId}` });
73 73
         break;
74
+
75
+      case "housename":
76
+        Taro.navigateTo({ url: `/pages/housename/index?houseId=${houseId}` });
77
+        break;
78
+
74 79
       case "image": {
75 80
         if (user.role == userRloe.customer) return;
76 81
         wx.chooseImage({
@@ -118,6 +123,17 @@ const guide = props => {
118 123
     <View className="guide">
119 124
       {!!houseId && (
120 125
         <View>
126
+          <View className="guide-view">
127
+            <Text className="guide-view-info">房屋名称</Text>
128
+            <ContainerLayout
129
+              className="guide-view-layout guide-view-wifi"
130
+              onClick={() => onToMap("housename")}
131
+            >
132
+              <View className="guide-view-layout-text1" style={{ margin: 0 }}>
133
+                {detail.title}
134
+              </View>
135
+            </ContainerLayout>
136
+          </View>
121 137
           <View className="guide-view">
122 138
             <Text className="guide-view-info">房屋位置</Text>
123 139
             <ContainerLayout

+ 6
- 16
src/pages/house/household/index.jsx Datei anzeigen

@@ -33,22 +33,11 @@ const house = (props) => {
33 33
     })
34 34
   }
35 35
 
36
-  // {
37
-
38
-  //   Object.keys(list).map((item) => {
39
-  //       console.log(list[item], item, 'list[item]11')
40
-
41
-  //       return <View className='imglist-card'>
42
-  //           <View className='imglist-card-tags' style={{ display: 'flex' }}>
43
-  //               {/* imageimageimageimage34 */}
44
-  //               {list[item].map((x) => {
45
-  //                   return <View className='tag' s>{x.tagName}</View>
46
-  //               })}
47
-  //           </View>
48
-  //           <Image src={list[item][0].image} style={{ width: '100%' }} onClick={() => { setData(list[item]); setIsOpened(true) }}></Image>
49
-  //       </View>
50
-  //   })
51
-  // }
36
+const getDate =(value)=>{ 
37
+  const [date,time] = value.split('T')
38
+  console.log(time,'time')
39
+return `${date} ${time.split(':')[0]}:${time.split(':')[1]}`
40
+}
52 41
   return <View className='household'>
53 42
 
54 43
     <Layout>
@@ -63,6 +52,7 @@ const house = (props) => {
63 52
               {list[item].map((x) => {
64 53
                 return <view>{x.name}: {x.phone}</view>  
65 54
               })}
55
+              {`入住时间:${getDate(list[item][0].createDate)}`}
66 56
               {list[item].length == 0 && '暂无入住人信息'}
67 57
 
68 58
             </ContainerLayout>

+ 2
- 1
src/pages/house/index.config.js Datei anzeigen

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

+ 3
- 5
src/pages/house/index.jsx Datei anzeigen

@@ -7,9 +7,7 @@ import Tab from '../../compents/tab/index'
7 7
 import Guide from '../guide/index'
8 8
 import Recommend from '../recommend/index'
9 9
 import roleList from '../../util/userRole'
10
-
11
-// import HouseLIst from '../house/list'
12
-
10
+import NavCustom from '../../compents/navcustom'
13 11
 import './index.scss'
14 12
 import request from '../../util/request'
15 13
 
@@ -74,8 +72,8 @@ const house = (props) => {
74 72
 
75 73
 
76 74
         <View >
77
-
78
-            <Layout>
75
+        <NavCustom houseInfo={dataSource}></NavCustom>
76
+            <Layout type='custom'>
79 77
                 {pageState == '2' && <Guide houseId={houseId} dataSource={dataSource}></Guide>}
80 78
                 {pageState == '3' && <Recommend houseId={houseId} dataSource={imgSource}></Recommend>}
81 79
             </Layout>

+ 4
- 2
src/pages/house/list/index.jsx Datei anzeigen

@@ -60,7 +60,7 @@ let house = (props, ref) => {
60 60
   };
61 61
 
62 62
   const onShare = x => {
63
-    Taro.navigateTo({ url: `/pages/share/index?houseId=${x.houseId}` });
63
+    Taro.navigateTo({ url: `/pages/share/index?houseId=${x.houseId}&&title=${x.title}` });
64 64
   };
65 65
 
66 66
   useEffect(() => {
@@ -119,9 +119,11 @@ let house = (props, ref) => {
119 119
   // useDidShow(() => {
120 120
   //   setQueryParams({ ...queryParams })
121 121
   // })
122
-
122
+ 
123 123
   return (
124 124
     <View className="houselist">
125
+     
126
+
125 127
       {(!list || !list.length) && <View className="nodata"> 暂无数据</View>}
126 128
       <RecycleList
127 129
         height={height}

+ 4
- 0
src/pages/housename/index.config.js Datei anzeigen

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

+ 106
- 0
src/pages/housename/index.jsx Datei anzeigen

@@ -0,0 +1,106 @@
1
+import React, { useEffect, useMemo, useState } from 'react'
2
+import Taro,{useRouter } from "@tarojs/taro";
3
+import { useSelector } from 'react-redux'
4
+import { View, Input, Text, Image } from '@tarojs/components'
5
+import Layout from '../../layout/index'
6
+import Tab from '../../compents/tab/index'
7
+import Container from '../../compents/container/index'
8
+import locationicon from '../../assets/locationicon.png'
9
+import request from '../../util/request'
10
+import './index.scss'
11
+
12
+const index = (props) => {
13
+    const router = useRouter()
14
+
15
+    const { houseId } = router.params
16
+    const page = useSelector(state => state.page)
17
+
18
+    const user = useSelector(state => state.user)
19
+
20
+    const [userRole, setUserRole] = useState('1')
21
+    const [pageState, setPageState] = useState('1')
22
+    const [list, setList] = useState([])
23
+    const [title,setTitle] = useState('')
24
+
25
+   useEffect(() => {
26
+        
27
+        if (houseId) {
28
+            getDetail()
29
+        }
30
+
31
+    }, [])
32
+    const getDetail = () => {
33
+        request({ url: `/taHouse/${houseId}` }).then((res) => {
34
+        
35
+            setTitle(res.data.data.title)
36
+        })
37
+    }
38
+
39
+
40
+    const onTabClick = (e) => {
41
+        console.log(e, '111')
42
+        setUserRole(e)
43
+    }
44
+
45
+    const onRegisterChange = (e) => {
46
+        console.log(e, '111')
47
+    }
48
+    const onSave = () => {
49
+        console.log(333)
50
+        const data= {
51
+            title
52
+        }
53
+
54
+        request({ url: `/taHouse/${houseId}`, method: 'put', data: { ...data, houseId } }).then((res) => {
55
+            Taro.navigateBack({
56
+                delta: 1
57
+            })
58
+        })
59
+        
60
+        // Taro.showModal({
61
+        //     title: '修改成功',
62
+        //     content: '点击确认按钮,返回上级菜单',
63
+        //     showCancel:false,
64
+        //     success: function (res) {
65
+        //       if (res.confirm) {
66
+        //         console.log('用户点击确定')
67
+
68
+        //         Taro.navigateBack({
69
+        //             delta: 1
70
+        //           })
71
+        //       } else if (res.cancel) {
72
+        //         console.log('用户点击取消')
73
+        //       }
74
+        //     }
75
+        //   })
76
+    }
77
+
78
+
79
+    return <View className='map'>
80
+
81
+
82
+
83
+
84
+        <Layout>
85
+            <View className='map-view'>
86
+                <Text className='title'>房屋名称</Text>
87
+                <Container className='map-view-card'>
88
+                <Input value={title} onInput={(e)=>setTitle(e.detail.value)}  placeholderClass='placeholderinput' className='input' type='text' placeholder='' />
89
+                </Container>
90
+            </View>
91
+         
92
+
93
+          
94
+        </Layout>
95
+         <Tab className='addhousetab' pageState='3' value={['取消', '保存修改']} onClick={[(e) =>Taro.navigateBack({
96
+                delta: 1
97
+            }), () => onSave()]}></Tab>
98
+
99
+
100
+
101
+
102
+
103
+    </View>
104
+}
105
+
106
+export default index

+ 50
- 0
src/pages/housename/index.scss Datei anzeigen

@@ -0,0 +1,50 @@
1
+.map {
2
+  // padding:13.33px;
3
+  &-view {
4
+    margin: 50px 0 0;
5
+
6
+    &-card {
7
+      // height: 106px;
8
+      // line-height: 106px;
9
+      padding: 0 40px;
10
+      // color:#181818;
11
+      font-size: 24px;
12
+      // font-weight: 600;
13
+      margin-top: 26.67px;
14
+      border-radius: 30px;
15
+      border-radius: 20px;
16
+      .input{
17
+        font-size: 28px;
18
+        padding:30px 0;
19
+        line-height: 106px;
20
+        // color: red;
21
+      }
22
+      .placeholderinput{
23
+        // line-height: 106px;
24
+        color: #d2d2d2;
25
+        font-size: 28px;
26
+      }
27
+    }
28
+    &-icon {
29
+      margin-left: 40px;
30
+      // padding: 20px 30px;
31
+      // color:#181818;
32
+      width: 150px;
33
+      height: 106.67px;
34
+      // font-size: 36px;
35
+      // // font-weight: 600;
36
+      margin-top: 26.67px;
37
+      border-radius: 20px;
38
+      background-color: #274291;
39
+      padding: 0;
40
+      text-align: center;
41
+      line-height:120.67px;
42
+      .icon {
43
+        
44
+        // width: 100%;
45
+      }
46
+    }
47
+    // style={{width:'48.4rpx',height:'48.4rpx'}}
48
+  }
49
+
50
+}

+ 1
- 1
src/pages/index/index.config.js Datei anzeigen

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

+ 5
- 4
src/pages/landlord/index.jsx Datei anzeigen

@@ -11,7 +11,7 @@ import HouseLIst from '../house/list/index'
11 11
 import { AtFloatLayout } from "taro-ui"
12 12
 import request from '@/util/request'
13 13
 import './index.scss'
14
-
14
+import NavCustom from '../../compents/navcustom'
15 15
 const index = (props) => {
16 16
 
17 17
 
@@ -86,14 +86,15 @@ const index = (props) => {
86 86
     }
87 87
 
88 88
   }
89
-
89
+  const navStyle =  Taro.getMenuButtonBoundingClientRect()
90 90
 
91 91
   return <View className='index'>
92 92
 
93 93
 
94 94
     <View>
95
-
96
-      <Layout>
95
+  
96
+  {pageState == '1' &&<NavCustom houseInfo={{title:'民宿房源管理'}}></NavCustom>}
97
+      <Layout type='custom'>
97 98
         {pageState == '1' && <HouseLIst ref={childRef} radioHouseState={radioHouseState} onChange={(e) => setRadioHouseData(e)}></HouseLIst>}
98 99
       </Layout>
99 100
       {!isOpened && <Tab className='addhousetab' value={['+添加房源']} onClick={(e) => setIsOpened(true)}></Tab>}

+ 1
- 1
src/pages/recommend/index.jsx Datei anzeigen

@@ -20,7 +20,7 @@ const ImageCard = props => {
20 20
       className="recommend-view-card"
21 21
       style={
22 22
 
23
-          { height: !isopen?'330rpx':undefined, overflow: "hidden"}
23
+          { height: !isopen?'333rpx':undefined, overflow: "hidden"}
24 24
          
25 25
       }
26 26
     >

+ 2
- 2
src/pages/share/index.jsx Datei anzeigen

@@ -19,7 +19,7 @@ import request from '../../util/request';
19 19
 
20 20
 const Index = () => {
21 21
     const router = useRouter()
22
-    const { houseId } = router.params
22
+    const { houseId,title } = router.params
23 23
     const [personNum, setPersonNum] = useState()
24 24
     const [startTime, setStartTime] = useState('')
25 25
     const [endTime, setEndTime] = useState('')
@@ -63,7 +63,7 @@ const Index = () => {
63 63
                 return request({ url: `/taHouse/${houseId}/share` }).then(res => {
64 64
 
65 65
                     const share = {
66
-                        title: '分享到微信',
66
+                        title: `欢迎来到${title}`,
67 67
                         imageUrl: (res.data.data || {}).image,
68 68
                         path: `/pages/index/index?houseId=${houseId}&personNum=${personNum}&startTime=${startTime}&endTime=${endTime}&orderId=${orderId}`
69 69
                     }