李志伟 3 gadus atpakaļ
vecāks
revīzija
acb6836417

+ 2
- 1
src/components/BadgeTag/index.jsx Parādīt failu

3
 import { View, Image } from '@tarojs/components'
3
 import { View, Image } from '@tarojs/components'
4
 import food from '@/assets/icons/ProCard/food.png'
4
 import food from '@/assets/icons/ProCard/food.png'
5
 import glTip from '@/assets/icons/housemantj/gltip.png'
5
 import glTip from '@/assets/icons/housemantj/gltip.png'
6
+import mjTip from '@/assets/icons/housemantj/mjtip.png'
6
 
7
 
7
 import './style.less'
8
 import './style.less'
8
 
9
 
9
 export default (props) => {
10
 export default (props) => {
10
   const { type, top = '0px', left = '0px' } = props
11
   const { type, top = '0px', left = '0px' } = props
11
 
12
 
12
-  const icon = type === 'food' ? food : glTip;
13
+  const icon = type === 'food' ||type=='shop'? food :type=='tourist'?mjTip : glTip;
13
 
14
 
14
   const style = {
15
   const style = {
15
     top,
16
     top,

+ 0
- 2
src/components/BossCard/index.jsx Parādīt failu

1
 import Taro from '@tarojs/taro'
1
 import Taro from '@tarojs/taro'
2
 import { View, Text } from '@tarojs/components'
2
 import { View, Text } from '@tarojs/components'
3
 import Pay from '@/assets/icons/GuideCheck/Pay_logo.png'
3
 import Pay from '@/assets/icons/GuideCheck/Pay_logo.png'
4
-
5
 import { getQueryString } from '@/utils/index'
4
 import { getQueryString } from '@/utils/index'
6
 import CouponCard from '@/components/CouponCard'
5
 import CouponCard from '@/components/CouponCard'
7
 import Location from '@/components/Location'
6
 import Location from '@/components/Location'
41
             {(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}
40
             {(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}
42
           </View>
41
           </View>
43
           <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
42
           <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
44
-            {/* <Text className='cpn-card-text_ms'>¥</Text> */}
45
             <Text className='cpn-card-text_mn'>¥{`${(item.actualPrice / 100)?.toFixed(2)}元`}</Text>
43
             <Text className='cpn-card-text_mn'>¥{`${(item.actualPrice / 100)?.toFixed(2)}元`}</Text>
46
             <Text className='cpn-card-text_rm'>{`门市价${(item.standardPrice / 100)?.toFixed(2)}元`}</Text>
44
             <Text className='cpn-card-text_rm'>{`门市价${(item.standardPrice / 100)?.toFixed(2)}元`}</Text>
47
           </View>
45
           </View>

+ 0
- 7
src/components/BossCard/style.less Parādīt failu

13
       margin-left: 8px;
13
       margin-left: 8px;
14
     }
14
     }
15
   }
15
   }
16
-
17
-  &_ms {
18
-    font-size: 20px;
19
-    font-weight: bold;
20
-    color: #333333;
21
-  }
22
-
23
   &_mn {
16
   &_mn {
24
     font-size: 24px;
17
     font-size: 24px;
25
     font-weight: bold;
18
     font-weight: bold;

+ 99
- 81
src/components/CollectList/MyCollect/index.jsx Parādīt failu

1
 import Taro from '@tarojs/taro'
1
 import Taro from '@tarojs/taro'
2
 import useLike from "@/utils/hooks/useLike"
2
 import useLike from "@/utils/hooks/useLike"
3
-import { View } from '@tarojs/components'
3
+import { View, Text } from '@tarojs/components'
4
 import formatPrice from "@/utils/formatPrice";
4
 import formatPrice from "@/utils/formatPrice";
5
 import Star from '@/components/Star/Star.jsx'
5
 import Star from '@/components/Star/Star.jsx'
6
 import position from '@/assets/icons/GuideCheck/position_logo.png'
6
 import position from '@/assets/icons/GuideCheck/position_logo.png'
11
 import food from '@/assets/icons/ProCard/food.png'
11
 import food from '@/assets/icons/ProCard/food.png'
12
 import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
12
 import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
13
 
13
 
14
-
15
-
14
+import CouponCard from '@/components/CouponCard'
15
+import Location from '@/components/Location'
16
 import './style.less'
16
 import './style.less'
17
 
17
 
18
+
19
+const CouponMedia = CouponCard.Media
20
+const Action = CouponCard.Action
18
 export default (props) => {
21
 export default (props) => {
19
   const { item, cardNavigateTo } = props
22
   const { item, cardNavigateTo } = props
20
-  // const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.targetId)
21
   const [isLike, toggleLike] = useLike(item.isLike, 'tourist', item.targetId)
23
   const [isLike, toggleLike] = useLike(item.isLike, 'tourist', item.targetId)
22
 
24
 
23
   const targetType = item.targetType
25
   const targetType = item.targetType
24
 
26
 
25
   const star = parseFloat(((item.sweetScore + item.environmentScore + item.serviceScore) / 3).toFixed(1));
27
   const star = parseFloat(((item.sweetScore + item.environmentScore + item.serviceScore) / 3).toFixed(1));
28
+
29
+  const handleDetail = () => {
30
+    targetType=="shop_package"? Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` })
31
+    :targetType=="tourist"?Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` })
32
+    :Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })
33
+  }
34
+
35
+  const PayAction = <Action.Icon icon={SeeDetails} text='查看详情' onClick={handleDetail} />
36
+
26
   return (
37
   return (
27
 
38
 
28
     <View className='View-box-LR'>
39
     <View className='View-box-LR'>
29
       <View className='left-View-box'>
40
       <View className='left-View-box'>
30
         {
41
         {
31
           targetType === "shop_package" && (
42
           targetType === "shop_package" && (
32
-            <view class='wrapper'>
33
-              <view class='left-complete-one'   >
34
-                <image className='left-image-1' src={ProCard_hot} style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} ></image>
35
-                <view className='left-viewText'  >
36
-                  返现¥{formatPrice(item.cashback)}
37
-                </view>
38
-                {/* 评分 */}
39
-                <view className='card-box-star' style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} >
40
-                  <Star star={star} />
41
-                  <text className='card-star-text' >{star}</text>
42
-                </view>
43
-                <view className='title-image' >
44
-                  <image className='image-1' mode='scaleToFill' src={item.poster}></image>
45
-                  <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
46
-                </view>
47
-                <view className='title-content'>
48
-                  <view className='Pro-title'  >
49
-                    <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
50
-                  </view>
51
-                  <text className='title-money' >¥{formatPrice(item.actualPrice)}元<text className='title-money-2'>门市价{formatPrice(item.standardPrice)}元</text></text>
52
-                  <view className='title-position-on'>
53
-                    <image className='title-position' src={position} />
54
-                    <text className='title-position-image'>
55
-                      {
56
-                        targetType === "shop_package" && (
57
-                          item.areaPName == null ? item.areaName : item.areaPName + '/' + item.areaName
58
-                        )
59
-                      }
60
-                    </text>
61
-                  </view>
62
-                </view>
63
-              </view>
64
-              <view class='right-complete-two'>
65
-                <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` }); }}>
66
-                  <image className='right-image' src={SeeDetails} />
67
-                  <view className='right-title'>查看详情</view>
68
-                </view>
69
-              </view>
70
-            </view>
43
+            <View style={{ margin: '15px 5px' }}>
44
+              <CouponCard action={PayAction}>
45
+                <CouponMedia>
46
+                  <CouponMedia.Header
47
+                    cashback={item.cashback}
48
+                    image={item.poster}
49
+                    badge='food'
50
+                  />
51
+                  <CouponMedia.Body star={star}>
52
+                    <View className='cpn-card-text'>
53
+                      {(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
54
+                    </View>
55
+                    <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
56
+                      <Text className='cpn-card-text_mn'>¥{`${(item.actualPrice / 100)?.toFixed(2)}元`}</Text>
57
+                      <Text className='cpn-card-text_rm'>{`门市价${(item.standardPrice / 100)?.toFixed(2)}元`}</Text>
58
+                    </View>
59
+                    <View className='cpn-md-act'>
60
+                      <Location {...item} />
61
+                    </View>
62
+                  </CouponMedia.Body>
63
+                </CouponMedia>
64
+              </CouponCard>
65
+            </View>
71
           )
66
           )
72
         }
67
         }
73
       </View>
68
       </View>
74
       <View className='right-View-box'>
69
       <View className='right-View-box'>
75
         {
70
         {
76
           targetType !== "shop_package" && (
71
           targetType !== "shop_package" && (
77
-            <view class='wrapper'>
78
-              <view class='left-complete-one'   >
79
-                <view className='title-image'>
80
-                  <image className='image-1' mode='scaleToFill' src={item.poster}></image>
81
-                  <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
82
-                </view>
83
-                <view className='title-content'>
84
-                  <view className='Pro-title'  >
85
-                    <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
86
-                  </view>
87
-                  <text className='title-money' >¥{formatPrice(item.averagePrice)}元</text>
88
-                  <view onClick={toggleLike}>
89
-                    <image className='title-on' src={isLike === 1 ? baozan : weibaozan} />
90
-                    <text className='title-on-text'>爆赞 {item.likeNum}</text>
91
-                  </view>
92
-                  <view className='title-position-on'>
93
-                    <image className='title-position' src={position} />
94
-                    <text className='title-position-image'>
95
 
72
 
96
-                      {
97
-                        targetType === "tourist" && (
98
-                          item.areaPName == null ? item.areaName : (item.areaPName + '/' + item.areaName)
99
-                        )
100
-                      }
101
-                      {
102
-                        targetType === "shop" && (
103
-                          item.areaPName === null ? item.areaName : (item.areaPName + '/' + item.areaName)
104
-                        )
105
-                      }</text>
106
-                  </view>
107
-                </view>
108
-              </view>
109
-              <view class='right-complete-two'>
110
-                <view className='right-content' onClick={() => { targetType === 'tourist' ? Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` }) : Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` }) }}>
111
-                  <image className='right-image' src={SeeDetails} />
112
-                  <view className='right-title'>查看详情</view>
113
-                </view>
114
-              </view>
115
-            </view>
73
+            <View style={{ margin: '15px 5px' }}>
74
+              <CouponCard action={PayAction}>
75
+                <CouponMedia>
76
+                  <CouponMedia.Header
77
+                    image={item.poster}
78
+                    badge={targetType}
79
+                  />
80
+                  <CouponMedia.Body >
81
+                    <View className='cpn-card-text'>
82
+                      {(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}
83
+                    </View>
84
+                    <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
85
+                      <Text className='cpn-card-text_mn'>¥{`${formatPrice(item.averagePrice)}元`}</Text>
86
+                    </View>
87
+                   
88
+                    <View className='cpn-md-act'> 
89
+                    <Location {...item} />
90
+
91
+                    <view onClick={toggleLike} className='wdscbaozan'>
92
+                   <image className='title-on' src={isLike === 1 ? baozan : weibaozan} />
93
+                   <text className='title-on-text'>爆赞 {item.likeNum}</text>
94
+                 </view>
95
+                    </View>
96
+                  </CouponMedia.Body>
97
+                </CouponMedia>
98
+              </CouponCard>
99
+            </View>
100
+
116
           )
101
           )
102
+          // <view class='wrapper'>
103
+          //   <view class='left-complete-one'   >
104
+          //     <view className='title-image'>
105
+          //       <image className='image-1' mode='scaleToFill' src={item.poster}></image>
106
+          //       <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
107
+          //     </view>
108
+          //     <view className='title-content'>
109
+          //       <view className='Pro-title'  >
110
+          //         <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
111
+          //       </view>
112
+          //       <text className='title-money' >¥{formatPrice(item.averagePrice)}元</text>
113
+          //       <view onClick={toggleLike}>
114
+          //         <image className='title-on' src={isLike === 1 ? baozan : weibaozan} />
115
+          //         <text className='title-on-text'>爆赞 {item.likeNum}</text>
116
+          //       </view>
117
+          //       <view className='title-position-on'>
118
+          //         <image className='title-position' src={position} />
119
+          //         <text className='title-position-image'>
120
+          //           {
121
+          //             item.areaPName === null ? item.areaName : (item.areaPName + '/' + item.areaName)
122
+          //           }
123
+          //         </text>
124
+          //       </view>
125
+          //     </view>
126
+          //   </view>
127
+          //   <view class='right-complete-two'>
128
+          //     <view className='right-content' onClick={() => { targetType === 'tourist' ? Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` }) : Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` }) }}>
129
+          //       <image className='right-image' src={SeeDetails} />
130
+          //       <view className='right-title'>查看详情</view>
131
+          //     </view>
132
+          //   </view>
133
+          // </view>
134
+
117
         }
135
         }
118
       </View>
136
       </View>
119
     </View>
137
     </View>

+ 52
- 383
src/components/CollectList/MyCollect/style.less Parādīt failu

1
 @whiteColor: #fff;
1
 @whiteColor: #fff;
2
-// .title-on {
3
-//   width: 21px;
4
-//   height: 21px;
5
-//   padding-right: 10px;
6
-// }
7
-// .wrapper {
8
-//   margin-top: 40px;
9
-//   display: flex;
10
-//   position: relative;
11
-//   // margin-top: 600px;
12
-//   // margin: 30px auto;
13
-//   width: 100%;
14
-
15
-//   // box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
16
-//   // filter: drop-shadow(5px 8px 6px rgb(202, 202, 202));
17
-//   filter: drop-shadow(0 0 0.9rem rgba(0, 0, 0, 0.12));
18
-//   .card-box-star {
19
-//     position: absolute;
20
-//     width: auto;
21
-//     height: 44.3px;
22
-//     position: absolute;
23
-//     left: 183px;
24
-//     top: 28px;
25
-//     font-size: 20px;
26
-//     color: @whiteColor;
27
-//     .card-star-image {
28
-//       padding-left: 6px;
29
-//       width: 21px;
30
-//       height: 21px;
31
-//     }
32
-//     .card-star-text {
33
-//       padding-left: 10px;
34
-//       font-size: 20px;
35
-//       color: #333;
36
-//       font-weight: 700;
37
-//     }
38
-//   }
39
-
40
-//   .left-complete-one {
41
-//     padding-top: 85px;
42
-//     padding-bottom: 43px;
43
-//     position: relative;
44
-//     display: flex;
45
-//     background: @whiteColor;
46
-//     background: radial-gradient(circle at top right, transparent 15px, #fff 0 ) top
47
-//         right,
48
-//       radial-gradient(circle at bottom right, transparent 15px, #fff 0 ) bottom
49
-//         right;
50
-//     background-size: 100% 60%;
51
-//     background-repeat: no-repeat;
52
-
53
-//     width: 80%;
54
-//     border-radius: 15px 0px 0px 15px;
55
-//     // border-radius: 12px;
56
-
57
-//     align-items: center;
58
-//     .left-image-1 {
59
-//       width: 145px;
60
-//       height: 44px;
61
-//       position: absolute;
62
-//       top: 22px;
63
-//     }
64
-//     .left-viewText {
65
-//       // background-image: url(@Image-ProCard_hot);
66
-//       // width: 287px;
67
-//       width: auto;
68
-//       height: 44.3px;
69
-//       position: absolute;
70
-//       left: 1px;
71
-//       top: 28px;
72
-//       font-size: 20px;
73
-//       color: @whiteColor;
74
-//     }
75
-//     //图片
76
-//     .title-image {
77
-//       height: 144px;
78
-//       margin-left: 20px;
79
-//       border-radius: 24px;
80
-//       overflow: hidden;
81
-//       position: relative;
82
-
83
-//       .image-1 {
84
-//         width: 144px;
85
-//         height: 144px;
86
-//         margin: 0;
87
-//       }
88
-//       .image-2 {
89
-//         width: 89px;
90
-//         height: 34px;
91
-//         position: absolute;
92
-//         left: 0;
93
-//         top: 0;
94
-//       }
95
-//     }
96
-//     // 商品标题
97
-//     .title-content {
98
-//       // padding: 84px 0 56px 20px;
99
-//       padding-left: 18px;
100
-
101
-//       .Pro-title {
102
-//         .title-text {
103
-//           width: 375px;
104
-//           overflow: hidden;
105
-//           text-overflow: ellipsis;
106
-//           // display: -webkit-box; //必须要
107
-//           -webkit-line-clamp: 1;
108
-//           -webkit-box-orient: vertical;
109
-//           // word-break: break-all; /* 多出文本省略号代替 */
110
-//           text-align: left;
111
-//           font-size: 24px;
112
-//           // padding-bottom: 10px;
113
-//         }
114
-//       }
115
-//       .title-money {
116
-//         // padding-top: 34px;
117
-//         font-size: 24px;
118
-//         // color: red;
119
-//         font-weight: 800;
120
-//       }
121
-//       .title-money-2 {
122
-//         font-size: 18px;
123
-//         color: rgba(102, 102, 102, 0.8);
124
-
125
-//         padding-left: 10px;
126
-//         text-decoration: line-through;
127
-//       }
128
-
129
-//       .title-time {
130
-//         font-size: 24px;
131
-//         // padding-top: 20px;
132
-//         color: #c0c8d3;
133
-//       }
134
-//       .title-position-on {
135
-//         display: flex;
136
-//         font-size: 20px;
137
-//         .title-position {
138
-//           width: 18px;
139
-//           height: 24px;
140
-//           padding-right: 10px;
141
-//           padding-top: 5px;
142
-//         }
143
-//         .title-position-image {
144
-//           align-items: center;
145
-//           font-size: 20px;
146
-//           color: #333;
147
-//         }
148
-//         // .title-on {
149
-//         //   // margin-bottom: 10px;
150
-//         //   padding-top: 5px;
151
-//         //   padding-left: 40px;
152
-//         //   width: 21px;
153
-//         //   height: 21px;
154
-//         //   padding-right: 10px;
155
-//         // }
156
-// .title-on {
157
-//   width: 21px;
158
-//   height: 21px;
159
-//   padding-right: 10px;
160
-// }
161
-//         .title-on-text {
162
-//           align-items: center;
163
-
164
-//           font-size: 20px;
165
-//           color: #333;
166
-//         }
167
-//       }
168
-//     }
169
-//   }
170
-//   // .left-complete-one:nth-child(2) {
171
-//   //   background: rgb(182, 0, 0);
172
-//   //   padding-top: 10px;
173
-//   // }
174
-// }
175
-
176
-// .right-complete-two {
177
-//   background: @whiteColor;
178
-//   background: radial-gradient(circle at top left, transparent 15px, #fff 0 ) top
179
-//       left,
180
-//     radial-gradient(circle at bottom left, transparent 15px, #fff 0 ) bottom left;
181
-//   background-size: 100% 60%;
182
-//   background-repeat: no-repeat;
183
-//   width: 129px;
184
-//   border-radius: 0 15px 15px 0;
185
-//   position: relative;
186
-//   //右面部分
187
-//   .right-content {
188
-//     // width: 50%;
189
-//     height: 134px;
190
-//     position: absolute;
191
-//     top: calc(50% - 45px);
192
-//     left: calc(50% - 30px);
193
-//     .right-image {
194
-//       width: 35px;
195
-//       height: 34px;
196
-//       margin-left: calc(50% - 41.5px);
197
-//     }
198
-
199
-//     .right-title {
200
-//       font-weight: 700;
201
-//       width: 110px;
202
-//       font-size: 24px;
203
-//       padding-top: 15px;
204
-//       text-align: center;
205
-//       position: relative;
206
-//       left: -22px;
207
-//     }
208
-//   }
209
-// }
210
-// //线条
211
-// .right-complete-two::after {
212
-//   content: "";
213
-//   position: absolute;
214
-//   top: 15px;
215
-//   margin: 26px auto;
216
-//   height: 70%;
217
-//   border-left: 1px dashed #595959;
218
-// }
219
-
220
-// .wrapper-tourist {
221
-//   margin-top: 40px;
222
-//   display: flex;
223
-//   position: relative;
224
-//   // margin-top: 600px;
225
-//   // margin: 30px auto;
226
-//   width: 100%;
227
-
228
-//   // box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
229
-//   // filter: drop-shadow(5px 8px 6px rgb(202, 202, 202));
230
-//   filter: drop-shadow(0 0 0.9rem rgba(0, 0, 0, 0.12));
231
-//   .card-box-star {
232
-//     position: absolute;
233
-//     width: auto;
234
-//     height: 44.3px;
235
-//     position: absolute;
236
-//     left: 183px;
237
-//     top: 28px;
238
-//     font-size: 20px;
239
-//     color: @whiteColor;
240
-//     .card-star-image {
241
-//       padding-left: 6px;
242
-//       width: 21px;
243
-//       height: 21px;
244
-//     }
245
-//     .card-star-text {
246
-//       padding-left: 10px;
247
-//       font-size: 20px;
248
-//       color: #333;
249
-//       font-weight: 700;
250
-//     }
251
-//   }
252
-
253
-//   .left-complete-one {
254
-//     padding-top: 35px;
255
-//     padding-bottom: 43px;
256
-//     position: relative;
257
-//     display: flex;
258
-//     background: @whiteColor;
259
-//     background: radial-gradient(circle at top right, transparent 15px, #fff 0 ) top
260
-//         right,
261
-//       radial-gradient(circle at bottom right, transparent 15px, #fff 0 ) bottom
262
-//         right;
263
-//     background-size: 100% 60%;
264
-//     background-repeat: no-repeat;
265
-
266
-//     width: 80%;
267
-//     border-radius: 15px 0px 0px 15px;
268
-//     // border-radius: 12px;
269
-
270
-//     align-items: center;
271
-//     .left-image-1 {
272
-//       width: 145px;
273
-//       height: 44px;
274
-//       position: absolute;
275
-//       top: 22px;
276
-//     }
277
-//     .left-viewText {
278
-//       // background-image: url(@Image-ProCard_hot);
279
-//       // width: 287px;
280
-//       width: auto;
281
-//       height: 44.3px;
282
-//       position: absolute;
283
-//       left: 1px;
284
-//       top: 28px;
285
-//       font-size: 20px;
286
-//       color: @whiteColor;
287
-//     }
288
-//     //图片
289
-//     .title-image {
290
-//       // width: 145px;
291
-//       // margin-left: 20px;
292
-//       // overflow: hidden;
293
-//       // position: relative;
294
-//       height: 144px;
295
-//       margin-left: 20px;
296
-//       border-radius: 24px;
297
-//       overflow: hidden;
298
-//       position: relative;
299
-//       .image-1 {
300
-//         // width: 100%;
301
-//         // height: 145px;
302
-//         // border-radius: 10px;
303
-
304
-//         width: 144px;
305
-//         height: 144px;
306
-//         margin: 0;
307
-//       }
308
-//       .image-2 {
309
-//         width: 89px;
310
-//         height: 34px;
311
-//         position: absolute;
312
-//         left: 0;
313
-//         top: 0;
314
-//       }
315
-//     }
316
-//     // 商品标题
317
-//     .title-content {
318
-//       // padding: 84px 0 56px 20px;
319
-//       padding-left: 18px;
320
-
321
-//       .Pro-title {
322
-//         .title-text {
323
-//           width: 375px;
324
-//           overflow: hidden;
325
-//           text-overflow: ellipsis;
326
-//           // display: -webkit-box; //必须要
327
-//           -webkit-line-clamp: 1;
328
-//           -webkit-box-orient: vertical;
329
-//           // word-break: break-all; /* 多出文本省略号代替 */
330
-//           text-align: left;
331
-//           font-size: 24px;
332
-//           // padding-bottom: 10px;
333
-//         }
334
-//       }
335
-//       .title-money {
336
-//         // padding-top: 34px;
337
-//         font-size: 24px;
338
-//         // color: red;
339
-//         font-weight: 800;
340
-//       }
341
-//       .title-money-2 {
342
-//         font-size: 18px;
343
-//         color: rgba(102, 102, 102, 0.8);
344
-
345
-//         padding-left: 10px;
346
-//         text-decoration: line-through;
347
-//       }
348
-
349
-//       .title-time {
350
-//         font-size: 24px;
351
-//         // padding-top: 20px;
352
-//         color: #c0c8d3;
353
-//       }
354
-//       .title-position-on {
355
-//         display: flex;
356
-//         font-size: 20px;
357
-//         .title-position {
358
-//           width: 18px;
359
-//           height: 24px;
360
-//           padding-right: 10px;
361
-//           padding-top: 5px;
362
-//         }
363
-//         .title-position-image {
364
-//           align-items: center;
365
-//           font-size: 20px;
366
-//           color: #333;
367
-//         }
368
-//         .title-on {
369
-//           // margin-bottom: 10px;
370
-//           padding-top: 5px;
371
-//           padding-left: 40px;
372
-//           width: 21px;
373
-//           height: 21px;
374
-//           padding-right: 10px;
375
-//         }
376
-//       }
377
-//       .title-on-text {
378
-//         align-items: center;
379
-//         font-size: 20px;
380
-//         color: #333;
381
-//       }
382
-//     }
383
-//   }
384
-// }
385
 .View-box-LR {
2
 .View-box-LR {
3
+  margin: 30px 0;
386
   .left-View-box {
4
   .left-View-box {
387
     .wrapper {
5
     .wrapper {
388
       display: flex;
6
       display: flex;
818
     }
436
     }
819
   }
437
   }
820
 }
438
 }
439
+.cpn-card-text {
440
+  font-size: 24px;
441
+  font-weight: 400;
442
+  color: #333333;
443
+  line-height: 40px;
444
+  vertical-align: baseline;
445
+
446
+  & > text {
447
+    display: inline-block;
448
+
449
+    & + text {
450
+      margin-left: 8px;
451
+    }
452
+  }
453
+  &_mn {
454
+    font-size: 24px;
455
+    font-weight: bold;
456
+    color: #333333;
457
+  }
458
+
459
+  &_rm {
460
+    font-size: 18px;
461
+    font-weight: 400;
462
+    text-decoration: line-through;
463
+    color: #666666;
464
+  }
465
+}
466
+
467
+.cpn-md-act {
468
+  display: flex;
469
+  margin-top: 10px;
470
+  position: relative;
471
+
472
+  & > view {
473
+    flex: 1;
474
+  }
475
+  .wdscbaozan{
476
+  .title-on {
477
+    width: 28px;
478
+    height: 28px;
479
+    padding-right: 10px;
480
+    position: relative;
481
+    top: 0.1em;
482
+  }
483
+  .title-on-text {
484
+    align-items: center;
485
+    font-size: 22px;
486
+    color: #333;
487
+  }
488
+}
489
+}

+ 10
- 1
src/components/CouponCard/Card/style.less Parādīt failu

2
 // 开孔半径
2
 // 开孔半径
3
 @radius-size: 16px;
3
 @radius-size: 16px;
4
 
4
 
5
+// 圆角
6
+@border-radius: 12px;
7
+
5
 .coupon-card {
8
 .coupon-card {
6
   display: flex;
9
   display: flex;
7
   filter: drop-shadow(0 0 0.9rem rgba(0, 0, 0, 0.12));
10
   filter: drop-shadow(0 0 0.9rem rgba(0, 0, 0, 0.12));
8
-  border-radius: 12px;
11
+  border-radius: @border-radius;
9
 
12
 
10
   & + & {
13
   & + & {
11
     margin-top: 36px;
14
     margin-top: 36px;
25
                   bottom right;
28
                   bottom right;
26
     background-size: 100% 60%;
29
     background-size: 100% 60%;
27
     background-repeat: no-repeat;
30
     background-repeat: no-repeat;
31
+
32
+    border-top-left-radius: @border-radius;
33
+    border-bottom-left-radius: @border-radius;
28
   }
34
   }
29
 
35
 
30
   &_action {
36
   &_action {
37
                   bottom left;
43
                   bottom left;
38
     background-size: 100% 60%;
44
     background-size: 100% 60%;
39
     background-repeat: no-repeat;
45
     background-repeat: no-repeat;
46
+
47
+    border-top-right-radius: @border-radius;
48
+    border-bottom-right-radius: @border-radius;
40
     
49
     
41
     // 避开孔位置, 方便子元素居中
50
     // 避开孔位置, 方便子元素居中
42
     // padding-left: @radius-size * 2;
51
     // padding-left: @radius-size * 2;

+ 1
- 1
src/components/CouponCard/Media/Body.jsx Parādīt failu

8
 
8
 
9
   return (
9
   return (
10
     <View className='coupun-media_body'>
10
     <View className='coupun-media_body'>
11
-      <Star score={(star).toFixed(1)} style={{ position: 'absolute', top: '26rpx', left: 0 }} />
11
+      {star?<Star score={(star).toFixed(1)} style={{ position: 'absolute', top: '26rpx', left: 0 }} />:''}      
12
       <View>
12
       <View>
13
         {props.children}
13
         {props.children}
14
       </View>
14
       </View>

+ 1
- 1
src/components/CouponCard/Media/Header.jsx Parādīt failu

9
 
9
 
10
   return (
10
   return (
11
     <View className='coupun-media_header'>
11
     <View className='coupun-media_header'>
12
-      <Cashback money={cashback} style={{ position: 'absolute', top: '10px', left: 0 }} />
12
+      {cashback?<Cashback money={cashback} style={{ position: 'absolute', top: '10px', left: 0 }} />:''}
13
       <View className='coupun-media_thumb'>
13
       <View className='coupun-media_thumb'>
14
         <BadgeTag type={badge} />
14
         <BadgeTag type={badge} />
15
         <Image src={image} />
15
         <Image src={image} />

+ 37
- 63
src/components/foodCards/foodCards.jsx Parādīt failu

1
 import useSave from "@/utils/hooks/useSave"
1
 import useSave from "@/utils/hooks/useSave"
2
 import Taro from '@tarojs/taro'
2
 import Taro from '@tarojs/taro'
3
-import Star from '@/components/Star/Star.jsx'
4
-import pay from '@/assets/icons/housemantj/pay.png'
5
-import msTip from '@/assets/icons/housemantj/foodtip.png'
6
-import wz from '@/assets/icons/housemantj/location.png'
7
-import ax from '@/assets/icons/housemantj/onlove.png'
8
-import good from '@/assets/icons/housemantj/touristGood.png'
3
+import { View, Text } from '@tarojs/components'
4
+import CouponCard from '@/components/CouponCard'
5
+import Location from '@/components/Location'
6
+import SaveIcon from '@/components/SaveIcon'
7
+import Pay from '@/assets/icons/housemantj/pay.png'
9
 import './style.less'
8
 import './style.less'
10
 
9
 
11
 
10
 
11
+const CouponMedia = CouponCard.Media
12
+const Action = CouponCard.Action
12
 
13
 
13
 //套餐卡片
14
 //套餐卡片
14
 export default (props) => {
15
 export default (props) => {
15
-  const { item,st,det } = props
16
+  const { item, st, det, editable, goshop } = props
16
   const { shopId } = props.item
17
   const { shopId } = props.item
17
-  const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.packageId)
18
-
19
   const goFood = () => {
18
   const goFood = () => {
20
-    const page = Taro.getCurrentPages()
21
-    const currentPage = page[page.length - 1];//第一位是首页,最后一位是当前页面
22
-    const pagesUrl = `/${currentPage.route}`;
23
-    if (pagesUrl === '/pages/details/foodDetails/foodDetails') {
24
-
25
-    } else {
26
-      Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
27
-
28
-    }
19
+    Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
29
   }
20
   }
21
+  const handlePayClick = () => {
22
+    Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}` })
23
+  }
24
+  const PayAction = <Action.Icon icon={Pay} text='支付' onClick={handlePayClick} />
30
   return (
25
   return (
31
-    <view className='foodCard'>
32
-      <view className='fCleft'>
33
-        <view className='fCleft_header'>
34
-          <view style={{flex:"none"}}>
35
-            <view className='backMoney'>
36
-              返现¥{(item.cashback / 100).toFixed(2)}
37
-            </view>
38
-          </view>
39
-          <view>
40
-            <view className='appraise'>
41
-              <Star star={st} />
42
-              <text className='storezf'>{st}</text>
43
-            </view>
44
-          </view>
45
-        </view>
46
-        <view className='fCleft_body'>
47
-          <view className='contentImg' onClick={() => { goFood() }}>
48
-            <image src={item.poster} className='img1'></image>
49
-            <image src={msTip} className='mstip'></image>
50
-          </view>
51
-          <view className='neirong'>
52
-            <view className='textword' onClick={() => { goFood() }} >{(item.description).toString().length > 22 ? (item.description).substring(0, 22) + '...' : (item.description)}</view>
53
-            <view className='jiage' onClick={() => { goFood() }} >
54
-              <text className='rmb' >¥</text>
55
-              <text className='p1'><text className='price' >{(item.actualPrice / 100).toFixed(2)}</text>元&nbsp;&nbsp;</text>
56
-              <text className='p2'>门市价<text className='oldprice' >{(item.standardPrice / 100).toFixed(2)}</text>元</text>
57
-            </view>
58
-            <view className='address'>
59
-              <image className='dw' src={wz} />
60
-              <text className='wz'>{det.areaName=='南京市'?det.areaName:det.areaPName+'/'+det.areaName}</text>
61
-              <view style={{ display: 'inline-block' }} onClick={toggleSave}>
62
-                <image className='star' src={isSaved > 0 ? ax : good}></image>
63
-                <text className='collection'>{isSaved > 0 ? '已收藏' : '加入收藏'}</text>
64
-              </view>
65
-            </view>
66
-          </view>
67
-        </view>
68
-      </view>
69
-      <view className='fCright' onClick={() => { Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}`}); }}>
70
-        <image src={pay} />
71
-        <view>支付</view>
72
-      </view>
73
-      <view className='columnLine'></view>
74
-    </view>
75
-
26
+    <View style={{margin:'15px 5px'}}>
27
+      <CouponCard action={PayAction}>
28
+        <CouponMedia onClick={goshop ? '' : goFood}>
29
+          <CouponMedia.Header
30
+            cashback={item.cashback}
31
+            image={item.poster}
32
+            badge='food'
33
+          />
34
+          <CouponMedia.Body star={st}>
35
+            <View className='cpn-card-text'>
36
+              {(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}
37
+            </View>
38
+            <View className='cpn-card-text' style={{ marginTop: '10rpx' }}>
39
+              <Text className='cpn-card-text_mn'>¥{`${(item.actualPrice / 100)?.toFixed(2)}元`}</Text>
40
+              <Text className='cpn-card-text_rm'>{`门市价${(item.standardPrice / 100)?.toFixed(2)}元`}</Text>
41
+            </View>
42
+            <View className='cpn-md-act'>
43
+              <Location {...det} />
44
+              <SaveIcon saved={item.isSaved > 0} targetType='shop_package' editable={editable} targetId={item.packageId} />
45
+            </View>
46
+          </CouponMedia.Body>
47
+        </CouponMedia>
48
+      </CouponCard>
49
+    </View>
76
   )
50
   )
77
 }
51
 }

+ 28
- 155
src/components/foodCards/style.less Parādīt failu

1
-.foodCard{
2
-  background: #FFF;
3
-  border-radius: 12px;
4
-  position: relative;
5
-  margin: 15px 15px;
6
-  margin-bottom: 30px;
7
-  overflow: hidden;
8
-  // filter: drop-shadow(0px 6px 13px rgba(0, 0, 0, 0.12));
9
-  // box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
10
-  background: radial-gradient(circle at 82% top,transparent 20px,#fff 0) top,
11
-              radial-gradient(circle at 82% bottom,transparent 20px,#fff 0) bottom;
12
-  background-repeat: no-repeat;
13
-  background-size: 100% 50%;
14
-  box-sizing: border-box;
15
-  display: flex;
16
-
17
-  .fCleft{
18
-    flex: auto;
1
+.cpn-card-text {
2
+  font-size: 24px;
3
+  font-weight: 400;
4
+  color: #333333;
5
+  line-height: 40px;
6
+  vertical-align: baseline;
19
 
7
 
20
-    &_header {
21
-      display: flex;
22
-      margin: 22px 0;
8
+  & > text {
9
+    display: inline-block;
23
 
10
 
24
-      & > view {
25
-        flex: 1;
26
-      }
27
-    }
28
-
29
-    &_body {
30
-      display: flex;
31
-      padding: 0 20px 43px 20px;
32
-    }
33
-    
34
-    .backMoney{
35
-      display: inline-block;
36
-
37
-      font-size: 24px;
38
-      font-weight: bold;
39
-      color: #FFF;     
40
-      padding: 12px 30px 9px 1em;
41
-      background:url('../../assets/icons/housemantj/fximg.png') no-repeat;
42
-      background-size: 100% 100%;
11
+    & + text {
12
+      margin-left: 8px;
43
     }
13
     }
14
+  }
15
+  &_mn {
16
+    font-size: 24px;
17
+    font-weight: bold;
18
+    color: #333333;
19
+  }
44
 
20
 
45
-    .appraise {
46
-      display: inline-block;
47
-      image{
48
-        width: 21px;
49
-        height: 21px;
50
-        margin-right: 10px;
51
-      }
52
-      text{
53
-        font-size: 24px;           
54
-        font-weight: bold;
55
-        color: #020200;
56
-      }
57
-    }
21
+  &_rm {
22
+    font-size: 18px;
23
+    font-weight: 400;
24
+    text-decoration: line-through;
25
+    color: #666666;
26
+  }
27
+}
58
 
28
 
59
-    .contentImg{
60
-      flex: none;
61
-      position: relative;
62
-      width: 144px;
63
-      
64
-      .img1{
65
-        width: 144px;
66
-        height: 144px;
67
-        border-radius: 24px;
68
-      }
69
-      .mstip{
70
-          width:99px;
71
-          height:37px;
72
-          position: absolute;
73
-          left: 0;          
74
-      }
75
-    }
76
-    .neirong{
77
-      flex: auto;
78
-      margin-left: 1em;
29
+.cpn-md-act {
30
+  display: flex;
31
+  margin-top: 10px;
79
 
32
 
80
-      .textword{
81
-        font-size: 24px;           
82
-        color: #333;
83
-        margin: 0 21px 0 0;
84
-        height: 84px;
85
-      }
86
-      .jiage{
87
-        line-height: 20px;
88
-        font-weight: bold;
89
-        color: #333;
90
-        .rmb{
91
-          font-size: 24px;             
92
-          margin-right:8px;
93
-        }
94
-        .p1{
95
-          font-size: 24px;     
96
-        }
97
-        .p2{
98
-          font-size: 18px;             
99
-          text-decoration: line-through;
100
-          opacity: 0.8;
101
-          font-weight: 400;
102
-          color: #666;
103
-        }
104
-      }
105
-      .address{
106
-        line-height: 0;
107
-        margin-top: 18px;
108
-        .dw{
109
-          width: 16px;
110
-          height: 20px;
111
-          position: relative;
112
-          top:3px;
113
-          margin-right: 10px;
114
-        }
115
-        .wz{
116
-          font-size: 20px;             
117
-          color: #333;
118
-        }
119
-        .star{
120
-          width: 21px;
121
-          height: 21px;
122
-          margin: 0 10px 0 40px;
123
-          position: relative;
124
-          top: 3px;
125
-        }
126
-        .collection{
127
-          font-size: 20px;             
128
-          color: #333333;
129
-        }
130
-      }
131
-    }
132
-  }
133
-  .fCright{
134
-    flex: none;
135
-    width: 18%;
136
-    line-height: 0;
137
-    image{
138
-      display: block;
139
-      width:35px;
140
-      height:32px;
141
-      margin: 0 auto;
142
-      margin-top: 100%;
143
-    }
144
-    view{
145
-      font-size: 24px;
146
-      line-height: 23px;
147
-      font-weight: bold;
148
-      color: #202020;
149
-      margin-top: 19px;
150
-      text-align: center;
151
-    }
152
-  }
153
-  .columnLine{
154
-    flex: none;
155
-    width: 1px;
156
-    height: 50%;
157
-    border-right: 2px dashed #595959;
158
-    opacity: 0.12;
159
-    position: absolute;
160
-    right: 18%;
161
-    bottom: 25%;
33
+  & > view {
34
+    flex: 1;
162
   }
35
   }
163
 }
36
 }

+ 1
- 1
src/pages/details/foodDetails/foodDetails.jsx Parādīt failu

226
                     <text>返现套餐</text>
226
                     <text>返现套餐</text>
227
                   </view>
227
                   </view>
228
                   {(spackage || []).map((item) => (
228
                   {(spackage || []).map((item) => (
229
-                    <Cards key={item.packageId} st={star} item={item} det={detail} />
229
+                    <Cards key={item.packageId} editable='1' st={star} goshop='1' item={item} det={detail} />
230
                   ))}
230
                   ))}
231
                   <view
231
                   <view
232
                     className='showMore'
232
                     className='showMore'

+ 0
- 1
src/pages/details/mjDetails/sceneryDetails.jsx Parādīt failu

156
             <view className='title'>
156
             <view className='title'>
157
               <image src={titlems} />老板推荐好吃的
157
               <image src={titlems} />老板推荐好吃的
158
             </view>
158
             </view>
159
-
160
             {(recommend || []).map((item) => <Cards item={item} det={item} st={parseFloat(item.score.toFixed(1))} />)}
159
             {(recommend || []).map((item) => <Cards item={item} det={item} st={parseFloat(item.score.toFixed(1))} />)}
161
           </view>
160
           </view>
162
           <view className='bottom'>这是我的底线</view>
161
           <view className='bottom'>这是我的底线</view>

+ 1
- 1
src/pages/details/mjDetails/sceneryDetails.less Parādīt failu

126
   color: #202020;
126
   color: #202020;
127
   text-align: center;
127
   text-align: center;
128
   position: absolute;
128
   position: absolute;
129
-  bottom: -100px;
129
+  bottom: -130px;
130
   padding-top: 77px;
130
   padding-top: 77px;
131
   padding-bottom: 20px;
131
   padding-bottom: 20px;
132
   .moreTip{
132
   .moreTip{