吃个甘蔗嚼一年 3 年前
父节点
当前提交
92a0caa53e

+ 1
- 4
src/components/Popup/index.jsx 查看文件

2
 import './style.less'
2
 import './style.less'
3
 
3
 
4
 export default (props) => {
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
   return (
6
   return (
10
     <mp-dialog extClass='x-popup' buttons={[]} show={show} mask={mask} maskClosable={maskClosable} onClose={onClose}>
7
     <mp-dialog extClass='x-popup' buttons={[]} show={show} mask={mask} maskClosable={maskClosable} onClose={onClose}>
11
       {props.children}
8
       {props.children}

+ 10
- 5
src/components/Star/Star.jsx 查看文件

2
 import hongxin from '@/assets/icons/housemantj/已收藏.png'
2
 import hongxin from '@/assets/icons/housemantj/已收藏.png'
3
 import baixin from '@/assets/icons/housemantj/收藏.png'
3
 import baixin from '@/assets/icons/housemantj/收藏.png'
4
 import './Star.less'
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
 export default (props) => {
10
 export default (props) => {
6
   const {star}=props
11
   const {star}=props
12
+
13
+
7
   return (
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 查看文件

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

+ 9
- 4
src/hotel/components/HouseManage/houseManage.jsx 查看文件

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
   const [showCutover, setShowCutover] = useState(false)
49
   const [showCutover, setShowCutover] = useState(false)
54
   const onClose = () => {
56
   const onClose = () => {
55
     setShowCutover(false)
57
     setShowCutover(false)
56
   }
58
   }
59
+  const onClose2 = () => {
60
+    setShowCard(false)
61
+  }
57
   useEffect(() => {
62
   useEffect(() => {
58
     //首次加载页面时
63
     //首次加载页面时
59
     if (!mounted.current && hotel.hotelId) {
64
     if (!mounted.current && hotel.hotelId) {
112
       <view style={{ padding: '0 30rpx', height: '100%' }}>
117
       <view style={{ padding: '0 30rpx', height: '100%' }}>
113
         <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch}/>
118
         <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch}/>
114
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
119
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
115
-        <ShareCard showCutover={showCard} onClose={onClose} />
120
+        <ShareCard showCutover={showCard} onClose={onClose2} />
116
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 244px)' }}>
121
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 244px)' }}>
117
           {
122
           {
118
             (detail || []).map((item) =>
123
             (detail || []).map((item) =>
119
-              <view className='houseCard'>
124
+              <view className='houseCard' onClick={()=>{handelDetail(item)}}>
120
                 <view className='houseName'>{item.roomName||''}</view>
125
                 <view className='houseName'>{item.roomName||''}</view>
121
                 <view className='operation'>
126
                 <view className='operation'>
122
                   <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
127
                   <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>

+ 66
- 34
src/hotel/components/Income/income.jsx 查看文件

1
 import { useState } from 'react'
1
 import { useState } from 'react'
2
-import './income.less'
3
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
2
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
4
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
3
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
5
 import sImg from '@/assets/icons/landlord/我的收入2.png'
4
 import sImg from '@/assets/icons/landlord/我的收入2.png'
7
 import ToggleRole from '@/components/toggleRole/ToggleRole'
6
 import ToggleRole from '@/components/toggleRole/ToggleRole'
8
 import Picker from '@/components/Picker'
7
 import Picker from '@/components/Picker'
9
 import formatTime from "@/utils/formatTime";
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
 export default (props) => {
16
 export default (props) => {
13
   const { hotelList, hotel, account, onHotelChange, accountlog } = props
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
   const handleHotelChange = (hotelId, current) => {
25
   const handleHotelChange = (hotelId, current) => {
16
     onHotelChange(current)
26
     onHotelChange(current)
17
   }
27
   }
29
     setShowCutover(true)
39
     setShowCutover(true)
30
   }
40
   }
31
   const onClose = () => {
41
   const onClose = () => {
32
-    console.log('11111111')
33
     setShowCutover(false)
42
     setShowCutover(false)
34
   }
43
   }
35
   return (
44
   return (
36
     <view>
45
     <view>
37
-      <ToggleRole role='hotel' showCutover={showCutover} onClose={onClose} />
46
+      <ToggleRole role='hotel' showCutover={showCutover} maskClosable={showCutover} onClose={onClose} />
38
       <view style={{ padding: '30rpx', height: '100%' }}>
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
               </view>
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
             </view>
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
           </view>
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
                 </view>
103
                 </view>
104
+              </view>
73
             )
105
             )
74
           }
106
           }
75
-          {accountlog.length != '' ? <view className='botton'>已经到底了~</view> : ''}
107
+        <view className='botton' >已经到底了~</view>
76
         </scroll-view>
108
         </scroll-view>
77
       </view>
109
       </view>
78
     </view>
110
     </view>

+ 30
- 4
src/hotel/components/shareRoom/ShareRoom.jsx 查看文件

30
   }
30
   }
31
   return (
31
   return (
32
     <Popup show={showCutover} onClose={onClose}>
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
         <Label style={{color:'black'}}>请输入入住人信息</Label>
62
         <Label style={{color:'black'}}>请输入入住人信息</Label>
36
         <mp-cells    footer='  ' >
63
         <mp-cells    footer='  ' >
37
           <mp-cell title='入住人数:' extClass='font'>
64
           <mp-cell title='入住人数:' extClass='font'>
49
           </mp-cell>
76
           </mp-cell>
50
           <mp-cell>
77
           <mp-cell>
51
             <Button className='cancel' onClick={onClose}>取消</Button><Button className='btn' onClick={handelShare}>分享</Button>
78
             <Button className='cancel' onClick={onClose}>取消</Button><Button className='btn' onClick={handelShare}>分享</Button>
52
-            {/* <button className='button-OK' onClick={sumbit}>确定</button> */}
53
           </mp-cell>
79
           </mp-cell>
54
         </mp-cells>
80
         </mp-cells>
55
-      </mp-form>
81
+      </mp-form> */}
56
       </View>
82
       </View>
57
 
83
 
58
 
84
 

+ 46
- 15
src/hotel/components/shareRoom/ShareRoom.less 查看文件

1
 .from-room{
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
   .cancel{
39
   .cancel{
8
-    width: 150px;
9
-    height: 70px;
40
+    color: #274290;
10
     display: inline-block;
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
     border-radius: 12px;
46
     border-radius: 12px;
13
-    font-size: 36px;
14
-    margin-right: 20px;
15
   }
47
   }
16
   .btn {
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
     border-radius: 12px;
52
     border-radius: 12px;
23
-    font-size: 36px;
53
+    display: inline-block;
24
     color: #fff;
54
     color: #fff;
25
   }
55
   }
26
 }
56
 }
57
+
27
   
58
   
28
   
59
   

+ 45
- 35
src/hotel/pages/landlord/addRoom/addRoom.jsx 查看文件

3
 import CustomNav from '@/components/CustomNav'
3
 import CustomNav from '@/components/CustomNav'
4
 import { useEffect, useState } from "react"
4
 import { useEffect, useState } from "react"
5
 import './addRoom.less'
5
 import './addRoom.less'
6
-import { saveRoom, getHotelDetail } from '@/services/landlord'
6
+import { saveRoom, getRoomDetail, updateRoom } from '@/services/landlord'
7
 
7
 
8
 
8
 
9
 export default withLayout((props) => {
9
 export default withLayout((props) => {
10
-  const { hotelId, hotelName } = props.router.params
10
+  const { hotelId, hotelName, roomId } = props.router.params
11
   const [roomModel, setRoomModel] = useState({
11
   const [roomModel, setRoomModel] = useState({
12
     hotelId,
12
     hotelId,
13
     roomName: '',
13
     roomName: '',
32
     })
32
     })
33
   }
33
   }
34
   const sumbit = () => {
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
         title: '有必填项未填哦',
52
         title: '有必填项未填哦',
53
         icon: 'none',
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
   return (
68
   return (
59
     <view className='page-index'>
69
     <view className='page-index'>
60
       <CustomNav title={hotelName} />
70
       <CustomNav title={hotelName} />
61
       <view className='from-room'  >
71
       <view className='from-room'  >
62
         <mp-form models={roomModel} >
72
         <mp-form models={roomModel} >
63
           <mp-cells title='请填写新增的房源信息' footer='  ' >
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
             </mp-cell>
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
             </mp-cell>
79
             </mp-cell>
70
-            <mp-cell prop='location' title='定位经纬度:' extClass='font'>
80
+            <mp-cell title='定位经纬度:' extClass='font'>
71
               <label onClick={onRoomMap}>{roomModel.location == '' ? '房间定位(必填)' : roomModel.location}</label>
81
               <label onClick={onRoomMap}>{roomModel.location == '' ? '房间定位(必填)' : roomModel.location}</label>
72
             </mp-cell>
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
             </mp-cell>
85
             </mp-cell>
76
-            <mp-cell prop='parkingLocation' title='定位经纬度:' extClass='font'>
86
+            <mp-cell title='定位经纬度:' extClass='font'>
77
               <label onClick={onParkMap}>{roomModel.parkingLocation == '' ? '停车场定位' : roomModel.parkingLocation}</label>
87
               <label onClick={onParkMap}>{roomModel.parkingLocation == '' ? '停车场定位' : roomModel.parkingLocation}</label>
78
             </mp-cell>
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
             </mp-cell>
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
             </mp-cell>
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
             </mp-cell>
97
             </mp-cell>
88
             <mp-cell>
98
             <mp-cell>
89
               <button className='button-OK' onClick={sumbit}>确定</button>
99
               <button className='button-OK' onClick={sumbit}>确定</button>

+ 1
- 2
src/hotel/pages/landlord/landlord.jsx 查看文件

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

+ 10
- 13
src/pages/details/mjDetails/sceneryDetails.jsx 查看文件

16
 import useLike from "@/utils/hooks/useLike"
16
 import useLike from "@/utils/hooks/useLike"
17
 import Cards from '@/components/foodCards/foodCards.jsx'
17
 import Cards from '@/components/foodCards/foodCards.jsx'
18
 import Taro,{ useShareAppMessage } from '@tarojs/taro'
18
 import Taro,{ useShareAppMessage } from '@tarojs/taro'
19
-import { getResourceList } from '@/services/home'
19
+import { getTouristDistance } from '@/services/home'
20
 import Extend from '../components/Extend/extend'
20
 import Extend from '../components/Extend/extend'
21
 import './sceneryDetails.less'
21
 import './sceneryDetails.less'
22
 
22
 
24
 
24
 
25
 export default withLayout((props) => {
25
 export default withLayout((props) => {
26
   const { router, person ,location } = props
26
   const { router, person ,location } = props
27
-  const { id, distance, loc } = props.router.params
27
+  const { id} = props.router.params
28
   const [detail, setDetail] = useState({})
28
   const [detail, setDetail] = useState({})
29
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'tourist', id)
29
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'tourist', id)
30
   const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
30
   const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
31
-
31
+  const [distance,setDistance]=useState()
32
+  const [tslocation,setTsLocation]=useState('')
32
   //banner图集数组
33
   //banner图集数组
33
   const [imglist, setimglist] = useState([])
34
   const [imglist, setimglist] = useState([])
34
   const [index, setIndex] = useState(0)
35
   const [index, setIndex] = useState(0)
66
   }
67
   }
67
   const log = useRef('')
68
   const log = useRef('')
68
   const lat = useRef('')
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
   useEffect(() => {
70
   useEffect(() => {
73
     getTouristDetail(id).then((res) => {
71
     getTouristDetail(id).then((res) => {
74
       log.current = (res.locaton).toString().split(',')[0]
72
       log.current = (res.locaton).toString().split(',')[0]
82
       setAllextNum(res.total)
80
       setAllextNum(res.total)
83
       setNewextNum(res.records.length)
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
       setRecommend(res || [])
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
   useShareAppMessage(()=>{
92
   useShareAppMessage(()=>{
96
     return {
93
     return {

+ 1
- 1
src/pages/index/components/Card.js 查看文件

16
   const Detail = () => {
16
   const Detail = () => {
17
     if (item.targetType == 'tourist') {
17
     if (item.targetType == 'tourist') {
18
       let loc = item.lng + ',' + item.lat
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
     else {
21
     else {
22
       Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })
22
       Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })

+ 7
- 0
src/services/home.js 查看文件

103
  */
103
  */
104
 export const getTouristDetail = (id) => request(`/tourist/${id}`)
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
  * @returns 
115
  * @returns 

+ 14
- 0
src/services/landlord.js 查看文件

59
 */
59
 */
60
 export const deleteRoom = (id) => request(`/taRoom/${id}`, { method: 'delete' })
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 查看文件

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

+ 1
- 1
src/shop/components/Sparead/spreadMoney.jsx 查看文件

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