吃个甘蔗嚼一年 3 years ago
parent
commit
92a0caa53e

+ 1
- 4
src/components/Popup/index.jsx View File

@@ -2,10 +2,7 @@
2 2
 import './style.less'
3 3
 
4 4
 export default (props) => {
5
-  const { show, mask = true, onClose, maskClosable } = props
6
-  const onClose3 = () => {
7
-    console.log('3333333333333333333333')
8
-  }
5
+  const { show, mask = true, onClose, maskClosable } = props  
9 6
   return (
10 7
     <mp-dialog extClass='x-popup' buttons={[]} show={show} mask={mask} maskClosable={maskClosable} onClose={onClose}>
11 8
       {props.children}

+ 10
- 5
src/components/Star/Star.jsx View File

@@ -2,15 +2,20 @@
2 2
 import hongxin from '@/assets/icons/housemantj/已收藏.png'
3 3
 import baixin from '@/assets/icons/housemantj/收藏.png'
4 4
 import './Star.less'
5
+
6
+const Star = (props) => <image className='star' src={props.star >= props.index ? hongxin : baixin}></image>
7
+
8
+const starList = (new Array(5)).fill()
9
+
5 10
 export default (props) => {
6 11
   const {star}=props
12
+
13
+
7 14
   return (
8 15
     <>
9
-      <image className='star' src={star >= 1 ? hongxin : baixin}></image>
10
-      <image className='star' src={star >= 2 ? hongxin : baixin}></image>
11
-      <image className='star' src={star >= 3 ? hongxin : baixin}></image>
12
-      <image className='star' src={star >= 4 ? hongxin : baixin}></image>
13
-      <image className='star' src={star >= 5 ? hongxin : baixin}></image>
16
+    {
17
+      starList.map((_, index) => <Star key={index} star={star} index={index + 1} />)
18
+    }
14 19
     </>
15 20
   )
16 21
 }

+ 0
- 3
src/components/toggleRole/ToggleRole.jsx View File

@@ -25,9 +25,6 @@ export default (props) => {
25 25
   const goToShop = () => {
26 26
     getRole('shop')
27 27
   }
28
-  const onClose2 = () => {
29
-    // console.log('2222222222222222222')
30
-  }
31 28
   return (
32 29
     <Popup show={showCutover} maskClosable={maskClosable} onClose={onClose}>
33 30
       <view className='User-box-sths' >

+ 9
- 4
src/hotel/components/HouseManage/houseManage.jsx View File

@@ -40,8 +40,10 @@ export default React.forwardRef((props, ref) => {
40 40
           })       
41 41
         } 
42 42
       }
43
-    })
44
-   
43
+    })   
44
+  }
45
+  const handelDetail=(val)=>{
46
+    Taro.navigateTo({ url: `/hotel/pages/landlord/addRoom/addRoom?hotelId=${hotel.hotelId}&hotelName=${hotel.hotelName}&roomId=${val.roomId}` });
45 47
   }
46 48
 
47 49
   const [showCutover, setShowCutover] = useState(false)
@@ -54,6 +56,9 @@ export default React.forwardRef((props, ref) => {
54 56
   const onClose = () => {
55 57
     setShowCutover(false)
56 58
   }
59
+  const onClose2 = () => {
60
+    setShowCard(false)
61
+  }
57 62
   useEffect(() => {
58 63
     //首次加载页面时
59 64
     if (!mounted.current && hotel.hotelId) {
@@ -112,11 +117,11 @@ export default React.forwardRef((props, ref) => {
112 117
       <view style={{ padding: '0 30rpx', height: '100%' }}>
113 118
         <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch}/>
114 119
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
115
-        <ShareCard showCutover={showCard} onClose={onClose} />
120
+        <ShareCard showCutover={showCard} onClose={onClose2} />
116 121
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 244px)' }}>
117 122
           {
118 123
             (detail || []).map((item) =>
119
-              <view className='houseCard'>
124
+              <view className='houseCard' onClick={()=>{handelDetail(item)}}>
120 125
                 <view className='houseName'>{item.roomName||''}</view>
121 126
                 <view className='operation'>
122 127
                   <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>

+ 66
- 34
src/hotel/components/Income/income.jsx View File

@@ -1,5 +1,4 @@
1 1
 import { useState } from 'react'
2
-import './income.less'
3 2
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
4 3
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
5 4
 import sImg from '@/assets/icons/landlord/我的收入2.png'
@@ -7,11 +6,22 @@ import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
7 6
 import ToggleRole from '@/components/toggleRole/ToggleRole'
8 7
 import Picker from '@/components/Picker'
9 8
 import formatTime from "@/utils/formatTime";
9
+import {getAccountLogList} from '@/services/landlord'
10
+
11
+import List from '@/components/List';
12
+import './income.less'
13
+
10 14
 
11 15
 
12 16
 export default (props) => {
13 17
   const { hotelList, hotel, account, onHotelChange, accountlog } = props
14 18
 
19
+  // const [accountLog,setAccountLog]=useState(accountlog)
20
+
21
+
22
+  // const [queryParams, setQueryParams] = useState({pageNum: 1, pageSize: 10})
23
+  // setQueryParams(hotel.hotelId)
24
+
15 25
   const handleHotelChange = (hotelId, current) => {
16 26
     onHotelChange(current)
17 27
   }
@@ -29,50 +39,72 @@ export default (props) => {
29 39
     setShowCutover(true)
30 40
   }
31 41
   const onClose = () => {
32
-    console.log('11111111')
33 42
     setShowCutover(false)
34 43
   }
35 44
   return (
36 45
     <view>
37
-      <ToggleRole role='hotel' showCutover={showCutover} onClose={onClose} />
46
+      <ToggleRole role='hotel' showCutover={showCutover} maskClosable={showCutover} onClose={onClose} />
38 47
       <view style={{ padding: '30rpx', height: '100%' }}>
39
-        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
40
-          <view className='storexx'>
41
-            <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择民宿" value={hotel?.hotelId} kv={['hotelName', 'hotelId']} dicts={hotelList} onChange={handleHotelChange} /></view>
42
-            <view onClick={ShowMoldeOn} className='User-info-cutover'>
43
-              <image className='User-info-cutover-image' src={cutoverUser} />
44
-            </view>
45
-            <view className='money'>
46
-              <view className='sleft'>
47
-                <view className='lword'>全年收入(税前)</view>
48
-                <view className='yearMoney'>
49
-                  <text>{isyear ? account?.amounts : '******'}</text>元
50
-                  <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
51
-                </view>
48
+        <view className='storexx'>
49
+          <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择民宿" value={hotel?.hotelId} kv={['hotelName', 'hotelId']} dicts={hotelList} onChange={handleHotelChange} /></view>
50
+          <view onClick={ShowMoldeOn} className='User-info-cutover'>
51
+            <image className='User-info-cutover-image' src={cutoverUser} />
52
+          </view>
53
+          <view className='money'>
54
+            <view className='sleft'>
55
+              <view className='lword'>全年收入(税前)</view>
56
+              <view className='yearMoney'>
57
+                <text>{isyear ? account?.amounts : '******'}</text>元
58
+                <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
52 59
               </view>
53
-              <view className='line' />
54
-              <view className='sright'>
55
-                <view className='rword'>当月收入(税前)</view>
56
-                <view className='monthMoney'>
57
-                  <text>{isMomth ? account?.currentCharges : '******'}</text>元
58
-                  <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
59
-                </view></view>
60 60
             </view>
61
+            <view className='line' />
62
+            <view className='sright'>
63
+              <view className='rword'>当月收入(税前)</view>
64
+              <view className='monthMoney'>
65
+                <text>{isMomth ? account?.currentCharges : '******'}</text>元
66
+                <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
67
+              </view></view>
61 68
           </view>
62
-          
63
-          <view className='title' >{accountlog.length!=''?'推广收入记录':'暂无推广收入'}</view>
64
-            {
65
-              (accountlog || []).map((item) => 
66
-                <view className='spreadCard'>
67
-                  <view className='card'>
68
-                    <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTime(item.createDate,'yyyy/MM/dd hh:mm:ss')}</text></view>
69
-                    <view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount/100).toFixed(2))}</text>元</view>
70
-                    <image className='spreadImg' src={sImg} />
71
-                  </view>
69
+        </view>
70
+
71
+        <view className='title' >{accountlog.length != '' ? '推广收入记录' : '暂无推广收入'}</view>
72
+        
73
+        {/* <List
74
+                  style={{ height: '50vh' }}
75
+                  request={getAccountLogList}
76
+                  params={queryParams}
77
+                  onDataChange={setAccountLog}
78
+                >
79
+                  {
80
+                    (accountLog || []).map((item) =>
81
+                    <view className='spreadCard'>
82
+                      <view className='card'>
83
+                        <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTime(item.createDate, 'yyyy/MM/dd hh:mm:ss')}</text></view>
84
+                        <view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount / 100).toFixed(2))}</text>元</view>
85
+                        <image className='spreadImg' src={sImg} />
86
+                      </view>
87
+                    </view>
88
+                    )
89
+                  }
90
+          </List> */}
91
+        
92
+        
93
+        
94
+        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: '50vh' }}>
95
+
96
+          {
97
+            (accountlog || []).map((item) =>
98
+              <view className='spreadCard'>
99
+                <view className='card'>
100
+                  <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTime(item.createDate, 'yyyy/MM/dd hh:mm:ss')}</text></view>
101
+                  <view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount / 100).toFixed(2))}</text>元</view>
102
+                  <image className='spreadImg' src={sImg} />
72 103
                 </view>
104
+              </view>
73 105
             )
74 106
           }
75
-          {accountlog.length != '' ? <view className='botton'>已经到底了~</view> : ''}
107
+        <view className='botton' >已经到底了~</view>
76 108
         </scroll-view>
77 109
       </view>
78 110
     </view>

+ 30
- 4
src/hotel/components/shareRoom/ShareRoom.jsx View File

@@ -30,8 +30,35 @@ export default (props) => {
30 30
   }
31 31
   return (
32 32
     <Popup show={showCutover} onClose={onClose}>
33
-      <View className='from-room'>
34
-      <mp-form  >
33
+      <View className='from-room srl'>
34
+        <View style={{marginBottom:'25px'}}>
35
+          <View className='rzline' /><Label className='srl mg'>请输入入住人信息</Label><View className='rzline' />
36
+        </View>
37
+        <View className='srleft'>
38
+          <Label>入住人数:</Label>
39
+          <Input onInput={(e) => setRoomNum(e.detail.value)} value={roomNum} type='number' placeholder='请输入入住人数' />
40
+        </View>
41
+        <View className='srleft'>
42
+          <Label >入住开始时间:</Label>
43
+          <Picker className='picker' mode='date' onChange={handelStartDate}>
44
+            {startDate == '' ? '请选择入住开始时间' : startDate}
45
+          </Picker>
46
+        </View>
47
+        <View className='srleft'>
48
+          <Label>入住结束时间:</Label>
49
+          <Picker className='picker' mode='date' onChange={handelEndDate}>
50
+            {endDate == '' ? '请选择入住结束时间' : endDate}
51
+          </Picker>
52
+        </View>
53
+        <View>
54
+          <Button className='cancel' onClick={onClose}>取消</Button>
55
+          <Button className='btn' onClick={handelShare}>分享</Button>
56
+        </View>
57
+
58
+
59
+
60
+
61
+        {/* <mp-form  >
35 62
         <Label style={{color:'black'}}>请输入入住人信息</Label>
36 63
         <mp-cells    footer='  ' >
37 64
           <mp-cell title='入住人数:' extClass='font'>
@@ -49,10 +76,9 @@ export default (props) => {
49 76
           </mp-cell>
50 77
           <mp-cell>
51 78
             <Button className='cancel' onClick={onClose}>取消</Button><Button className='btn' onClick={handelShare}>分享</Button>
52
-            {/* <button className='button-OK' onClick={sumbit}>确定</button> */}
53 79
           </mp-cell>
54 80
         </mp-cells>
55
-      </mp-form>
81
+      </mp-form> */}
56 82
       </View>
57 83
 
58 84
 

+ 46
- 15
src/hotel/components/shareRoom/ShareRoom.less View File

@@ -1,28 +1,59 @@
1 1
 .from-room{
2
-  padding-top: 30px;
3
-  .font{
4
-    font-size: 28px;
5
-    color: #202020;
2
+  padding-top: 60px;
3
+}
4
+.srl{
5
+  font-size: 30px;
6
+  font-weight: bold;
7
+  color: #202020;  
8
+  .mg{
9
+    font-size: 38px;
10
+    margin: 0 20px 50px 20px;
11
+  }
12
+  .rzline{
13
+    border-top: 2px #999 dashed;
14
+    height: 2px;
15
+    width: 80px;
16
+    display: inline-block;
17
+    margin-bottom: 8px;
6 18
   }
19
+  .srleft{
20
+    text-align: left;
21
+    Input{
22
+      height: 92px;
23
+      font-size: 28px;
24
+      color: #999;
25
+      background: #FEFEFE;
26
+      box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.08);
27
+      margin-bottom: 40px;
28
+    }
29
+    .picker{
30
+      font-size: 28px;
31
+      color: #999;
32
+      line-height: 92px;
33
+      height: 92px;
34
+      background: #FEFEFE;
35
+      margin-bottom: 40px;
36
+      box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.08);
37
+    }
38
+  }  
7 39
   .cancel{
8
-    width: 150px;
9
-    height: 70px;
40
+    color: #274290;
10 41
     display: inline-block;
11
-    line-height: 70px;
42
+    margin: 20px 20px 0 0;
43
+    width: 236px;
44
+    height: 78px;
45
+    border: 2px solid #274190;
12 46
     border-radius: 12px;
13
-    font-size: 36px;
14
-    margin-right: 20px;
15 47
   }
16 48
   .btn {
17
-    width: 150px;
18
-    height: 70px;
19
-    background: #1A3B83;
20
-    display: inline-block;
21
-    line-height: 70px;
49
+    width: 236px;
50
+    height: 78px;
51
+    background: #274291;
22 52
     border-radius: 12px;
23
-    font-size: 36px;
53
+    display: inline-block;
24 54
     color: #fff;
25 55
   }
26 56
 }
57
+
27 58
   
28 59
   

+ 45
- 35
src/hotel/pages/landlord/addRoom/addRoom.jsx View File

@@ -3,11 +3,11 @@ import Taro from '@tarojs/taro'
3 3
 import CustomNav from '@/components/CustomNav'
4 4
 import { useEffect, useState } from "react"
5 5
 import './addRoom.less'
6
-import { saveRoom, getHotelDetail } from '@/services/landlord'
6
+import { saveRoom, getRoomDetail, updateRoom } from '@/services/landlord'
7 7
 
8 8
 
9 9
 export default withLayout((props) => {
10
-  const { hotelId, hotelName } = props.router.params
10
+  const { hotelId, hotelName, roomId } = props.router.params
11 11
   const [roomModel, setRoomModel] = useState({
12 12
     hotelId,
13 13
     roomName: '',
@@ -32,58 +32,68 @@ export default withLayout((props) => {
32 32
     })
33 33
   }
34 34
   const sumbit = () => {
35
-    if(
36
-    roomModel.roomName!=''&&
37
-    roomModel.address!=''&&
38
-    roomModel.location!=''&&
39
-    roomModel.weight!=''
40
-    )
41
-     { 
42
-      saveRoom(roomModel).then(() => {       
43
-          Taro.showModal({
44
-            title: '保存成功',
45
-            showCancel:false
46
-          }).then(() => {
47
-            Taro.navigateBack()
48
-          })
49
-      })       
50
-     } else{
51
-       Taro.showToast({
35
+    if (
36
+      roomModel.roomName != '' &&
37
+      roomModel.address != '' &&
38
+      roomModel.location != '' &&
39
+      roomModel.weight != ''
40
+    ) {
41
+      const seveices = roomId ? updateRoom : saveRoom
42
+      seveices(roomModel, roomId).then(() => {
43
+        Taro.showModal({
44
+          title: roomId ? '修改成功' : '保存成功',
45
+          showCancel: false
46
+        }).then(() => {
47
+          Taro.navigateBack()
48
+        })
49
+      })
50
+    } else {
51
+      Taro.showToast({
52 52
         title: '有必填项未填哦',
53 53
         icon: 'none',
54 54
       })
55
-     }
56
-      
55
+    }
57 56
   }
57
+
58
+  useEffect(() => {
59
+    if (roomId) {
60
+      getRoomDetail(roomId).then((res) => {
61
+        setRoomModel(res)
62
+      })
63
+    }
64
+  }, [])
65
+
66
+
67
+
58 68
   return (
59 69
     <view className='page-index'>
60 70
       <CustomNav title={hotelName} />
61 71
       <view className='from-room'  >
62 72
         <mp-form models={roomModel} >
63 73
           <mp-cells title='请填写新增的房源信息' footer='  ' >
64
-            <mp-cell prop='roomName' title='房屋名称:' extClass='font'>
65
-              <input focus dataField='roomName' onInput={(e) => setRoomModel({ ...roomModel, roomName: e.detail.value })} value={roomModel.roomName}  placeholder='请输入房屋名称(必填)' />
74
+            <mp-cell title='房屋名称:' extClass='font'>
75
+              <input onInput={(e) => setRoomModel({ ...roomModel, roomName: e.detail.value })} value={roomModel.roomName} placeholder='请输入房屋名称(必填)' />
66 76
             </mp-cell>
67
-            <mp-cell prop='address' title='位置信息:' extClass='font'>
68
-              <input dataField='address' onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address}  placeholder='请输入房屋位置(必填)' />
77
+            <mp-cell title='位置信息:' extClass='font'>
78
+              <input onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address} placeholder='请输入房屋位置(必填)' />
69 79
             </mp-cell>
70
-            <mp-cell prop='location' title='定位经纬度:' extClass='font'>
80
+            <mp-cell title='定位经纬度:' extClass='font'>
71 81
               <label onClick={onRoomMap}>{roomModel.location == '' ? '房间定位(必填)' : roomModel.location}</label>
72 82
             </mp-cell>
73
-            <mp-cell prop='parkingAddress' title='停车场位置:' extClass='font'>
74
-              <input dataField='parkingAddress' onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress}  placeholder='请输入停车场位置' />
83
+            <mp-cell title='停车场位置:' extClass='font'>
84
+              <input onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress} placeholder='请输入停车场位置' />
75 85
             </mp-cell>
76
-            <mp-cell prop='parkingLocation' title='定位经纬度:' extClass='font'>
86
+            <mp-cell title='定位经纬度:' extClass='font'>
77 87
               <label onClick={onParkMap}>{roomModel.parkingLocation == '' ? '停车场定位' : roomModel.parkingLocation}</label>
78 88
             </mp-cell>
79
-            <mp-cell prop='wifiName' title='Wi-Fi名称:' extClass='font'>
80
-              <input dataField='wifiName' onInput={(e) => setRoomModel({ ...roomModel, wifiName: e.detail.value })} value={roomModel.wifiName}  placeholder='请输入wifi名称' />
89
+            <mp-cell title='Wi-Fi名称:' extClass='font'>
90
+              <input onInput={(e) => setRoomModel({ ...roomModel, wifiName: e.detail.value })} value={roomModel.wifiName} placeholder='请输入wifi名称' />
81 91
             </mp-cell>
82
-            <mp-cell prop='wifiPassword' title='Wi-Fi密码:' extClass='font'>
83
-              <input dataField='wifiPassword' onInput={(e) => setRoomModel({ ...roomModel, wifiPassword: e.detail.value })} value={roomModel.wifiPassword}  placeholder='请输入wifi密码' />
92
+            <mp-cell title='Wi-Fi密码:' extClass='font'>
93
+              <input onInput={(e) => setRoomModel({ ...roomModel, wifiPassword: e.detail.value })} value={roomModel.wifiPassword} placeholder='请输入wifi密码' />
84 94
             </mp-cell>
85
-            <mp-cell prop='weight' title='权重:' extClass='font'>
86
-              <input type='number' dataField='weight'  onInput={(e) => setRoomModel({ ...roomModel, weight: e.detail.value })} placeholder='请输入权重(必填)' />
95
+            <mp-cell title='权重:' extClass='font'>
96
+              <input type='number' value={roomModel.weight} onInput={(e) => setRoomModel({ ...roomModel, weight: e.detail.value })} placeholder='请输入权重(必填)' />
87 97
             </mp-cell>
88 98
             <mp-cell>
89 99
               <button className='button-OK' onClick={sumbit}>确定</button>

+ 1
- 2
src/hotel/pages/landlord/landlord.jsx View File

@@ -10,7 +10,6 @@ import onhouseImg from '@/assets/icons/landlord/房源管理按下.png'
10 10
 import withLayout from '@/layouts'
11 11
 import { getHotelManage, getAccountLogList, getNowHotelManage } from '@/services/landlord'
12 12
 import CustomNav from '@/components/CustomNav'
13
-
14 13
 import './landlord.less'
15 14
 
16 15
 export default withLayout((props) => {
@@ -20,7 +19,7 @@ export default withLayout((props) => {
20 19
 
21 20
   const [hotelList, setHotelList] = useState([])
22 21
   const [hotel, setHotel] = useState()
23
-  const [account, setAccount] = useState()
22
+  const [account, setAccount] = useState({})
24 23
   const [accountlog, setAccountLog] = useState([])
25 24
 
26 25
   const houseRef = useRef()

+ 10
- 13
src/pages/details/mjDetails/sceneryDetails.jsx View File

@@ -16,7 +16,7 @@ import useSave from "@/utils/hooks/useSave"
16 16
 import useLike from "@/utils/hooks/useLike"
17 17
 import Cards from '@/components/foodCards/foodCards.jsx'
18 18
 import Taro,{ useShareAppMessage } from '@tarojs/taro'
19
-import { getResourceList } from '@/services/home'
19
+import { getTouristDistance } from '@/services/home'
20 20
 import Extend from '../components/Extend/extend'
21 21
 import './sceneryDetails.less'
22 22
 
@@ -24,11 +24,12 @@ import './sceneryDetails.less'
24 24
 
25 25
 export default withLayout((props) => {
26 26
   const { router, person ,location } = props
27
-  const { id, distance, loc } = props.router.params
27
+  const { id} = props.router.params
28 28
   const [detail, setDetail] = useState({})
29 29
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'tourist', id)
30 30
   const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
31
-
31
+  const [distance,setDistance]=useState()
32
+  const [tslocation,setTsLocation]=useState('')
32 33
   //banner图集数组
33 34
   const [imglist, setimglist] = useState([])
34 35
   const [index, setIndex] = useState(0)
@@ -66,9 +67,6 @@ export default withLayout((props) => {
66 67
   }
67 68
   const log = useRef('')
68 69
   const lat = useRef('')
69
-  const [queryParams, setQueryParams] = useState({ location: location, pageNum: 1, pageSize: 10, typeId: '',targetId:id  })
70
-  const [nloction,setNLoction]=useState()
71
-
72 70
   useEffect(() => {
73 71
     getTouristDetail(id).then((res) => {
74 72
       log.current = (res.locaton).toString().split(',')[0]
@@ -82,15 +80,14 @@ export default withLayout((props) => {
82 80
       setAllextNum(res.total)
83 81
       setNewextNum(res.records.length)
84 82
     })
85
-    getRecommendList({ location: loc }).then((res) => {
83
+    getTouristDistance('tourist',id,{location:location}).then((res)=>{
84
+      setDistance((res.distance / 1000).toFixed(2))
85
+      setTsLocation(res.lng + ',' + res.lat)
86
+    })    
87
+    getRecommendList({ location: tslocation }).then((res) => {
86 88
       setRecommend(res || [])
87 89
     })
88
-    getResourceList(queryParams).then((res)=>{
89
-      console.log(queryParams)
90
-      console.log(res)
91
-    })
92
-  }, [])
93
-  
90
+  }, []) 
94 91
   // 分享
95 92
   useShareAppMessage(()=>{
96 93
     return {

+ 1
- 1
src/pages/index/components/Card.js View File

@@ -16,7 +16,7 @@ export default (props) => {
16 16
   const Detail = () => {
17 17
     if (item.targetType == 'tourist') {
18 18
       let loc = item.lng + ',' + item.lat
19
-      Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}&distance=${(item.distance / 1000).toFixed(2)}&loc=${loc}` });
19
+      Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` });
20 20
     }
21 21
     else {
22 22
       Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })

+ 7
- 0
src/services/home.js View File

@@ -103,6 +103,13 @@ export const getExtendContent = (type, id, params) => request(`/${type}/${id}/co
103 103
  */
104 104
 export const getTouristDetail = (id) => request(`/tourist/${id}`)
105 105
 
106
+/**
107
+ * 获取景点距离定位 用于通过景点分享功能进入景点详情页的客户
108
+ * @param {*} id 
109
+ * @returns 
110
+ */
111
+ export const getTouristDistance = (targetType,targetId,params) => request(`/resource/${targetType}/${targetId}`,{params})
112
+
106 113
 /**
107 114
  * 获取推荐套餐列表
108 115
  * @returns 

+ 14
- 0
src/services/landlord.js View File

@@ -59,6 +59,20 @@ export const saveRoom = (data) => request('/taRoom', { method: 'post', data })
59 59
 */
60 60
 export const deleteRoom = (id) => request(`/taRoom/${id}`, { method: 'delete' })
61 61
 
62
+/**
63
+* 房源详情
64
+* @param {*} id 
65
+* @returns 
66
+*/
67
+export const getRoomDetail = (id) => request(`/taRoom/${id}`)
68
+
69
+/**
70
+ * 更新房源
71
+ * @param {*} data 
72
+ * @returns 
73
+ */
74
+export const updateRoom = (data, id) => request(`/taRoom/${id}`, { method: 'put', data })
75
+
62 76
 
63 77
 /**
64 78
  * 分享房源

+ 1
- 1
src/shop/components/ShopKeeper/shopKeeper.jsx View File

@@ -96,7 +96,7 @@ export default (props) => {
96 96
     <view>
97 97
       <view>
98 98
       </view>
99
-      <ToggleRole showCutover={showCutover} onClose={onClose} maskClosable={showCutover} role='shop' />
99
+      <ToggleRole showCutover={showCutover} maskClosable={showCutover} onClose={onClose} role='shop' />
100 100
       <view style={{ padding: '30rpx', height: '100%' }}>
101 101
         <scroll-view scroll-y scroll-view='true' bindscrolltoupper='upper' bindscrolltolower='lower' bindscroll='scroll' style={{ height: 'calc(100vh - 120px)' }}>
102 102
           <view className='storexx'>

+ 1
- 1
src/shop/components/Sparead/spreadMoney.jsx View File

@@ -59,7 +59,7 @@ export default (props) => {
59 59
     <view>
60 60
       <view>
61 61
       </view>
62
-      <ToggleRole showCutover={showCutover} onClose={onClose} role='shop' />
62
+      <ToggleRole showCutover={showCutover} maskClosable={showCutover} onClose={onClose} role='shop' />
63 63
       <view style={{ padding: '30rpx', height: '100%' }}>
64 64
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
65 65
           <view className='storexx'>