吃个甘蔗嚼一年 3 years ago
parent
commit
91e477ef90

+ 2
- 1
src/components/SearchBar/index.jsx View File

@@ -4,7 +4,7 @@ import './style.less'
4 4
 
5 5
 export default (props) => {
6 6
 
7
-  const { placeholder, onBlur } = props
7
+  const { placeholder, onBlur, searchValue } = props
8 8
 
9 9
 
10 10
 
@@ -14,6 +14,7 @@ export default (props) => {
14 14
       <mp-searchbar
15 15
         placeholder={placeholder}
16 16
         onBlur={onBlur}
17
+        value={searchValue}
17 18
       >
18 19
       </mp-searchbar>
19 20
     </View>

+ 1
- 1
src/components/ShopUnused/index.jsx View File

@@ -25,7 +25,7 @@ export default (props) => {
25 25
         <image className='orderImg' src={item.poster} mode='aspectFit' />
26 26
         <view className='orderRight'>
27 27
           <view className='foodName'>{item.description}</view>
28
-          <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>{(item.actualPrice / 100).toFixed(2)}</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
28
+          <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>{(item.commissionCharge / 100).toFixed(2)}</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
29 29
           <view>已下单:等待客户上门就餐</view>
30 30
         </view>
31 31
         <view className='line' />

+ 1
- 1
src/components/ShopUsed/index.jsx View File

@@ -39,7 +39,7 @@ export default (props) => {
39 39
         <Image className='orderImg' src={item.poster} mode='aspectFit' />
40 40
         <View className='orderRight'>
41 41
           <View className='foodName'>{item.description}</View>
42
-          <View className='price'>合计金额:¥<Text style={{ fontSize: '24rpx' }}>{item.actualPrice / 100}</Text>元 <Text className='pnum'>数量:<Text>1</Text>张</Text> </View>
42
+          <View className='price'>合计金额:¥<Text style={{ fontSize: '24rpx' }}>{(item.commissionCharge / 100).toFixed(2)}</Text>元 <Text className='pnum'>数量:<Text>1</Text>张</Text> </View>
43 43
         </View>
44 44
 
45 45
         <View className='veri_Date' > 核销时间:{formatTimes(item.verifiedDate, 'yyyy-MM-dd hh:mm')}</View>

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

@@ -1,5 +1,5 @@
1 1
 import Taro, { useDidShow } from '@tarojs/taro'
2
-import { View, Image} from '@tarojs/components';
2
+import { View, Image } from '@tarojs/components';
3 3
 import see from '@/assets/icons/landlord/lookPerson.png'
4 4
 import share from '@/assets/icons/landlord/shareLink.png'
5 5
 import del from '@/assets/icons/landlord/delete.png'
@@ -22,13 +22,13 @@ export default React.forwardRef((props, ref) => {
22 22
   const [detail, setDetail] = useState([])
23 23
 
24 24
   const fetchAPI = useMemo(() => hotel.hotelId ? () => getRoomList({ hotelId: hotel.hotelId }) : undefined, [hotel?.hotelId])
25
-  const queryParams = useMemo(() => ({}), [])
25
+  const queryParams = useMemo(() => ({ pageNum: 1, pageSize: 0, }), [])
26 26
 
27 27
   const shareDataRef = useRef()
28 28
 
29 29
   // 判断是否首次加载
30
-  const mounted = useRef(false)
31 30
 
31
+  const mounted = useRef(false)
32 32
   const handelClick = () => {
33 33
     Taro.navigateTo({ url: `/hotel/pages/landlord/addRoom/addRoom?hotelId=${hotel.hotelId}&hotelName=${hotel.hotelName}` });
34 34
   }
@@ -122,12 +122,13 @@ export default React.forwardRef((props, ref) => {
122 122
       })
123 123
     }
124 124
     else {
125
+      // setVal('')
125 126
       getRoomList({ hotelId: hotel.hotelId, roomName: e.detail.value }).then((res) => {
126 127
         setDetail(res.records || [])
127 128
       })
128 129
     }
129 130
   }
130
-  const handelCopy = (e, val) => {
131
+  const handelCopy = (e, val, index) => {
131 132
     //阻止冒泡不允许执行父元素的点击事件
132 133
     e.stopPropagation()
133 134
     saveRoom({ ...val, roomId: null, roomName: val.roomName + '复制' }).then(() => {
@@ -135,6 +136,8 @@ export default React.forwardRef((props, ref) => {
135 136
         setDetail(res.records || [])
136 137
       })
137 138
     })
139
+
140
+
138 141
   }
139 142
   const [showCutover3, setShowCutover3] = useState(false)
140 143
   const ShowMoldeOn3 = () => {
@@ -143,18 +146,19 @@ export default React.forwardRef((props, ref) => {
143 146
   const onClose3 = () => {
144 147
     setShowCutover3(false)
145 148
   }
149
+  const [val, setVal] = useState()
146 150
   return (
147 151
     <view>
148 152
       <view style={{ padding: '0 30rpx', height: '100%' }}>
149
-      <ToggleRole role='hotel' showCutover={showCutover3} maskClosable={showCutover3} onClose={onClose3} />
153
+        <ToggleRole role='hotel' showCutover={showCutover3} maskClosable={showCutover3} onClose={onClose3} />
150 154
 
151 155
         <View>
152
-        <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择民宿" value={hotel?.hotelId} kv={['hotelName', 'hotelId']} dicts={hotelList} onChange={handleHotelChange} /></view>
153
-        <view onClick={ShowMoldeOn3} className='User-info-cutover'>
156
+          <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择民宿" value={hotel?.hotelId} kv={['hotelName', 'hotelId']} dicts={hotelList} onChange={handleHotelChange} /></view>
157
+          <view onClick={ShowMoldeOn3} className='User-info-cutover'>
154 158
             <image className='User-info-cutover-image' src={cutoverUser} />
155 159
           </view>
156 160
         </View>
157
-        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch} />
161
+        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch} searchValue={val} />
158 162
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
159 163
         <ShareCard showCutover={showCard} onClose={onClose2} />
160 164
         <List
@@ -168,7 +172,8 @@ export default React.forwardRef((props, ref) => {
168 172
             {
169 173
               detail.map((item, index) =>
170 174
                 <view className='houseCard' key={index}>
171
-                  <View className='houseName' onClick={() => handelDetail(item)}>{item.roomName || ''}<Image src={copyRoom} onClick={(e) => handelCopy(e, item)} /></View>
175
+                  <View className='houseName' onClick={() => handelDetail(item)}>{item.roomName || ''}<Image src={copyRoom} onClick={(e) => handelCopy(e, item, index)} /></View>
176
+
172 177
                   <view className='operation'>
173 178
                     <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
174 179
                     <view onClick={() => ShowMoldeOn(item)}><image src={share} />分享链接</view>

+ 24
- 10
src/hotel/pages/landlord/addRoom/addRoom.jsx View File

@@ -1,7 +1,7 @@
1 1
 import withLayout from '@/layouts'
2
-import Taro from '@tarojs/taro'
2
+import Taro, { useDidShow } from '@tarojs/taro'
3 3
 import CustomNav from '@/components/CustomNav'
4
-import { View, Input, Button, Label, Textarea, Text,Image } from '@tarojs/components';
4
+import { View, Input, Button, Label, Textarea, Text, Image } from '@tarojs/components';
5 5
 import { useEffect, useState } from "react"
6 6
 import { saveRoom, getRoomDetail, updateRoom } from '@/services/landlord'
7 7
 import GPS from '@/assets/icons/GuideCheck/GPS.png'
@@ -29,15 +29,29 @@ export default withLayout((props) => {
29 29
   })
30 30
   const [paddress, setpAddress] = useState()
31 31
   const [wifiName, setwifiName] = useState()
32
+
33
+  const tipsMap = () => {
34
+    Taro.showToast({
35
+      title: '位置信息添加成功',
36
+      icon: 'success',
37
+      duration: 2000
38
+    })
39
+  }
40
+
41
+
32 42
   const onRoomMap = () => {
33 43
     Taro.chooseLocation().then((res) => {
34 44
       setRoomModel({ ...roomModel, location: res.longitude + ',' + res.latitude })
35
-
45
+      tipsMap()
36 46
     })
37 47
   }
48
+
49
+
50
+
38 51
   const onParkMap = () => {
39 52
     Taro.chooseLocation().then((res) => {
40 53
       setRoomModel({ ...roomModel, parkingLocation: res.longitude + ',' + res.latitude })
54
+      tipsMap()
41 55
 
42 56
     })
43 57
   }
@@ -190,9 +204,9 @@ export default withLayout((props) => {
190 204
             <mp-cells title='房屋位置'>
191 205
               <mp-cell>
192 206
                 <View className='roomloc'>
193
-                <Input style={{ color: '#000', fontWeight: 'bold'}} onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address} placeholder='请输入房屋位置(必填)' />
194
-                <Label style={{display:'none' }} onClick={onRoomMap}>{isError(roomModel.location) ? '房间定位(必填)' : roomModel.location}</Label>
195
-                <Image className='location' src={GPS} onClick={onRoomMap} />
207
+                  <Input style={{ color: '#000', fontWeight: 'bold', paddingRight: '3em' }} onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address} placeholder='请输入房屋位置(必填)' />
208
+                  <Label style={{ display: 'none' }} onClick={onRoomMap}>{isError(roomModel.location) ? '房间定位(必填)' : roomModel.location}</Label>
209
+                  <Image className='location' src={GPS} onClick={onRoomMap} />
196 210
                 </View>
197 211
               </mp-cell>
198 212
             </mp-cells>
@@ -200,10 +214,10 @@ export default withLayout((props) => {
200 214
               paddress != '' ?
201 215
                 <mp-cells title='停车场位置'>
202 216
                   <mp-cell>
203
-                  <View className='roomloc'>
204
-                    <Input onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress} placeholder='请输入停车场位置' />
205
-                    <Label style={{ color: '#666', lineHeight: '30px',display:'none' }} onClick={onParkMap}>{isError(roomModel.parkingLocation) ? '停车场定位' : roomModel.parkingLocation}</Label>
206
-                    <Image className='location' src={GPS} onClick={onParkMap} />
217
+                    <View className='roomloc'>
218
+                      <Input style={{ paddingRight: '3em' }} onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress} placeholder='请输入停车场位置' />
219
+                      <Label style={{ color: '#666', lineHeight: '30px', display: 'none' }} onClick={onParkMap}>{isError(roomModel.parkingLocation) ? '停车场定位' : roomModel.parkingLocation}</Label>
220
+                      <Image className='location' src={GPS} onClick={onParkMap} />
207 221
                     </View>
208 222
                   </mp-cell>
209 223
                 </mp-cells> : null

+ 6
- 5
src/hotel/pages/landlord/addRoom/addRoom.less View File

@@ -2,25 +2,26 @@
2 2
   padding: 30px;
3 3
   background-color: #f8f8f8;
4 4
   .weui-cells__title {
5
-    font-size: 34px;
5
+    font-size: 26px;
6 6
   }
7 7
   .weui-cells_after-title {
8 8
     border-radius: 50px;
9 9
     font-size: 30px;
10 10
     margin-top: 40px;
11 11
   }
12
-  .roomloc{
12
+  .roomloc {
13 13
     position: relative;
14
-    .location{
14
+    font-size: 26px;
15
+    .location {
15 16
       width: 50px;
16 17
       height: 50px;
17
-      position:absolute;
18
+      position: absolute;
18 19
       right: 0;
19 20
       top: -2px;
20 21
       z-index: 999;
21 22
     }
22 23
   }
23
-  
24
+
24 25
   .adds {
25 26
     width: 100%;
26 27
     background-color: #fff;

+ 0
- 1
src/pages/details/foodDetails/foodDetails.less View File

@@ -187,7 +187,6 @@
187 187
   border-radius: 12px;
188 188
   column-count: 3;
189 189
   text-align: center;
190
-  height: 6em;
191 190
 
192 191
   .sharebtn {
193 192
     position: absolute;

+ 0
- 1
src/pages/details/mjDetails/sceneryDetails.less View File

@@ -154,7 +154,6 @@
154 154
   border-radius: 12px;
155 155
   column-count: 3;
156 156
   text-align: center;
157
-  height: 6em;
158 157
 
159 158
   .sharebtn {
160 159
     position: absolute;

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

@@ -1,5 +1,5 @@
1 1
 
2
-import Taro from '@tarojs/taro'
2
+import Taro, { useDidShow } from '@tarojs/taro'
3 3
 import useSave from "@/utils/hooks/useSave"
4 4
 import msTip from '@/assets/icons/housemantj/foodtip.png'
5 5
 import mjTip from '@/assets/icons/housemantj/mjtip.png'
@@ -21,6 +21,9 @@ export default (props) => {
21 21
       Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })
22 22
     }
23 23
   }
24
+
25
+
26
+
24 27
   return (
25 28
     <view className='contentCard' style={style}>
26 29
       <view className='cardTop'>

+ 11
- 3
src/pages/index/tabs/Guide.jsx View File

@@ -1,5 +1,5 @@
1 1
 import { useState, useEffect, useRef } from "react";
2
-import Taro from '@tarojs/taro'
2
+import Taro, { useDidShow } from '@tarojs/taro'
3 3
 import MoreGuide from "@/components/MoreGuide";
4 4
 import BossCard from '@/components/BossCard'
5 5
 import GPS from '@/assets/icons/GuideCheck/GPS.png'
@@ -55,8 +55,7 @@ export default (props) => {
55 55
     })
56 56
   }
57 57
 
58
-
59
-  useEffect(() => {
58
+  const goContent = () => {
60 59
     if (roomOrderId) {
61 60
       goToRoomForm(roomOrderId).then((res) => {
62 61
         if (res.status !== 1 && res.personNum > 0) {
@@ -66,8 +65,17 @@ export default (props) => {
66 65
         }
67 66
       })
68 67
     }
68
+  }
69
+
70
+
71
+  useEffect(() => {
72
+    goContent()
69 73
   }, [roomId, roomOrderId])
70 74
 
75
+  useDidShow(() => {
76
+    goContent()
77
+  })
78
+
71 79
 
72 80
   useEffect(() => {
73 81
 

+ 11
- 1
src/pages/index/tabs/Recommend.jsx View File

@@ -1,4 +1,4 @@
1
-import Taro from '@tarojs/taro'
1
+import Taro, { useDidShow } from '@tarojs/taro'
2 2
 import { React, useState, useEffect, useRef } from 'react'
3 3
 import iconsearch from '@/assets/icons/housemantj/search.png'
4 4
 import locationimg from '@/assets/icons/housemantj/location.png'
@@ -55,8 +55,18 @@ export default (props) => {
55 55
     // 用绝对路径
56 56
     Taro.navigateTo({ url: '/pages/search/search' });
57 57
   }
58
+  // 联动收藏
59
+  const likeLook = () => {
60
+    getResourceList().then(e => {
61
+      setAllList(e.records)
62
+    })
63
+
64
+  }
58 65
 
59 66
 
67
+  useDidShow(() => {
68
+    likeLook()
69
+  })
60 70
 
61 71
 
62 72
 

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

@@ -102,47 +102,48 @@ export default (props) => {
102 102
       </view>
103 103
       <ToggleRole showCutover={showCutover} maskClosable={showCutover} onClose={onClose} role='shop' />
104 104
       <view style={{ padding: '30rpx', height: '100%' }}>
105
-        <scroll-view scrollY style={{ height: 'calc(100vh - 120px)' }}>
106
-          <view className='storexx'>
107
-            <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder='请选择商铺' value={shop?.shopId} kv={['shopName', 'shopId']} dicts={shopList} onChange={handleHotelChange} /></view>
108
-            <view onClick={ShowMoldeOn} className='User-info-cutover'>
109
-              <image className='User-info-cutover-image' src={cutoverUser} />
110
-            </view>
111
-            <view className='tip'>(计算收入以核销为准)</view>
112
-            <view className='money'>
113
-              <view className='sleft'>
114
-                <view className='lword'>全年订单收入(税前)</view>
115
-
116
-                <view className='yearMoney'>
117
-                  <text>{isyear ? (shopMoney?.totalCharges / 100).toFixed(2) : '******'}</text>元
118
-                  <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
119
-                </view>
105
+        <view className='storexx'>
106
+          <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder='请选择商铺' value={shop?.shopId} kv={['shopName', 'shopId']} dicts={shopList} onChange={handleHotelChange} /></view>
107
+          <view onClick={ShowMoldeOn} className='User-info-cutover'>
108
+            <image className='User-info-cutover-image' src={cutoverUser} />
109
+          </view>
110
+          <view className='tip'>(计算收入以核销为准)</view>
111
+          <view className='money'>
112
+            <view className='sleft'>
113
+              <view className='lword'>全年订单收入(税前)</view>
114
+
115
+              <view className='yearMoney'>
116
+                <text>{isyear ? (shopMoney?.totalCharges / 100).toFixed(2) : '******'}</text>元
117
+                <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
120 118
               </view>
121
-              <view className='line' />
122
-              <view className='sright'>
123
-                <view className='rword'>当月订单收入(税前)</view>
124
-                <view className='monthMoney'>
125
-                  <text>{isMomth ? (shopMoney?.currentCharges / 100).toFixed(2) : '******'}</text>元
126
-                  <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
127
-                </view></view>
128 119
             </view>
120
+            <view className='line' />
121
+            <view className='sright'>
122
+              <view className='rword'>当月订单收入(税前)</view>
123
+              <view className='monthMoney'>
124
+                <text>{isMomth ? (shopMoney?.currentCharges / 100).toFixed(2) : '******'}</text>元
125
+                <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
126
+              </view></view>
129 127
           </view>
130
-          <view className='search'>
128
+        </view>
129
+        <view className='search'>
130
+
131
+          <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={handelSearch} />
132
+        </view>
133
+        <view className='index-tabs'>
134
+          <mp-tabs
135
+            tabClass='tabs-Unselected'
136
+            swiperClass='tabs-swiper'
137
+            activeClass='tabs-Selected'
138
+            tabs={tabs}
139
+            current={activeTab}
140
+            onChange={handleTabChange}
141
+            activeTab={activeTab}
142
+          >
143
+          </mp-tabs>
144
+        </view>
145
+        <scroll-view scrollY style={{ height: 'calc(100vh - 120px)' }}>
131 146
 
132
-            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={handelSearch} />
133
-          </view>
134
-          <view className='index-tabs'>
135
-            <mp-tabs
136
-              tabClass='tabs-Unselected'
137
-              swiperClass='tabs-swiper'
138
-              activeClass='tabs-Selected'
139
-              tabs={tabs}
140
-              current={activeTab}
141
-              onChange={handleTabChange}
142
-              activeTab={activeTab}
143
-            >
144
-            </mp-tabs>
145
-          </view>
146 147
           <view>
147 148
             {/* 未核销 */}
148 149
             {activeTab === 0 &&
@@ -175,8 +176,9 @@ export default (props) => {
175 176
               </>
176 177
             }
177 178
           </view>
178
-          {/* <view className='botton'>这是我的底线</view> */}
179 179
         </scroll-view>
180
+
181
+        {/* <view className='botton'>这是我的底线</view> */}
180 182
       </view>
181 183
     </view>
182 184
   )