Przeglądaj źródła

Merge branch 'dev' of http://git.ycjcjy.com/shigongli/miniapp-v2 into dev

吃个甘蔗嚼一年 3 lat temu
rodzic
commit
d1f19f05a4

+ 26
- 7
src/components/foodCards/foodCards.jsx Wyświetl plik

1
 import Taro from '@tarojs/taro'
1
 import Taro from '@tarojs/taro'
2
-import { View, Text } from '@tarojs/components'
2
+import { View, Text, Image, Button, ScrollView } from '@tarojs/components'
3
 import CouponCard from '@/components/CouponCard'
3
 import CouponCard from '@/components/CouponCard'
4
 import Location from '@/components/Location'
4
 import Location from '@/components/Location'
5
 import { compressImage } from '@/utils'
5
 import { compressImage } from '@/utils'
6
 import SaveIcon from '@/components/SaveIcon'
6
 import SaveIcon from '@/components/SaveIcon'
7
 import Pay from '@/assets/icons/housemantj/pay.png'
7
 import Pay from '@/assets/icons/housemantj/pay.png'
8
+import Popup from '@/components/Popup'
8
 import './style.less'
9
 import './style.less'
10
+import { useState } from 'react'
9
 
11
 
10
 
12
 
11
 const CouponMedia = CouponCard.Media
13
 const CouponMedia = CouponCard.Media
13
 
15
 
14
 //套餐卡片
16
 //套餐卡片
15
 export default (props) => {
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
   const { shopId } = props.item
19
   const { shopId } = props.item
18
   const goFood = () => {
20
   const goFood = () => {
19
     Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
21
     Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
20
   }
22
   }
23
+  const [showCutover, setShowCutover] = useState(false)
21
   const goDetail = () => {
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
   const handlePayClick = () => {
39
   const handlePayClick = () => {
29
     Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}&scene=${scene || ''}&subOrderId=${subOrderId}&id=${id}` })
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
   const PayAction = <Action.Icon icon={Pay} text='支付' onClick={handlePayClick} />
42
   const PayAction = <Action.Icon icon={Pay} text='支付' onClick={handlePayClick} />
34
   return (
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
       <CouponCard action={PayAction}>
55
       <CouponCard action={PayAction}>
37
         <CouponMedia onClick={goshop ? goDetail : goFood}>
56
         <CouponMedia onClick={goshop ? goDetail : goFood}>
38
           <CouponMedia.Header
57
           <CouponMedia.Header

+ 9
- 0
src/components/foodCards/style.less Wyświetl plik

35
       flex: 1;
35
       flex: 1;
36
     }
36
     }
37
   }
37
   }
38
+}
39
+.packageDetail{
40
+  Image{
41
+    width: 100%;
42
+  }
43
+  .weui-dialog__bd{
44
+    padding: 0;
45
+    margin: 0;
46
+  }
38
 }
47
 }

+ 4
- 2
src/pages/details/foodDetails/foodDetails.config.js Wyświetl plik

2
   navigationBarTitleText: '美食详情',
2
   navigationBarTitleText: '美食详情',
3
   navigationStyle: 'custom',
3
   navigationStyle: 'custom',
4
   disableScroll: true,
4
   disableScroll: true,
5
-
6
-  enableShareAppMessage: true
5
+  enableShareAppMessage: true,
6
+  usingComponents: {
7
+    "mp-dialog": "weui-miniprogram/dialog/dialog",
8
+  }
7
 }
9
 }

+ 3
- 3
src/pages/details/foodDetails/foodDetails.jsx Wyświetl plik

126
       imageUrl: detail.poster,
126
       imageUrl: detail.poster,
127
     };
127
     };
128
   });
128
   });
129
-
129
+ const [isScroll,setScroll]=useState(true)
130
   return (
130
   return (
131
     <view className='page-index'>
131
     <view className='page-index'>
132
       <view className='index-navbar'>
132
       <view className='index-navbar'>
134
       </view>
134
       </view>
135
       <SpinBox loading={loading} className='index-container' style={{ padding: '0 30rpx' }}>
135
       <SpinBox loading={loading} className='index-container' style={{ padding: '0 30rpx' }}>
136
         <scroll-view
136
         <scroll-view
137
-          scrollY
137
+          scrollY={isScroll}
138
           style={{ height: '100%' }}
138
           style={{ height: '100%' }}
139
         >
139
         >
140
           <view className='storeDetails'>
140
           <view className='storeDetails'>
217
                     <text>返现套餐</text>
217
                     <text>返现套餐</text>
218
                   </view>
218
                   </view>
219
                   {(spackage || []).map((item) => (
219
                   {(spackage || []).map((item) => (
220
-                    <Cards scene={scene} id={id} subOrderId={subOrderId} key={item.packageId} editable='1' st={star} goshop='1' item={item} det={detail} />
220
+                    <Cards scene={scene} id={id} setScroll={setScroll} subOrderId={subOrderId} key={item.packageId} editable='1' st={star} goshop='1' item={item} det={detail} />
221
                   ))}
221
                   ))}
222
                 </view>
222
                 </view>
223
                 <view
223
                 <view