|
@@ -1,11 +1,13 @@
|
1
|
1
|
import Taro from '@tarojs/taro'
|
2
|
|
-import { View, Text } from '@tarojs/components'
|
|
2
|
+import { View, Text, Image, Button, ScrollView } from '@tarojs/components'
|
3
|
3
|
import CouponCard from '@/components/CouponCard'
|
4
|
4
|
import Location from '@/components/Location'
|
5
|
5
|
import { compressImage } from '@/utils'
|
6
|
6
|
import SaveIcon from '@/components/SaveIcon'
|
7
|
7
|
import Pay from '@/assets/icons/housemantj/pay.png'
|
|
8
|
+import Popup from '@/components/Popup'
|
8
|
9
|
import './style.less'
|
|
10
|
+import { useState } from 'react'
|
9
|
11
|
|
10
|
12
|
|
11
|
13
|
const CouponMedia = CouponCard.Media
|
|
@@ -13,26 +15,43 @@ const Action = CouponCard.Action
|
13
|
15
|
|
14
|
16
|
//套餐卡片
|
15
|
17
|
export default (props) => {
|
16
|
|
- const { item, st, det, editable, goshop, scene, subOrderId, id } = props
|
|
18
|
+ const { item, st, det, editable,setScroll, goshop, scene, subOrderId, id } = props
|
17
|
19
|
const { shopId } = props.item
|
18
|
20
|
const goFood = () => {
|
19
|
21
|
Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
|
20
|
22
|
}
|
|
23
|
+ const [showCutover, setShowCutover] = useState(false)
|
21
|
24
|
const goDetail = () => {
|
22
|
|
-
|
|
25
|
+ //打开当前套餐详情弹窗
|
|
26
|
+ setShowCutover(true)
|
|
27
|
+ //使父组件禁止滚动
|
|
28
|
+ setScroll(false)
|
|
29
|
+ }
|
|
30
|
+ const onClose = () => {
|
|
31
|
+ //关闭当前套餐详情弹窗
|
|
32
|
+ setShowCutover(false)
|
|
33
|
+ //使父组件恢复滚动
|
|
34
|
+ setScroll(true)
|
23
|
35
|
}
|
24
|
36
|
|
25
|
|
- // 支付成功--判断---有---问--没有--跳转到全部订单
|
26
|
37
|
|
27
|
38
|
|
28
|
39
|
const handlePayClick = () => {
|
29
|
40
|
Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}&scene=${scene || ''}&subOrderId=${subOrderId}&id=${id}` })
|
30
|
|
- console.log("🚀 ~ file: foodCards.jsx ~ line 17 ~ scene", item.packageId, scene)
|
31
|
|
-
|
32
|
41
|
}
|
33
|
42
|
const PayAction = <Action.Icon icon={Pay} text='支付' onClick={handlePayClick} />
|
34
|
43
|
return (
|
35
|
|
- <View style={{ margin: '15px 5px' }}>
|
|
44
|
+ <View style={{ margin: '15px 5px' }} >
|
|
45
|
+ <View className='packageDetail' style={{display:goshop?'':'none'}}>
|
|
46
|
+ <Popup show={showCutover} maskClosable={showCutover} onClose={onClose}>
|
|
47
|
+ <ScrollView
|
|
48
|
+ scrollY
|
|
49
|
+ style={{ maxHeight: '60vh' }}
|
|
50
|
+ >
|
|
51
|
+ <Image mode='widthFix' src={item.details ? item.details : item.poster} />
|
|
52
|
+ </ScrollView>
|
|
53
|
+ </Popup >
|
|
54
|
+ </View>
|
36
|
55
|
<CouponCard action={PayAction}>
|
37
|
56
|
<CouponMedia onClick={goshop ? goDetail : goFood}>
|
38
|
57
|
<CouponMedia.Header
|