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

+ 4
- 2
src/components/BossCard/index.jsx View File

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

+ 8
- 10
src/components/ShopUnused/index.jsx View File

1
 import Taro from '@tarojs/taro'
1
 import Taro from '@tarojs/taro'
2
 import { useState, useEffect } from 'react'
2
 import { useState, useEffect } from 'react'
3
+import formatTimes from '@/utils/formatTime'
3
 import iconsearch from '@/assets/icons/housemantj/search.png'
4
 import iconsearch from '@/assets/icons/housemantj/search.png'
4
 import ms from '@/assets/icons/housemantj/ms3.jpg'
5
 import ms from '@/assets/icons/housemantj/ms3.jpg'
5
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
6
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
7
 
8
 
8
 
9
 
9
 export default (props) => {
10
 export default (props) => {
10
-  const { } = props
11
+  const { item } = props
11
 
12
 
12
 
13
 
13
 
14
 
18
   return (
19
   return (
19
     <view className='orderCard'>
20
     <view className='orderCard'>
20
       <view style={{ overflow: 'hidden' }}>
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
       </view>
24
       </view>
24
       <view className='order'>
25
       <view className='order'>
25
-        <image className='orderImg' src={ms} mode='aspectFit' />
26
+        <image className='orderImg' src={item.poster} mode='aspectFit' />
26
         <view className='orderRight'>
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
           <view>已下单:等待客户上门就餐</view>
30
           <view>已下单:等待客户上门就餐</view>
31
         </view>
31
         </view>
32
         <view className='line' />
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
       </view>
34
       </view>
37
     </view>
35
     </view>
38
   )
36
   )

+ 0
- 1
src/components/ShopUnused/style.less View File

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

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

32
         <view className='line' />
32
         <view className='line' />
33
 
33
 
34
         <view className='phone'>客户手机:<text>136****9434</text><button className='button-OK'  >确认核销</button> </view>
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>
36
       </view>
35
       </view>
37
     </view>
36
     </view>
38
   )
37
   )

+ 16
- 4
src/components/foodCards/foodCards.jsx View File

1
+import useSave from "@/utils/hooks/useSave"
2
+import { getShopDetail, getShopcity } from '@/services/home'
3
+import { useState, useEffect } from 'react'
1
 import Taro from '@tarojs/taro'
4
 import Taro from '@tarojs/taro'
2
 import Star from '@/components/Star/Star.jsx'
5
 import Star from '@/components/Star/Star.jsx'
3
 import pay from '@/assets/icons/housemantj/pay.png'
6
 import pay from '@/assets/icons/housemantj/pay.png'
6
 import hongxin from '@/assets/icons/housemantj/已收藏.png'
9
 import hongxin from '@/assets/icons/housemantj/已收藏.png'
7
 import baixin from '@/assets/icons/housemantj/收藏.png'
10
 import baixin from '@/assets/icons/housemantj/收藏.png'
8
 import './style.less'
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
   const [city, setCity] = useState({})
20
   const [city, setCity] = useState({})
21
   const [detail, setDetail] = useState({})
21
   const [detail, setDetail] = useState({})
22
 
22
 
23
+
24
+
25
+
23
   const goFood = () => {
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
   useEffect(() => {
40
   useEffect(() => {
29
     getShopDetail(item.shopId).then((res) => {
41
     getShopDetail(item.shopId).then((res) => {
30
       setDetail(res)
42
       setDetail(res)

+ 6
- 6
src/pages/index/index.jsx View File

1
-import React, { useState, useEffect,useRef } from 'react'
1
+import React, { useState, useEffect, useRef } from 'react'
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
 import CustomNav from '@/components/CustomNav'
3
 import CustomNav from '@/components/CustomNav'
4
 import logo from '@/assets/icons/comm/logo_small.png'
4
 import logo from '@/assets/icons/comm/logo_small.png'
9
 import Recommend from './tabs/Recommend'
9
 import Recommend from './tabs/Recommend'
10
 import './index.less'
10
 import './index.less'
11
 import { getLocation } from '@/utils/location'
11
 import { getLocation } from '@/utils/location'
12
-import { getIndexType,  getResourceList } from '@/services/home'
12
+import { getIndexType, getResourceList } from '@/services/home'
13
 
13
 
14
 
14
 
15
 
15
 
16
 export default withLayout((props) => {
16
 export default withLayout((props) => {
17
-  const { router, person } = props
17
+  const { router, person, location } = props
18
   const { params, path } = router
18
   const { params, path } = router
19
   const { tab } = params || {}
19
   const { tab } = params || {}
20
 
20
 
38
         ...queryParams,
38
         ...queryParams,
39
         location: locRef.current
39
         location: locRef.current
40
       })
40
       })
41
-    })  
41
+    })
42
   }, [])
42
   }, [])
43
 
43
 
44
   useEffect(() => {
44
   useEffect(() => {
52
         <CustomNav logo={logo} title='十公里' />
52
         <CustomNav logo={logo} title='十公里' />
53
       </view>
53
       </view>
54
       <view className='index-container'>
54
       <view className='index-container'>
55
-        {currentTab === 0 && <Recommend loc={locRef} qp={queryParams}/>}
56
-        {currentTab === 1 && <Guide person={person} router={router} />}
55
+        {currentTab === 0 && <Recommend loc={locRef} qp={queryParams} />}
56
+        {currentTab === 1 && <Guide person={person} router={router} iflocation={location} />}
57
         {/* {currentTab === 2 && <Strategy />} */}
57
         {/* {currentTab === 2 && <Strategy />} */}
58
         {currentTab === 2 && <Mine person={person} />}
58
         {currentTab === 2 && <Mine person={person} />}
59
       </view>
59
       </view>

+ 55
- 26
src/pages/index/tabs/Guide.jsx View File

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

+ 20
- 0
src/services/shopBoss.js View File

25
  */
25
  */
26
 export const getAccount = (id,) => request(`/shop/account/${id}/log`, { id })
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
+export const setGetVerifiedOrder = (id) => request(`/verifyTarget​/${id}`, { method: 'put', id })
46
+
47
+

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

21
 
21
 
22
 
22
 
23
 export default (props) => {
23
 export default (props) => {
24
-  const { shopList, shop, account, onHotelChange, accountlog, shopMoney } = props
24
+  const { shopList, shop, onHotelChange, shopMoney, verifiedOrder } = props
25
   const [activeTab, setActiveTab] = useState(0)
25
   const [activeTab, setActiveTab] = useState(0)
26
   const { params } = useRouter()
26
   const { params } = useRouter()
27
   const { tabJump } = params || {}
27
   const { tabJump } = params || {}
41
     onHotelChange(current)
41
     onHotelChange(current)
42
   }
42
   }
43
 
43
 
44
+
45
+  //搜索
46
+  const search = (value) => {
47
+    console.log(value);
48
+
49
+    return new Promise((resolve, reject) => {
50
+      console.log(resolve, reject);
51
+      resolve([{ text: '搜索结果', value: 1 }, { text: '搜索结果2', value: 2 }])
52
+
53
+    })
54
+  }
55
+  const handeInput = (e) => {
56
+    const value = e.detail.value
57
+    console.log("🚀 ~ file: shopKeeper.jsx ~ line 57 ~ handeInput ~ value", value)
58
+
59
+
60
+  }
61
+
62
+
63
+
44
   useEffect(() => {
64
   useEffect(() => {
45
     if (tabJump) {
65
     if (tabJump) {
46
       setActiveTab(tabJump - 0)
66
       setActiveTab(tabJump - 0)
74
       </view>
94
       </view>
75
       <ToggleRole showCutover={showCutover} onClose={onClose} role='shop' />
95
       <ToggleRole showCutover={showCutover} onClose={onClose} role='shop' />
76
       <view style={{ padding: '30rpx', height: '100%' }}>
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
           <view className='storexx'>
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
             <view onClick={ShowMoldeOn} className='User-info-cutover'>
100
             <view onClick={ShowMoldeOn} className='User-info-cutover'>
81
               <image className='User-info-cutover-image' src={cutoverUser} />
101
               <image className='User-info-cutover-image' src={cutoverUser} />
82
             </view>
102
             </view>
86
                 <view className='lword'>全年订单收入(税前)</view>
106
                 <view className='lword'>全年订单收入(税前)</view>
87
 
107
 
88
                 <view className='yearMoney'>
108
                 <view className='yearMoney'>
89
-                  <text>{isyear ? shopMoney?.totalCharges : '******'}</text>元
109
+                  <text>{isyear ? shopMoney?.totalCharges / 100 : '******'}</text>元
90
                   <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
110
                   <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
91
                 </view>
111
                 </view>
92
               </view>
112
               </view>
94
               <view className='sright'>
114
               <view className='sright'>
95
                 <view className='rword'>当月订单收入(税前)</view>
115
                 <view className='rword'>当月订单收入(税前)</view>
96
                 <view className='monthMoney'>
116
                 <view className='monthMoney'>
97
-                  <text>{isMomth ? shopMoney?.currentCharges : '******'}</text>元
117
+                  <text>{isMomth ? shopMoney?.currentCharges / 100 : '******'}</text>元
98
                   <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
118
                   <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
99
                 </view></view>
119
                 </view></view>
100
             </view>
120
             </view>
101
           </view>
121
           </view>
102
           <view className='search'>
122
           <view className='search'>
103
-            <input className='searchInput' />
104
-            <image className='searchicon' src={iconsearch} />
105
-            <view className="searchword">搜索订单(输入客户手机号码)</view>
123
+            <mp-searchbar
124
+              placeholder='搜索订单(输入客户手机号码)'
125
+              search={search}
126
+              onInput={(e) => handeInput(e)}
127
+            >
128
+            </mp-searchbar>
106
           </view>
129
           </view>
107
           <view className='index-tabs'>
130
           <view className='index-tabs'>
108
             <mp-tabs
131
             <mp-tabs
116
             >
139
             >
117
             </mp-tabs>
140
             </mp-tabs>
118
           </view>
141
           </view>
142
+          {
143
+            verifiedOrder.map
119
 
144
 
145
+          }
120
           <view>
146
           <view>
121
             {/* 未核销 */}
147
             {/* 未核销 */}
122
             {activeTab === 0 &&
148
             {activeTab === 0 &&
123
-              <ShopUnused />
149
+              <>
150
+                {
151
+                  verifiedOrder.map((item, index) => {
152
+
153
+                    return <ShopUnused key={(index)} item={item} />
154
+                  })
155
+                }
156
+              </>
157
+
124
             }
158
             }
125
             {/* 已核销 */}
159
             {/* 已核销 */}
126
             {activeTab === 1 &&
160
             {activeTab === 1 &&

+ 38
- 113
src/shop/components/ShopKeeper/shopKeeper.less View File

146
 }
146
 }
147
 
147
 
148
 .search{
148
 .search{
149
-  padding: 40px 0  30px 0;
150
-  position: relative;
151
-  .searchInput{    
152
-    height: 68px;
149
+  margin: 35px 0;
150
+  .weui-search-bar{
151
+    padding: 0px;
152
+    border-radius: 45px;
153
     background: #F8F8F8;
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;
154
+
155
+    .weui-search-bar__label{
156
+      background: #F8F8F8;
157
+    }
158
+    .weui-search-bar__form{
159
+      border-radius: 45px;
160
+      background: #F8F8F8;
161
+      
162
+
163
+    }
164
+
165
+    .weui-search-bar__label{
166
+      border-radius: 45px;
167
+      background: #F8F8F8;
168
+
169
+
170
+    }
171
+    .weui-search-bar__input{
172
+      text-align: center;
173
+      background: #F8F8F8;
174
+
175
+    }
176
+  
177
+    .weui-search-bar__cancel-btn{
178
+      position: relative;
179
+      left: -10px;
180
+      font-size: 31px;
181
+      padding-left: 5px;
182
+      background: #F8F8F8;
183
+
184
+
185
+    }
171
   }
186
   }
172
 }
187
 }
188
+
189
+
173
 .index-tabs {
190
 .index-tabs {
174
   width: 100%;
191
   width: 100%;
175
   height: 91px;
192
   height: 91px;
194
     border-bottom: 5px solid black;
211
     border-bottom: 5px solid black;
195
   }
212
   }
196
 }
213
 }
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
 
214
 
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
 .botton{
215
 .botton{
291
   font-size: 28px;   
216
   font-size: 28px;   
292
   color: #C0C8D3;
217
   color: #C0C8D3;

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

16
 import ToggleRole from '@/components/toggleRole/ToggleRole'
16
 import ToggleRole from '@/components/toggleRole/ToggleRole'
17
 
17
 
18
 export default (props) => {
18
 export default (props) => {
19
-  const { shopList, shop, account, onHotelChange, accountlog, shopMoney } = props
19
+  const { shopList, shop, onHotelChange, shopMoney } = props
20
   const [showCutover, setShowCutover] = useState(false)
20
   const [showCutover, setShowCutover] = useState(false)
21
   const [isyear, setYear] = useState(false)
21
   const [isyear, setYear] = useState(false)
22
   const [isMomth, setMonth] = useState(false)
22
   const [isMomth, setMonth] = useState(false)
73
               <view className='sleft'>
73
               <view className='sleft'>
74
                 <view className='lword'>全年推广收入(税前)</view>
74
                 <view className='lword'>全年推广收入(税前)</view>
75
                 <view className='yearMoney'>
75
                 <view className='yearMoney'>
76
-                  <text>{isyear ? shopMoney?.totalCharges : '******'}</text>元
76
+                  <text>{isyear ? shopMoney?.totalCharges / 100 : '******'}</text>元
77
                   <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
77
                   <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
78
                 </view>
78
                 </view>
79
               </view>
79
               </view>
81
               <view className='sright'>
81
               <view className='sright'>
82
                 <view className='rword'>当月推广收入(税前)</view>
82
                 <view className='rword'>当月推广收入(税前)</view>
83
                 <view className='monthMoney'>
83
                 <view className='monthMoney'>
84
-                  <text>{isMomth ? shopMoney?.currentCharges : '******'}</text>元
84
+                  <text>{isMomth ? shopMoney?.currentCharges / 100 : '******'}</text>元
85
                   <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
85
                   <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
86
                 </view></view>
86
                 </view></view>
87
             </view>
87
             </view>
90
           {
90
           {
91
             shopAccount.map((item, index) => {
91
             shopAccount.map((item, index) => {
92
               return (
92
               return (
93
-                <ShopCommission item={item} />
93
+                <ShopCommission key={(index)} item={item} />
94
 
94
 
95
               )
95
               )
96
             })
96
             })

+ 2
- 1
src/shop/pages/spread/spreadIndex.config.js View File

4
   usingComponents: {
4
   usingComponents: {
5
     "mp-tabbar": "weui-miniprogram/tabbar/tabbar",
5
     "mp-tabbar": "weui-miniprogram/tabbar/tabbar",
6
     "mp-tabs": "../../../components/tabs/index",
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
 }

+ 25
- 10
src/shop/pages/spread/spreadIndex.jsx View File

1
 import React, { useState, useEffect } from 'react'
1
 import React, { useState, useEffect } from 'react'
2
 import CustomNav from '@/components/CustomNav'
2
 import CustomNav from '@/components/CustomNav'
3
 import { useRouter } from '@tarojs/taro'
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
 import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
5
 import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
6
 import Sparead from '../../components/Sparead/spreadMoney'
6
 import Sparead from '../../components/Sparead/spreadMoney'
7
 import TabBar from '@/components/CustTabBar'
7
 import TabBar from '@/components/CustTabBar'
21
   const { tab } = params || {}
21
   const { tab } = params || {}
22
   const [currentTab, setCurrentTab] = useState(0)
22
   const [currentTab, setCurrentTab] = useState(0)
23
   const [shopList, setShopList] = useState([])
23
   const [shopList, setShopList] = useState([])
24
+  console.log("🚀 ~ file: spreadIndex.jsx ~ line 24 ~ withLayout ~ shopList", shopList)
24
   const [shop, setShop] = useState()
25
   const [shop, setShop] = useState()
25
   const shopId = shop?.shopId
26
   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
 
27
 
30
   const [amountType, setAmountType] = useState('order')
28
   const [amountType, setAmountType] = useState('order')
31
   const [shopMoney, setShopMoney] = useState([])
29
   const [shopMoney, setShopMoney] = useState([])
30
+  const [verifiedOrder, setVerifiedOrder] = useState([])
32
   const handleTabChange = (e) => {
31
   const handleTabChange = (e) => {
33
     const { index } = e.detail
32
     const { index } = e.detail
34
     setCurrentTab(index)
33
     setCurrentTab(index)
40
 
39
 
41
   useEffect(() => {
40
   useEffect(() => {
42
     getShopList().then((res) => {
41
     getShopList().then((res) => {
43
-      const { shopList: list, account: acc, shop: current } = res
42
+      const { shopList: list, shop: current } = res
44
       setShopList(list)
43
       setShopList(list)
45
       setShop(current)
44
       setShop(current)
46
-      setAccount(acc)
47
-      console.log("🚀 ~ file: shopKeeper.jsx ~ line 48 ~ getShopList ~ res", res)
45
+    })
46
+
47
+  }, [])
48
+
48
 
49
 
50
+  //未核销订单列表
51
+  useEffect(() => {
52
+    getVerifiedOrder({
53
+      isVerified: 0,
54
+      pageNum: 1,
55
+      pageSize: 99,
56
+      shopId: shopId,
49
 
57
 
58
+    }).then((res) => {
59
+      const order = res.records
60
+      setVerifiedOrder(order)
61
+      console.log("🚀 ~ file: spreadIndex.jsx ~ line 49 ~ getVerifiedOrder ~ res", res)
50
 
62
 
51
     })
63
     })
52
 
64
 
53
-  }, [])
65
+  }, [shopId])
54
 
66
 
55
   useEffect(() => {
67
   useEffect(() => {
56
     if (shopId) {
68
     if (shopId) {
86
       <CustomNav title={shop?.shopName} />
98
       <CustomNav title={shop?.shopName} />
87
 
99
 
88
       <view className='index-container'>
100
       <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} />}
101
+        {currentTab === 0 && <ShopKeeper verifiedOrder={verifiedOrder} shopList={shopList} shop={shop} onHotelChange={handleHotelChange} shopMoney={shopMoney} />
102
+
103
+
104
+        }
105
+        {currentTab === 1 && <Sparead shopList={shopList} shop={shop} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
91
       </view>
106
       </view>
92
       <view className='index-tabbar'>
107
       <view className='index-tabbar'>
93
         <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>
108
         <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>