吃个甘蔗嚼一年 3 år sedan
förälder
incheckning
4696d4b458
4 ändrade filer med 51 tillägg och 303 borttagningar
  1. 10
    7
      .vscode/launch.json
  2. 0
    261
      ad
  3. 37
    32
      src/components/foodCards/foodCards.jsx
  4. 4
    3
      src/pages/PayOrder/index.jsx

+ 10
- 7
.vscode/launch.json Visa fil

@@ -2,14 +2,17 @@
2 2
     // 使用 IntelliSense 了解相关属性。 
3 3
     // 悬停以查看现有属性的描述。
4 4
     // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
5
-    "version": "0.2.0",
6
-    "configurations": [
7
-        {
8
-            "type": "pwa-chrome",
5
+    
6
+        "version": "0.2.0",
7
+        "configurations": [
8
+          {
9
+            "type": "pwa-msedge",
9 10
             "request": "launch",
10
-            "name": "Launch Chrome against localhost",
11
+            "name": "Launch Microsoft Edge and open the Edge DevTools",
11 12
             "url": "http://localhost:8080",
12 13
             "webRoot": "${workspaceFolder}"
13
-        }
14
-    ]
14
+          }
15
+        ]
16
+      
17
+    
15 18
 }

+ 0
- 261
ad Visa fil

@@ -1,261 +0,0 @@
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

+ 37
- 32
src/components/foodCards/foodCards.jsx Visa fil

@@ -1,14 +1,14 @@
1
+import useSave from "@/utils/hooks/useSave"
2
+import Taro from "@tarojs/taro"
3
+import { getShopDetail, getShopcity } from '@/services/home'
4
+import { useState, useEffect } from 'react'
1 5
 import Star from '@/components/Star/Star.jsx'
2
-import Taro from '@tarojs/taro'
3 6
 import pay from '@/assets/icons/housemantj/pay.png'
4 7
 import msTip from '@/assets/icons/housemantj/foodtip.png'
5 8
 import wz from '@/assets/icons/housemantj/location.png'
6 9
 import hongxin from '@/assets/icons/housemantj/已收藏.png'
7 10
 import baixin from '@/assets/icons/housemantj/收藏.png'
8 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
 
@@ -19,6 +19,12 @@ export default (props) => {
19 19
   const [city, setCity] = useState({})
20 20
   const [detail, setDetail] = useState({})
21 21
 
22
+  const goToPay = () => {
23
+    Taro.navigateTo({
24
+      url: `/pages/PayOrder/index?packageId=${item.packageId}&shopId=${item.shopId}`,
25
+    })
26
+  }
27
+
22 28
   useEffect(() => {
23 29
     getShopDetail(item.shopId).then((res) => {
24 30
       setDetail(res)
@@ -30,45 +36,44 @@ export default (props) => {
30 36
   const star = parseFloat(((detail.sweetScore + detail.environmentScore + detail.serviceScore) / 3).toFixed(1));
31 37
 
32 38
   return (
33
-      <view className='foodCard'>
34
-        <view className='fCleft'>
35
-          <view className='backMoney'>
36
-            返现¥{item.cashback/100}
37
-          </view>
38
-          <view className='appraise'>
39
-            <Star star={star} />
40
-            <text className='storezf'>{star}</text>
39
+    <view className='foodCard'>
40
+      <view className='fCleft'>
41
+        <view className='backMoney'>
42
+          返现¥{item.cashback / 100}
43
+        </view>
44
+        <view className='appraise'>
45
+          <Star star={star} />
46
+          <text className='storezf'>{star}</text>
47
+        </view>
48
+        <view>
49
+          <view className='contentImg'>
50
+            <image src={item.poster} className='img1'></image>
51
+            <image src={msTip} className='mstip'></image>
41 52
           </view>
42
-          <view>
43
-            <view className='contentImg'>
44
-              <image src={item.poster} className='img1'></image>
45
-              <image src={msTip} className='mstip'></image>
53
+          <view className='neirong'>
54
+            <view className='textword'>{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</view>
55
+            <view className='jiage'>
56
+              <text className='rmb' >¥&nbsp;&nbsp;</text>
57
+              <text className='p1'><text className='price' >{item.actualPrice / 100}</text>元&nbsp;&nbsp;</text>
58
+              <text className='p2'>门市价<text className='oldprice' >{item.standardPrice / 100}</text>元</text>
46 59
             </view>
47
-            <view className='neirong'>
48
-              <view className='textword'>{(item.description).toString().length>25?(item.description).substring(0, 25)+'...':(item.description)}</view>
49
-              <view className='jiage'>
50
-                <text className='rmb' >¥&nbsp;&nbsp;</text>
51
-                <text className='p1'><text className='price' >{item.actualPrice/100}</text>元&nbsp;&nbsp;</text>
52
-                <text className='p2'>门市价<text className='oldprice' >{item.standardPrice/100}</text>元</text>
53
-              </view>
54
-              <view className='address'>
55
-                <image className='dw' src={wz} />
56
-                <text className='wz'>{city.areaPName}/{city.areaName}</text>
57
-                <view style={{display:'inline-block'}} onClick={toggleSave}>
58
-                <image className='star' src={isSaved>0?hongxin:baixin}></image>
59
-                <text className='collection'>{isSaved>0?'已收藏':'加入收藏'}</text>
60
-              </view>
60
+            <view className='address'>
61
+              <image className='dw' src={wz} />
62
+              <text className='wz'>{city.areaPName}/{city.areaName}</text>
63
+              <view style={{ display: 'inline-block' }} onClick={toggleSave}>
64
+                <image className='star' src={isSaved > 0 ? hongxin : baixin}></image>
65
+                <text className='collection'>{isSaved > 0 ? '已收藏' : '加入收藏'}</text>
61 66
               </view>
62 67
             </view>
63 68
           </view>
64 69
         </view>
65 70
       </view>
66
-      <view className='fCright' onClick={() => Detail()} >
71
+      <view className='fCright' onClick={() => { goToPay() }}>
67 72
         <image src={pay} />
68 73
         <view>支付</view>
69 74
       </view>
70 75
       <view className='columnLine'></view>
71
-    </view >
76
+    </view>
72 77
 
73 78
   )
74 79
 }

+ 4
- 3
src/pages/PayOrder/index.jsx Visa fil

@@ -14,13 +14,15 @@ import './style.less'
14 14
 
15 15
 export default withLayout((props) => {
16 16
   const { router, person } = props
17
-  const { id, shopId } = props.router.params
17
+  const { id, shopId, packageId } = props.router.params
18 18
   const [shopPackage, setShopPackage] = useState([])
19 19
   const [buttonDisabled, setButtonDisabled] = useState(true)
20 20
   const [totalCost, setTotalCost] = useState(0)
21 21
   const [cashBack, setCashBack] = useState(0)
22 22
   const [realPrice, setRealPrice] = useState(0)
23 23
 
24
+  console.log('----------shopId-------', props, shopId, id);
25
+
24 26
   const handelButton = () => {
25 27
     setButtonDisabled(false)
26 28
   }
@@ -33,7 +35,6 @@ export default withLayout((props) => {
33 35
 
34 36
   const handeList = () => {
35 37
     shopPackage.map((item) => {
36
-      console.log("🚀 ~ file: index.jsx ~ line 34 ~ shopPackage.map ~ item", item)
37 38
       //总价
38 39
       let CostSum = (item.actualPrice / 100) * (item.BuyNumber || 1)
39 40
       setTotalCost(totalCost + CostSum)
@@ -53,7 +54,7 @@ export default withLayout((props) => {
53 54
   useEffect(() => {
54 55
 
55 56
 
56
-    getShopPackage(shopId, { packageId: id }).then((res) => {
57
+    getShopPackage(shopId, { packageId: packageId }).then((res) => {
57 58
       const itemShop = res.records
58 59
       setShopPackage(itemShop)
59 60
     })