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

+ 261
- 0
ad View File

1
+commit 67fe9bd4260dfa536992b2c435352541536f4c1e (HEAD -> dev, origin/dev)
2
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
3
+Date:   Thu Sep 2 17:14:18 2021 +0800
4
+
5
+    great
6
+
7
+commit dbeb0756f397ff11410ccd8848430c098664528b
8
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
9
+Date:   Tue Aug 31 12:40:11 2021 +0800
10
+
11
+    Great upload
12
+
13
+commit ef783233934388b872688af72d07fa337a2fd533
14
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
15
+Date:   Tue Aug 31 09:05:55 2021 +0800
16
+
17
+    Great upload
18
+
19
+commit b10eddc6c4e443aec9d098e97a5650512ca922a3
20
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
21
+Date:   Mon Aug 30 19:03:30 2021 +0800
22
+
23
+    Great upload
24
+
25
+commit ee1ac7da8c936bf626a4aed5a1614c02594f6691
26
+Merge: 2f6a1ba e686091
27
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
28
+Date:   Sun Aug 29 13:40:43 2021 +0800
29
+
30
+    Mine
31
+
32
+commit 2f6a1baeafab16174dd0a5fe02ec0941e8b658d3
33
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
34
+Date:   Sun Aug 29 13:39:26 2021 +0800
35
+
36
+    mine
37
+
38
+commit e6860916b59693c3849f5118ebd6892aa245d324
39
+Author: lizhiwei <lizhiwei@123.com>
40
+Date:   Sat Aug 28 17:13:06 2021 +0800
41
+
42
+    小程序角色切换功能
43
+
44
+commit 7c21dfd537ea09b2266be6d043fb42020e472575
45
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
46
+Date:   Fri Aug 27 16:30:04 2021 +0800
47
+
48
+    切换账户
49
+
50
+commit 9ef048a18dd15919f82a7b6f6138a5503bc8eb09
51
+Author: lizhiwei <lizhiwei@123.com>
52
+Date:   Fri Aug 27 16:28:21 2021 +0800
53
+
54
+    小程序联系我们功能实现
55
+
56
+commit 7f8342d0dc411e267da70229c9f945137e5eda93
57
+Merge: 0150a0d fd05c2a
58
+Author: lizhiwei <lizhiwei@123.com>
59
+Date:   Fri Aug 27 14:30:30 2021 +0800
60
+
61
+    Merge branch 'dev' of http://git.ycjcjy.com/shigongli/miniapp-v2 into dev
62
+
63
+commit 0150a0da4461943e6f87cb0cf67fc8b79342afec
64
+Author: lizhiwei <lizhiwei@123.com>
65
+Date:   Fri Aug 27 14:27:02 2021 +0800
66
+
67
+    小程序增加withLayout
68
+
69
+commit fd05c2a2cb691086469b0fe9ee358df3fea472c0
70
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
71
+Date:   Fri Aug 27 14:25:47 2021 +0800
72
+
73
+    1
74
+
75
+commit ee4c3f97c20213301289f666e762131dbb2a536f
76
+Author: yansen <zhangyansen8769@dingtalk.com>
77
+Date:   Fri Aug 27 10:37:30 2021 +0800
78
+
79
+    feats
80
+
81
+commit 9003d5fceccd584c4dd48a55f14e731f5f4239f1
82
+Author: yansen <zhangyansen8769@dingtalk.com>
83
+Date:   Thu Aug 26 22:12:53 2021 +0800
84
+
85
+    feats
86
+
87
+commit 7dd5c011ecf2e147431d383c7fa17c55abda271c
88
+Author: yansen <zhangyansen8769@dingtalk.com>
89
+Date:   Thu Aug 26 21:19:12 2021 +0800
90
+
91
+    feats\
92
+
93
+commit 129acdfdee1da25b775e968eb3c573ad67755517
94
+Author: yansen <zhangyansen8769@dingtalk.com>
95
+Date:   Thu Aug 26 19:51:11 2021 +0800
96
+
97
+    feats
98
+
99
+commit d87cd283052c40bd9613e28b509c79568d53e744
100
+Author: yansen <zhangyansen8769@dingtalk.com>
101
+Date:   Thu Aug 26 19:26:16 2021 +0800
102
+
103
+    feats
104
+
105
+commit 392597d00001fe81219c0ca6f608fd622a9c1239
106
+Author: Your Name <you@example.com>
107
+Date:   Thu Aug 26 00:29:44 2021 +0800
108
+
109
+    feats
110
+
111
+commit 6ae348d549bee56657b8dce6f353b7248c1ff866
112
+Author: yansen <zhangyansen8769@dingtalk.com>
113
+Date:   Wed Aug 25 23:13:02 2021 +0800
114
+
115
+    feats
116
+
117
+commit 5dba1157bea174121d2d631b1fd3cc8931313a19
118
+Author: lizhiwei <lizhiwei@123.com>
119
+Date:   Wed Aug 25 16:19:39 2021 +0800
120
+
121
+    services添加相应模块接口
122
+
123
+commit 5b55acf8b0ce73e0e659c979e7dc99308cf29797
124
+Author: lizhiwei <lizhiwei@123.com>
125
+Date:   Mon Aug 23 17:32:50 2021 +0800
126
+
127
+    小程序端服务增加
128
+
129
+commit ed2fbfc2c36c531b1079e8d4f7b9c7c083719990
130
+Author: lizhiwei <lizhiwei@123.com>
131
+Date:   Fri Aug 20 13:47:17 2021 +0800
132
+
133
+    开始搞后台加油
134
+
135
+commit 68e48ac2bff4e4965488d5d13fb3c6e20a9002f4
136
+Merge: c6e9c0b 6cb203f
137
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
138
+Date:   Fri Aug 20 09:52:01 2021 +0800
139
+
140
+    Merge branch 'dev' of http://git.ycjcjy.com/shigongli/miniapp-v2 into dev
141
+
142
+commit c6e9c0b407b0eaf283e51a33c8d4094e2d3b486b
143
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
144
+Date:   Fri Aug 20 09:50:51 2021 +0800
145
+
146
+    tday
147
+
148
+commit 6cb203f6e477fd847e0f98e0a1f1f8ba79a3730c
149
+Author: lizhiwei <lizhiwei@123.com>
150
+Date:   Fri Aug 20 09:10:32 2021 +0800
151
+
152
+    房东端tab
153
+
154
+commit ccda14a02d9cb3b789e6488b408ecaa61dc424e8
155
+Author: lizhiwei <lizhiwei@123.com>
156
+Date:   Fri Aug 20 08:21:50 2021 +0800
157
+
158
+    自定义tabs
159
+
160
+commit 6b4630c5c48361a584af54bfe6362d53e66caf0b
161
+Author: lizhiwei <lizhiwei@123.com>
162
+Date:   Thu Aug 19 19:55:35 2021 +0800
163
+
164
+    ..
165
+
166
+commit 2809ce41aacc514c07c36a34e71ea03c86f26e82
167
+Merge: dc7741b 3e191d3
168
+Author: lizhiwei <lizhiwei@123.com>
169
+Date:   Thu Aug 19 18:03:47 2021 +0800
170
+
171
+    merge
172
+
173
+commit dc7741b206259207beca34be6a597e1704fb388e
174
+Author: lizhiwei <lizhiwei@123.com>
175
+Date:   Thu Aug 19 18:01:17 2021 +0800
176
+
177
+    eats
178
+
179
+commit 3e191d3d8eb3da7dd978eef672b1e51ea97755e5
180
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
181
+Date:   Thu Aug 19 17:54:20 2021 +0800
182
+
183
+    个人中心
184
+
185
+commit 798614afb520201b215f33675918077f7a549cf3
186
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
187
+Date:   Thu Aug 19 17:53:58 2021 +0800
188
+
189
+    个人中心 入住指引 支付订单
190
+
191
+commit 9a5779097d2f6641139b7be5e7a8b1d6e39253e3
192
+Author: lizhiwei <lizhiwei@123.com>
193
+Date:   Thu Aug 19 17:33:58 2021 +0800
194
+
195
+    改距离
196
+
197
+commit ca85cb12505dfb5acfe7c40b85fb09176d130ca2
198
+Author: lizhiwei <lizhiwei@123.com>
199
+Date:   Thu Aug 19 13:46:16 2021 +0800
200
+
201
+    1
202
+
203
+commit 853665134ddac57b9b7ff2c238bce0e368bcf6ff
204
+Author: lizhiwei <lizhiwei@123.com>
205
+Date:   Thu Aug 19 13:40:56 2021 +0800
206
+
207
+    新增房东端店主端一键登录房东推荐
208
+
209
+commit 2fe0f066d70c7af2c9d6c009628fec3808f8f88c
210
+Author: baozhangchao <baozhangchao@123>
211
+Date:   Sun Aug 15 21:45:31 2021 +0800
212
+
213
+    card
214
+
215
+commit eb247e9cdaf9c733cfa6326e024d49bb20b2713d
216
+Author: 吃个甘蔗嚼一年 <oncwnuCPQ6kimzTDqDGNXpXo_CFQ@git.weixin.qq.com>
217
+Date:   Fri Aug 13 19:00:41 2021 +0800
218
+
219
+    入住指引
220
+
221
+commit 4f690982eee37bb753c8d42f0a8572ae539e8401
222
+Author: lizhiwei <lizhiwei@123.com>
223
+Date:   Wed Aug 11 15:47:51 2021 +0800
224
+
225
+    feats
226
+
227
+commit 1159e62c9489c7a627d17d9ae7a1d7339d56fa58
228
+Author: yansen <zhangyansen8769@dingtalk.com>
229
+Date:   Wed Aug 11 14:46:21 2021 +0800
230
+
231
+    feats
232
+
233
+commit 18c50aaf968578ffcd90b89e3596d7f4f7929364
234
+Author: yansen <zhangyansen8769@dingtalk.com>
235
+Date:   Wed Aug 11 14:44:45 2021 +0800
236
+
237
+    feats
238
+
239
+commit 72ea903bacff9467eec8ffe6dbbdb6ea728cd73e
240
+Author: yansen <zhangyansen8769@dingtalk.com>
241
+Date:   Wed Aug 11 14:34:10 2021 +0800
242
+
243
+    feats
244
+
245
+commit e630881ecf4dd59b767634e848c7894664a8c301
246
+Author: Your Name <you@example.com>
247
+Date:   Wed Aug 11 02:25:30 2021 +0800
248
+
249
+    feats
250
+
251
+commit 8be7ee61c955934320dd3623c46a73c4d52e7c09
252
+Author: Your Name <you@example.com>
253
+Date:   Wed Aug 11 01:45:40 2021 +0800
254
+
255
+    feats
256
+
257
+commit 01e91de24d1f593f1b3e575cffb6c3cb0ddf2f7d (origin/master, origin/HEAD, master)
258
+Author: Your Name <you@example.com>
259
+Date:   Tue Aug 10 00:19:07 2021 +0800
260
+
261
+    first

+ 1
- 1
config/dev.js View File

3
     NODE_ENV: '"development"'
3
     NODE_ENV: '"development"'
4
   },
4
   },
5
   defineConstants: {
5
   defineConstants: {
6
-    HOST: '"https://sgl-v2.njyunzhi.com"',
6
+    HOST: '"http://192.168.89.147:8080"',
7
   },
7
   },
8
   mini: {},
8
   mini: {},
9
   h5: {}
9
   h5: {}

+ 1
- 0
package.json View File

42
     "@tarojs/runtime": "3.3.2",
42
     "@tarojs/runtime": "3.3.2",
43
     "@tarojs/taro": "3.3.2",
43
     "@tarojs/taro": "3.3.2",
44
     "@zjxpcyc/react-tiny-store": "^1.0.0",
44
     "@zjxpcyc/react-tiny-store": "^1.0.0",
45
+    "moment": "^2.29.1",
45
     "react": "^17.0.0",
46
     "react": "^17.0.0",
46
     "react-dom": "^17.0.0"
47
     "react-dom": "^17.0.0"
47
   },
48
   },

+ 2
- 2
src/components/CompoentsOrder/AlreadyExpired/index.jsx View File

39
             <view className='card-box-star'>
39
             <view className='card-box-star'>
40
               {
40
               {
41
                 scoreList.map((_, index) => {
41
                 scoreList.map((_, index) => {
42
-                  console.log(index)
42
+
43
                   const src = (index + '0.1') < score ? starOn : starOff
43
                   const src = (index + '0.1') < score ? starOn : starOff
44
                   return (
44
                   return (
45
                     <image className='card-star-image' key={index} src={src} />
45
                     <image className='card-star-image' key={index} src={src} />
78
             <view className='card-box-star'>
78
             <view className='card-box-star'>
79
               {
79
               {
80
                 scoreList.map((_, index) => {
80
                 scoreList.map((_, index) => {
81
-                  console.log(index)
81
+
82
                   const src = (index + '0.1') < score ? starOn : starOff
82
                   const src = (index + '0.1') < score ? starOn : starOff
83
                   return (
83
                   return (
84
                     <image className='card-star-image' key={index} src={src} />
84
                     <image className='card-star-image' key={index} src={src} />

+ 5
- 5
src/components/CompoentsOrder/AlreadyUsed/index.jsx View File

48
               <text className='card-box-star-text' onClick={Nuberr} >口味:</text>
48
               <text className='card-box-star-text' onClick={Nuberr} >口味:</text>
49
               {
49
               {
50
                 scoreList.map((_, index) => {
50
                 scoreList.map((_, index) => {
51
-                  console.log(index)
51
+
52
                   const src = (index + `${CollectNub}`) < score ? starOn : starOff
52
                   const src = (index + `${CollectNub}`) < score ? starOn : starOff
53
                   return (
53
                   return (
54
                     <image className='card-star-image' key={index} src={src} onClick={Nuberr} />
54
                     <image className='card-star-image' key={index} src={src} onClick={Nuberr} />
60
               <text className='card-box-star-text' onClick={Nuberr} >环境:</text>
60
               <text className='card-box-star-text' onClick={Nuberr} >环境:</text>
61
               {
61
               {
62
                 scoreList.map((_, index) => {
62
                 scoreList.map((_, index) => {
63
-                  console.log(index)
63
+
64
                   const src = (index + `${CollectNub}`) < score ? starOn : starOff
64
                   const src = (index + `${CollectNub}`) < score ? starOn : starOff
65
                   return (
65
                   return (
66
                     <image className='card-star-image' key={index} src={src} onClick={Nuberr} />
66
                     <image className='card-star-image' key={index} src={src} onClick={Nuberr} />
72
               <text className='card-box-star-text' onClick={Nuberr} >服务:</text>
72
               <text className='card-box-star-text' onClick={Nuberr} >服务:</text>
73
               {
73
               {
74
                 scoreList.map((_, index) => {
74
                 scoreList.map((_, index) => {
75
-                  console.log(index)
75
+
76
                   const src = (index + `${CollectNub}`) < score ? starOn : starOff
76
                   const src = (index + `${CollectNub}`) < score ? starOn : starOff
77
                   return (
77
                   return (
78
                     <image className='card-star-image' key={index} src={src} onClick={Nuberr} />
78
                     <image className='card-star-image' key={index} src={src} onClick={Nuberr} />
100
             <view className='card-box-star'>
100
             <view className='card-box-star'>
101
               {
101
               {
102
                 scoreList.map((_, index) => {
102
                 scoreList.map((_, index) => {
103
-                  console.log(index)
103
+
104
                   const src = (index + '0.1') < score ? starOn : starOff
104
                   const src = (index + '0.1') < score ? starOn : starOff
105
                   return (
105
                   return (
106
                     <image className='card-star-image' key={index} src={src} />
106
                     <image className='card-star-image' key={index} src={src} />
141
             <view className='card-box-star'>
141
             <view className='card-box-star'>
142
               {
142
               {
143
                 scoreList.map((_, index) => {
143
                 scoreList.map((_, index) => {
144
-                  console.log(index)
144
+
145
                   const src = (index + '0.1') < score ? starOn : starOff
145
                   const src = (index + '0.1') < score ? starOn : starOff
146
                   return (
146
                   return (
147
                     <image className='card-star-image' key={index} src={src} />
147
                     <image className='card-star-image' key={index} src={src} />

+ 2
- 2
src/components/CompoentsOrder/complete/index.jsx View File

34
             <view className='card-box-star'>
34
             <view className='card-box-star'>
35
               {
35
               {
36
                 scoreList.map((_, index) => {
36
                 scoreList.map((_, index) => {
37
-                  console.log(index)
37
+
38
                   const src = (index + '0.1') < score ? starOn : starOff
38
                   const src = (index + '0.1') < score ? starOn : starOff
39
                   return (
39
                   return (
40
                     <image className='card-star-image' key={index} src={src} />
40
                     <image className='card-star-image' key={index} src={src} />
129
             <view className='card-box-star'>
129
             <view className='card-box-star'>
130
               {
130
               {
131
                 scoreList.map((_, index) => {
131
                 scoreList.map((_, index) => {
132
-                  console.log(index)
132
+
133
                   const src = (index + '0.1') < score ? starOn : starOff
133
                   const src = (index + '0.1') < score ? starOn : starOff
134
                   return (
134
                   return (
135
                     <image className='card-star-image' key={index} src={src} />
135
                     <image className='card-star-image' key={index} src={src} />

+ 9
- 6
src/components/OrderMolded/index.jsx View File

1
 import { useState } from 'react'
1
 import { useState } from 'react'
2
 import image from '@/assets/icons/ProCard/8kb.jpg'
2
 import image from '@/assets/icons/ProCard/8kb.jpg'
3
 import { Button, Radio } from '@tarojs/components'
3
 import { Button, Radio } from '@tarojs/components'
4
-
4
+import PayOrderCard from '@/components/PayOrderCard'
5
+import moment from 'moment'
5
 import food from '@/assets/icons/ProCard/food.png'
6
 import food from '@/assets/icons/ProCard/food.png'
6
 import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
7
 import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
7
 import './style.less'
8
 import './style.less'
8
 
9
 
9
 export default (props) => {
10
 export default (props) => {
11
+  const { item } = props
10
 
12
 
11
   return (
13
   return (
12
     <view class='wrapper-box'>
14
     <view class='wrapper-box'>
13
       <view class='left-complete-one'>
15
       <view class='left-complete-one'>
14
         <image className='left-image-1' src={ProCard_hot}></image>
16
         <image className='left-image-1' src={ProCard_hot}></image>
15
         <view className='left-viewText'>
17
         <view className='left-viewText'>
16
-          返现¥16.00
18
+          返现¥{item.cashback / 100}
17
         </view>
19
         </view>
18
         <view className='title-image'>
20
         <view className='title-image'>
19
-          <image className='image-1' mode='scaleToFill' src={image}></image>
21
+          <image className='image-1' mode='scaleToFill' src={item.poster}></image>
20
           <image className='image-2' src={food}></image>
22
           <image className='image-2' src={food}></image>
21
         </view>
23
         </view>
22
         <view className='title-content'>
24
         <view className='title-content'>
23
           <view className='Pro-title'>
25
           <view className='Pro-title'>
24
-            <view className='title-text'>【橘里橘气咖啡店】新鲜出炉啦!</view>
26
+            <view className='title-text'>{item.description}</view>
25
           </view>
27
           </view>
26
-          <text className='title-money' >¥6990元</text>
27
-          <view className='title-time' >有效期:2021/06/21-2021/12/31</view>
28
+          <text className='title-money' >¥{item.actualPrice / 100}元</text>
29
+          <view className='title-time' >有效期:<text>{moment(item.startTimeal).format('YYYY/MM/DD')}</text> - <text>{moment(item.endTime).format('YYYY/MM/DD')}</text></view>
28
         </view>
30
         </view>
29
       </view>
31
       </view>
30
     </view>
32
     </view>
33
+    // </view >
31
   )
34
   )
32
 }
35
 }

+ 121
- 0
src/components/PayOrderCard/index.jsx View File

1
+import withLayout from '@/layouts'
2
+import useSave from "@/utils/hooks/useSave"
3
+import image from '@/assets/icons/ProCard/8kb.jpg'
4
+import AuthPage from '@/components/AuthPage'
5
+import moment from 'moment'
6
+import { useState, useEffect } from 'react'
7
+import { Button, Radio, Input } from '@tarojs/components'
8
+import food from '@/assets/icons/ProCard/food.png'
9
+import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
10
+import OrderMolded from '@/components/OrderMolded'
11
+import Popup from '@/components/Popup'
12
+
13
+
14
+
15
+import './style.less'
16
+
17
+export default (props) => {
18
+  const { item, onShopContent, onShopNumber } = props
19
+  const [showDialog, setShowDialog] = useState(false)
20
+  const [BuyNumber, setBuyNumber] = useState(1)
21
+  const [DisabledBool, setDisabledBool] = useState(false)
22
+
23
+
24
+
25
+  const ShowMoldeOn = () => {
26
+    setShowDialog(true)
27
+  }
28
+  const ButtonCancel = () => {
29
+    setShowDialog(false)
30
+    setBuyNumber(1)
31
+  }
32
+  const ButtonOK = (e) => {
33
+    setShowDialog(false)
34
+    const itemList = [{ ...item }]
35
+    const itemListNumber = itemList.map(x => {
36
+      return { ...x, BuyNumber: BuyNumber }
37
+    })
38
+    const handeItemList = itemListNumber.map(shoPnumber => {
39
+      onShopContent(shoPnumber)
40
+    })
41
+    onShopNumber()
42
+    // console.log("🚀 ~ file: index.jsx ~ line 38 ~ ButtonOK ~ handeItemList", handeItemList)
43
+
44
+
45
+  }
46
+  const NumberAdd = () => {
47
+    setBuyNumber(BuyNumber + 1)
48
+
49
+  }
50
+
51
+  const NumberCut = () => {
52
+    setBuyNumber(BuyNumber - 1)
53
+
54
+  }
55
+
56
+  const onInput = (e) => {
57
+    let values = e.detail.value
58
+    setBuyNumber(values - 0)
59
+
60
+
61
+  }
62
+
63
+
64
+  useEffect(() => {
65
+    if (BuyNumber < 2) {
66
+      setDisabledBool(true)
67
+
68
+    } else {
69
+      setDisabledBool(false)
70
+
71
+    }
72
+
73
+  }, [BuyNumber])
74
+
75
+  return (
76
+
77
+    <view class='container'>
78
+      <Popup show={showDialog} maskClosable={false}>
79
+        <OrderMolded item={item} />
80
+        <view className='item-center-Number' >
81
+          <view className='buy-num-minus' disabled={DisabledBool} onClick={NumberCut} > - </view>
82
+          <Input className='buy-num-input' type='number' min={1} onInput={onInput} value={BuyNumber} />
83
+          <view className='buy-num-add' onClick={NumberAdd} >+</view>
84
+        </view>
85
+        <view className='buy-button-box' >
86
+          <button className='button-Cancel' onClick={ButtonCancel} >取消</button>
87
+          <button className='button-OK' onClick={ButtonOK} >确定</button>
88
+        </view>
89
+      </Popup>
90
+      <view class='coupon-list'>
91
+        <view class='wrapper'>
92
+          <view class='left-complete-one'>
93
+            <image className='left-image-1' src={ProCard_hot}></image>
94
+            <view className='left-viewText'>
95
+              返现¥{item.cashback / 100}
96
+            </view>
97
+            <view className='title-image'>
98
+              <image className='image-1' mode='scaleToFill' src={item.poster}></image>
99
+              <image className='image-2' src={food}></image>
100
+            </view>
101
+            <view className='title-content'>
102
+              <view className='Pro-title'>
103
+                <view className='title-text'>{item.description}</view>
104
+              </view>
105
+              <text className='title-money' >¥{item.actualPrice / 100}<text className='title-money-2'>{item.standardPrice / 100}</text></text>
106
+              <view className='title-time' >有效期:<text>{moment(item.startTimeal).format('YYYY/MM/DD')}</text> - <text>{moment(item.endTime).format('YYYY/MM/DD')}</text></view>
107
+            </view>
108
+          </view>
109
+          <view class='right-complete-two' onClick={ShowMoldeOn} >
110
+            <view className='right-content'>
111
+              <view className='right-number'>×{BuyNumber}</view>
112
+              <view className='right-title'>数量</view>
113
+            </view>
114
+          </view>
115
+        </view>
116
+      </view>
117
+    </view>
118
+
119
+
120
+  )
121
+}

+ 299
- 0
src/components/PayOrderCard/style.less View File

1
+@whiteColor: #fff;
2
+@Image-ProCard_hot: "../../assets/icons/ProCard/ProCard_hot.png";
3
+.container {
4
+  width: 100%;
5
+  .item-center-Number {
6
+    width: 100%;
7
+    margin-top: 30px;
8
+    .buy-num-minus {
9
+      display: inline-block;
10
+      width: 60px;
11
+      height: 60px;
12
+      background: #ffffff;
13
+      border: 1px solid #999999;
14
+      border-radius: 8px 0px 0px 8px;
15
+    }
16
+    .buy-num-input {
17
+      display: inline-block;
18
+      width: 90px;
19
+      height: 60px;
20
+      font-size: 28px;
21
+      font-weight: 400;
22
+      color: #202020;
23
+      background: #ffffff;
24
+      border: 1px solid #999999;
25
+      position: relative;
26
+      top: 26px;
27
+    }
28
+    .buy-num-add {
29
+      display: inline-block;
30
+
31
+      width: 60px;
32
+      height: 60px;
33
+      background: #ffffff;
34
+      border: 1px solid #999999;
35
+      border-radius: 0px 8px 8px 0px;
36
+    }
37
+  }
38
+  .buy-button-box {
39
+    width: 100%;
40
+    margin: 40px 0 0 0;
41
+
42
+    .button-Cancel {
43
+      display: inline-block;
44
+      width: 236px;
45
+      height: 78px;
46
+      border: 2px solid #274291;
47
+      font-size: 30px;
48
+      font-weight: bold;
49
+      color: #274291;
50
+      border-radius: 12px;
51
+      margin-right: 80px;
52
+    }
53
+    .button-OK {
54
+      display: inline-block;
55
+
56
+      width: 236px;
57
+      height: 78px;
58
+      background: #274291;
59
+      border-radius: 12px;
60
+      font-size: 30px;
61
+      font-weight: bold;
62
+      color: #ffffff;
63
+    }
64
+  }
65
+  .wrapper {
66
+    display: flex;
67
+    position: relative;
68
+    // margin-top: 600px;
69
+    margin: 30px auto;
70
+    width: 700px;
71
+
72
+    // box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
73
+    // filter: drop-shadow(5px 8px 6px rgb(202, 202, 202));
74
+    filter: drop-shadow(0 0 0.9rem rgba(0, 0, 0, 0.12));
75
+
76
+    .left-complete-one {
77
+      padding-top: 87px;
78
+      padding-bottom: 43px;
79
+      position: relative;
80
+      display: flex;
81
+      background: @whiteColor;
82
+      background: radial-gradient(
83
+            circle at top right,
84
+            transparent 15px,
85
+            @whiteColor 0
86
+          )
87
+          top right,
88
+        radial-gradient(circle at bottom right, transparent 15px, @whiteColor 0)
89
+          bottom right;
90
+      background-size: 100% 60%;
91
+      background-repeat: no-repeat;
92
+
93
+      width: 573px;
94
+      border-radius: 15px 0px 0px 15px;
95
+      // border-radius: 12px;
96
+
97
+      align-items: center;
98
+      .left-image-1 {
99
+        width: 145px;
100
+        height: 44px;
101
+        position: absolute;
102
+        top: 22px;
103
+      }
104
+      .left-viewText {
105
+        // background-image: url(@Image-ProCard_hot);
106
+        // width: 287px;
107
+        width: auto;
108
+        height: 44.3px;
109
+        position: absolute;
110
+        left: 1px;
111
+        top: 28px;
112
+        font-size: 24px;
113
+        color: @whiteColor;
114
+        font-weight: 600;
115
+      }
116
+      //图片
117
+      .title-image {
118
+        width: 145px;
119
+        margin-left: 20px;
120
+        border-radius: 24px;
121
+        overflow: hidden;
122
+        position: relative;
123
+        .image-1 {
124
+          width: 100%;
125
+          height: 145px;
126
+        }
127
+        .image-2 {
128
+          width: 89px;
129
+          height: 34px;
130
+          position: absolute;
131
+          left: 0;
132
+          top: 0;
133
+        }
134
+      }
135
+      // 商品标题
136
+      .title-content {
137
+        // padding: 84px 0 56px 20px;
138
+        padding-left: 18px;
139
+
140
+        .Pro-title {
141
+          .title-text {
142
+            width: 375px;
143
+            overflow: hidden;
144
+            text-overflow: ellipsis;
145
+            display: -webkit-box; //必须要
146
+            -webkit-line-clamp: 1;
147
+            -webkit-box-orient: vertical;
148
+            word-break: break-all; /* 多出文本省略号代替 */
149
+            text-align: left;
150
+            font-size: 24px;
151
+            padding-bottom: 10px;
152
+          }
153
+        }
154
+        .title-money {
155
+          padding-top: 34px;
156
+          font-size: 24px;
157
+          // color: red;
158
+          font-weight: 800;
159
+        }
160
+        .title-money-2 {
161
+          font-size: 18px;
162
+          color: #666;
163
+          padding-left: 10px;
164
+          text-decoration: line-through;
165
+        }
166
+
167
+        .title-time {
168
+          font-size: 24px;
169
+          padding-top: 20px;
170
+          color: #c0c8d3;
171
+        }
172
+      }
173
+    }
174
+  }
175
+
176
+  .right-complete-two {
177
+    background: @whiteColor;
178
+    background: radial-gradient(
179
+          circle at top left,
180
+          transparent 15px,
181
+          @whiteColor 0
182
+        )
183
+        top left,
184
+      radial-gradient(circle at bottom left, transparent 15px, @whiteColor 0)
185
+        bottom left;
186
+    background-size: 100% 60%;
187
+    background-repeat: no-repeat;
188
+    width: 129px;
189
+    border-radius: 0 15px 15px 0;
190
+    position: relative;
191
+    //右面部分
192
+    .right-content {
193
+      // width: 100px;
194
+      // height: 80px;
195
+      position: absolute;
196
+      top: 50%;
197
+      left: 50%;
198
+      transform: translate(-50%, -50%);
199
+      // border: 1px solid red;
200
+
201
+      .right-number {
202
+        width: 40px;
203
+        font-size: 20px;
204
+        border-radius: 4px;
205
+        border: 2px solid #999;
206
+        margin: auto;
207
+        text-align: center;
208
+      }
209
+
210
+      .right-title {
211
+        font-weight: 700;
212
+        font-size: 24px;
213
+        padding-top: 20px;
214
+        text-align: center;
215
+      }
216
+    }
217
+  }
218
+  //线条
219
+  .right-complete-two::after {
220
+    content: "";
221
+    position: absolute;
222
+    top: 15px;
223
+    margin: 26px auto;
224
+    height: 70%;
225
+    border-left: 1px dashed #595959;
226
+  }
227
+
228
+  .view-button {
229
+
230
+    position: fixed;
231
+    bottom: 0px;
232
+
233
+    .Card-number-box {
234
+      .Card-number {
235
+        width: 100%;
236
+        height: 96px;
237
+        background-color: @whiteColor;
238
+      }
239
+      .Card-user {
240
+        width: 100%;
241
+        height: 96px;
242
+        background-color: @whiteColor;
243
+      }
244
+    }
245
+    .button-box-button-box {
246
+      position: relative;
247
+      .button-text-image {
248
+        width: 144;
249
+        height: 45px;
250
+        position: absolute;
251
+        top: -35px;
252
+        left: 267px;
253
+        right: 305px;
254
+        z-index: 1;
255
+        .button-text-money-hot {
256
+          position: absolute;
257
+          width: 144px;
258
+          height: 43px;
259
+          line-height: 43px;
260
+          font-size: 24px;
261
+          font-weight: bold;
262
+          color: @whiteColor;
263
+        }
264
+        .button-image {
265
+          width: 143px;
266
+          height: 43px;
267
+        }
268
+        .button-text-money {
269
+          position: absolute;
270
+          margin-top: -8;
271
+          width: 157px;
272
+          font-size: 18px;
273
+          font-weight: 400;
274
+          text-decoration: line-through;
275
+          color: @whiteColor;
276
+        }
277
+      }
278
+      .button-box-one {
279
+        font-size: 30px;
280
+        line-height: 92px;
281
+        margin-top: 3em;
282
+        background-color: #274190;
283
+        border-radius: 12px;
284
+        width: 690px;
285
+        height: 92px;
286
+        color: @whiteColor;
287
+        // position: absolute;
288
+        bottom: 40px;
289
+        right: 0;
290
+        left: 0;
291
+        .button-text-one {
292
+          right: 133px;
293
+          font-size: 30px;
294
+          padding-left: 220px;
295
+        }
296
+      }
297
+    }
298
+  }
299
+}

+ 39
- 33
src/components/foodCards/foodCards.jsx View File

1
 import Star from '@/components/Star/Star.jsx'
1
 import Star from '@/components/Star/Star.jsx'
2
+import Taro from '@tarojs/taro'
2
 import pay from '@/assets/icons/housemantj/pay.png'
3
 import pay from '@/assets/icons/housemantj/pay.png'
3
 import msTip from '@/assets/icons/housemantj/foodtip.png'
4
 import msTip from '@/assets/icons/housemantj/foodtip.png'
4
 import wz from '@/assets/icons/housemantj/location.png'
5
 import wz from '@/assets/icons/housemantj/location.png'
11
 //套餐卡片
12
 //套餐卡片
12
 export default (props) => {
13
 export default (props) => {
13
   const { star, item, city } = props
14
   const { star, item, city } = props
14
-  const [isSaved, toggleSave] = useSave(item.isSaved,'shop_package', item.packageId)
15
+  const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.packageId)
16
+  const Detail = () => {
17
+    Taro.navigateTo({ url: `/pages/PayOrder/index?id=${item.packageId}&shopId=${item.shopId}` });
18
+
19
+  }
20
+
15
   return (
21
   return (
16
-      <view className='foodCard'>
17
-        <view className='fCleft'>
18
-          <view className='backMoney'>
19
-            返现¥{item.cashback}
20
-          </view>
21
-          <view className='appraise'>
22
-            <Star star={star} />
23
-            <text className='storezf'>{star}</text>
22
+    <view className='foodCard'>
23
+      <view className='fCleft'>
24
+        <view className='backMoney'>
25
+          返现¥{item.cashback}
26
+        </view>
27
+        <view className='appraise'>
28
+          <Star star={star} />
29
+          <text className='storezf'>{star}</text>
30
+        </view>
31
+        <view>
32
+          <view className='contentImg'>
33
+            <image src={item.poster} className='img1' ></image>
34
+            <image src={msTip} className='mstip'></image>
24
           </view>
35
           </view>
25
-          <view>
26
-            <view className='contentImg'>
27
-              <image src={item.poster} className='img1' ></image>
28
-              <image src={msTip} className='mstip'></image>
36
+          <view className='neirong'>
37
+            <view className='textword'>{item.description}</view>
38
+            <view className='jiage'>
39
+              <text className='rmb' >¥&nbsp;&nbsp;</text>
40
+              <text className='p1'><text className='price' >{item.actualPrice}</text>元&nbsp;&nbsp;</text>
41
+              <text className='p2'>门市价<text className='oldprice' >{item.standardPrice}</text>元</text>
29
             </view>
42
             </view>
30
-            <view className='neirong'>
31
-              <view className='textword'>{item.description}</view>
32
-              <view className='jiage'>
33
-                <text className='rmb' >¥&nbsp;&nbsp;</text>
34
-                <text className='p1'><text className='price' >{item.actualPrice}</text>元&nbsp;&nbsp;</text>
35
-                <text className='p2'>门市价<text className='oldprice' >{item.standardPrice}</text>元</text>
36
-              </view>
37
-              <view className='address'>
38
-                <image className='dw' src={wz} />
39
-                <text className='wz'>{city.areaPName}/{city.areaName}</text>
40
-                <view style={{display:'inline-block'}} onClick={toggleSave}>
41
-                <image className='star' src={isSaved>0?hongxin:baixin}></image>
42
-                <text className='collection'>{isSaved>0?'已收藏':'加入收藏'}</text>
43
-              </view>
43
+            <view className='address'>
44
+              <image className='dw' src={wz} />
45
+              <text className='wz'>{city.areaPName}/{city.areaName}</text>
46
+              <view style={{ display: 'inline-block' }} onClick={toggleSave}>
47
+                <image className='star' src={isSaved > 0 ? hongxin : baixin}></image>
48
+                <text className='collection'>{isSaved > 0 ? '已收藏' : '加入收藏'}</text>
44
               </view>
49
               </view>
45
             </view>
50
             </view>
46
           </view>
51
           </view>
47
         </view>
52
         </view>
48
-        <view className='fCright'>
49
-          <image src={pay} />
50
-          <view>支付</view>
51
-        </view>
52
-        <view className='columnLine'></view>
53
       </view>
53
       </view>
54
-    
54
+      <view className='fCright' onClick={() => Detail()} >
55
+        <image src={pay} />
56
+        <view>支付</view>
57
+      </view>
58
+      <view className='columnLine'></view>
59
+    </view>
60
+
55
   )
61
   )
56
 }
62
 }

+ 2
- 2
src/pages/MineUserAll/Collect/index.jsx View File

49
           <view className='card-box-star'>
49
           <view className='card-box-star'>
50
             {
50
             {
51
               scoreList.map((_, index) => {
51
               scoreList.map((_, index) => {
52
-                console.log(index)
52
+
53
                 const src = (index + '0.1') < score ? starOn : starOff
53
                 const src = (index + '0.1') < score ? starOn : starOff
54
                 return (
54
                 return (
55
                   <image className='card-star-image' key={index} src={src} />
55
                   <image className='card-star-image' key={index} src={src} />
92
           <view className='card-box-star'>
92
           <view className='card-box-star'>
93
             {
93
             {
94
               scoreList.map((_, index) => {
94
               scoreList.map((_, index) => {
95
-                console.log(index)
95
+
96
                 const src = (index + '0.1') < score ? starOn : starOff
96
                 const src = (index + '0.1') < score ? starOn : starOff
97
                 return (
97
                 return (
98
                   <image className='card-star-image' key={index} src={src} />
98
                   <image className='card-star-image' key={index} src={src} />

+ 2
- 2
src/pages/MineUserAll/RefundMoney/index.jsx View File

40
           <view className='card-box-star'>
40
           <view className='card-box-star'>
41
             {
41
             {
42
               scoreList.map((_, index) => {
42
               scoreList.map((_, index) => {
43
-                console.log(index)
43
+
44
                 const src = (index + '0.1') < score ? starOn : starOff
44
                 const src = (index + '0.1') < score ? starOn : starOff
45
                 return (
45
                 return (
46
                   <image className='card-star-image' key={index} src={src} />
46
                   <image className='card-star-image' key={index} src={src} />
80
           <view className='card-box-star'>
80
           <view className='card-box-star'>
81
             {
81
             {
82
               scoreList.map((_, index) => {
82
               scoreList.map((_, index) => {
83
-                console.log(index)
83
+
84
                 const src = (index + '0.1') < score ? starOn : starOff
84
                 const src = (index + '0.1') < score ? starOn : starOff
85
                 return (
85
                 return (
86
                   <image className='card-star-image' key={index} src={src} />
86
                   <image className='card-star-image' key={index} src={src} />

+ 94
- 131
src/pages/PayOrder/index.jsx View File

1
 import withLayout from '@/layouts'
1
 import withLayout from '@/layouts'
2
 import image from '@/assets/icons/ProCard/8kb.jpg'
2
 import image from '@/assets/icons/ProCard/8kb.jpg'
3
-import { useState, useEffect } from 'react'
3
+import AuthPage from '@/components/AuthPage'
4
+import Taro from '@tarojs/taro'
5
+import { useState, useEffect, useRef } from 'react'
4
 import { Button, Radio, Input } from '@tarojs/components'
6
 import { Button, Radio, Input } from '@tarojs/components'
5
-
6
 import food from '@/assets/icons/ProCard/food.png'
7
 import food from '@/assets/icons/ProCard/food.png'
7
 import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
8
 import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
8
 import CustomNav from '@/components/CustomNav'
9
 import CustomNav from '@/components/CustomNav'
9
-import OrderMolded from '@/components/OrderMolded'
10
-import Popup from '@/components/Popup'
11
-
10
+import PayOrderCard from '@/components/PayOrderCard'
11
+import { PaysOrder, getMineOrder } from '@/services/payOrder' //创建订单
12
+import { getShopPackage, } from '@/services/home'
12
 import './style.less'
13
 import './style.less'
13
 
14
 
14
 export default withLayout((props) => {
15
 export default withLayout((props) => {
15
   const { router, person } = props
16
   const { router, person } = props
17
+  const { id, shopId } = props.router.params
18
+  const [shopPackage, setShopPackage] = useState([])
19
+  const [buttonDisabled, setButtonDisabled] = useState(true)
20
+  const [totalCost, setTotalCost] = useState(0)
21
+  const [cashBack, setCashBack] = useState(0)
22
+  const [realPrice, setRealPrice] = useState(0)
23
+
24
+  const handelButton = () => {
25
+    setButtonDisabled(false)
26
+  }
16
 
27
 
17
-  const [showDialog, setShowDialog] = useState(false)
18
-
19
-  const [BuyNumber, setBuyNumber] = useState(1)
20
-  const [DisabledBool, setDisabledBool] = useState(false)
28
+  const goRules = () => {
29
+    Taro.navigateTo({ url: `/pages/MineUserAll/Rules/index` })
21
 
30
 
22
-  const ShowMoldeOn = () => {
23
-    setShowDialog(true)
24
-  }
25
-  const ButtonCancel = () => {
26
-    setShowDialog(false)
27
   }
31
   }
28
-  const ButtonOK = (e) => {
29
-    setShowDialog(false)
30
 
32
 
33
+
34
+  const handeList = () => {
35
+    shopPackage.map((item) => {
36
+      console.log("🚀 ~ file: index.jsx ~ line 34 ~ shopPackage.map ~ item", item)
37
+      //总价
38
+      let CostSum = (item.actualPrice / 100) * (item.BuyNumber || 1)
39
+      setTotalCost(totalCost + CostSum)
40
+      //返现价
41
+      let backSum = (item.cashback / 100) * (item.BuyNumber || 1)
42
+      setCashBack(cashBack + backSum)
43
+      //实际价
44
+      let PriceSum = (item.standardPrice / 100) * (item.BuyNumber || 1)
45
+      setRealPrice(realPrice + PriceSum)
46
+
47
+    })
31
   }
48
   }
32
 
49
 
33
 
50
 
34
 
51
 
35
-  const NumberAdd = () => {
36
-    setBuyNumber(BuyNumber + 1)
37
-    console.log(BuyNumber);
38
 
52
 
39
-  }
53
+  useEffect(() => {
40
 
54
 
41
-  const NumberCut = () => {
42
-    setBuyNumber(BuyNumber - 1)
43
-    console.log(BuyNumber);
44
 
55
 
45
-  }
56
+    getShopPackage(shopId, { packageId: id }).then((res) => {
57
+      const itemShop = res.records
58
+      setShopPackage(itemShop)
59
+    })
60
+
46
 
61
 
47
-  const onInput = (e) => {
48
-    let values = e.detail.value
49
-    setBuyNumber(values - 0)
62
+  }, [])
50
 
63
 
51
 
64
 
65
+
66
+
67
+
68
+  const shopContent = (item) => {
69
+    const lst = shopPackage.map((pack) => {
70
+      if (pack.packageId === item.packageId) {
71
+        return item
72
+      } else {
73
+        return pack
74
+      }
75
+    })
76
+
77
+    setShopPackage(lst)
52
   }
78
   }
53
 
79
 
54
-  useEffect(() => {
55
-    if (BuyNumber < 2) {
56
-      setDisabledBool(true)
80
+  const submit = (data) => {
81
+    PaysOrder(data, {
82
+      amount: 2,
83
+      itemId: id,
84
+      price: totalCost
57
 
85
 
58
-    } else {
59
-      setDisabledBool(false)
86
+    }).then((res) => {
87
+      console.log("🚀 ~ file: index.jsx ~ line 33 ~ submit ~ res", res)
60
 
88
 
61
-    }
62
-  }, [BuyNumber])
89
+      Taro.requestPayment({
90
+        timeStamp: '',
91
+        nonceStr: '',
92
+        package: '',
93
+        signType: 'MD5',
94
+        paySign: '',
95
+        success: val => {
96
+          console.log(val);
97
+        },
98
+        fail: err => {
63
 
99
 
64
-  return (
100
+        }
101
+
102
+      })
103
+
104
+    }).catch(err => {
105
+      console.log("🚀 ~ -------------支付错误------------", err)
106
+
107
+    });
108
+  }
109
+
110
+
111
+
112
+  return !person.phone ? <AuthPage /> : (
65
 
113
 
66
     <view class='container'>
114
     <view class='container'>
67
       <CustomNav title='订单' />
115
       <CustomNav title='订单' />
68
-      <Popup show={showDialog} maskClosable={false}>
69
-        <OrderMolded />
70
-        <view className='item-center-Number' >
71
-          <view className='buy-num-minus' disabled={DisabledBool} onClick={NumberCut} >-</view>
72
-          <Input className='buy-num-input' type="number" min="1" onInput={onInput} value={BuyNumber} />
73
-          <view className='buy-num-add' onClick={NumberAdd} >+</view>
74
-        </view>
75
-        <view className='buy-button-box' >
76
-          <button className='button-Cancel' onClick={ButtonCancel} >取消</button>
77
-          <button className='button-OK' onClick={ButtonOK} >确定</button>
78
-        </view>
79
-      </Popup>
80
-      <view class='coupon-list'>
81
-        <view class='wrapper'>
82
-          <view class='left-complete-one'>
83
-            <image className='left-image-1' src={ProCard_hot}></image>
84
-            <view className='left-viewText'>
85
-              返现¥16.00
86
-            </view>
87
-            <view className='title-image'>
88
-              <image className='image-1' mode='scaleToFill' src={image}></image>
89
-              <image className='image-2' src={food}></image>
90
-            </view>
91
-            <view className='title-content'>
92
-              <view className='Pro-title'>
93
-                <view className='title-text'>【橘里橘气咖啡店】新鲜出炉啦!</view>
94
-              </view>
95
-              <text className='title-money' >¥6990元<text className='title-money-2'>门市价78元</text></text>
96
-              <view className='title-time' >有效期:2021/06/21-2021/12/31</view>
97
-            </view>
98
-          </view>
99
-          <view class='right-complete-two' onClick={ShowMoldeOn} >
100
-            <view className='right-content'>
101
-              <view className='right-number'>×{BuyNumber}</view>
102
-              <view className='right-title'>数量</view>
103
-            </view>
104
-          </view>
105
-        </view>
106
-        <view class='wrapper'>
107
-          <view class='left-complete-one'>
108
-            <image className='left-image-1' src={ProCard_hot}></image>
109
-            <view className='left-viewText'>
110
-              返现¥16.00
111
-            </view>
112
-            <view className='title-image'>
113
-              <image className='image-1' mode='scaleToFill' src={image}></image>
114
-              <image className='image-2' src={food}></image>
115
-            </view>
116
-            <view className='title-content'>
117
-              <view className='Pro-title'>
118
-                <view className='title-text'>【橘里橘气咖啡店】新鲜出炉啦!</view>
119
-              </view>
120
-              <text className='title-money' >¥6990元<text className='title-money-2'>门市价78元</text></text>
121
-              <view className='title-time' >有效期:2021/06/21-2021/12/31</view>
122
-            </view>
123
-          </view>
124
-          <view class='right-complete-two'>
125
-            <view className='right-content'>
126
-              <view className='right-number'>×1</view>
127
-              <view className='right-title'>数量</view>
128
-            </view>
129
-          </view>
130
-        </view>
116
+      {
117
+        shopPackage?.map((item, index) => <PayOrderCard onShopContent={shopContent} onShopNumber={handeList} key={(index)} item={item} />)
118
+      }
131
 
119
 
132
-        <view class='wrapper'>
133
-          <view class='left-complete-one'>
134
-            <image className='left-image-1' src={ProCard_hot}></image>
135
-            <view className='left-viewText'>
136
-              返现¥16.00
137
-            </view>
138
-            <view className='title-image'>
139
-              <image className='image-1' mode='scaleToFill' src={image}></image>
140
-              <image className='image-2' src={food}></image>
141
-            </view>
142
-            <view className='title-content'>
143
-              <view className='Pro-title'>
144
-                <view className='title-text'>【橘里橘气咖啡店】新鲜出炉啦!</view>
145
-              </view>
146
-              <text className='title-money' >¥6990元<text className='title-money-2'>门市价78元</text></text>
147
-              <view className='title-time' >有效期:2021/06/21-2021/12/31</view>
148
-            </view>
149
-          </view>
150
-          <view class='right-complete-two'>
151
-            <view className='right-content'>
152
-              <view className='right-number'>×1</view>
153
-              <view className='right-title'>数量</view>
154
-            </view>
155
-          </view>
156
-        </view>
157
-
158
-      </view>
159
       <view className='view-button'>
120
       <view className='view-button'>
160
         <view className='Card-number-box'>
121
         <view className='Card-number-box'>
161
           <view className='Card-number'>
122
           <view className='Card-number'>
162
             <text style='left:29px;position: absolute; padding-top:20px'>手机号码:</text>
123
             <text style='left:29px;position: absolute; padding-top:20px'>手机号码:</text>
163
-            <text style='right:29px;position: absolute;padding-top:20px'>16161312125</text>
124
+            <text style='right:29px;position: absolute;padding-top:20px'>{person.phone}</text>
164
           </view>
125
           </view>
165
           <view className='Card-user'>
126
           <view className='Card-user'>
166
-            <Radio style='padding-left:20px; position: relative; top:24px;' value='我已阅读知晓并同意' >我已阅读知晓并同意 <text style='color:#274190;text-decoration:underline;font-weight:400'>《平台用户服务协议》</text></Radio>
127
+            <Radio onClick={handelButton} style='padding-left:20px; position: relative; top:24px;' value='我已阅读知晓并同意' >我已阅读知晓并同意 <text style='color:#274190;text-decoration:underline;font-weight:400' onClick={goRules} >《平台用户服务协议》</text></Radio>
167
           </view>
128
           </view>
168
         </view>
129
         </view>
169
         <view className='button-box-button-box'>
130
         <view className='button-box-button-box'>
170
           <view className='button-text-image' >
131
           <view className='button-text-image' >
171
-            <text className='button-text-money-hot'>返现¥2.18</text>
172
-            <image className='button-image' src={ProCard_hot}>123123</image>
173
-            <view className='button-text-money'>门店市面价:230元</view>
132
+            <text className='button-text-money-hot'>返现¥{cashBack}</text>
133
+            <image className='button-image' src={ProCard_hot}></image>
134
+            <view className='button-text-money'>门店市面价:{realPrice / 100}元</view>
174
           </view>
135
           </view>
175
-          <Button className='button-box-one'>¥170元 <text className='button-text-one'>支付订单</text> </Button>
136
+          <Button onClick={submit} disabled={buttonDisabled} className='button-box-one'>¥{totalCost}元 <text className='button-text-one'>支付订单</text> </Button>
176
         </view>
137
         </view>
177
 
138
 
178
       </view>
139
       </view>
180
 
141
 
181
 
142
 
182
   )
143
   )
144
+
183
 })
145
 })
146
+

+ 4
- 4
src/pages/PayOrder/style.less View File

23
       background: #ffffff;
23
       background: #ffffff;
24
       border: 1px solid #999999;
24
       border: 1px solid #999999;
25
       position: relative;
25
       position: relative;
26
-      top: 30px;
26
+      top: 26px;
27
     }
27
     }
28
     .buy-num-add {
28
     .buy-num-add {
29
       display: inline-block;
29
       display: inline-block;
226
   }
226
   }
227
 
227
 
228
   .view-button {
228
   .view-button {
229
-    // width: 100%;
230
-    // height: 150px;
231
-    position: relative;
229
+
230
+    position: fixed;
231
+    bottom: 0px;
232
 
232
 
233
     .Card-number-box {
233
     .Card-number-box {
234
       .Card-number {
234
       .Card-number {

+ 57
- 57
src/pages/details/foodDetails/foodDetails.jsx View File

1
 import CustomNav from '@/components/CustomNav'
1
 import CustomNav from '@/components/CustomNav'
2
 import withLayout from '@/layouts'
2
 import withLayout from '@/layouts'
3
-import {getShopDetail,getShopPackage,getShopcity,getExtendContent} from '@/services/home'
4
-import { useState,useEffect } from 'react'
3
+import { getShopDetail, getShopPackage, getShopcity, getExtendContent } from '@/services/home'
4
+import { useState, useEffect } from 'react'
5
 import { Swiper, SwiperItem } from '@tarojs/components';
5
 import { Swiper, SwiperItem } from '@tarojs/components';
6
 import Star from '@/components/Star/Star.jsx'
6
 import Star from '@/components/Star/Star.jsx'
7
 import Cards from '@/components/foodCards/foodCards.jsx'
7
 import Cards from '@/components/foodCards/foodCards.jsx'
16
 
16
 
17
 export default withLayout((props) => {
17
 export default withLayout((props) => {
18
   const { router, person } = props
18
   const { router, person } = props
19
-  const {id}=props.router.params
19
+  const { id } = props.router.params
20
   //商铺基础信息
20
   //商铺基础信息
21
-  const [detail,setDetail]=useState({})
21
+  const [detail, setDetail] = useState({})
22
   //商铺套餐
22
   //商铺套餐
23
-  const [spackage,setPackage]=useState([])
24
-  const [city,setCity]=useState({})
23
+  const [spackage, setPackage] = useState([])
24
+  const [city, setCity] = useState({})
25
   //banner图集数组
25
   //banner图集数组
26
-  const [imlist,setimlist]=useState([])
26
+  const [imlist, setimlist] = useState([])
27
   const [index, setIndex] = useState(0)
27
   const [index, setIndex] = useState(0)
28
   const handchange = (e) => {
28
   const handchange = (e) => {
29
     setIndex(e.detail.current)
29
     setIndex(e.detail.current)
30
   }
30
   }
31
 
31
 
32
   //当前套餐总数
32
   //当前套餐总数
33
-  const [newpgNum,setNewpgNum]=useState(0)
33
+  const [newpgNum, setNewpgNum] = useState(0)
34
   //全部套餐个数
34
   //全部套餐个数
35
-  const [AllpgNum,setAllpgNum]=useState(0)
35
+  const [AllpgNum, setAllpgNum] = useState(0)
36
   //套餐当前页数
36
   //套餐当前页数
37
-  const [page,setpage]=useState(2)
38
-  const pgMore=()=>{
39
-    setpage(page+1)
40
-    getShopPackage(id,{pageNum:page}).then((res)=>{
41
-      setPackage([...spackage,...res.records])
42
-      setNewpgNum(newpgNum+res.records.length)
37
+  const [page, setpage] = useState(2)
38
+  const pgMore = () => {
39
+    setpage(page + 1)
40
+    getShopPackage(id, { pageNum: page }).then((res) => {
41
+      setPackage([...spackage, ...res.records])
42
+      setNewpgNum(newpgNum + res.records.length)
43
     })
43
     })
44
   }
44
   }
45
   //本店指南
45
   //本店指南
46
-  const [extend,setExtend]=useState([])
46
+  const [extend, setExtend] = useState([])
47
 
47
 
48
   //当前指南总数
48
   //当前指南总数
49
-  const [newextNum,setNewextNum]=useState(0)
49
+  const [newextNum, setNewextNum] = useState(0)
50
   //全部指南个数
50
   //全部指南个数
51
-  const [AllextNum,setAllextNum]=useState(0)
51
+  const [AllextNum, setAllextNum] = useState(0)
52
   //指南当前页数
52
   //指南当前页数
53
-  const [epage,setepage]=useState(2)
54
-  const extendMore=()=>{
55
-    setepage(epage+1)
56
-    getExtendContent('shop',id,{pageNum:epage}).then((res)=>{
57
-      setExtend([...extend,...res.records])
58
-      setNewextNum(newextNum+res.records.length)
53
+  const [epage, setepage] = useState(2)
54
+  const extendMore = () => {
55
+    setepage(epage + 1)
56
+    getExtendContent('shop', id, { pageNum: epage }).then((res) => {
57
+      setExtend([...extend, ...res.records])
58
+      setNewextNum(newextNum + res.records.length)
59
     })
59
     })
60
   }
60
   }
61
-  useEffect(()=>{
62
-    getShopDetail(id).then((res)=>{
61
+  useEffect(() => {
62
+    getShopDetail(id).then((res) => {
63
       setDetail(res)
63
       setDetail(res)
64
-      setimlist(res.imageList||[])
65
-      getShopcity(res.cityId).then((res2)=>{
64
+      setimlist(res.imageList || [])
65
+      getShopcity(res.cityId).then((res2) => {
66
         setCity(res2)
66
         setCity(res2)
67
       })
67
       })
68
     })
68
     })
69
-    getShopPackage(id).then((res)=>{
70
-      setPackage(res.records||[])
69
+    getShopPackage(id).then((res) => {
70
+      setPackage(res.records || [])
71
       setNewpgNum(res.records.length)
71
       setNewpgNum(res.records.length)
72
       setAllpgNum(res.total)
72
       setAllpgNum(res.total)
73
     })
73
     })
74
-    getExtendContent('shop',id).then((res)=>{
75
-      setExtend(res.records||[])
74
+    getExtendContent('shop', id).then((res) => {
75
+      setExtend(res.records || [])
76
       setAllextNum(res.total)
76
       setAllextNum(res.total)
77
       setNewextNum(res.records.length)
77
       setNewextNum(res.records.length)
78
     })
78
     })
79
-  },[])
80
-  const star=parseFloat(((detail.sweetScore+detail.environmentScore+detail.serviceScore)/3).toFixed(1)); 
81
-return (
79
+  }, [])
80
+  const star = parseFloat(((detail.sweetScore + detail.environmentScore + detail.serviceScore) / 3).toFixed(1));
81
+  return (
82
     <view className='page-index'>
82
     <view className='page-index'>
83
       <view className='index-navbar'>
83
       <view className='index-navbar'>
84
         <CustomNav title='十公里' />
84
         <CustomNav title='十公里' />
85
       </view>
85
       </view>
86
-      <view style={{overflow: 'auto', padding: '0 30rpx', background: '#F8F8F8' }}>
86
+      <view style={{ overflow: 'auto', padding: '0 30rpx', background: '#F8F8F8' }}>
87
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll">
87
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll">
88
-          <view className='storeDetails'>           
88
+          <view className='storeDetails'>
89
             <Swiper
89
             <Swiper
90
               className='.swiper'
90
               className='.swiper'
91
               circular
91
               circular
103
                   </SwiperItem>
103
                   </SwiperItem>
104
                 )
104
                 )
105
               }
105
               }
106
-            </Swiper>                        
106
+            </Swiper>
107
             <view className='storeJs'>
107
             <view className='storeJs'>
108
               <view style={{ overflow: 'hidden' }}>
108
               <view style={{ overflow: 'hidden' }}>
109
-                  <view className='storeName'>{detail.shopName}</view>
110
-                  <view className='sprice'>
111
-                    <text className='t1'>¥</text>
112
-                    {detail.averagePrice}/人                
113
-                    <view className='bzRight'>
114
-                      <image src={ax} style={{ width: '15px', height: '15px', marginRight: '11rpx', marginBottom: '-2px' }} />
109
+                <view className='storeName'>{detail.shopName}</view>
110
+                <view className='sprice'>
111
+                  <text className='t1'>¥</text>
112
+                  {detail.averagePrice}/人
113
+                  <view className='bzRight'>
114
+                    <image src={ax} style={{ width: '15px', height: '15px', marginRight: '11rpx', marginBottom: '-2px' }} />
115
                     爆赞{detail.likeNum}</view>
115
                     爆赞{detail.likeNum}</view>
116
-                  </view>
116
+                </view>
117
               </view>
117
               </view>
118
               <view className='appraise'>
118
               <view className='appraise'>
119
-                <Star star={star}/>
119
+                <Star star={star} />
120
                 <text className='storezf'>{star}</text>
120
                 <text className='storezf'>{star}</text>
121
-                <view style={{float:'right',marginTop:'5px'}}>
121
+                <view style={{ float: 'right', marginTop: '5px' }}>
122
                   <text className='comment'>点评:</text>
122
                   <text className='comment'>点评:</text>
123
                   <text className='t1'>口味:{detail.sweetScore}</text>
123
                   <text className='t1'>口味:{detail.sweetScore}</text>
124
                   <text className='t1'>环境:{detail.environmentScore}</text>
124
                   <text className='t1'>环境:{detail.environmentScore}</text>
128
               <view className='yysj'>
128
               <view className='yysj'>
129
                 <image src={yysj} className='yysjImg' />营业时间:{detail.businessHours}
129
                 <image src={yysj} className='yysjImg' />营业时间:{detail.businessHours}
130
               </view>
130
               </view>
131
-              <view className='dpPosition'> 
131
+              <view className='dpPosition'>
132
                 <image src={dw} className='dwTip' />
132
                 <image src={dw} className='dwTip' />
133
                 <view>{detail.address}
133
                 <view>{detail.address}
134
                   <image src={zhuandao} className='zhuandao' />
134
                   <image src={zhuandao} className='zhuandao' />
136
               </view>
136
               </view>
137
             </view>
137
             </view>
138
           </view>
138
           </view>
139
-          <view style={{ position: 'relative',display:spackage?'':'none'}}>
139
+          <view style={{ position: 'relative', display: spackage ? '' : 'none' }}>
140
             <view className='title'>
140
             <view className='title'>
141
               <image src={titlezs}></image>
141
               <image src={titlezs}></image>
142
               <text>返现套餐</text>
142
               <text>返现套餐</text>
143
             </view>
143
             </view>
144
-            
144
+
145
             {
145
             {
146
-             spackage?.map((item)=><Cards star={star} item={item} city={city} />)
146
+              spackage?.map((item) => <Cards star={star} item={item} city={city} />)
147
             }
147
             }
148
-            
149
-            <view className='showMore' style={{display:newpgNum==AllpgNum?'none':''}} onClick={pgMore}>
148
+
149
+            <view className='showMore' style={{ display: newpgNum == AllpgNum ? 'none' : '' }} onClick={pgMore}>
150
               <view>查看更多</view>
150
               <view>查看更多</view>
151
               <image src={showMore} className='moreTip' />
151
               <image src={showMore} className='moreTip' />
152
             </view>
152
             </view>
153
           </view>
153
           </view>
154
 
154
 
155
-          <view style={{ position: 'relative',display:extend?'':'none' }}>
155
+          <view style={{ position: 'relative', display: extend ? '' : 'none' }}>
156
             <view className='title'>
156
             <view className='title'>
157
               <image src={titlezs}></image>
157
               <image src={titlezs}></image>
158
               <text>本店指南</text>
158
               <text>本店指南</text>
159
             </view>
159
             </view>
160
-            {extend?.map((item)=><Extend item={item} />)}
161
-            <view className='showMore' style={{display:newextNum==AllextNum?'none':''}} onClick={extendMore}>
160
+            {extend?.map((item) => <Extend item={item} />)}
161
+            <view className='showMore' style={{ display: newextNum == AllextNum ? 'none' : '' }} onClick={extendMore}>
162
               <view>查看更多</view>
162
               <view>查看更多</view>
163
               <image src={showMore} className='moreTip' />
163
               <image src={showMore} className='moreTip' />
164
             </view>
164
             </view>
165
           </view>
165
           </view>
166
-           <view className='botton'>已经到底了~</view>
166
+          <view className='botton'>已经到底了~</view>
167
         </scroll-view>
167
         </scroll-view>
168
       </view>
168
       </view>
169
     </view>
169
     </view>

+ 18
- 7
src/pages/index/tabs/Mine.jsx View File

1
 
1
 
2
-import { useState } from 'react'
2
+import { useState, useEffect } from 'react'
3
 import Taro from '@tarojs/taro'
3
 import Taro from '@tarojs/taro'
4
 import { Slot } from '@tarojs/components'
4
 import { Slot } from '@tarojs/components'
5
 import AuthPage from '@/components/AuthPage'
5
 import AuthPage from '@/components/AuthPage'
16
 import DefaultImage from '@/assets/icons/UserCenter/DefaultImage.png'
16
 import DefaultImage from '@/assets/icons/UserCenter/DefaultImage.png'
17
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
17
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
18
 import SwitchSelect from '@/components/SwitchSelect'
18
 import SwitchSelect from '@/components/SwitchSelect'
19
+import { PaysOrder, getMineOrder } from '@/services/payOrder' //创建订单
20
+
19
 import { useModel } from '@/store'
21
 import { useModel } from '@/store'
20
 import './MineCss/style.less'
22
 import './MineCss/style.less'
21
 
23
 
28
   const { getAvatar } = useModel('person')
30
   const { getAvatar } = useModel('person')
29
   const [showCutover, setShowCutover] = useState(false)
31
   const [showCutover, setShowCutover] = useState(false)
30
   const hasAvatar = !!person.avatar
32
   const hasAvatar = !!person.avatar
31
-  // const hidePhone = person.phone.replace(/^(\d{3})\d{4}(\d+)/, "$1****$2")
32
-  // console.log("🚀 ~ file: Mine.jsx ~ line 31 ~ hidePhone", hidePhone)
33
+  const [orderNum, setOrderNum] = useState([])
34
+  console.log("🚀 ~ file: Mine.jsx ~ line 34 ~ orderNum", orderNum)
35
+
33
 
36
 
34
   const ShowMoldeOn = () => {
37
   const ShowMoldeOn = () => {
35
-    setShowCutover(true)
38
+    setShowCutover(!showCutover)
39
+
36
   }
40
   }
37
 
41
 
42
+  useEffect(() => {
43
+    getMineOrder().then(res => setOrderNum(res))
44
+
45
+  }, [])
46
+
47
+
48
+
38
   // 通过getUserProfile获取微信用户信息
49
   // 通过getUserProfile获取微信用户信息
39
   const handleGetUserProfile = () => {
50
   const handleGetUserProfile = () => {
40
     if (hasAvatar) return;
51
     if (hasAvatar) return;
123
             <view className='buy-list-Paybox' onClick={handleTobePaid} >
134
             <view className='buy-list-Paybox' onClick={handleTobePaid} >
124
               <image className='buy-list-PayLogo' src={awaitPay} />
135
               <image className='buy-list-PayLogo' src={awaitPay} />
125
               <view className='buy-list-goPay'>待支付</view>
136
               <view className='buy-list-goPay'>待支付</view>
126
-              <view className='buy-list-OrderNumber'>2笔订单</view>
137
+              <view className='buy-list-OrderNumber'>{orderNum?.unPayNum}笔订单</view>
127
             </view>
138
             </view>
128
             <view className='buy-list-Paybox ' onClick={handleTobeWritten} >
139
             <view className='buy-list-Paybox ' onClick={handleTobeWritten} >
129
               <image className='buy-list-PayLogo' src={ToShop} />
140
               <image className='buy-list-PayLogo' src={ToShop} />
130
               <view className='buy-list-goPay'>待核销</view>
141
               <view className='buy-list-goPay'>待核销</view>
131
-              <view className='buy-list-OrderNumber'>1个订单</view>
142
+              <view className='buy-list-OrderNumber'>{orderNum?.unVerifiedNum}个订单</view>
132
             </view>
143
             </view>
133
             <view className='buy-list-Paybox ' onClick={handleAllOrder} >
144
             <view className='buy-list-Paybox ' onClick={handleAllOrder} >
134
               <image className='buy-list-PayLogo' src={AllOrder} />
145
               <image className='buy-list-PayLogo' src={AllOrder} />
138
             <view className='buy-list-Paybox ' onClick={handleRefund} >
149
             <view className='buy-list-Paybox ' onClick={handleRefund} >
139
               <image className='buy-list-PayLogo' src={Refund} />
150
               <image className='buy-list-PayLogo' src={Refund} />
140
               <view className='buy-list-goPay'>退款/售后</view>
151
               <view className='buy-list-goPay'>退款/售后</view>
141
-              <view className='buy-list-OrderNumber'>2笔订单</view>
152
+              <view className='buy-list-OrderNumber'>{orderNum?.refundNum}笔订单</view>
142
             </view>
153
             </view>
143
           </view>
154
           </view>
144
           <view className='Badge-box'>
155
           <view className='Badge-box'>

+ 9
- 0
src/services/payOrder.js View File

1
 //支付订单模块
1
 //支付订单模块
2
 import request from '@/utils/request'
2
 import request from '@/utils/request'
3
 //套餐订单列表用哪个接口
3
 //套餐订单列表用哪个接口
4
+
5
+export const getMineOrder = () => request('/orderSub/summary/mine',)
6
+
7
+
8
+
9
+export const PaysOrder = (data) => request('/order', { data, method: 'post' })
10
+
11
+
12
+
4
 //订单详情,订单修改数量
13
 //订单详情,订单修改数量