|
@@ -1,22 +1,83 @@
|
1
|
1
|
|
2
|
2
|
import image from '@/assets/icons/ProCard/8kb.jpg'
|
3
|
|
-import { Button, Radio } from '@tarojs/components'
|
|
3
|
+import { useState, useEffect } from 'react'
|
|
4
|
+import { Button, Radio, Input } from '@tarojs/components'
|
4
|
5
|
|
5
|
6
|
import food from '@/assets/icons/ProCard/food.png'
|
6
|
7
|
import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
|
7
|
8
|
import CustomNav from '@/components/CustomNav'
|
8
|
|
-import PPP from '@/components/ProCard'
|
|
9
|
+import OrderMolded from '@/components/OrderMolded'
|
|
10
|
+import Popup from '@/components/Popup'
|
|
11
|
+
|
9
|
12
|
import './style.less'
|
10
|
13
|
|
11
|
14
|
export default () => {
|
|
15
|
+ const [showDialog, setShowDialog] = useState(false)
|
|
16
|
+
|
|
17
|
+ const ShowMoldeOn = () => {
|
|
18
|
+ setShowDialog(true)
|
|
19
|
+ }
|
|
20
|
+ const ShowMoldeOff = () => {
|
|
21
|
+ setShowDialog(false)
|
|
22
|
+ }
|
|
23
|
+
|
|
24
|
+ const buttons = [
|
|
25
|
+
|
|
26
|
+ {
|
|
27
|
+ text: '取消'
|
|
28
|
+ },
|
|
29
|
+ {
|
|
30
|
+ text: '确定'
|
|
31
|
+ },
|
|
32
|
+
|
|
33
|
+ ]
|
|
34
|
+
|
|
35
|
+ const [BuyNumber, setBuyNumber] = useState(1)
|
|
36
|
+ const [DisabledBool, setDisabledBool] = useState(false)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+ const NumberAdd = () => {
|
|
40
|
+ setBuyNumber(BuyNumber + 1)
|
|
41
|
+ console.log(BuyNumber);
|
|
42
|
+
|
|
43
|
+ }
|
12
|
44
|
|
|
45
|
+ const NumberCut = () => {
|
|
46
|
+ setBuyNumber(BuyNumber - 1)
|
|
47
|
+ console.log(BuyNumber);
|
13
|
48
|
|
|
49
|
+ }
|
14
|
50
|
|
|
51
|
+ const onChange = (value, event) => {
|
|
52
|
+ console.log('----------------->', value, event);
|
|
53
|
+ }
|
|
54
|
+
|
|
55
|
+ useEffect(() => {
|
|
56
|
+ onChange()
|
|
57
|
+ if (BuyNumber < 2) {
|
|
58
|
+ setDisabledBool(true)
|
|
59
|
+
|
|
60
|
+ } else {
|
|
61
|
+ setDisabledBool(false)
|
|
62
|
+
|
|
63
|
+ }
|
|
64
|
+ }, [BuyNumber])
|
15
|
65
|
|
16
|
66
|
return (
|
17
|
67
|
|
18
|
68
|
<view class='container'>
|
19
|
69
|
<CustomNav title='订单' />
|
|
70
|
+ <Popup show={showDialog} maskClosable={false}>
|
|
71
|
+ <OrderMolded />
|
|
72
|
+ <view className='item-center-Number' >
|
|
73
|
+ <view className='buy-num-minus' disabled={DisabledBool} onClick={NumberCut} >-</view>
|
|
74
|
+ <Input className='buy-num-input' type='number' min={1} onChange={onChange} value={BuyNumber} />
|
|
75
|
+ <view className='buy-num-add' onClick={NumberAdd} >+</view>
|
|
76
|
+ </view>
|
|
77
|
+ <view className='buy' >
|
|
78
|
+
|
|
79
|
+ </view>
|
|
80
|
+ </Popup>
|
20
|
81
|
<view class='coupon-list'>
|
21
|
82
|
<view class='wrapper'>
|
22
|
83
|
<view class='left-complete-one'>
|
|
@@ -36,9 +97,9 @@ export default () => {
|
36
|
97
|
<view className='title-time' >有效期:2021/06/21-2021/12/31</view>
|
37
|
98
|
</view>
|
38
|
99
|
</view>
|
39
|
|
- <view class='right-complete-two'>
|
|
100
|
+ <view class='right-complete-two' onClick={ShowMoldeOn} >
|
40
|
101
|
<view className='right-content'>
|
41
|
|
- <view className='right-number'>×1</view>
|
|
102
|
+ <view className='right-number'>×{BuyNumber}</view>
|
42
|
103
|
<view className='right-title'>数量</view>
|
43
|
104
|
</view>
|
44
|
105
|
</view>
|