吃个甘蔗嚼一年 3 年前
父节点
当前提交
8ca9b0c28d

+ 2
- 2
src/components/BossCard/index.jsx 查看文件

@@ -54,7 +54,7 @@ export default (props) => {
54 54
             <Star star={star} />
55 55
             <text className='card-star-text' >{star}</text>
56 56
           </view>
57
-          <view className='title-image'  onClick={() => { goFood() }}>
57
+          <view className='title-image' onClick={() => { goFood() }}>
58 58
             <image className='image-1' mode='scaleToFill' src={item.poster}></image>
59 59
             <image className='image-2' src={food}></image>
60 60
           </view>
@@ -62,7 +62,7 @@ export default (props) => {
62 62
             <view className='Pro-title' onClick={() => { goFood() }} >
63 63
               <view className='title-text'>{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</view>
64 64
             </view>
65
-            <text className='title-money' >¥{(item.actualPrice / 100)?.toFixed}元<text className='title-money-2'>门市价{(item.standardPrice / 100)?.toFixed(2)}元</text></text>
65
+            <text className='title-money' >¥{(item.actualPrice / 100)?.toFixed(2)}元<text className='title-money-2'>门市价{(item.standardPrice / 100)?.toFixed(2)}元</text></text>
66 66
             <view className='title-position-on'>
67 67
               <image className='title-position' src={position} />
68 68
               <text className='title-position-image'>{city.areaPName}/{city.areaName}</text>

src/components/CollectList/FoodCollect/index.jsx → src/components/CollectList/MyCollect/index.jsx 查看文件

@@ -5,7 +5,7 @@ import useLike from "@/utils/hooks/useLike"
5 5
 import { getShopDetail, getShopcity } from '@/services/home'
6 6
 import { useState, useEffect } from 'react'
7 7
 import { View } from '@tarojs/components'
8
-
8
+import formatPrice from "@/utils/formatPrice";
9 9
 import Star from '@/components/Star/Star.jsx'
10 10
 import position from '@/assets/icons/GuideCheck/position_logo.png'
11 11
 import SeeDetails from '@/assets/icons/GuideCheck/SeeDetails.png'
@@ -24,39 +24,11 @@ import './style.less'
24 24
 
25 25
 export default (props) => {
26 26
   const { item, cardNavigateTo } = props
27
-  const shopId = props.item
28
-  const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.targetId)
29
-  const [isLike, toggleLike] = useLike(item.isLike, 'shop', item.targetId)
27
+  // const [isSaved, toggleSave] = useSave(item.isSaved, 'shop_package', item.targetId)
28
+  const [isLike, toggleLike] = useLike(item.isLike, 'tourist', item.targetId)
30 29
 
31
-  const [city, setCity] = useState({})
32
-  const [detail, setDetail] = useState({})
33
-  const [hotStyle, setHotStyle] = useState('none')
34 30
   const targetType = item.targetType
35
-  // item.targetType !== 'shop_package'
36
-
37
-
38
-  const goFood = () => {
39
-    // Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${shopId}` })
40
-  }
41
-
42
-  // useEffect(() => {
43
-  //   if (shopId) {
44
-  //     getShopDetail(item.shopId).then((res) => {
45
-  //       setDetail(res)
46
-  //       getShopcity(res.cityId).then((x) => {
47
-  //         setCity(x)
48
-  //       })
49
-  //     })
50
-  //   }
51
-
52
-  // }, [shopId, targetType])
53 31
 
54
-  // useEffect(() => {
55
-  //   if (item.targetType !== 'shop_package') {
56
-  //     console.log(item.targetType);
57
-  //   }
58
-
59
-  // }, [item.targetType])
60 32
 
61 33
 
62 34
 
@@ -69,22 +41,22 @@ export default (props) => {
69 41
             <view class='left-complete-one'   >
70 42
               <image className='left-image-1' src={ProCard_hot} style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} ></image>
71 43
               <view className='left-viewText'  >
72
-                返现¥{(item.cashback / 100).toFixed(2)}
44
+                返现¥{formatPrice(item.cashback)}
73 45
               </view>
74 46
               {/* 评分 */}
75 47
               <view className='card-box-star' style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} >
76 48
                 <Star star={star} />
77 49
                 <text className='card-star-text' >{star}</text>
78 50
               </view>
79
-              <view className='title-image' onClick={() => { goFood() }}>
51
+              <view className='title-image' >
80 52
                 <image className='image-1' mode='scaleToFill' src={item.poster}></image>
81 53
                 <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
82 54
               </view>
83 55
               <view className='title-content'>
84
-                <view className='Pro-title' onClick={() => { goFood() }} >
56
+                <view className='Pro-title'  >
85 57
                   <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
86 58
                 </view>
87
-                <text className='title-money' >¥{(item.actualPrice / 100)?.toFixed(2)}元<text className='title-money-2'>门市价{(item.standardPrice / 100)?.toFixed(2)}元</text></text>
59
+                <text className='title-money' >¥{formatPrice(item.actualPrice)}元<text className='title-money-2'>门市价{formatPrice(item.standardPrice)}元</text></text>
88 60
                 <view className='title-position-on'>
89 61
                   <image className='title-position' src={position} />
90 62
                   <text className='title-position-image'>{item.areaPName}/{item.areaName}</text>
@@ -92,7 +64,7 @@ export default (props) => {
92 64
               </view>
93 65
             </view>
94 66
             <view class='right-complete-two'>
95
-              <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}` }); }}>
67
+              <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` }); }}>
96 68
                 {/* <view className='right-number'>×1</view> */}
97 69
                 <image className='right-image' src={SeeDetails} />
98 70
                 <view className='right-title'>查看详情</view>
@@ -106,30 +78,27 @@ export default (props) => {
106 78
           targetType !== "shop_package" && (
107 79
             <view class='wrapper-tourist'>
108 80
               <view class='left-complete-one'   >
109
-                <view className='title-image' onClick={() => { goFood() }}>
81
+                <view className='title-image'>
110 82
                   <image className='image-1' mode='scaleToFill' src={item.poster}></image>
111 83
                   <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
112 84
                 </view>
113 85
                 <view className='title-content'>
114
-                  <view className='Pro-title' onClick={() => { goFood() }} >
86
+                  <view className='Pro-title'  >
115 87
                     <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
116 88
                   </view>
117
-                  <text className='title-money' >¥{(item.actualPrice / 100)?.toFixed(2)}元<text className='title-money-2'>门市价{(item.standardPrice / 100)?.toFixed(2)}元</text></text>
118
-                  <view onClick={toggleSave}>
119
-                    <image className='title-on' src={isLike > 0 ? baozan : weibaozan} />
120
-                    <text onClick={toggleLike} className='title-on-text'>{isLike > 0 ? '已爆赞' : '爆赞'}</text>
89
+                  <text className='title-money' >¥{formatPrice(item.actualPrice)}元<text className='title-money-2'>门市价{formatPrice(item.standardPrice)}元</text></text>
90
+                  <view onClick={toggleLike}>
91
+                    <image className='title-on' src={isLike === 1 ? baozan : weibaozan} />
92
+                    <text className='title-on-text'>{isLike === 1 ? '已爆赞' : '爆赞'}</text>
121 93
                   </view>
122 94
                   <view className='title-position-on'>
123
-
124 95
                     <image className='title-position' src={position} />
125
-
126 96
                     <text className='title-position-image'>{item.areaPName}/{item.areaName}</text>
127
-
128 97
                   </view>
129 98
                 </view>
130 99
               </view>
131 100
               <view class='right-complete-two'>
132
-                <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/PayOrder/index?packageId=${item.packageId}` }); }}>
101
+                <view className='right-content' onClick={() => { Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` }); }}>
133 102
                   {/* <view className='right-number'>×1</view> */}
134 103
                   <image className='right-image' src={SeeDetails} />
135 104
                   <view className='right-title'>查看详情</view>

src/components/CollectList/FoodCollect/style.less → src/components/CollectList/MyCollect/style.less 查看文件


+ 3
- 30
src/pages/MineUserAll/Collect/index.jsx 查看文件

@@ -2,31 +2,14 @@
2 2
 import CustomNav from '@/components/CustomNav'
3 3
 import { useState, useEffect } from "react";
4 4
 import withLayout from '@/layouts'
5
-
6
-import Taro from '@tarojs/taro'
7
-import image from '@/assets/icons/ProCard/8kb.jpg'
8
-import Pay from '@/assets/icons/GuideCheck/Pay_logo.png'
9
-import SeeDetails from '@/assets/icons/GuideCheck/SeeDetails.png'
10 5
 import { getCollectList } from '@/services/home'
11
-
12
-import Attractions from '@/assets/icons/GuideCheck/Attractions.png'
13
-import food from '@/assets/icons/ProCard/food.png'
14
-import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
15
-import position from '@/assets/icons/GuideCheck/position_logo.png'
16
-import starOn from '@/assets/icons/GuideCheck/starOn.png'
17
-import starOff from '@/assets/icons/GuideCheck/starOff.png'
18
-import FoodCollect from '@/components/CollectList/FoodCollect'
19
-
20
-
6
+import MyCollect from '@/components/CollectList/MyCollect'
21 7
 import './style.less'
22 8
 
23
-
24 9
 export default withLayout((props) => {
25 10
   const { router, person, location } = props
26
-  console.log("🚀 ~ file: index.jsx ~ line 27 ~ withLayout ~ props", props)
27 11
   const [collectContent, setCollectContent] = useState([])
28
-
29
-
12
+  console.log("🚀 ~ file: index.jsx ~ line 12 ~ withLayout ~ collectContent", collectContent)
30 13
 
31 14
   useEffect(() => {
32 15
     getCollectList({
@@ -39,24 +22,14 @@ export default withLayout((props) => {
39 22
     })
40 23
   }, [location])
41 24
 
42
-
43
-
44
-
45 25
   return (
46 26
     <view className='box-content'>
47 27
       <CustomNav title='我的收藏' />
48
-
49 28
       <view>
50 29
         {
51
-          collectContent.map((item, index) => {
52
-            return <FoodCollect key={(index)} item={item} />
53
-          })
54
-
30
+          collectContent.map((item, index) => { return <MyCollect key={(index)} item={item} /> })
55 31
         }
56
-
57
-
58 32
       </view>
59
-
60 33
       <view className='foot'>
61 34
         已经到底了~
62 35
       </view>

+ 12
- 12
src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx 查看文件

@@ -1,6 +1,7 @@
1 1
 import BlackSpot from "@/assets/icons/GuideCheck/BlackSpot.png";
2 2
 import Taro from "@tarojs/taro";
3 3
 import { Button, Icon, Text, Textarea } from "@tarojs/components";
4
+import formatPrice from "@/utils/formatPrice";
4 5
 
5 6
 import { useState, useEffect } from "react";
6 7
 import withLayout from "@/layouts";
@@ -86,7 +87,7 @@ export default withLayout((props) => {
86 87
   const onRefund = () => {
87 88
     // console.log(explain, checkeds, "----onRefund----");
88 89
     refund(id, {
89
-      refundDecription: checkeds?.map(x=>options.filter(y=>y.key==x)[0]?.title).join(';'),
90
+      refundDecription: checkeds?.map(x => options.filter(y => y.key == x)[0]?.title).join(';'),
90 91
       refundReason: explain,
91 92
     }).then((res) => {
92 93
       Taro.showToast({
@@ -94,7 +95,7 @@ export default withLayout((props) => {
94 95
         icon: "none",
95 96
         duration: 2000,
96 97
       });
97
-      Taro.navigateBack({delta: 1})
98
+      Taro.navigateBack({ delta: 1 })
98 99
     });
99 100
   };
100 101
 
@@ -127,13 +128,13 @@ export default withLayout((props) => {
127 128
       </view>
128 129
       {/* 商品信息结束 */}
129 130
       <view>
130
-        {(list||[]).map((item) => {
131
+        {(list || []).map((item) => {
131 132
           return (
132 133
             <view class="wrapper" key={item.orderId}>
133 134
               <view class="left-complete-one">
134 135
                 <image className="left-image-1" src={ProCard_hot}></image>
135 136
                 <view className="left-viewText">
136
-                  返现¥{item.cashback / 100}
137
+                  返现¥{formatPrice(item.cashback)}
137 138
                 </view>
138 139
                 <view className="title-image">
139 140
                   <image
@@ -153,9 +154,9 @@ export default withLayout((props) => {
153 154
                     </view>
154 155
                   </view>
155 156
                   <text className="title-money">
156
-                    ¥{item.unitPrice / 100}元
157
+                    ¥{formatPrice(item.unitPrice)}元
157 158
                     <text className="title-money-2">
158
-                      门市价{item.standardPrice / 100}元
159
+                      门市价{formatPrice(item.standardPrice)}元
159 160
                     </text>
160 161
                   </text>
161 162
                   <view className="title-time">
@@ -188,11 +189,10 @@ export default withLayout((props) => {
188 189
         {options.map((x) => {
189 190
           return (
190 191
             <text
191
-              className={`Refund-star-view${x.key} ${
192
-                checkeds.indexOf(x.key) > -1
192
+              className={`Refund-star-view${x.key} ${checkeds.indexOf(x.key) > -1
193 193
                   ? "bg2"
194 194
                   : `Refund-star-view${x.key}`
195
-              }`}
195
+                }`}
196 196
               key={x.key}
197 197
               onClick={() => viewOK(x)}
198 198
             >
@@ -221,15 +221,15 @@ export default withLayout((props) => {
221 221
       </view>
222 222
       <view className="money-title">
223 223
         实付金额:{" "}
224
-        <text className="money-name">{totalPrice.charges / 100}元</text>
224
+        <text className="money-name">{formatPrice(totalPrice.charges)}元</text>
225 225
       </view>
226 226
       <view className="money-title">
227 227
         已获返现:{" "}
228
-        <text className="money-name">{totalPrice.cashback / 100}元</text>
228
+        <text className="money-name">{formatPrice(totalPrice.cashback)}元</text>
229 229
       </view>
230 230
       <view className="money-title">
231 231
         退款金额:{" "}
232
-        <text className="money-name">{totalPrice.refundPrice / 100}元</text>
232
+        <text className="money-name">{formatPrice(totalPrice.refundPrice)}元</text>
233 233
       </view>
234 234
       <view className="ul-li-text">
235 235
         <view className="ul-li-view"></view>

+ 6
- 6
src/pages/PayOrder/index.jsx 查看文件

@@ -117,7 +117,7 @@ export default withLayout((props) => {
117 117
         ).then((res) => {
118 118
           setPayInfo(res);
119 119
           requestPayment(res);
120
-        }).catch(()=>{
120
+        }).catch(() => {
121 121
           Taro.hideLoading()
122 122
           Taro.showToast({
123 123
             title: "支付失败",
@@ -130,7 +130,7 @@ export default withLayout((props) => {
130 130
         payOrder(orderId).then((res) => {
131 131
           setPayInfo(res);
132 132
           requestPayment(res);
133
-        }).catch(()=>{
133
+        }).catch(() => {
134 134
           Taro.hideLoading()
135 135
           Taro.showToast({
136 136
             title: "支付失败",
@@ -217,7 +217,7 @@ export default withLayout((props) => {
217 217
         </view>
218 218
       </Popup>
219 219
       <view class="coupon-list">
220
-        {(list||[]).map((item) => {
220
+        {(list || []).map((item) => {
221 221
           return (
222 222
             <view class="wrapper" key={item.orderId}>
223 223
               <view class="left-complete-one">
@@ -291,17 +291,17 @@ export default withLayout((props) => {
291 291
         <view className="button-box-button-box">
292 292
           <view className="button-text-image">
293 293
             <text className="button-text-money-hot">
294
-              返现¥{(totalPrice?.cashback || 0) / 100}
294
+              返现¥{formatPrice(totalPrice?.cashback || 0)}
295 295
             </text>
296 296
             <image className="button-image" src={ProCard_hot}>
297 297
               123123
298 298
             </image>
299 299
             <view className="button-text-money">
300
-              门店市面价:{(totalPrice?.standardPrice || 0) / 100}元
300
+              门店市面价:{formatPrice(totalPrice?.standardPrice || 0)}元
301 301
             </view>
302 302
           </view>
303 303
           <Button className="button-box-one" onClick={() => onShowPay()}>
304
-            ¥{(totalPrice?.actualPrice || 0) / 100}元
304
+            ¥{formatPrice(totalPrice?.actualPrice || 0)}元
305 305
             <text className="button-text-one">支付订单</text>
306 306
           </Button>
307 307
         </view>

+ 4
- 2
src/pages/TobeShop/index.jsx 查看文件

@@ -4,6 +4,8 @@ import withLayout from "@/layouts";
4 4
 import CustomNav from "@/components/CustomNav";
5 5
 import { getShopDetail, getShopPackage, getExtendContent } from '@/services/home'
6 6
 import Popup from "@/components/Popup";
7
+import formatPrice from "@/utils/formatPrice";
8
+
7 9
 import LocationBig from "@/assets/icons/UserCenter/LocationBig.png";
8 10
 import Perfection from "@/assets/icons/UserCenter/Perfection.png";
9 11
 import Check_OK from "@/assets/icons/UserCenter/Check_OK.png";
@@ -147,7 +149,7 @@ export default withLayout((props) => {
147 149
           <text className="shop-title-title">请选择你要核销的套餐</text>
148 150
         </view>
149 151
         <view>
150
-          {(list||[]).map((item) => {
152
+          {(list || []).map((item) => {
151 153
 
152 154
             return (
153 155
               <view class="wrapper" key={item.verifyNo} onClick={() => setChecked(item.verifyNo)}>
@@ -173,7 +175,7 @@ export default withLayout((props) => {
173 175
                       </view>
174 176
                     </view>
175 177
                     <text className="title-money">
176
-                      ¥{item.actualPrice / 100}元<text className="title-money-2">门市价{item.standPrice / 100}元</text>
178
+                      ¥{formatPrice(item.actualPrice)}元<text className="title-money-2">门市价{formatPrice(item.standPrice)}元</text>
177 179
                     </text>
178 180
                     <view className="title-time">
179 181
                       有效期:{formatTime(item?.createDate, "yyyy/MM/dd")}-

+ 2
- 2
src/pages/index/tabs/Guide.jsx 查看文件

@@ -245,7 +245,7 @@ export default (props) => {
245 245
                   <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
246 246
                   <text className='title-title-boss' >更多指引</text>
247 247
                 </view>
248
-                {(extend||[]).map((item, index) => <MoreGuide key={(index)} item={item} />)}
248
+                {(extend || []).map((item, index) => <MoreGuide key={(index)} item={item} />)}
249 249
 
250 250
                 <view className='showMore' style={{ display: newextNum == AllextNum ? 'none' : '' }} onClick={extendMore}>
251 251
                   <view>点击查看更多</view>
@@ -261,7 +261,7 @@ export default (props) => {
261 261
             <text className='title-title-boss' >老板推荐好吃的</text>
262 262
           </view>
263 263
         </view>
264
-        {(spackage||[]).map((item, index) => <BossCard cardNavigateTo={cardNavigateTo} key={(index)} item={item} />)}
264
+        {(spackage || []).map((item, index) => <BossCard cardNavigateTo={cardNavigateTo} key={(index)} item={item} />)}
265 265
         {/* 卡片------------- */}
266 266
         {/* <view className='Guide-Content-box-two'>
267 267
           <view className='title-image-two'>