李志伟 3 years ago
parent
commit
c87a2aee44

+ 32
- 76
src/components/foodCards/ShareCard/index.jsx View File

@@ -14,95 +14,51 @@ import SeeDetails from '@/assets/icons/GuideCheck/SeeDetails.png'
14 14
 import './style.less'
15 15
 
16 16
 
17
-const CouponMedia = CouponCard.Media
18 17
 const Action = CouponCard.Action
19 18
 
20 19
 //套餐卡片
21 20
 export default (props) => {
22
-  const { item, st, editable, setScroll, goshop, det, onDay, onDelete } = props
23
-  // const travelId = travelMineContent?.records[0]?.travelId
21
+  const { item, st, editable, det } = props
24 22
   const { targetId, itemId } = props.item
23
+  //进入详情页面
25 24
   const goDetail = () => {
26
-    Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${targetId}` })
27
-
28
-  }
29
-  const goFood = () => {
25
+    item.targetType === 'tourist' ?  
26
+    Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${targetId}` }): 
30 27
     Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${targetId}` })
31
-
32
-  }
33
-  const [showCutover, setShowCutover] = useState(false)
34
-  const [valueList, setValueList] = useState([])
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-  // useEffect(() => {
45
-
46
-  // }, [item])
47
-
48
-  const onClose = () => {
49
-    //关闭当前套餐详情弹窗
50
-    setShowCutover(false)
51
-    //使父组件恢复滚动
52
-    setScroll(true)
53 28
   }
54
-
55
-
56
-
57
-
58
-  const handlePayClick = (e) => {
59
-
60
-    onDelete(itemId)
61
-
62
-    // Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}&scene=${scene || ''}&subOrderId=${subOrderId}&id=${id}` })
63
-
29
+  const backStyle = {
30
+    background: `url('${compressImage(item.poster)}') no-repeat`,
31
+    backgroundSize: '100% 100%',
64 32
   }
65
-  const PayAction = <Action.Icon icon={SeeDetails} text='查看详情' onClick={item.targetType === 'tourist' ? goDetail : goFood} />
66
-
67
-
68
-
69
-
70 33
   return (
71
-    <View style={{ margin: '15px 5px' }} >
72
-      {/* <View className='packageDetail' style={{ display: goshop ? '' : 'none' }}>
73
-        <Popup show={showCutover} maskClosable={showCutover} onClose={onClose}>
74
-          <ScrollView
75
-            scrollY
76
-            style={{ maxHeight: '60vh' }}
77
-          >
78
-            <Image mode='widthFix' src={item.details ? item.details : item.poster} />
79
-          </ScrollView>
80
-        </Popup >
81
-      </View> */}
82
-      <CouponCard action={PayAction}  >
83
-        <CouponMedia >
84
-          <CouponMedia.Header
85
-            cashback={item.cashback}
86
-            image={compressImage(item.poster)}
87
-          // badge='food'
88
-          />
89
-          <CouponMedia.Body star={st}>
90
-            <View className='foodCard'>
91
-              <View className='cpn-card-text'>
92
-                {(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
93
-              </View>
94
-              <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
95
-                <Text className='cpn-card-text_mn'>¥{`${(item.averagePrice == '' ? '0.00' : item.averagePrice / 100)?.toFixed(2)}元`}</Text>
96
-                {/* <Text className='cpn-card-text_rm'>{`门市价${(item.standardPrice / 100)?.toFixed(2)}元`}</Text> */}
34
+    <View style={{ margin: '15px 15px' }} >
35
+      <View className='coupon-card' onClick={goDetail}>
36
+        <View className='coupon-card_body' style='background: #fff;border-radius: 12px;'>
37
+          <View className='coupun-media'>
38
+            <View className='coupun-media_header'>
39
+              <View className='coupun-media_thumb' style="margin-top: 20px;">
40
+                <View className='image' style={backStyle}></View>
97 41
               </View>
98
-              <View className='cpn-md-act'>
99
-                <Location {...det} />
100
-                <SaveIcon saved={item.isSaved > 0} targetType='shop_package' editable={editable} targetId={item.targetId} />
42
+            </View>
43
+            <View className='coupun-media_body'>
44
+              <View class="coupun-media_body_ctt" style={{ marginTop: '20px' }}>
45
+                <View className='foodCard'>
46
+                  <View className='cpn-card-text'>
47
+                    {(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
48
+                  </View>
49
+                  <View className='cpn-card-text' style={{ marginTop: '5px' }}>
50
+                    <Text className='cpn-card-text_mn'>¥{`${(item.averagePrice == '' ? '0.00' : item.averagePrice / 100)?.toFixed(2)}元`}</Text>
51
+                  </View>
52
+                  <View className='cpn-md-act'>
53
+                    <Location {...det} />
54
+                    <SaveIcon saved={item.isSaved > 0} targetType={item.targetType} editable={editable} targetId={item.targetId} />
55
+                  </View>
56
+                </View>
101 57
               </View>
102 58
             </View>
103
-          </CouponMedia.Body>
104
-        </CouponMedia>
105
-      </CouponCard>
59
+          </View>
60
+        </View>
61
+      </View>
106 62
     </View>
107 63
   )
108 64
 }

+ 4
- 4
src/pages/RandomItinerary/ResultOver/index.jsx View File

@@ -58,11 +58,11 @@ export default withLayout((props) => {
58 58
                 </Text>
59 59
                 <View className='bottom-text'>》</View>
60 60
               </View>
61
+              {
62
+                traveContent?.isHidden === true && shareList.map((item) => <ShareCard det={item} editable='1' item={item} key={item.itemId} />
63
+                )
64
+              }
61 65
             </View>
62
-            {
63
-              traveContent?.isHidden === false && shareList.map((item) => <ShareCard det={item} item={item} key={item.itemId} />
64
-              )
65
-            }
66 66
             {
67 67
               traveContent?.isHidden &&
68 68
               <Button openType='share' className='content'><View className='shareImg'>分享并邀请好友点开查看完整命定行程</View></Button>

+ 8
- 8
src/pages/RandomItinerary/ResultOver/style.less View File

@@ -30,14 +30,6 @@
30 30
       }
31 31
     }
32 32
   }
33
-  .shareImg {
34
-    height: 120px;
35
-    background: url("../../../assets/icons/GuideCheck/shareImage.png") no-repeat;
36
-    background-size: 100%;
37
-    font-size: 29px;
38
-    color: #1a3b83;
39
-    line-height: 120px;
40
-  }
41 33
   .content {
42 34
     background: transparent;
43 35
     padding: 0;
@@ -45,5 +37,13 @@
45 37
     &::after {
46 38
       border: none;
47 39
     }
40
+    .shareImg {
41
+      height: 120px;
42
+      background: url("../../../assets/icons/GuideCheck/shareImage.png") no-repeat;
43
+      background-size: 100%;
44
+      font-size: 29px;
45
+      color: #1a3b83;
46
+      line-height: 120px;
47
+    } 
48 48
   }
49 49
 }