|
@@ -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
|
+
|