吃个甘蔗嚼一年 3 år sedan
förälder
incheckning
2cbecbadb8
2 ändrade filer med 33 tillägg och 11 borttagningar
  1. 27
    10
      src/components/ShopUsed/index.jsx
  2. 6
    1
      src/shop/components/Sparead/spreadMoney.jsx

+ 27
- 10
src/components/ShopUsed/index.jsx Visa fil

@@ -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,21 +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>
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>
35 51
       </view>
36 52
     </view>
37 53
   )
38 54
 }
55
+

+ 6
- 1
src/shop/components/Sparead/spreadMoney.jsx Visa fil

@@ -11,9 +11,10 @@ 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 20
   const { shopList, shop, onHotelChange, shopMoney } = props
@@ -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
   //小眼睛开关