瀏覽代碼

Merge branch 'dev' of http://git.ycjcjy.com/shigongli/miniapp-v2 into dev

zlisen 3 年之前
父節點
當前提交
6394f83e94
共有 41 個文件被更改,包括 487 次插入336 次删除
  1. 二進制
      src/assets/icons/landlord/复制.png
  2. 4
    2
      src/components/BossCard/index.jsx
  3. 1
    1
      src/components/BossCard/style.less
  4. 1
    1
      src/components/CompoentsOrder/AlreadyUsed/style.less
  5. 1
    1
      src/components/CompoentsOrder/TobePaid/style.less
  6. 1
    1
      src/components/CompoentsOrder/TobeWritten/style.less
  7. 1
    1
      src/components/PayOrderCard/style.less
  8. 21
    0
      src/components/SearchBar/index.jsx
  9. 41
    0
      src/components/SearchBar/style.less
  10. 3
    0
      src/components/ShopCommission/index.jsx
  11. 8
    10
      src/components/ShopUnused/index.jsx
  12. 0
    1
      src/components/ShopUnused/style.less
  13. 27
    11
      src/components/ShopUsed/index.jsx
  14. 1
    0
      src/components/ShopUsed/style.less
  15. 16
    4
      src/components/foodCards/foodCards.jsx
  16. 49
    40
      src/hotel/components/HouseManage/houseManage.jsx
  17. 1
    25
      src/hotel/components/HouseManage/houseManage.less
  18. 1
    1
      src/hotel/pages/landlord/addRoom/addRoom.less
  19. 2
    1
      src/hotel/pages/landlord/landlord.config.js
  20. 6
    0
      src/hotel/pages/landlord/roomOrder/roomOrder.config.js
  21. 78
    0
      src/hotel/pages/landlord/roomOrder/roomOrder.jsx
  22. 19
    0
      src/hotel/pages/landlord/roomOrder/roomOrder.less
  23. 1
    1
      src/pages/MineUserAll/RefundMoney/CheckRefund/style.less
  24. 1
    1
      src/pages/PayOrder/style.less
  25. 0
    1
      src/pages/RoomOrder/index.jsx
  26. 1
    1
      src/pages/RoomOrder/style.less
  27. 1
    1
      src/pages/TobeShop/style.less
  28. 8
    27
      src/pages/index/index.jsx
  29. 55
    26
      src/pages/index/tabs/Guide.jsx
  30. 2
    2
      src/pages/index/tabs/GuideCss/style.less
  31. 1
    1
      src/pages/index/tabs/MineCss/style.less
  32. 9
    28
      src/pages/index/tabs/Recommend.jsx
  33. 0
    1
      src/pages/index/tabs/less/Recommend.less
  34. 4
    0
      src/routes.js
  35. 7
    1
      src/services/landlord.js
  36. 20
    0
      src/services/shopBoss.js
  37. 48
    11
      src/shop/components/ShopKeeper/shopKeeper.jsx
  38. 2
    117
      src/shop/components/ShopKeeper/shopKeeper.less
  39. 10
    5
      src/shop/components/Sparead/spreadMoney.jsx
  40. 2
    1
      src/shop/pages/spread/spreadIndex.config.js
  41. 33
    11
      src/shop/pages/spread/spreadIndex.jsx

二進制
src/assets/icons/landlord/复制.png 查看文件


+ 4
- 2
src/components/BossCard/index.jsx 查看文件

@@ -18,15 +18,17 @@ import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
18 18
 import './style.less'
19 19
 
20 20
 export default (props) => {
21
-  const { item } = props
21
+  const { item, cardNavigateTo } = props
22 22
   const { shopId } = props.item
23 23
   const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.packageId)
24 24
   const [city, setCity] = useState({})
25 25
   const [detail, setDetail] = useState({})
26 26
 
27
+
28
+
29
+
27 30
   const goFood = () => {
28 31
     Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
29
-
30 32
   }
31 33
 
32 34
   useEffect(() => {

+ 1
- 1
src/components/BossCard/style.less 查看文件

@@ -281,7 +281,7 @@
281 281
         margin-top: 3em;
282 282
         background-color: #274190;
283 283
         border-radius: 12px;
284
-        width: 690px;
284
+        width: calc(100% - 60px);
285 285
         height: 92px;
286 286
         color: @whiteColor;
287 287
         // position: absolute;

+ 1
- 1
src/components/CompoentsOrder/AlreadyUsed/style.less 查看文件

@@ -314,7 +314,7 @@
314 314
 
315 315
     .button-box {
316 316
       margin: 60px 0;
317
-      width: 690px;
317
+      width: calc(100% - 60px);
318 318
       height: 88px;
319 319
       line-height: 88px;
320 320
       background: #274291;

+ 1
- 1
src/components/CompoentsOrder/TobePaid/style.less 查看文件

@@ -257,7 +257,7 @@
257 257
 
258 258
     .button-box {
259 259
       margin: 60px 0;
260
-      width: 690px;
260
+      width: calc(100% - 60px);
261 261
       height: 88px;
262 262
       line-height: 88px;
263 263
       background: #274291;

+ 1
- 1
src/components/CompoentsOrder/TobeWritten/style.less 查看文件

@@ -258,7 +258,7 @@
258 258
 
259 259
     .button-box {
260 260
       margin: 60px 0;
261
-      width: 690px;
261
+      width: calc(100% - 60px);
262 262
       height: 88px;
263 263
       line-height: 88px;
264 264
       background: #274291;

+ 1
- 1
src/components/PayOrderCard/style.less 查看文件

@@ -281,7 +281,7 @@
281 281
         margin-top: 3em;
282 282
         background-color: #274190;
283 283
         border-radius: 12px;
284
-        width: 690px;
284
+        width: calc(100% - 60px);
285 285
         height: 92px;
286 286
         color: @whiteColor;
287 287
         // position: absolute;

+ 21
- 0
src/components/SearchBar/index.jsx 查看文件

@@ -0,0 +1,21 @@
1
+import Taro, { View } from "@tarojs/components"
2
+
3
+import './style.less'
4
+
5
+export default (props) => {
6
+
7
+  const { placeholder, onBlur } = props
8
+
9
+
10
+
11
+
12
+  return (
13
+    <View className='searchBar'>
14
+      <mp-searchbar
15
+        placeholder={placeholder}
16
+        onBlur={onBlur}
17
+      >
18
+      </mp-searchbar>
19
+    </View>
20
+  )
21
+}

+ 41
- 0
src/components/SearchBar/style.less 查看文件

@@ -0,0 +1,41 @@
1
+
2
+.searchBar{
3
+  margin: 35px 0;
4
+  .weui-search-bar{
5
+    padding: 0px;
6
+    border-radius: 45px;
7
+    background: #F8F8F8;
8
+
9
+    .weui-search-bar__label{
10
+      background: #F8F8F8;
11
+    }
12
+    .weui-search-bar__form{
13
+      border-radius: 45px;
14
+      background: #F8F8F8;
15
+      
16
+
17
+    }
18
+
19
+    .weui-search-bar__label{
20
+      border-radius: 45px;
21
+      background: #F8F8F8;
22
+
23
+
24
+    }
25
+    .weui-search-bar__input{
26
+      text-align: center;
27
+      background: #F8F8F8;
28
+
29
+    }
30
+  
31
+    .weui-search-bar__cancel-btn{
32
+      position: relative;
33
+      left: -10px;
34
+      font-size: 31px;
35
+      padding-left: 5px;
36
+      background: #F8F8F8;
37
+
38
+
39
+    }
40
+  }
41
+}

+ 3
- 0
src/components/ShopCommission/index.jsx 查看文件

@@ -1,6 +1,8 @@
1 1
 import Taro from '@tarojs/taro'
2 2
 import { useEffect } from 'react'
3
+
3 4
 import { getAccount } from '@/services/shopBoss'
5
+
4 6
 import formatTimes from '@/utils/formatTime'
5 7
 
6 8
 import './style.less'
@@ -11,6 +13,7 @@ export default (props) => {
11 13
   const { item } = props
12 14
 
13 15
 
16
+
14 17
   return (
15 18
     <view className='spreadCard'>
16 19
       <view className='spreadDate'>日期:<text>{formatTimes(item.createDate, "yyyy/MM/dd")}</text></view>

+ 8
- 10
src/components/ShopUnused/index.jsx 查看文件

@@ -1,5 +1,6 @@
1 1
 import Taro from '@tarojs/taro'
2 2
 import { useState, useEffect } from 'react'
3
+import formatTimes from '@/utils/formatTime'
3 4
 import iconsearch from '@/assets/icons/housemantj/search.png'
4 5
 import ms from '@/assets/icons/housemantj/ms3.jpg'
5 6
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
@@ -7,7 +8,7 @@ import './style.less'
7 8
 
8 9
 
9 10
 export default (props) => {
10
-  const { } = props
11
+  const { item } = props
11 12
 
12 13
 
13 14
 
@@ -18,21 +19,18 @@ export default (props) => {
18 19
   return (
19 20
     <view className='orderCard'>
20 21
       <view style={{ overflow: 'hidden' }}>
21
-        <view className='orderId'>订单编号:<text>ABC123456789</text></view>
22
-        <view className='orderTime'>下单日期:<text>2021-06-22 12:35</text></view>
22
+        <view className='orderId'>订单编号:{item.orderId}</view>
23
+        <view className='orderTime'>下单日期:{formatTimes(item.orderDate, 'yyyy-MM-dd hh:ss')}</view>
23 24
       </view>
24 25
       <view className='order'>
25
-        <image className='orderImg' src={ms} mode='aspectFit' />
26
+        <image className='orderImg' src={item.poster} mode='aspectFit' />
26 27
         <view className='orderRight'>
27
-          <view className='foodName'>【SEOUL.创意韩国料理】火爆全南京,
28
-            新街口又开新店啦...</view>
29
-          <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>88</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
28
+          <view className='foodName'>{item.description}</view>
29
+          <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>{item.actualPrice / 100}</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
30 30
           <view>已下单:等待客户上门就餐</view>
31 31
         </view>
32 32
         <view className='line' />
33
-
34
-        <view className='phone'>客户手机:<text>136****9434</text></view>
35
-        <view className='tripTime'>客户行程日期:预计在<text>2021-06-21中下午10:30-16:30</text></view>
33
+        <view className='phone'>客户手机:<text>{item.phone.replace(/^(\d{3})\d{4}(\d+)/, "$1****$2") || ''}</text></view>
36 34
       </view>
37 35
     </view>
38 36
   )

+ 0
- 1
src/components/ShopUnused/style.less 查看文件

@@ -29,7 +29,6 @@
29 29
     }
30 30
     .orderRight{
31 31
       .foodName{
32
-        height: 63px;
33 32
         font-size: 24px;
34 33
         color: #333333;
35 34
         line-height: 40px;

+ 27
- 11
src/components/ShopUsed/index.jsx 查看文件

@@ -1,14 +1,32 @@
1 1
 import Taro from '@tarojs/taro'
2
+import { getShopList, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
3
+
2 4
 import { useState, useEffect } from 'react'
3 5
 import iconsearch from '@/assets/icons/housemantj/search.png'
4 6
 import ms from '@/assets/icons/housemantj/ms3.jpg'
5 7
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
8
+import formatTimes from '@/utils/formatTime'
6 9
 import './style.less'
7 10
 
8 11
 
9 12
 export default (props) => {
10
-  const { } = props
11 13
 
14
+  const { item, verifiedOrder } = props
15
+  const verifyNo = item?.verifyNo
16
+  const [buttonStyle, setButtonStyle] = useState('')
17
+
18
+
19
+  const confirmOrder = () => {
20
+    setGetVerifiedOrder(verifyNo).then((e) => {
21
+      Taro.showToast({
22
+        title: '核销成功',
23
+        icon: 'success',
24
+        duration: 2000,
25
+      })
26
+      setButtonStyle('none')
27
+
28
+    })
29
+  }
12 30
 
13 31
 
14 32
   useEffect(() => {
@@ -18,22 +36,20 @@ export default (props) => {
18 36
   return (
19 37
     <view className='orderCard'>
20 38
       <view style={{ overflow: 'hidden' }}>
21
-        <view className='orderId'>订单编号:<text>ABC123456789</text></view>
22
-        <view className='orderTime'>下单日期:<text>2021-06-22 12:35</text></view>
39
+        <view className='orderId'>订单编号:{item.orderId}</view>
40
+        <view className='orderTime'>下单日期:{formatTimes(item.orderDate, 'yyyy-MM-dd hh:ss')}</view>
23 41
       </view>
24 42
       <view className='order'>
25
-        <image className='orderImg' src={ms} mode='aspectFit' />
43
+        <image className='orderImg' src={item.poster} mode='aspectFit' />
26 44
         <view className='orderRight'>
27
-          <view className='foodName'>【SEOUL.创意韩国料理】火爆全南京,
28
-            新街口又开新店啦...</view>
29
-          <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>88</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
30
-          <view>已下单:等待客户上门就餐</view>
45
+          <view className='foodName'>{item.description}</view>
46
+          <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>{item.actualPrice / 100}</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
31 47
         </view>
32 48
         <view className='line' />
33
-
34
-        <view className='phone'>客户手机:<text>136****9434</text><button className='button-OK'  >确认核销</button> </view>
35
-        <view className='tripTime'>客户行程日期:预计在<text>2021-06-21中下午10:30-16:30</text></view>
49
+        <view className='phone'>客户手机:<text>{item.phone.replace(/^(\d{3})\d{4}(\d+)/, "$1****$2") || ''}</text>
50
+          <button className='button-OK' onClick={confirmOrder} style={{ display: buttonStyle }}  >确认核销</button> </view>
36 51
       </view>
37 52
     </view>
38 53
   )
39 54
 }
55
+

+ 1
- 0
src/components/ShopUsed/style.less 查看文件

@@ -61,6 +61,7 @@
61 61
       height: 2px;
62 62
       background: #000;
63 63
       opacity: 0.1;
64
+      margin-top: 100px;
64 65
     }
65 66
     .phone{
66 67
       font-size: 24px;

+ 16
- 4
src/components/foodCards/foodCards.jsx 查看文件

@@ -1,3 +1,6 @@
1
+import useSave from "@/utils/hooks/useSave"
2
+import { getShopDetail, getShopcity } from '@/services/home'
3
+import { useState, useEffect } from 'react'
1 4
 import Taro from '@tarojs/taro'
2 5
 import Star from '@/components/Star/Star.jsx'
3 6
 import pay from '@/assets/icons/housemantj/pay.png'
@@ -6,9 +9,6 @@ import wz from '@/assets/icons/housemantj/location.png'
6 9
 import hongxin from '@/assets/icons/housemantj/已收藏.png'
7 10
 import baixin from '@/assets/icons/housemantj/收藏.png'
8 11
 import './style.less'
9
-import useSave from "@/utils/hooks/useSave"
10
-import { getShopDetail, getShopcity } from '@/services/home'
11
-import { useState, useEffect } from 'react'
12 12
 
13 13
 
14 14
 
@@ -20,11 +20,23 @@ export default (props) => {
20 20
   const [city, setCity] = useState({})
21 21
   const [detail, setDetail] = useState({})
22 22
 
23
+
24
+
25
+
23 26
   const goFood = () => {
24
-    Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
27
+    const page = Taro.getCurrentPages()
28
+    const currentPage = page[page.length - 1];//第一位是首页,最后一位是当前页面
29
+    const pagesUrl = `/${currentPage.route}`;
30
+    if (pagesUrl === '/pages/details/foodDetails/foodDetails') {
25 31
 
32
+    } else {
33
+      Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
34
+
35
+    }
26 36
   }
27 37
 
38
+
39
+
28 40
   useEffect(() => {
29 41
     getShopDetail(item.shopId).then((res) => {
30 42
       setDetail(res)

+ 49
- 40
src/hotel/components/HouseManage/houseManage.jsx 查看文件

@@ -1,17 +1,19 @@
1
-import Taro, {useDidShow } from '@tarojs/taro'
1
+import Taro, { useDidShow } from '@tarojs/taro'
2 2
 import see from '@/assets/icons/landlord/查看入住人.png'
3 3
 import share from '@/assets/icons/landlord/分享链接.png'
4 4
 import del from '@/assets/icons/landlord/删除.png'
5 5
 import addImg from '@/assets/icons/landlord/添加.png'
6 6
 import iconsearch from '@/assets/icons/housemantj/search.png'
7
-import React,{useState, useEffect,useRef, useImperativeHandle } from 'react'
8
-import {getRoomList,deleteRoom} from '@/services/landlord'
7
+import React, { useState, useEffect, useRef, useImperativeHandle } from 'react'
8
+import { getRoomList, deleteRoom } from '@/services/landlord'
9 9
 import ShareRoom from '../shareRoom/ShareRoom.jsx'
10 10
 import ShareCard from '../shareCard/shareCard'
11 11
 import './houseManage.less'
12
+import SearchBar from '@/components/SearchBar'
13
+
12 14
 
13 15
 export default React.forwardRef((props, ref) => {
14
-  const {hotel}=props
16
+  const { hotel } = props
15 17
   const [detail, setDetail] = useState([])
16 18
 
17 19
   const shareDataRef = useRef()
@@ -19,17 +21,17 @@ export default React.forwardRef((props, ref) => {
19 21
   // 判断是否首次加载
20 22
   const mounted = useRef(false)
21 23
 
22
-  const handelClick=()=>{
24
+  const handelClick = () => {
23 25
     Taro.navigateTo({ url: `/hotel/pages/landlord/addRoom/addRoom?hotelId=${hotel.hotelId}&hotelName=${hotel.hotelName}` });
24 26
   }
25
-  const handelDelete=(roomId)=>{
26
-    deleteRoom(roomId).then(()=>{
27
+  const handelDelete = (roomId) => {
28
+    deleteRoom(roomId).then(() => {
27 29
       Taro.showToast({
28 30
         title: '删除房源成功',
29 31
         icon: 'none',
30 32
       })
31
-      getRoomList({hotelId:hotel.hotelId}).then((res)=>{
32
-        setDetail(res.records||[])
33
+      getRoomList({ hotelId: hotel.hotelId }).then((res) => {
34
+        setDetail(res.records || [])
33 35
       })
34 36
     })
35 37
   }
@@ -44,21 +46,21 @@ export default React.forwardRef((props, ref) => {
44 46
   const onClose = () => {
45 47
     setShowCutover(false)
46 48
   }
47
-  useEffect(()=>{
49
+  useEffect(() => {
48 50
     //首次加载页面时
49 51
     if (!mounted.current && hotel.hotelId) {
50
-      getRoomList({hotelId:hotel.hotelId}).then((res)=>{
51
-        setDetail(res.records||[])
52
+      getRoomList({ hotelId: hotel.hotelId }).then((res) => {
53
+        setDetail(res.records || [])
52 54
         mounted.current = true
53 55
       })
54 56
     }
55
-  },[hotel?.hotelId])
57
+  }, [hotel?.hotelId])
56 58
 
57 59
   //当前页面切换到前台时
58 60
   useDidShow(() => {
59 61
     if (mounted.current) {
60
-      getRoomList({hotelId:hotel.hotelId}).then((res)=>{
61
-        setDetail(res.records||[])
62
+      getRoomList({ hotelId: hotel.hotelId }).then((res) => {
63
+        setDetail(res.records || [])
62 64
       })
63 65
     }
64 66
   })
@@ -81,41 +83,48 @@ export default React.forwardRef((props, ref) => {
81 83
     // 打开分享弹窗
82 84
     setShowCard(true)
83 85
   }
86
+  const handelOrder = (val) => {
87
+    Taro.navigateTo({ url: `/hotel/pages/landlord/roomOrder/roomOrder?roomId=${val.roomId}&roomName=${val.roomName}` });
88
+  }
84 89
 
90
+  const onSearch=(e)=>{
91
+    if(e.detail.value==''){
92
+      getRoomList({ hotelId: hotel.hotelId }).then((res) => {
93
+        setDetail(res.records || [])
94
+      })
95
+    }
96
+    else{
97
+      getRoomList({ hotelId: hotel.hotelId,roomName:e.detail.value }).then((res) => {
98
+      setDetail(res.records || [])
99
+    })
100
+    }
101
+    
102
+  }
85 103
   return (
86 104
     <view>
87 105
       <view style={{ padding: '0 30rpx', height: '100%' }}>
88
-          <view className='search'>
89
-            <input className='searchInput' disabled />
90
-            <image className='searchicon' src={iconsearch} />
91
-            <view className="searchword">请输入关键字搜索</view>
92
-          </view>
93
-          <ShareRoom showCutover={showCutover} onClose={onClose}  room={room} onFinish={handleFinish} />
94
-          <ShareCard showCutover={showCard} onClose={onClose}/>
106
+        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch} />
107
+        <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
108
+        <ShareCard showCutover={showCard} onClose={onClose} />
95 109
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 255px)' }}>
96
-
97
-          <view>
98
-            {
99
-              detail?.map((item)=>
110
+          {
111
+            detail?.map((item) =>
100 112
               <view className='houseCard'>
101
-              <view className='houseName'>{item.roomName}</view>
102
-              <view className='operation'>
103
-                <view><image src={see} />查看入住人</view>
104
-                <view onClick={()=>ShowMoldeOn(item)}><image src={share}/>分享链接</view>
105
-                <view onClick={()=>{handelDelete(item.roomId)}}><image src={del} />删除房源</view>
113
+                <view className='houseName'>{item.roomName}</view>
114
+                <view className='operation'>
115
+                  <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
116
+                  <view onClick={() => ShowMoldeOn(item)}><image src={share} />分享链接</view>
117
+                  <view onClick={() => handelDelete(item.roomId)}><image src={del} />删除房源</view>
118
+                </view>
106 119
               </view>
107
-            </view>
108
-              )
109
-            }
110
-            
111
-           
112
-          </view>
113
-        </scroll-view>        
120
+            )
121
+          }
122
+        </scroll-view>
114 123
       </view>
115 124
       <view className='addHouse' onClick={handelClick}>
116 125
         <image className='addImg' src={addImg} />添加房源
117 126
       </view>
118
-    
119
-      </view>
127
+
128
+    </view>
120 129
   )
121 130
 })

+ 1
- 25
src/hotel/components/HouseManage/houseManage.less 查看文件

@@ -1,29 +1,5 @@
1 1
 
2
-.search{
3
-  padding: 40px 0 15px 0;
4
-  position: relative;
5
-  .searchInput{    
6
-    height: 68px;
7
-    background: #F8F8F8;
8
-    border-radius: 34px;
9
-    box-sizing: border-box;
10
-  }
11
-  .searchicon{
12
-    width: 25px;
13
-    height: 25px;
14
-    position: absolute;
15
-    left: calc(50% - 135px);
16
-    top: 64px;
17
-  }
18
-  .searchword{
19
-    height: 23px;
20
-    font-size: 24px;
21
-    color: #C0C8D3;
22
-    position: absolute;
23
-    left: calc(50% - 100px);
24
-    bottom: 45px;
25
-  }
26
-}
2
+
27 3
 .houseCard{
28 4
   background: #FFFFFF;
29 5
   box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);

+ 1
- 1
src/hotel/pages/landlord/addRoom/addRoom.less 查看文件

@@ -8,7 +8,7 @@
8 8
   display: inline;
9 9
 }
10 10
 button {
11
-  width: 690px;
11
+  width: calc(100% - 60px);
12 12
   height: 92px;
13 13
   background: #1A3B83;
14 14
   margin: 0 auto;

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

@@ -4,7 +4,8 @@ export default {
4 4
   styleIsolation: 'shared',
5 5
   usingComponents: {
6 6
     "mp-tabbar": "weui-miniprogram/tabbar/tabbar",
7
-    "mp-dialog": "weui-miniprogram/dialog/dialog"
7
+    "mp-dialog": "weui-miniprogram/dialog/dialog",
8
+    "mp-searchbar": "weui-miniprogram/searchbar/searchbar"
8 9
   },
9 10
   enableShareAppMessage: true
10 11
 }

+ 6
- 0
src/hotel/pages/landlord/roomOrder/roomOrder.config.js 查看文件

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

+ 78
- 0
src/hotel/pages/landlord/roomOrder/roomOrder.jsx 查看文件

@@ -0,0 +1,78 @@
1
+import withLayout from '@/layouts'
2
+import React, { useState, useEffect, useRef } from 'react'
3
+import CustomNav from '@/components/CustomNav'
4
+import Taro from '@tarojs/taro'
5
+import copy from '@/assets/icons/landlord/复制.png'
6
+import { Input, Button, View, Picker, Label, Image } from '@tarojs/components'
7
+import { getRoomOrderList } from '@/services/landlord'
8
+import './roomOrder.less'
9
+
10
+
11
+
12
+
13
+export default withLayout((props) => {
14
+  const { roomId, roomName } = props.router.params
15
+  const [detail, setDetail] = useState([])
16
+  useEffect(() => {
17
+    getRoomOrderList({ roomId: roomId }).then((res) => {
18
+      setDetail(res.records || [])
19
+    })
20
+  }, [])
21
+  const CopyName = (val) => {
22
+    Taro.setClipboardData({
23
+      data: val,
24
+      success: e => {
25
+        Taro.showToast({
26
+          title: '入住人姓名已复制',
27
+          icon: 'success',
28
+          duration: 2000,
29
+        })
30
+      }
31
+    })
32
+  }
33
+  const CopyPhone = (val) => {
34
+    Taro.setClipboardData({
35
+      data: val,
36
+      success: e => {
37
+        Taro.showToast({
38
+          title: '入住人电话已复制',
39
+          icon: 'success',
40
+          duration: 2000,
41
+        })
42
+      }
43
+    })
44
+  }
45
+  return (
46
+    <View style={{ padding: '0 30px' }}>
47
+      <CustomNav title={roomName ? roomName : '房间名'} />
48
+      <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 65px)' }}>
49
+
50
+        {
51
+          detail.length==0?<View className='houseCard'>暂无入住人数据</View>
52
+           :detail?.map((item) =>
53
+            <View className='houseCard'>
54
+              {
55
+                item.personList?.map((item2) =>
56
+                  <View className='operation'>
57
+                    <View style={{display:'inline-block'}} onClick={()=>CopyName(item2.customerName)}>
58
+                      <Label>{item2.customerName}</Label>
59
+                      <Image src={copy} />
60
+                    </View>
61
+                    <View style={{display:'inline-block',marginLeft:'40rpx'}} onClick={()=>CopyPhone(item2.customerPhone)}>
62
+                      <Label>{item2.customerPhone}</Label>
63
+                      <Image src={copy} />
64
+                    </View>
65
+                  </View>
66
+
67
+                )
68
+              }              
69
+              <View className='operation'>入住时间:{item.startDate}  -  {item.endDate}</View>
70
+
71
+            </View>
72
+          )
73
+        }
74
+        
75
+      </scroll-view>
76
+    </View>
77
+  )
78
+})

+ 19
- 0
src/hotel/pages/landlord/roomOrder/roomOrder.less 查看文件

@@ -0,0 +1,19 @@
1
+.houseCard{
2
+  background: #1A3B83;
3
+  border-radius: 60px;
4
+  padding: 40px 30px 41px 30px;
5
+  text-align: center;
6
+  margin: 30px 0;
7
+  font-size: 28px;
8
+  color: #fff;  
9
+  Image{
10
+    width: 35px;
11
+    height: 35px;
12
+    margin-left:40px;
13
+    position: relative;
14
+    top: 5px;
15
+  }
16
+  .operation{
17
+    margin: 10px 0;
18
+  }
19
+}

+ 1
- 1
src/pages/MineUserAll/RefundMoney/CheckRefund/style.less 查看文件

@@ -402,7 +402,7 @@
402 402
 
403 403
     .button-box {
404 404
       margin: 60px 0;
405
-      width: 690px;
405
+      width: calc(100% - 60px);
406 406
       height: 88px;
407 407
       line-height: 88px;
408 408
       background: #274291;

+ 1
- 1
src/pages/PayOrder/style.less 查看文件

@@ -281,7 +281,7 @@
281 281
         margin-top: 3em;
282 282
         background-color: #274190;
283 283
         border-radius: 12px;
284
-        width: 690px;
284
+        width: calc(100% - 60px);
285 285
         height: 92px;
286 286
         color: @whiteColor;
287 287
         // position: absolute;

+ 0
- 1
src/pages/RoomOrder/index.jsx 查看文件

@@ -9,7 +9,6 @@ import './style.less'
9 9
 
10 10
 
11 11
 
12
-
13 12
 export default withLayout((props) => {
14 13
   const { router, person } = props
15 14
   const { roomId, roomOrderId, status } = router.params

+ 1
- 1
src/pages/RoomOrder/style.less 查看文件

@@ -1,5 +1,5 @@
1 1
 button {
2
-  width: 690px;
2
+  width: calc(100% - 60px);
3 3
   height: 92px;
4 4
   background: #1A3B83;
5 5
   margin: 0 auto;

+ 1
- 1
src/pages/TobeShop/style.less 查看文件

@@ -303,7 +303,7 @@
303 303
 
304 304
     .button-box {
305 305
       margin: 60px 0;
306
-      width: 690px;
306
+      width: calc(100% - 60px);
307 307
       height: 88px;
308 308
       line-height: 88px;
309 309
       background: #274291;

+ 8
- 27
src/pages/index/index.jsx 查看文件

@@ -1,4 +1,6 @@
1
-import React, { useState, useEffect,useRef } from 'react'
1
+
2
+
3
+import React, { useState, useEffect, useRef } from 'react'
2 4
 import Taro from '@tarojs/taro'
3 5
 import CustomNav from '@/components/CustomNav'
4 6
 import logo from '@/assets/icons/comm/logo_small.png'
@@ -9,38 +11,19 @@ import Mine from './tabs/Mine'
9 11
 import Recommend from './tabs/Recommend'
10 12
 import './index.less'
11 13
 import { getLocation } from '@/utils/location'
12
-import { getIndexType,  getResourceList } from '@/services/home'
14
+import { getIndexType, getResourceList } from '@/services/home'
13 15
 
14 16
 
15 17
 
16 18
 export default withLayout((props) => {
17
-  const { router, person } = props
19
+  const { router, person, location } = props
18 20
   const { params, path } = router
19 21
   const { tab } = params || {}
20
-
21 22
   const [currentTab, setCurrentTab] = useState(0)
22
-
23
-  const locRef = useRef()
24
-
25
-
26 23
   const handleTabChange = (e) => {
27 24
     const { index } = e.detail
28 25
     setCurrentTab(index)
29 26
   }
30
-
31
-  const [queryParams, setQueryParams] = useState({ location: '', pageNum: 1, pageSize: 10, typeId: '' })
32
-
33
-
34
-  useEffect(() => {
35
-    getLocation().then((res) => {
36
-      locRef.current = `${res.longitude},${res.latitude}`
37
-      setQueryParams({
38
-        ...queryParams,
39
-        location: locRef.current
40
-      })
41
-    })  
42
-  }, [])
43
-
44 27
   useEffect(() => {
45 28
     if (tab) {
46 29
       setCurrentTab(tab - 0)
@@ -52,16 +35,14 @@ export default withLayout((props) => {
52 35
         <CustomNav logo={logo} title='十公里' />
53 36
       </view>
54 37
       <view className='index-container'>
55
-        {currentTab === 0 && <Recommend loc={locRef} qp={queryParams}/>}
38
+        {currentTab === 0 && <Recommend location={location} />}
56 39
         {currentTab === 1 && <Guide person={person} router={router} />}
57
-        {/* {currentTab === 2 && <Strategy />} */}
40
+        {/* {currentTab === 2 && <Strategy />} */}
58 41
         {currentTab === 2 && <Mine person={person} />}
59 42
       </view>
60 43
       <view className='index-tabbar'>
61 44
         <mp-tabbar extClass='custom-tabbar' current={currentTab} list={tabList} onChange={handleTabChange}></mp-tabbar>
62 45
       </view>
63 46
     </view>
64
-
65 47
   )
66
-
67
-})
48
+})

+ 55
- 26
src/pages/index/tabs/Guide.jsx 查看文件

@@ -18,14 +18,17 @@ import './GuideCss/style.less'
18 18
 
19 19
 
20 20
 
21
+
21 22
 export default (props) => {
22
-  const { router, person } = props
23
-  console.log("🚀 ~ file: Guide.jsx ~ line 34 ~ props", props)
24
-  const { roomId, location, roomOrderId } = router.params
23
+  const { router, person, iflocation } = props
24
+  const { roomId, roomOrderId } = router.params
25 25
   const [extend, setExtend] = useState([])
26 26
   const [ifroomId, setIfroomId] = useState('havenot')
27 27
   const [spackage, setPackage] = useState([])
28 28
 
29
+  const cardNavigateTo = undefined
30
+
31
+
29 32
   // 住宿经纬度
30 33
   const Roomlog = useRef('')
31 34
   const Roomlat = useRef('')
@@ -33,26 +36,32 @@ export default (props) => {
33 36
   const Parklog = useRef('')
34 37
   const Parklat = useRef('')
35 38
   const [taRoomContent, setTaRoomContent] = useState([])
36
-
39
+  const RoomLocation = taRoomContent?.location
40
+  //没有停车 wifi的就不显示按钮
41
+  const [wifiButtonStyle, setWifiButtonStyle] = useState('')
42
+  const [parkingButtonStyle, setParkingButtonStyle] = useState('')
43
+  const [guideStyle, setGuideStyle] = useState('')
37 44
 
38 45
   //当前指南总数
39 46
   const [newextNum, setNewextNum] = useState(0)
40 47
   //全部指南个数
41 48
   const [AllextNum, setAllextNum] = useState(0)
42 49
   //指南当前页数
43
-  const [epage, setepage] = useState(2)
50
+  const [epage, setEpage] = useState(2)
44 51
   const extendMore = () => {
45
-    setepage(epage + 1)
52
+    setEpage(epage + 1)
46 53
     getExtendContent('room', roomId, { pageNum: epage }).then((res) => {
47 54
       setExtend([...extend, ...res.records])
48 55
       setNewextNum(newextNum + res.records.length)
49 56
     })
50 57
   }
51 58
 
59
+
60
+
61
+
52 62
   useEffect(() => {
53 63
     if (roomOrderId) {
54 64
       goToRoomForm(roomOrderId).then((res) => {
55
-        console.log("🚀 ~ file: Guide.jsx ~ line 48 ~ goToRoomForm ~ res", res)
56 65
         if (res.status !== 1) {
57 66
           Taro.navigateTo({
58 67
             url: `/pages/RoomOrder/index?roomOrderId=${roomOrderId}&status=${res.status}&roomId=${roomId}`,
@@ -65,10 +74,6 @@ export default (props) => {
65 74
 
66 75
 
67 76
   useEffect(() => {
68
-    // 老板推荐的套餐
69
-    getRecommendList({ location: location }).then((res) => {
70
-      setPackage(res || [])
71
-    })
72 77
 
73 78
     if (roomId) {
74 79
       // 点击’去这里‘跳转导航
@@ -78,7 +83,6 @@ export default (props) => {
78 83
         Parklog.current = (res.parkingLocation).toString().split(',')[0]
79 84
         Parklat.current = (res.parkingLocation).toString().split(',')[1]
80 85
         setTaRoomContent(res || [])
81
-        console.log(res);
82 86
       })
83 87
       //更多指引
84 88
       getExtendContent('room', roomId).then((res) => {
@@ -87,14 +91,41 @@ export default (props) => {
87 91
         setAllextNum(res.total)
88 92
         setNewextNum(res.records.length)
89 93
       })
94
+      getRecommendList({ location: RoomLocation }).then((res) => {
95
+        setPackage(res || [])
96
+      })
90 97
 
91 98
 
92 99
     } else {
93
-      console.log('房源没有ID');
100
+      getRecommendList({ location: iflocation }).then((res) => {
101
+        setPackage(res || [])
102
+      })
103
+
94 104
       return
95 105
     }
106
+    // extend?.records === []
96 107
 
97
-  }, [roomId])
108
+
109
+    if (taRoomContent?.wifiPassword === "") {
110
+      setWifiButtonStyle('none')
111
+    }
112
+    if (taRoomContent?.parkingAddress === "") {
113
+      setParkingButtonStyle('none')
114
+    }
115
+    // if (extend.length === 0) {
116
+    //   setGuideStyle('none')
117
+    // }
118
+    // if (extend) {
119
+    //   extend.map(item => {
120
+    //     if (item.pages) {
121
+    //       setGuideStyle('none')
122
+    //     } else {
123
+    //       setGuideStyle('')
124
+    //     }
125
+    //   })
126
+    // }
127
+
128
+  }, [roomId, RoomLocation])
98 129
 
99 130
 
100 131
   const goRoomMap = () => {
@@ -137,8 +168,6 @@ export default (props) => {
137 168
 
138 169
 
139 170
 
140
-
141
-
142 171
   return (
143 172
     <scroll-view scroll-y style='height:100%;'  >
144 173
 
@@ -176,9 +205,9 @@ export default (props) => {
176 205
                 <view className='MessageCard-content'>
177 206
                   <view className='MessageCard-name' >{taRoomContent?.address}</view>
178 207
                 </view>
179
-                <view className='MessageCard-button-RoomName'>
208
+                <view className='MessageCard-button-RoomName' onClick={() => { goRoomMap() }}>
180 209
                   <image className='MessageCard-image' src={GoHere} />
181
-                  <text className='MessageCard-text' onClick={() => { goRoomMap() }} >去这里</text>
210
+                  <text className='MessageCard-text'  >去这里</text>
182 211
                 </view>
183 212
               </view>
184 213
               <view className='MessageCard'>
@@ -190,9 +219,9 @@ export default (props) => {
190 219
                 <view className='MessageCard-content'>
191 220
                   <view className='MessageCard-name' >{taRoomContent?.parkingAddress}</view>
192 221
                 </view>
193
-                <view className='MessageCard-button-Park'>
222
+                <view className='MessageCard-button-Park' onClick={() => { goParkMap() }} style={{ display: parkingButtonStyle }} >
194 223
                   <image className='MessageCard-image' src={Taxi} />
195
-                  <text className='MessageCard-text' onClick={() => { goParkMap() }} >去这里</text>
224
+                  <text className='MessageCard-text'  >去这里</text>
196 225
                 </view>
197 226
               </view>
198 227
               <view className='MessageCard'>
@@ -201,18 +230,18 @@ export default (props) => {
201 230
                   WiFi信息
202 231
                   <text className='MessageCard-right'>----------</text>
203 232
                 </view>
204
-                <view className='MessageCard-content'>
233
+                <view className='MessageCard-content' style={{ display: wifiButtonStyle }} >
205 234
                   <view className='MessageCard-name' >名称:{taRoomContent?.wifiName}</view>
206 235
                   <view className='MessageCard-info'  ><text className='MessageCard-name'>密码:</text>{taRoomContent?.wifiPassword}</view>
207 236
                 </view>
208
-                <view className='MessageCard-button'>
237
+                <view className='MessageCard-button' onClick={() => { wifiCopy() }} style={{ display: wifiButtonStyle }}>
209 238
                   <image className='MessageCard-image' src={WiFi} />
210
-                  <text className='MessageCard-text' onClick={() => { wifiCopy() }}>复制</text>
239
+                  <text className='MessageCard-text'>复制</text>
211 240
                 </view>
212 241
               </view>
213 242
 
214
-              <view className='Guide-Content-box' >
215
-                <view className='title-image'>
243
+              <view className='Guide-Content-box'  >
244
+                <view className='title-image' style={{ display: guideStyle }} >
216 245
                   <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
217 246
                   <text className='title-title-boss' >更多指引</text>
218 247
                 </view>
@@ -232,7 +261,7 @@ export default (props) => {
232 261
             <text className='title-title-boss' >老板推荐好吃的</text>
233 262
           </view>
234 263
         </view>
235
-        {spackage?.map((item, index) => <BossCard key={(index)} item={item} />)}
264
+        {spackage?.map((item, index) => <BossCard cardNavigateTo={cardNavigateTo} key={(index)} item={item} />)}
236 265
         {/* 卡片------------- */}
237 266
         {/* <view className='Guide-Content-box-two'>
238 267
           <view className='title-image-two'>

+ 2
- 2
src/pages/index/tabs/GuideCss/style.less 查看文件

@@ -5,7 +5,7 @@
5 5
   width: 94%;
6 6
   margin: auto;
7 7
   .MessageCard {
8
-    width: 690px;
8
+    width: calc(100% - 60px);
9 9
     height: 175px;
10 10
     background: @whiteColor;
11 11
     border-radius: 12px;
@@ -135,7 +135,7 @@
135 135
 
136 136
   .articleCard {
137 137
     margin-top: 60px;
138
-    width: 690px;
138
+    width: calc(100% - 60px);
139 139
     // height: 1066px;
140 140
     background: #ffffff;
141 141
     border-radius: 12px;

+ 1
- 1
src/pages/index/tabs/MineCss/style.less 查看文件

@@ -169,7 +169,7 @@
169 169
   .Badge-box {
170 170
     margin-top: 30px;
171 171
     .Badge-list {
172
-      width: 690px;
172
+      width: calc(100% - 60px);
173 173
       height: 102px;
174 174
       background: #ffffff;
175 175
       box-shadow: 0px 4px 24px 0px rgba(0, 0, 0, 0.08);

+ 9
- 28
src/pages/index/tabs/Recommend.jsx 查看文件

@@ -1,7 +1,7 @@
1 1
 import Taro, { useRouter } from '@tarojs/taro'
2 2
 import { React, useState, useEffect, useRef } from 'react'
3 3
 import iconsearch from '@/assets/icons/housemantj/search.png'
4
-import location from '@/assets/icons/housemantj/location.png'
4
+import locationimg from '@/assets/icons/housemantj/location.png'
5 5
 import Tip from '@/components/tip'
6 6
 import { getIndexType,  getResourceList } from '@/services/home'
7 7
 import Card from '../components/Card'
@@ -11,20 +11,14 @@ import './less/Recommend.less'
11 11
 
12 12
 
13 13
 export default (props) => {
14
-  const { router, person, loc,qp } = props
14
+  const { router, person, location } = props
15 15
   const [activeTab, setActiveTab] = useState(0)
16 16
   const { params } = useRouter()
17 17
   const { tabJump } = params || {}
18 18
   const [typeList, setTypeList] = useState([])
19 19
   
20
-  const locRef = useRef(loc)
21
-  // if(locRef.current==null){
22
-  //     Taro.showLoading()
23
-  //   }
24
-  //   if (locRef.current!=null) {
25
-  //     Taro.hideLoading()
26
-  //   }
27
-  const [queryParams, setQueryParams] = useState(qp)
20
+  
21
+  const [queryParams, setQueryParams] = useState({ location: location, pageNum: 1, pageSize: 10, typeId: '' })
28 22
 
29 23
   // 获取资源表信息
30 24
   const [alllist, setAllList] = useState([])
@@ -40,35 +34,22 @@ export default (props) => {
40 34
       typeId: tab
41 35
     })
42 36
     if (index == 0) {
43
-      setQueryParams({ location:  locRef.current, pageNum: 1, pageSize: 10, typeId: '' })
37
+      setQueryParams({ location: location, pageNum: 1, pageSize: 10, typeId: '' })
44 38
     }
45 39
   }
46 40
 
47
-  useEffect(() => {
48
-    
41
+  useEffect(() => {    
49 42
     //查询分类标签表
50 43
     getIndexType({ pageSize: 20 }).then((res) => {
51 44
       setTypeList(res.records || [])
52
-    })
53
-    
45
+    })    
54 46
   }, [])
55 47
 
56 48
   useEffect(() => {
57
-    if (tabJump) {
58
-      // 更新 typeId
59
-      // 更新 分页
60
-    }
61
-    setActiveTab(tabJump - 0)
62
-  }, [tabJump])
63
-
64
-
65
-  useEffect(() => {
66
-    if (locRef.current) {
67 49
       getResourceList(queryParams).then((res) => {
68 50
         setAllList(res.records || [])
69 51
       })
70
-    }
71
-  }, [queryParams])
52
+    }, [queryParams])
72 53
 
73 54
   const onSearch = () => {
74 55
     // 用绝对路径
@@ -88,7 +69,7 @@ export default (props) => {
88 69
       <Tip />
89 70
       <view className='index-tabs'>
90 71
         <view className='position'>
91
-          <image className='location' src={location} />
72
+          <image className='location' src={locationimg} />
92 73
           <view className='city'>南京</view>
93 74
           <view className='line' />
94 75
         </view>

+ 0
- 1
src/pages/index/tabs/less/Recommend.less 查看文件

@@ -2,7 +2,6 @@
2 2
     padding: 10px 30px 0 30px;
3 3
     position: relative;
4 4
     .searchInput{    
5
-        width: 690px;
6 5
         height: 68px;
7 6
         background: #F8F8F8;
8 7
         border-radius: 34px;

+ 4
- 0
src/routes.js 查看文件

@@ -80,6 +80,10 @@ const hotelPages = [
80 80
     title: '新增房源',
81 81
     page: 'pages/landlord/addRoom/addRoom',
82 82
   },
83
+  {
84
+    title: '查看入住人',
85
+    page: 'pages/landlord/roomOrder/roomOrder',
86
+  },
83 87
 ];
84 88
 
85 89
 // 所有的页面

+ 7
- 1
src/services/landlord.js 查看文件

@@ -57,4 +57,10 @@ import request from '@/utils/request'
57 57
  * @param {*} data 
58 58
  * @returns 
59 59
  */
60
- export const shareRoom = (data) => request('/roomOrder', { method: 'post', data })
60
+ export const shareRoom = (data) => request('/roomOrder', { method: 'post', data })
61
+ /**
62
+ * 查看历史入住人列表
63
+ * @param {*} id 
64
+ * @returns 
65
+ */
66
+  export const getRoomOrderList = (params) => request('/roomOrder',{params})

+ 20
- 0
src/services/shopBoss.js 查看文件

@@ -25,3 +25,23 @@ export const getShopMoney = (id, amountType) => request(`/shop/${id}/account?amo
25 25
  */
26 26
 export const getAccount = (id,) => request(`/shop/account/${id}/log`, { id })
27 27
 
28
+
29
+/**
30
+ * 商铺核销列表
31
+ * @param {*} 
32
+ * @returns 
33
+ */
34
+export const getVerifiedOrder = (data) => request(`/verifyTarget`, { data })
35
+
36
+
37
+
38
+
39
+
40
+/**
41
+ * 商铺核销确认
42
+ * @param {*} 
43
+ * @returns 
44
+ */
45
+
46
+
47
+export const setGetVerifiedOrder = (id) => request(`/verifyTarget/${id}/confirm`, { method: 'put', id })

+ 48
- 11
src/shop/components/ShopKeeper/shopKeeper.jsx 查看文件

@@ -5,6 +5,8 @@ import Picker from '@/components/Picker'
5 5
 import Popup from '@/components/Popup'
6 6
 import ShopUsed from '@/components/ShopUsed' //已核销
7 7
 import ShopUnused from '@/components/ShopUnused' //未核销
8
+import SearchBar from '@/components/SearchBar'
9
+
8 10
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
9 11
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
10 12
 import iconsearch from '@/assets/icons/housemantj/search.png'
@@ -21,7 +23,8 @@ import ToggleRole from '@/components/toggleRole/ToggleRole'
21 23
 
22 24
 
23 25
 export default (props) => {
24
-  const { shopList, shop, account, onHotelChange, accountlog, shopMoney } = props
26
+  const { shopList, shop, onHotelChange, shopMoney, verifiedOrder, onVarified, onVarifiedTwo } = props
27
+  const shopId = shop?.shopId
25 28
   const [activeTab, setActiveTab] = useState(0)
26 29
   const { params } = useRouter()
27 30
   const { tabJump } = params || {}
@@ -37,10 +40,11 @@ export default (props) => {
37 40
   }
38 41
 
39 42
 
40
-  const handleHotelChange = (shopId, current) => {
43
+  const handleHotelChange = (e, current) => {
41 44
     onHotelChange(current)
42 45
   }
43 46
 
47
+
44 48
   useEffect(() => {
45 49
     if (tabJump) {
46 50
       setActiveTab(tabJump - 0)
@@ -50,6 +54,13 @@ export default (props) => {
50 54
   const handleTabChange = (e) => {
51 55
     const { index } = e.detail
52 56
     setActiveTab(index)
57
+    if (index === 1) {
58
+      onVarified()
59
+
60
+    } else {
61
+      onVarifiedTwo()
62
+
63
+    }
53 64
   }
54 65
   const tabs = [
55 66
     {
@@ -61,6 +72,15 @@ export default (props) => {
61 72
   ]
62 73
 
63 74
 
75
+  const handleVarified = () => {
76
+    onVarified()
77
+  }
78
+
79
+
80
+  const onSeacrh = (e) => {
81
+    console.log('eeeeeeeeeeeeeeeeee', e.detail.value);
82
+  }
83
+
64 84
   const [showCutover, setShowCutover] = useState(false)
65 85
   const ShowMoldeOn = () => {
66 86
     setShowCutover(true)
@@ -74,9 +94,9 @@ export default (props) => {
74 94
       </view>
75 95
       <ToggleRole showCutover={showCutover} onClose={onClose} role='shop' />
76 96
       <view style={{ padding: '30rpx', height: '100%' }}>
77
-        <scroll-view scroll-y scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
97
+        <scroll-view scroll-y scroll-view='true' bindscrolltoupper='upper' bindscrolltolower='lower' bindscroll='scroll' style={{ height: 'calc(100vh - 120px)' }}>
78 98
           <view className='storexx'>
79
-            <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择商铺" value={shop?.shopId} kv={['shopName', 'shopId']} dicts={shopList} onChange={handleHotelChange} /></view>
99
+            <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder='请选择商铺' value={shop?.shopId} kv={['shopName', 'shopId']} dicts={shopList} onChange={handleHotelChange} /></view>
80 100
             <view onClick={ShowMoldeOn} className='User-info-cutover'>
81 101
               <image className='User-info-cutover-image' src={cutoverUser} />
82 102
             </view>
@@ -86,7 +106,7 @@ export default (props) => {
86 106
                 <view className='lword'>全年订单收入(税前)</view>
87 107
 
88 108
                 <view className='yearMoney'>
89
-                  <text>{isyear ? shopMoney?.totalCharges : '******'}</text>元
109
+                  <text>{isyear ? shopMoney?.totalCharges / 100 : '******'}</text>元
90 110
                   <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
91 111
                 </view>
92 112
               </view>
@@ -94,15 +114,14 @@ export default (props) => {
94 114
               <view className='sright'>
95 115
                 <view className='rword'>当月订单收入(税前)</view>
96 116
                 <view className='monthMoney'>
97
-                  <text>{isMomth ? shopMoney?.currentCharges : '******'}</text>元
117
+                  <text>{isMomth ? shopMoney?.currentCharges / 100 : '******'}</text>元
98 118
                   <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
99 119
                 </view></view>
100 120
             </view>
101 121
           </view>
102 122
           <view className='search'>
103
-            <input className='searchInput' />
104
-            <image className='searchicon' src={iconsearch} />
105
-            <view className="searchword">搜索订单(输入客户手机号码)</view>
123
+
124
+            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={onSearch} />
106 125
           </view>
107 126
           <view className='index-tabs'>
108 127
             <mp-tabs
@@ -116,16 +135,34 @@ export default (props) => {
116 135
             >
117 136
             </mp-tabs>
118 137
           </view>
138
+          {
139
+            verifiedOrder.map
119 140
 
141
+          }
120 142
           <view>
121 143
             {/* 未核销 */}
122 144
             {activeTab === 0 &&
123
-              <ShopUnused />
145
+              <>
146
+                {
147
+                  verifiedOrder.map((item, index) => {
148
+
149
+                    return <ShopUnused key={(index)} item={item} />
150
+                  })
151
+                }
152
+              </>
124 153
             }
125 154
             {/* 已核销 */}
126 155
             {activeTab === 1 &&
127 156
               <>
128
-                <ShopUsed />
157
+                {
158
+                  verifiedOrder.map((item, index) => {
159
+
160
+                    return <ShopUsed verifiedOrder={verifiedOrder} key={(index)} item={item} />
161
+                  })
162
+                }
163
+
164
+
165
+
129 166
               </>
130 167
             }
131 168
           </view>

+ 2
- 117
src/shop/components/ShopKeeper/shopKeeper.less 查看文件

@@ -145,31 +145,8 @@
145 145
   }
146 146
 }
147 147
 
148
-.search{
149
-  padding: 40px 0  30px 0;
150
-  position: relative;
151
-  .searchInput{    
152
-    height: 68px;
153
-    background: #F8F8F8;
154
-    border-radius: 34px;
155
-    box-sizing: border-box;
156
-  }
157
-  .searchicon{
158
-    width: 25px;
159
-    height: 25px;
160
-    position: absolute;
161
-    left: 136px;
162
-    top: 61px;
163
-  }
164
-  .searchword{
165
-    height: 25px;
166
-    font-size: 24px;
167
-    color: #C0C8D3;
168
-    position: absolute;
169
-    left: calc(50% - 141rpx);
170
-    bottom: 60px;
171
-  }
172
-}
148
+
149
+
173 150
 .index-tabs {
174 151
   width: 100%;
175 152
   height: 91px;
@@ -194,99 +171,7 @@
194 171
     border-bottom: 5px solid black;
195 172
   }
196 173
 }
197
-.orderCard{
198
-  margin-bottom: 20px;
199
-  .orderId{
200
-    font-size: 20px;
201
-    color: #666666;
202
-    line-height: 44px;
203
-    float: left;
204
-    margin: 60px 0 32px 0;
205 174
 
206
-  }
207
-  .orderTime{    
208
-    font-size: 20px;
209
-    color: #666666;
210
-    line-height: 44px;
211
-    float: right;
212
-    margin: 60px 0 32px 0;
213
-  }
214
-  .order{
215
-    background: #FFFFFF;
216
-    box-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.08);
217
-    border-radius: 12px;
218
-    padding: 20px;
219
-    .orderImg{
220
-      width: 194px;
221
-      height: 194px;
222
-      border-radius: 22px;
223
-      float: left;
224
-      margin:0 26px 30px 0;
225
-    }
226
-    .orderRight{
227
-      .foodName{
228
-        height: 63px;
229
-        font-size: 24px;
230
-        color: #333333;
231
-        line-height: 40px;
232
-      }
233
-      .price{
234
-        font-size: 20px;
235
-        font-weight: bold;
236
-        color: #202020;
237
-        line-height: 44px;
238
-        margin: 37px 0 40px 0;
239
-        height: 19px;
240
-        .pnum{
241
-          color: #333333;
242
-          font-weight: 400;
243
-          margin-left: 47px;         
244
-        }
245
-      }
246
-      .price+view{
247
-        font-size: 20px;
248
-        font-weight: bold;
249
-        color: #FF3434;
250
-        line-height: 44px;
251
-        margin-bottom: 35px;
252
-        height: 19px;
253
-      }
254
-    }
255
-    .line{
256
-      width: 100%;
257
-      height: 2px;
258
-      background: #000;
259
-      opacity: 0.1;
260
-    }
261
-    .phone{
262
-      font-size: 24px;
263
-      color: #666666;
264
-      line-height: 44px;
265
-      height: 23px;
266
-      margin: 30px 0;
267
-    }
268
-    .button-OK{
269
-      width: 160px;
270
-    height: 40px;
271
-    background: #1A3B83;
272
-    /* margin: 0 auto; */
273
-    line-height: 40px;
274
-    border-radius: 12px;
275
-    font-size: 23px;
276
-    color: #ffffff;
277
-    position: relative;
278
-    right: -8em;
279
-    top: -2em;
280
-    }
281
-    .tripTime{
282
-      font-size: 24px;
283
-      color: #666666;
284
-      line-height: 44px;
285
-      margin-bottom: 30px;
286
-    }
287
-  }
288
-  
289
-}
290 175
 .botton{
291 176
   font-size: 28px;   
292 177
   color: #C0C8D3;

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

@@ -11,12 +11,13 @@ import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
11 11
 import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
12 12
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
13 13
 import { getAccount } from '@/services/shopBoss'
14
+import ToggleRole from '@/components/toggleRole/ToggleRole'
15
+
14 16
 
15 17
 import './spreadMoney.less'
16
-import ToggleRole from '@/components/toggleRole/ToggleRole'
17 18
 
18 19
 export default (props) => {
19
-  const { shopList, shop, account, onHotelChange, accountlog, shopMoney } = props
20
+  const { shopList, shop, onHotelChange, shopMoney } = props
20 21
   const [showCutover, setShowCutover] = useState(false)
21 22
   const [isyear, setYear] = useState(false)
22 23
   const [isMomth, setMonth] = useState(false)
@@ -26,12 +27,16 @@ export default (props) => {
26 27
 
27 28
 
28 29
 
30
+
31
+
32
+
29 33
   useEffect(() => {
30 34
     getAccount(accountId).then((e) => {
31 35
       const accContent = e.records
32 36
       setShopAccount(accContent)
33 37
 
34 38
     })
39
+
35 40
   }, [accountId])
36 41
 
37 42
   //小眼睛开关
@@ -73,7 +78,7 @@ export default (props) => {
73 78
               <view className='sleft'>
74 79
                 <view className='lword'>全年推广收入(税前)</view>
75 80
                 <view className='yearMoney'>
76
-                  <text>{isyear ? shopMoney?.totalCharges : '******'}</text>元
81
+                  <text>{isyear ? shopMoney?.totalCharges / 100 : '******'}</text>元
77 82
                   <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
78 83
                 </view>
79 84
               </view>
@@ -81,7 +86,7 @@ export default (props) => {
81 86
               <view className='sright'>
82 87
                 <view className='rword'>当月推广收入(税前)</view>
83 88
                 <view className='monthMoney'>
84
-                  <text>{isMomth ? shopMoney?.currentCharges : '******'}</text>元
89
+                  <text>{isMomth ? shopMoney?.currentCharges / 100 : '******'}</text>元
85 90
                   <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
86 91
                 </view></view>
87 92
             </view>
@@ -90,7 +95,7 @@ export default (props) => {
90 95
           {
91 96
             shopAccount.map((item, index) => {
92 97
               return (
93
-                <ShopCommission item={item} />
98
+                <ShopCommission key={(index)} item={item} />
94 99
 
95 100
               )
96 101
             })

+ 2
- 1
src/shop/pages/spread/spreadIndex.config.js 查看文件

@@ -4,6 +4,7 @@ export default {
4 4
   usingComponents: {
5 5
     "mp-tabbar": "weui-miniprogram/tabbar/tabbar",
6 6
     "mp-tabs": "../../../components/tabs/index",
7
-    "mp-dialog": "weui-miniprogram/dialog/dialog"
7
+    "mp-dialog": "weui-miniprogram/dialog/dialog",
8
+    "mp-searchbar": "weui-miniprogram/searchbar/searchbar",
8 9
   }
9 10
 }

+ 33
- 11
src/shop/pages/spread/spreadIndex.jsx 查看文件

@@ -1,7 +1,7 @@
1 1
 import React, { useState, useEffect } from 'react'
2 2
 import CustomNav from '@/components/CustomNav'
3 3
 import { useRouter } from '@tarojs/taro'
4
-import { getShopList, getShopMoney, getAccount } from '@/services/shopBoss'
4
+import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
5 5
 import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
6 6
 import Sparead from '../../components/Sparead/spreadMoney'
7 7
 import TabBar from '@/components/CustTabBar'
@@ -23,12 +23,11 @@ export default withLayout((props) => {
23 23
   const [shopList, setShopList] = useState([])
24 24
   const [shop, setShop] = useState()
25 25
   const shopId = shop?.shopId
26
-  console.log("🚀 ~ file: spreadIndex.jsx ~ line 26 ~ withLayout ~ shopId", shopId)
27
-  const [account, setAccount] = useState()
28
-  const [accountlog, setAccountLog] = useState([])
29 26
 
30 27
   const [amountType, setAmountType] = useState('order')
28
+  const [isVerified, setisVerified] = useState(0)
31 29
   const [shopMoney, setShopMoney] = useState([])
30
+  const [verifiedOrder, setVerifiedOrder] = useState([])
32 31
   const handleTabChange = (e) => {
33 32
     const { index } = e.detail
34 33
     setCurrentTab(index)
@@ -40,17 +39,40 @@ export default withLayout((props) => {
40 39
 
41 40
   useEffect(() => {
42 41
     getShopList().then((res) => {
43
-      const { shopList: list, account: acc, shop: current } = res
42
+      const { shopList: list, shop: current } = res
44 43
       setShopList(list)
45 44
       setShop(current)
46
-      setAccount(acc)
47
-      console.log("🚀 ~ file: shopKeeper.jsx ~ line 48 ~ getShopList ~ res", res)
45
+    })
46
+
47
+  }, [])
48 48
 
49 49
 
50
+  //未核销订单列表
51
+  useEffect(() => {
52
+    getVerifiedOrder({
53
+      isVerified: isVerified,
54
+      pageNum: 1,
55
+      pageSize: 99,
56
+      shopId: shopId,
57
+
58
+    }).then((res) => {
59
+      const order = res.records
60
+      setVerifiedOrder(order)
50 61
 
51 62
     })
52 63
 
53
-  }, [])
64
+
65
+  }, [shopId, isVerified])
66
+
67
+
68
+  const onVarified = () => {
69
+    setisVerified(1)
70
+  }
71
+
72
+
73
+  const onVarifiedTwo = () => {
74
+    setisVerified(0)
75
+  }
54 76
 
55 77
   useEffect(() => {
56 78
     if (shopId) {
@@ -84,10 +106,10 @@ export default withLayout((props) => {
84 106
   return (
85 107
     <view className='page-index'>
86 108
       <CustomNav title={shop?.shopName} />
87
-
88 109
       <view className='index-container'>
89
-        {currentTab === 0 && <ShopKeeper shopList={shopList} shop={shop} account={account} onHotelChange={handleHotelChange} accountlog={accountlog} shopMoney={shopMoney} />}
90
-        {currentTab === 1 && <Sparead shopList={shopList} shop={shop} account={account} onHotelChange={handleHotelChange} accountlog={accountlog} shopMoney={shopMoney} />}
110
+        {currentTab === 0 && <ShopKeeper onVarifiedTwo={onVarifiedTwo} onVarified={onVarified} verifiedOrder={verifiedOrder} shopList={shopList} shop={shop} onHotelChange={handleHotelChange} shopMoney={shopMoney} />
111
+        }
112
+        {currentTab === 1 && <Sparead shopList={shopList} shop={shop} verifiedOrder={verifiedOrder} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
91 113
       </view>
92 114
       <view className='index-tabbar'>
93 115
         <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>