浏览代码

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

张延森 3 年前
父节点
当前提交
20b6090072
共有 45 个文件被更改,包括 829 次插入861 次删除
  1. 二进制
      src/assets/icons/GuideCheck/refund.png
  2. 3
    3
      src/components/BossCard/index.jsx
  3. 0
    47
      src/components/CollectList/AttractionsCollect/index.jsx
  4. 0
    228
      src/components/CollectList/AttractionsCollect/style.less
  5. 15
    49
      src/components/CollectList/MyCollect/index.jsx
  6. 0
    0
      src/components/CollectList/MyCollect/style.less
  7. 69
    12
      src/components/CompoentsOrder/complete/index.jsx
  8. 27
    17
      src/components/List/index.jsx
  9. 2
    2
      src/components/OrderMolded/index.jsx
  10. 2
    2
      src/components/PayOrderCard/index.jsx
  11. 2
    5
      src/components/Popup/index.jsx
  12. 1
    4
      src/components/ShopCommission/index.jsx
  13. 3
    4
      src/components/ShopUnused/index.jsx
  14. 5
    4
      src/components/ShopUsed/index.jsx
  15. 10
    5
      src/components/Star/Star.jsx
  16. 3
    3
      src/components/foodCards/foodCards.jsx
  17. 2
    5
      src/components/toggleRole/ToggleRole.jsx
  18. 19
    14
      src/hotel/components/HouseManage/houseManage.jsx
  19. 66
    34
      src/hotel/components/Income/income.jsx
  20. 30
    4
      src/hotel/components/shareRoom/ShareRoom.jsx
  21. 46
    15
      src/hotel/components/shareRoom/ShareRoom.less
  22. 45
    35
      src/hotel/pages/landlord/addRoom/addRoom.jsx
  23. 1
    2
      src/hotel/pages/landlord/landlord.jsx
  24. 2
    2
      src/hotel/pages/landlord/roomOrder/roomOrder.jsx
  25. 3
    36
      src/pages/MineUserAll/Collect/index.jsx
  26. 12
    12
      src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx
  27. 2
    2
      src/pages/MineUserAll/RefundMoney/index.jsx
  28. 11
    10
      src/pages/PayOrder/index.jsx
  29. 22
    8
      src/pages/TobeShop/index.jsx
  30. 4
    3
      src/pages/TobeShop/style.less
  31. 222
    142
      src/pages/details/foodDetails/foodDetails.jsx
  32. 13
    11
      src/pages/details/mjDetails/sceneryDetails.jsx
  33. 1
    1
      src/pages/index/components/Card.js
  34. 2
    2
      src/pages/index/tabs/Guide.jsx
  35. 4
    6
      src/pages/index/tabs/Mine.jsx
  36. 4
    3
      src/pages/index/tabs/Recommend.jsx
  37. 1
    1
      src/pages/search/search.jsx
  38. 19
    20
      src/pages/searchResult/searchResult.jsx
  39. 7
    0
      src/services/home.js
  40. 39
    17
      src/services/landlord.js
  41. 1
    1
      src/services/shopBoss.js
  42. 47
    43
      src/shop/components/ShopKeeper/shopKeeper.jsx
  43. 19
    22
      src/shop/components/Sparead/spreadMoney.jsx
  44. 42
    25
      src/shop/pages/spread/spreadIndex.jsx
  45. 1
    0
      src/utils/formatPrice.js

二进制
src/assets/icons/GuideCheck/refund.png 查看文件


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

@@ -47,14 +47,14 @@ export default (props) => {
47 47
         <view class='left-complete-one'  >
48 48
           <image className='left-image-1' src={ProCard_hot}></image>
49 49
           <view className='left-viewText'>
50
-            返现¥{item.cashback / 100}
50
+            返现¥{(item.cashback / 100)?.toFixed(2)}
51 51
           </view>
52 52
           {/* 评分 */}
53 53
           <view className='card-box-star'>
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}元<text className='title-money-2'>门市价{item.standardPrice / 100}元</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>

+ 0
- 47
src/components/CollectList/AttractionsCollect/index.jsx 查看文件

@@ -1,47 +0,0 @@
1
-import Taro from "@tarojs/taro";
2
-import { useState } from "react";
3
-import image from '@/assets/icons/ProCard/8kb.jpg'
4
-import Pay from '@/assets/icons/GuideCheck/Pay_logo.png'
5
-import SeeDetails from '@/assets/icons/GuideCheck/SeeDetails.png'
6
-
7
-import Attractions from '@/assets/icons/GuideCheck/Attractions.png'
8
-import food from '@/assets/icons/ProCard/food.png'
9
-import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
10
-import position from '@/assets/icons/GuideCheck/position_logo.png'
11
-
12
-import starOn from '@/assets/icons/housemantj/onlove.png'
13
-import starOff from '@/assets/icons/housemantj/景点爆赞.png'
14
-import './style.less'
15
-
16
-
17
-export default (props) => {
18
-
19
-  return (
20
-    <view class='wrapper'>
21
-      <view class='left-complete-one' style='padding-top: 20px;'>
22
-        <view className='title-image'>
23
-          <image className='image-1' mode='scaleToFill' src={image}></image>
24
-          <image className='image-2' src={Attractions}></image>
25
-        </view>
26
-        <view className='title-content'>
27
-          <view className='Pro-title'>
28
-            <view className='title-text'>【橘里橘啊换行啊啊啊气咖啡店】新鲜出炉啦!</view>
29
-          </view>
30
-          <text className='title-money' >¥6990元<text className='title-money-2'>门市价78元</text></text>
31
-          <view className='title-position-on'>
32
-            <image className='title-position' src={position} />
33
-            <text className='title-position-image'>南京市/秦淮区</text>
34
-            <image className='title-on' src={starOn} />
35
-          </view>
36
-        </view>
37
-      </view>
38
-      <view class='right-complete-two'>
39
-        <view className='right-content'>
40
-          <image className='right-image' src={SeeDetails} />
41
-          <view className='right-title'>查看详情</view>
42
-        </view>
43
-      </view>
44
-    </view>
45
-  )
46
-}
47
-

+ 0
- 228
src/components/CollectList/AttractionsCollect/style.less 查看文件

@@ -1,228 +0,0 @@
1
-@whiteColor: #fff;
2
-
3
-.wrapper-tourist {
4
-  margin-top: 40px;
5
-  display: flex;
6
-  position: relative;
7
-  // margin-top: 600px;
8
-  // margin: 30px auto;
9
-  width: 700px;
10
-
11
-  // box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
12
-  // filter: drop-shadow(5px 8px 6px rgb(202, 202, 202));
13
-  filter: drop-shadow(0 0 0.9rem rgba(0, 0, 0, 0.12));
14
-  .card-box-star {
15
-    position: absolute;
16
-    width: auto;
17
-    height: 44.3px;
18
-    position: absolute;
19
-    left: 200px;
20
-    top: 28px;
21
-    font-size: 20px;
22
-    color: @whiteColor;
23
-    .card-star-image {
24
-      padding-left: 6px;
25
-      width: 21px;
26
-      height: 21px;
27
-    }
28
-    .card-star-text {
29
-      padding-left: 10px;
30
-      font-size: 20px;
31
-      color: #333;
32
-      font-weight: 700;
33
-    }
34
-  }
35
-
36
-  .left-complete-one {
37
-    padding-top: 85px;
38
-    padding-bottom: 43px;
39
-    position: relative;
40
-    display: flex;
41
-    background: @whiteColor;
42
-    background: radial-gradient(
43
-          circle at top right,
44
-          transparent 15px,
45
-          @whiteColor 0
46
-        )
47
-        top right,
48
-      radial-gradient(circle at bottom right, transparent 15px, @whiteColor 0)
49
-        bottom right;
50
-    background-size: 100% 60%;
51
-    background-repeat: no-repeat;
52
-
53
-    width: 573px;
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
-      width: 145px;
78
-      margin-left: 20px;
79
-      border-radius: 24px;
80
-      overflow: hidden;
81
-      position: relative;
82
-      .image-1 {
83
-        width: 100%;
84
-        height: 145px;
85
-      }
86
-      .image-2 {
87
-        width: 89px;
88
-        height: 34px;
89
-        position: absolute;
90
-        left: 0;
91
-        top: 0;
92
-      }
93
-    }
94
-    // 商品标题
95
-    .title-content {
96
-      // padding: 84px 0 56px 20px;
97
-      padding-left: 18px;
98
-
99
-      .Pro-title {
100
-        .title-text {
101
-          width: 375px;
102
-          overflow: hidden;
103
-          text-overflow: ellipsis;
104
-          // display: -webkit-box; //必须要
105
-          -webkit-line-clamp: 1;
106
-          -webkit-box-orient: vertical;
107
-          // word-break: break-all; /* 多出文本省略号代替 */
108
-          text-align: left;
109
-          font-size: 24px;
110
-          // padding-bottom: 10px;
111
-        }
112
-      }
113
-      .title-money {
114
-        // padding-top: 34px;
115
-        font-size: 24px;
116
-        // color: red;
117
-        font-weight: 800;
118
-      }
119
-      .title-money-2 {
120
-        font-size: 18px;
121
-        color: #666;
122
-        padding-left: 10px;
123
-        text-decoration: line-through;
124
-      }
125
-
126
-      .title-time {
127
-        font-size: 24px;
128
-        // padding-top: 20px;
129
-        color: #c0c8d3;
130
-      }
131
-      .title-position-on {
132
-        display: flex;
133
-        font-size: 20px;
134
-        .title-position {
135
-          width: 18px;
136
-          height: 24px;
137
-          padding-right: 10px;
138
-          padding-top: 5px;
139
-        }
140
-        .title-position-image {
141
-          align-items: center;
142
-          font-size: 20px;
143
-          color: #333;
144
-        }
145
-        .title-on {
146
-          // margin-bottom: 10px;
147
-          padding-top: 5px;
148
-          padding-left: 40px;
149
-          width: 21px;
150
-          height: 21px;
151
-          padding-right: 10px;
152
-        }
153
-        .title-on-text {
154
-          align-items: center;
155
-
156
-          font-size: 20px;
157
-          color: #333;
158
-        }
159
-      }
160
-    }
161
-  }
162
-  // .left-complete-one:nth-child(2) {
163
-  //   background: rgb(182, 0, 0);
164
-  //   padding-top: 10px;
165
-  // }
166
-}
167
-
168
-.right-complete-two {
169
-  background: @whiteColor;
170
-  background: radial-gradient(
171
-        circle at top left,
172
-        transparent 15px,
173
-        @whiteColor 0
174
-      )
175
-      top left,
176
-    radial-gradient(circle at bottom left, transparent 15px, @whiteColor 0)
177
-      bottom left;
178
-  background-size: 100% 60%;
179
-  background-repeat: no-repeat;
180
-  width: 129px;
181
-  border-radius: 0 15px 15px 0;
182
-  position: relative;
183
-  //右面部分
184
-  .right-content {
185
-    // width: 100px;
186
-    height: 120px;
187
-    position: absolute;
188
-    top: 50%;
189
-    left: 50%;
190
-    transform: translate(-50%, -50%);
191
-    // border: 1px solid red;
192
-
193
-    .right-number {
194
-      // width: 32px;
195
-      // font-size: 20px;
196
-      // border-radius: 4px;
197
-      // border: 2px solid #999;
198
-      // margin: auto;
199
-      // text-align: center;
200
-    }
201
-    .right-image {
202
-      // float: convert();
203
-      width: 35px;
204
-      height: 34px;
205
-      margin: 0 auto;
206
-      align-items: center;
207
-      margin: auto;
208
-      padding-left: 8px;
209
-      // text-align: center;
210
-    }
211
-
212
-    .right-title {
213
-      font-weight: 700;
214
-      font-size: 24px;
215
-      padding-top: 15px;
216
-      text-align: center;
217
-    }
218
-  }
219
-}
220
-//线条
221
-.right-complete-two::after {
222
-  content: "";
223
-  position: absolute;
224
-  top: 15px;
225
-  margin: 26px auto;
226
-  height: 70%;
227
-  border-left: 1px dashed #595959;
228
-}

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

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


+ 69
- 12
src/components/CompoentsOrder/complete/index.jsx 查看文件

@@ -5,6 +5,7 @@ import formatTime from "@/utils/formatTime";
5 5
 import image from "@/assets/icons/ProCard/8kb.jpg";
6 6
 import food from "@/assets/icons/ProCard/food.png";
7 7
 import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
8
+import refund from "@/assets/icons/GuideCheck/refund.png";
8 9
 
9 10
 import Evaluation from "@/assets/icons/UserCenter/Evaluation.png";
10 11
 import Null from "@/assets/icons/UserCenter/null_logo.png";
@@ -15,15 +16,16 @@ import starOn from "@/assets/icons/GuideCheck/starOn.png";
15 16
 import starOff from "@/assets/icons/GuideCheck/starOff.png";
16 17
 import AlreadyUsed from "../AlreadyUsed";
17 18
 import "./style.less";
19
+import { useDidShow } from "@tarojs/taro";
18 20
 
19 21
 const scoreList = new Array(5).fill(0);
20 22
 const score = "3.9";
21 23
 
22 24
 const dict = {
23
-  0: { status: 0 },
24
-  1: { status: 1 },
25
+  0: { status: 0,isVerified: 0  },
26
+  1: { status: 1,isVerified: 0 },
25 27
   2: { isVerified: 1 },
26
-  3: { status: 9 },
28
+  3: { status: 9,isVerified: 0 },
27 29
 };
28 30
 export default (props) => {
29 31
   const { type } = props;
@@ -32,8 +34,15 @@ export default (props) => {
32 34
   const [pageNum, setNumber] = useState(1);
33 35
   const [HasNextPage, setHasNextPage] = useState(true);
34 36
 
37
+  useDidShow(()=>{
38
+    setNumber(1)
39
+  })
40
+
35 41
   useEffect(() => {
36
-    getList();
42
+    if(pageNum){
43
+      getList();
44
+    }
45
+    
37 46
   }, [pageNum]);
38 47
 
39 48
   const pageRefresh = () => {
@@ -46,6 +55,7 @@ export default (props) => {
46 55
     getOrderSub({
47 56
       pageNum,
48 57
       pageSize: 10,
58
+      isVerified: '',
49 59
       ...(type !== undefined ? dict[type] : null),
50 60
     }).then((res) => {
51 61
       setList(
@@ -76,6 +86,7 @@ export default (props) => {
76 86
 
77 87
   //核销
78 88
   const onWriteOff = (item) => {
89
+    // 本地测试用
79 90
     // Taro.navigateTo({
80 91
     //   url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}&subOrderId=${item.subOrderId}`,
81 92
     // });
@@ -123,7 +134,7 @@ export default (props) => {
123 134
                   <view class="left-complete-one">
124 135
                     <image className="left-image-1" src={ProCard_hot}></image>
125 136
                     <view className="left-viewText">
126
-                      返现¥{item.cashback / 100}
137
+                      返现¥{(item.cashback / 100).toFixed(2)}
127 138
                     </view>
128 139
                     <view className="title-image">
129 140
                       <image
@@ -143,7 +154,7 @@ export default (props) => {
143 154
                         </view>
144 155
                       </view>
145 156
                       <text className="title-money">
146
-                        ¥{item.unitPrice / 100}元
157
+                        ¥{(item.unitPrice / 100).toFixed(2)}元
147 158
                       </text>
148 159
                       <view className="title-time">
149 160
                         有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
@@ -177,7 +188,7 @@ export default (props) => {
177 188
                   <view class="left-complete-one">
178 189
                     <image className="left-image-1" src={ProCard_hot}></image>
179 190
                     <view className="left-viewText">
180
-                      返现¥{item.cashback / 100}
191
+                      返现¥{(item.cashback / 100).toFixed(2)}
181 192
                     </view>
182 193
                     <view className="title-image">
183 194
                       <image
@@ -197,7 +208,7 @@ export default (props) => {
197 208
                         </view>
198 209
                       </view>
199 210
                       <text className="title-money">
200
-                        ¥{item.unitPrice / 100}元
211
+                        ¥{(item.unitPrice / 100).toFixed(2)}元
201 212
                       </text>
202 213
                       <view className="title-time">
203 214
                         有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
@@ -217,6 +228,52 @@ export default (props) => {
217 228
                 </view>
218 229
               </view>
219 230
             );
231
+          }
232
+           /* 已退费 */
233
+           if (item.status === 2 && item.isVerified == 0) {
234
+            return (
235
+              <view key={`${type}-${item.orderId}`}>
236
+                <view className="OrderNumber">订单编号:{item.orderId}</view>
237
+                <view class="wrapper">
238
+                  <view class="left-complete-one">
239
+                    <image className="left-image-1" src={ProCard_hot}></image>
240
+                    <view className="left-viewText">
241
+                      返现¥{(item.cashback / 100).toFixed(2)}
242
+                    </view>
243
+                    <view className="title-image">
244
+                      <image
245
+                        className="image-1"
246
+                        mode="scaleToFill"
247
+                        src={item.poster || image}
248
+                      ></image>
249
+                      <image className="image-2" src={food}></image>
250
+                    </view>
251
+                    <view className="title-content">
252
+                      <view className="Pro-title">
253
+                        <view className="title-text">
254
+                          {item.packageDescription}
255
+                          <text className="title-money-2">
256
+                            数量:{item.amount}张
257
+                          </text>
258
+                        </view>
259
+                      </view>
260
+                      <text className="title-money">
261
+                        ¥{(item.unitPrice / 100).toFixed(2)}元
262
+                      </text>
263
+                      <view className="title-time">
264
+                        有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
265
+                        {formatTime(item.endTime, "yyyy/MM/dd")}
266
+                      </view>
267
+                    </view>
268
+                  </view>
269
+                  <view class="right-complete-two">
270
+                    <view className="right-content">
271
+                      <image className="right-image-2" src={refund} />
272
+                    </view>
273
+                  </view>
274
+                </view>
275
+              </view>
276
+            );
220 277
           }
221 278
           /* 已过期 */
222 279
           if (item.status === 9) {
@@ -227,7 +284,7 @@ export default (props) => {
227 284
                   <view class="left-complete-one">
228 285
                     <image className="left-image-1" src={ProCard_hot}></image>
229 286
                     <view className="left-viewText">
230
-                      返现¥{item.cashback / 100}
287
+                      返现¥{(item.cashback / 100).toFixed(2)}
231 288
                     </view>
232 289
                     {/* 评分 */}
233 290
                     <view className="card-box-star">
@@ -261,7 +318,7 @@ export default (props) => {
261 318
                         </view>
262 319
                       </view>
263 320
                       <text className="title-money">
264
-                        ¥{item.unitPrice / 100}元
321
+                        ¥{(item.unitPrice / 100).toFixed(2)}元
265 322
                       </text>
266 323
                       <view className="title-time">
267 324
                         有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
@@ -287,7 +344,7 @@ export default (props) => {
287 344
                   <view class="left-complete-one">
288 345
                     <image className="left-image-1" src={ProCard_hot}></image>
289 346
                     <view className="left-viewText">
290
-                      返现¥{item.cashback / 100}
347
+                      返现¥{(item.cashback / 100).toFixed(2)}
291 348
                     </view>
292 349
                     {/* 评分 */}
293 350
                     <view className="card-box-star">
@@ -322,7 +379,7 @@ export default (props) => {
322 379
                         </view>
323 380
                       </view>
324 381
                       <text className="title-money">
325
-                        ¥{item.unitPrice / 100}元
382
+                        ¥{(item.unitPrice / 100).toFixed(2)}元
326 383
                       </text>
327 384
                       <view className="title-time">
328 385
                         核销时间:{" "}

+ 27
- 17
src/components/List/index.jsx 查看文件

@@ -9,6 +9,7 @@ export default (props) => {
9 9
     params,
10 10
     pageSize = 10,
11 11
     onError,
12
+    shopId,
12 13
     onDataChange,
13 14
     ...leftProps
14 15
   } = props
@@ -17,11 +18,11 @@ export default (props) => {
17 18
   const [payload, setPayload] = useState({})
18 19
   const [list, setList] = useState([])
19 20
   const pageRef = useRef({ current: 1, pages: 0 })
21
+  const hasMore = pageRef.current.current < pageRef.current.pages
20 22
 
21 23
   // 滚动
22 24
   const handleScrollToLower = (e) => {
23 25
     const loading = loadingRef.current
24
-    const hasMore = pageRef.current.current < pageRef.current.pages
25 26
 
26 27
     if (!loading && hasMore) {
27 28
       setPayload({
@@ -31,22 +32,13 @@ export default (props) => {
31 32
     }
32 33
   }
33 34
 
34
-  // 联动状态, 设置查询参数
35
-  useEffect(() => {
36
-    setPayload({
37
-      ...params,
38
-      pageNum: 1,
39
-      pageSize,
40
-    })
41
-  }, [pageSize, params])
35
+  const fetchList = (queryParams) => {
36
+    if (!request) return;
42 37
 
43
-  // 请求数据
44
-  useEffect(() => {
45 38
     Taro.showLoading()
46 39
     loadingRef.current = true
47
-    request(payload).then((res) => {
40
+    request(queryParams).then((res) => {
48 41
       const { records, ...pageInfo } = res || {}
49
-
50 42
       const lst = pageInfo.current === 1 ? records || [] : list.concat(records || [])
51 43
       setList(lst)
52 44
       if (onDataChange) {
@@ -64,7 +56,24 @@ export default (props) => {
64 56
         onError(err)
65 57
       }
66 58
     })
67
-  }, [payload])
59
+  }
60
+
61
+  const fetchRef = useRef()
62
+  fetchRef.current = fetchList
63
+
64
+  // 联动状态, 设置查询参数
65
+  useEffect(() => {
66
+    setPayload({
67
+      ...params || {},
68
+      pageNum: 1,
69
+      pageSize,
70
+    })
71
+  }, [pageSize, params])
72
+
73
+  // 请求数据
74
+  useEffect(() => {
75
+    fetchRef.current(payload)
76
+  }, [payload, shopId])
68 77
 
69 78
   return (
70 79
     <ScrollView
@@ -72,10 +81,11 @@ export default (props) => {
72 81
       onScrollToLower={handleScrollToLower}
73 82
       {...leftProps}
74 83
     >
75
-      { !render
76
-          ? props.children
77
-          : list.map((item, index) => render({ item, index }))
84
+      {!render
85
+        ? props.children
86
+        : list.map((item, index) => render({ item, index }))
78 87
       }
88
+      <view className='botton' style={{ display: hasMore ? 'none' : '' }}>已经到底了~</view>
79 89
     </ScrollView>
80 90
   )
81 91
 }

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

@@ -15,7 +15,7 @@ export default (props) => {
15 15
       <view class='left-complete-one'>
16 16
         <image className='left-image-1' src={ProCard_hot}></image>
17 17
         <view className='left-viewText'>
18
-          返现¥{item.cashback / 100}
18
+          返现¥{(item.cashback / 100).toFixed(2)}
19 19
         </view>
20 20
         <view className='title-image'>
21 21
           <image className='image-1' mode='scaleToFill' src={item.poster}></image>
@@ -25,7 +25,7 @@ export default (props) => {
25 25
           <view className='Pro-title'>
26 26
             <view className='title-text'>{item.description}</view>
27 27
           </view>
28
-          <text className='title-money' >¥{item.actualPrice / 100}元</text>
28
+          <text className='title-money' >¥{(item.actualPrice / 100).toFixed(2)}元</text>
29 29
           <view className='title-time' >有效期:{formatTimes(item.startTime, "yyyy/MM/dd")}-{formatTimes(item.endTime, "yyyy/MM/dd")}</view>
30 30
         </view>
31 31
       </view>

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

@@ -91,7 +91,7 @@ export default (props) => {
91 91
           <view class='left-complete-one'>
92 92
             <image className='left-image-1' src={ProCard_hot}></image>
93 93
             <view className='left-viewText'>
94
-              返现¥{item.cashback / 100}
94
+              返现¥{(item.cashback / 100).toFixed(2)}
95 95
             </view>
96 96
             <view className='title-image'>
97 97
               <image className='image-1' mode='scaleToFill' src={item.poster}></image>
@@ -101,7 +101,7 @@ export default (props) => {
101 101
               <view className='Pro-title'>
102 102
                 <view className='title-text'>{item.description}</view>
103 103
               </view>
104
-              <text className='title-money' >¥{item.actualPrice / 100}<text className='title-money-2'>{item.standardPrice / 100}</text></text>
104
+              <text className='title-money' >¥{(item.actualPrice / 100).toFixed(2)}<text className='title-money-2'>{(item.standardPrice / 100).toFixed(2)}</text></text>
105 105
               <view className='title-time' >有效期:{formatTimes(item.startTime, "yyyy/MM/dd")}-{formatTimes(item.endTime, "yyyy/MM/dd")}</view>
106 106
             </view>
107 107
           </view>

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

@@ -2,12 +2,9 @@
2 2
 import './style.less'
3 3
 
4 4
 export default (props) => {
5
-  const { show, mask = true, onClose, maskClosable } = props
6
-  const onClose3=()=>{
7
-    console.log('3333333333333333333333')
8
-  }
5
+  const { show, mask = true, onClose, maskClosable } = props  
9 6
   return (
10
-    <mp-dialog extClass='x-popup' buttons={[]} show={show} mask={mask} maskClosable={maskClosable} onClose={onClose3}>
7
+    <mp-dialog extClass='x-popup' buttons={[]} show={show} mask={mask} maskClosable={maskClosable} onClose={onClose}>
11 8
       {props.children}
12 9
     </mp-dialog>
13 10
   )

+ 1
- 4
src/components/ShopCommission/index.jsx 查看文件

@@ -1,7 +1,4 @@
1
-import Taro from '@tarojs/taro'
2
-import { useEffect } from 'react'
3 1
 
4
-import { getAccount } from '@/services/shopBoss'
5 2
 
6 3
 import formatTimes from '@/utils/formatTime'
7 4
 
@@ -19,7 +16,7 @@ export default (props) => {
19 16
       <view className='spreadDate'>日期:<text>{formatTimes(item.createDate, "yyyy/MM/dd")}</text></view>
20 17
       <view className='card'>
21 18
         <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTimes(item.createDate, "yyyy/MM/dd hh:ss")}</text></view>
22
-        <view className='spreadMoney'>收入金额:<text>{item.amount / 100}</text>元</view>
19
+        <view className='spreadMoney'>收入金额:<text>{(item.amount / 100).toFixed(2)}</text>元</view>
23 20
       </view>
24 21
     </view>
25 22
   )

+ 3
- 4
src/components/ShopUnused/index.jsx 查看文件

@@ -1,9 +1,8 @@
1 1
 import Taro from '@tarojs/taro'
2 2
 import { useState, useEffect } from 'react'
3 3
 import formatTimes from '@/utils/formatTime'
4
-import iconsearch from '@/assets/icons/housemantj/search.png'
5
-import ms from '@/assets/icons/housemantj/ms3.jpg'
6
-import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
4
+
5
+
7 6
 import './style.less'
8 7
 
9 8
 
@@ -26,7 +25,7 @@ export default (props) => {
26 25
         <image className='orderImg' src={item.poster} mode='aspectFit' />
27 26
         <view className='orderRight'>
28 27
           <view className='foodName'>{item.description}</view>
29
-          <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>{item.actualPrice / 100}</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
28
+          <view className='price'>合计金额:¥<text style={{ fontSize: '24rpx' }}>{(item.actualPrice / 100).toFixed(2)}</text>元 <text className='pnum'>数量:<text>1</text>张</text> </view>
30 29
           <view>已下单:等待客户上门就餐</view>
31 30
         </view>
32 31
         <view className='line' />

+ 5
- 4
src/components/ShopUsed/index.jsx 查看文件

@@ -29,15 +29,13 @@ export default (props) => {
29 29
   }
30 30
 
31 31
 
32
-  useEffect(() => {
33 32
 
34
-  }, [])
35 33
 
36 34
   return (
37 35
     <View className='orderCard'>
38 36
       <View style={{ overflow: 'hidden' }}>
39 37
         <View className='orderId'>订单编号:{item.orderId}</View>
40
-        <View className='orderTime'>下单日期:{formatTimes(item.orderDate, 'yyyy-MM-dd hh:ss')}</View>
38
+        <View className='orderTime'>下单日期:{formatTimes(item.orderDate, 'yyyy-MM-dd hh:ss') || ''}</View>
41 39
       </View>
42 40
       <View className='order'>
43 41
         <Image className='orderImg' src={item.poster} mode='aspectFit' />
@@ -47,7 +45,10 @@ export default (props) => {
47 45
         </View>
48 46
         <View className='line' />
49 47
         <View className='phone'>客户手机:<Text>{item.phone.replace(/^(\d{3})\d{4}(\d+)/, "$1****$2") || ''}</Text>
50
-          <button className='Button-OK' onClick={confirmOrder} style={{ display: buttonStyle }}  >确认核销</button> </View>
48
+          {
49
+            !item.isConfirmVerified && <button className='Button-OK' onClick={confirmOrder} style={{ display: buttonStyle }}  >确认核销</button>
50
+          }
51
+        </View>
51 52
       </View>
52 53
     </View>
53 54
   )

+ 10
- 5
src/components/Star/Star.jsx 查看文件

@@ -2,15 +2,20 @@
2 2
 import hongxin from '@/assets/icons/housemantj/已收藏.png'
3 3
 import baixin from '@/assets/icons/housemantj/收藏.png'
4 4
 import './Star.less'
5
+
6
+const Star = (props) => <image className='star' src={props.star >= props.index ? hongxin : baixin}></image>
7
+
8
+const starList = (new Array(5)).fill()
9
+
5 10
 export default (props) => {
6 11
   const {star}=props
12
+
13
+
7 14
   return (
8 15
     <>
9
-      <image className='star' src={star >= 1 ? hongxin : baixin}></image>
10
-      <image className='star' src={star >= 2 ? hongxin : baixin}></image>
11
-      <image className='star' src={star >= 3 ? hongxin : baixin}></image>
12
-      <image className='star' src={star >= 4 ? hongxin : baixin}></image>
13
-      <image className='star' src={star >= 5 ? hongxin : baixin}></image>
16
+    {
17
+      starList.map((_, index) => <Star key={index} star={star} index={index + 1} />)
18
+    }
14 19
     </>
15 20
   )
16 21
 }

+ 3
- 3
src/components/foodCards/foodCards.jsx 查看文件

@@ -51,7 +51,7 @@ export default (props) => {
51 51
     <view className='foodCard'>
52 52
       <view className='fCleft'>
53 53
         <view className='backMoney'>
54
-          返现¥{item.cashback / 100}
54
+          返现¥{(item.cashback / 100).toFixed(2)}
55 55
         </view>
56 56
         <view className='appraise'>
57 57
           <Star star={star} />
@@ -66,8 +66,8 @@ export default (props) => {
66 66
             <view className='textword'  onClick={() => { goFood() }} >{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</view>
67 67
             <view className='jiage' onClick={() => { goFood() }} >
68 68
               <text className='rmb' >¥&nbsp;&nbsp;</text>
69
-              <text className='p1'><text className='price' >{item.actualPrice / 100}</text>元&nbsp;&nbsp;</text>
70
-              <text className='p2'>门市价<text className='oldprice' >{item.standardPrice / 100}</text>元</text>
69
+              <text className='p1'><text className='price' >{(item.actualPrice / 100).toFixed(2)}</text>元&nbsp;&nbsp;</text>
70
+              <text className='p2'>门市价<text className='oldprice' >{(item.standardPrice / 100).toFixed(2)}</text>元</text>
71 71
             </view>
72 72
             <view className='address'>
73 73
               <image className='dw' src={wz} />

+ 2
- 5
src/components/toggleRole/ToggleRole.jsx 查看文件

@@ -13,7 +13,7 @@ import { useModel } from '@/store'
13 13
 
14 14
 
15 15
 export default (props) => {
16
-  const { showCutover, onClose, role } = props
16
+  const { showCutover, onClose, maskClosable, role } = props
17 17
   const { getRole } = useModel('person')
18 18
   const goToPerson = () => {
19 19
     getRole('normal')
@@ -25,11 +25,8 @@ export default (props) => {
25 25
   const goToShop = () => {
26 26
     getRole('shop')
27 27
   }
28
-  const onClose2 = () => {
29
-    // console.log('2222222222222222222')
30
-  }
31 28
   return (
32
-    <Popup show={showCutover} onClose={onClose2}>
29
+    <Popup show={showCutover} maskClosable={maskClosable} onClose={onClose}>
33 30
       <view className='User-box-sths' >
34 31
         <view className='User-box-selectUser'>请选择身份:</view>
35 32
         <view className='User-box-tourist' onClick={goToPerson}>

+ 19
- 14
src/hotel/components/HouseManage/houseManage.jsx 查看文件

@@ -37,11 +37,13 @@ export default React.forwardRef((props, ref) => {
37 37
             getRoomList({ hotelId: hotel.hotelId }).then((res) => {
38 38
               setDetail(res.records || [])
39 39
             })
40
-          })       
41
-        } 
40
+          })
41
+        }
42 42
       }
43 43
     })
44
-   
44
+  }
45
+  const handelDetail = (val) => {
46
+    Taro.navigateTo({ url: `/hotel/pages/landlord/addRoom/addRoom?hotelId=${hotel.hotelId}&hotelName=${hotel.hotelName}&roomId=${val.roomId}` });
45 47
   }
46 48
 
47 49
   const [showCutover, setShowCutover] = useState(false)
@@ -54,6 +56,9 @@ export default React.forwardRef((props, ref) => {
54 56
   const onClose = () => {
55 57
     setShowCutover(false)
56 58
   }
59
+  const onClose2 = () => {
60
+    setShowCard(false)
61
+  }
57 62
   useEffect(() => {
58 63
     //首次加载页面时
59 64
     if (!mounted.current && hotel.hotelId) {
@@ -95,29 +100,29 @@ export default React.forwardRef((props, ref) => {
95 100
     Taro.navigateTo({ url: `/hotel/pages/landlord/roomOrder/roomOrder?roomId=${val.roomId}&roomName=${val.roomName}` });
96 101
   }
97 102
 
98
-  const onSearch=(e)=>{
99
-    if(e.detail.value==''){
103
+  const onSearch = (e) => {
104
+    if (e.detail.value == '') {
100 105
       getRoomList({ hotelId: hotel.hotelId }).then((res) => {
101 106
         setDetail(res.records || [])
102 107
       })
103 108
     }
104
-    else{
105
-      getRoomList({ hotelId: hotel.hotelId,roomName:e.detail.value }).then((res) => {
106
-      setDetail(res.records || [])
107
-    })
108
-    }    
109
+    else {
110
+      getRoomList({ hotelId: hotel.hotelId, roomName: e.detail.value }).then((res) => {
111
+        setDetail(res.records || [])
112
+      })
113
+    }
109 114
   }
110 115
   return (
111 116
     <view>
112 117
       <view style={{ padding: '0 30rpx', height: '100%' }}>
113
-        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch}/>
118
+        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch} />
114 119
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
115
-        <ShareCard showCutover={showCard} onClose={onClose} />
120
+        <ShareCard showCutover={showCard} onClose={onClose2} />
116 121
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 244px)' }}>
117 122
           {
118
-            detail?.map((item) =>
123
+            (detail || []).map((item) =>
119 124
               <view className='houseCard'>
120
-                <view className='houseName'>{item.roomName}</view>
125
+                <view className='houseName' onClick={() => { handelDetail(item) }} >{item.roomName || ''}</view>
121 126
                 <view className='operation'>
122 127
                   <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
123 128
                   <view onClick={() => ShowMoldeOn(item)}><image src={share} />分享链接</view>

+ 66
- 34
src/hotel/components/Income/income.jsx 查看文件

@@ -1,5 +1,4 @@
1 1
 import { useState } from 'react'
2
-import './income.less'
3 2
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
4 3
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
5 4
 import sImg from '@/assets/icons/landlord/我的收入2.png'
@@ -7,11 +6,22 @@ import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
7 6
 import ToggleRole from '@/components/toggleRole/ToggleRole'
8 7
 import Picker from '@/components/Picker'
9 8
 import formatTime from "@/utils/formatTime";
9
+import {getAccountLogList} from '@/services/landlord'
10
+
11
+import List from '@/components/List';
12
+import './income.less'
13
+
10 14
 
11 15
 
12 16
 export default (props) => {
13 17
   const { hotelList, hotel, account, onHotelChange, accountlog } = props
14 18
 
19
+  // const [accountLog,setAccountLog]=useState(accountlog)
20
+
21
+
22
+  // const [queryParams, setQueryParams] = useState({pageNum: 1, pageSize: 10})
23
+  // setQueryParams(hotel.hotelId)
24
+
15 25
   const handleHotelChange = (hotelId, current) => {
16 26
     onHotelChange(current)
17 27
   }
@@ -29,50 +39,72 @@ export default (props) => {
29 39
     setShowCutover(true)
30 40
   }
31 41
   const onClose = () => {
32
-    console.log('11111111')
33 42
     setShowCutover(false)
34 43
   }
35 44
   return (
36 45
     <view>
37
-      <ToggleRole role='hotel' showCutover={showCutover} onClose={onClose} />
46
+      <ToggleRole role='hotel' showCutover={showCutover} maskClosable={showCutover} onClose={onClose} />
38 47
       <view style={{ padding: '30rpx', height: '100%' }}>
39
-        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
40
-          <view className='storexx'>
41
-            <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择民宿" value={hotel?.hotelId} kv={['hotelName', 'hotelId']} dicts={hotelList} onChange={handleHotelChange} /></view>
42
-            <view onClick={ShowMoldeOn} className='User-info-cutover'>
43
-              <image className='User-info-cutover-image' src={cutoverUser} />
44
-            </view>
45
-            <view className='money'>
46
-              <view className='sleft'>
47
-                <view className='lword'>全年收入(税前)</view>
48
-                <view className='yearMoney'>
49
-                  <text>{isyear ? account?.amounts : '******'}</text>元
50
-                  <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
51
-                </view>
48
+        <view className='storexx'>
49
+          <view className='storeName'>店名:<Picker style={{ display: 'inline-block' }} placeholder="请选择民宿" value={hotel?.hotelId} kv={['hotelName', 'hotelId']} dicts={hotelList} onChange={handleHotelChange} /></view>
50
+          <view onClick={ShowMoldeOn} className='User-info-cutover'>
51
+            <image className='User-info-cutover-image' src={cutoverUser} />
52
+          </view>
53
+          <view className='money'>
54
+            <view className='sleft'>
55
+              <view className='lword'>全年收入(税前)</view>
56
+              <view className='yearMoney'>
57
+                <text>{isyear ? account?.amounts : '******'}</text>元
58
+                <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
52 59
               </view>
53
-              <view className='line' />
54
-              <view className='sright'>
55
-                <view className='rword'>当月收入(税前)</view>
56
-                <view className='monthMoney'>
57
-                  <text>{isMomth ? account?.currentCharges : '******'}</text>元
58
-                  <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
59
-                </view></view>
60 60
             </view>
61
+            <view className='line' />
62
+            <view className='sright'>
63
+              <view className='rword'>当月收入(税前)</view>
64
+              <view className='monthMoney'>
65
+                <text>{isMomth ? account?.currentCharges : '******'}</text>元
66
+                <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
67
+              </view></view>
61 68
           </view>
62
-          
63
-          <view className='title' >{accountlog.length!=''?'推广收入记录':'暂无推广收入'}</view>
64
-            {
65
-              accountlog?.map((item) => 
66
-                <view className='spreadCard'>
67
-                  <view className='card'>
68
-                    <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTime(item.createDate,'yyyy/MM/dd hh:mm:ss')}</text></view>
69
-                    <view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount/100).toFixed(2))}</text>元</view>
70
-                    <image className='spreadImg' src={sImg} />
71
-                  </view>
69
+        </view>
70
+
71
+        <view className='title' >{accountlog.length != '' ? '推广收入记录' : '暂无推广收入'}</view>
72
+        
73
+        {/* <List
74
+                  style={{ height: '50vh' }}
75
+                  request={getAccountLogList}
76
+                  params={queryParams}
77
+                  onDataChange={setAccountLog}
78
+                >
79
+                  {
80
+                    (accountLog || []).map((item) =>
81
+                    <view className='spreadCard'>
82
+                      <view className='card'>
83
+                        <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTime(item.createDate, 'yyyy/MM/dd hh:mm:ss')}</text></view>
84
+                        <view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount / 100).toFixed(2))}</text>元</view>
85
+                        <image className='spreadImg' src={sImg} />
86
+                      </view>
87
+                    </view>
88
+                    )
89
+                  }
90
+          </List> */}
91
+        
92
+        
93
+        
94
+        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: '50vh' }}>
95
+
96
+          {
97
+            (accountlog || []).map((item) =>
98
+              <view className='spreadCard'>
99
+                <view className='card'>
100
+                  <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTime(item.createDate, 'yyyy/MM/dd hh:mm:ss')}</text></view>
101
+                  <view className='spreadMoney'>收入金额:<text>{parseFloat((item.amount / 100).toFixed(2))}</text>元</view>
102
+                  <image className='spreadImg' src={sImg} />
72 103
                 </view>
104
+              </view>
73 105
             )
74 106
           }
75
-          {accountlog.length != '' ? <view className='botton'>已经到底了~</view> : ''}
107
+        <view className='botton' >已经到底了~</view>
76 108
         </scroll-view>
77 109
       </view>
78 110
     </view>

+ 30
- 4
src/hotel/components/shareRoom/ShareRoom.jsx 查看文件

@@ -30,8 +30,35 @@ export default (props) => {
30 30
   }
31 31
   return (
32 32
     <Popup show={showCutover} onClose={onClose}>
33
-      <View className='from-room'>
34
-      <mp-form  >
33
+      <View className='from-room srl'>
34
+        <View style={{marginBottom:'25px'}}>
35
+          <View className='rzline' /><Label className='srl mg'>请输入入住人信息</Label><View className='rzline' />
36
+        </View>
37
+        <View className='srleft'>
38
+          <Label>入住人数:</Label>
39
+          <Input onInput={(e) => setRoomNum(e.detail.value)} value={roomNum} type='number' placeholder='请输入入住人数' />
40
+        </View>
41
+        <View className='srleft'>
42
+          <Label >入住开始时间:</Label>
43
+          <Picker className='picker' mode='date' onChange={handelStartDate}>
44
+            {startDate == '' ? '请选择入住开始时间' : startDate}
45
+          </Picker>
46
+        </View>
47
+        <View className='srleft'>
48
+          <Label>入住结束时间:</Label>
49
+          <Picker className='picker' mode='date' onChange={handelEndDate}>
50
+            {endDate == '' ? '请选择入住结束时间' : endDate}
51
+          </Picker>
52
+        </View>
53
+        <View>
54
+          <Button className='cancel' onClick={onClose}>取消</Button>
55
+          <Button className='btn' onClick={handelShare}>分享</Button>
56
+        </View>
57
+
58
+
59
+
60
+
61
+        {/* <mp-form  >
35 62
         <Label style={{color:'black'}}>请输入入住人信息</Label>
36 63
         <mp-cells    footer='  ' >
37 64
           <mp-cell title='入住人数:' extClass='font'>
@@ -49,10 +76,9 @@ export default (props) => {
49 76
           </mp-cell>
50 77
           <mp-cell>
51 78
             <Button className='cancel' onClick={onClose}>取消</Button><Button className='btn' onClick={handelShare}>分享</Button>
52
-            {/* <button className='button-OK' onClick={sumbit}>确定</button> */}
53 79
           </mp-cell>
54 80
         </mp-cells>
55
-      </mp-form>
81
+      </mp-form> */}
56 82
       </View>
57 83
 
58 84
 

+ 46
- 15
src/hotel/components/shareRoom/ShareRoom.less 查看文件

@@ -1,28 +1,59 @@
1 1
 .from-room{
2
-  padding-top: 30px;
3
-  .font{
4
-    font-size: 28px;
5
-    color: #202020;
2
+  padding-top: 60px;
3
+}
4
+.srl{
5
+  font-size: 30px;
6
+  font-weight: bold;
7
+  color: #202020;  
8
+  .mg{
9
+    font-size: 38px;
10
+    margin: 0 20px 50px 20px;
11
+  }
12
+  .rzline{
13
+    border-top: 2px #999 dashed;
14
+    height: 2px;
15
+    width: 80px;
16
+    display: inline-block;
17
+    margin-bottom: 8px;
6 18
   }
19
+  .srleft{
20
+    text-align: left;
21
+    Input{
22
+      height: 92px;
23
+      font-size: 28px;
24
+      color: #999;
25
+      background: #FEFEFE;
26
+      box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.08);
27
+      margin-bottom: 40px;
28
+    }
29
+    .picker{
30
+      font-size: 28px;
31
+      color: #999;
32
+      line-height: 92px;
33
+      height: 92px;
34
+      background: #FEFEFE;
35
+      margin-bottom: 40px;
36
+      box-shadow: 0px 1px 0px 0px rgba(0, 0, 0, 0.08);
37
+    }
38
+  }  
7 39
   .cancel{
8
-    width: 150px;
9
-    height: 70px;
40
+    color: #274290;
10 41
     display: inline-block;
11
-    line-height: 70px;
42
+    margin: 20px 20px 0 0;
43
+    width: 236px;
44
+    height: 78px;
45
+    border: 2px solid #274190;
12 46
     border-radius: 12px;
13
-    font-size: 36px;
14
-    margin-right: 20px;
15 47
   }
16 48
   .btn {
17
-    width: 150px;
18
-    height: 70px;
19
-    background: #1A3B83;
20
-    display: inline-block;
21
-    line-height: 70px;
49
+    width: 236px;
50
+    height: 78px;
51
+    background: #274291;
22 52
     border-radius: 12px;
23
-    font-size: 36px;
53
+    display: inline-block;
24 54
     color: #fff;
25 55
   }
26 56
 }
57
+
27 58
   
28 59
   

+ 45
- 35
src/hotel/pages/landlord/addRoom/addRoom.jsx 查看文件

@@ -3,11 +3,11 @@ import Taro from '@tarojs/taro'
3 3
 import CustomNav from '@/components/CustomNav'
4 4
 import { useEffect, useState } from "react"
5 5
 import './addRoom.less'
6
-import { saveRoom, getHotelDetail } from '@/services/landlord'
6
+import { saveRoom, getRoomDetail, updateRoom } from '@/services/landlord'
7 7
 
8 8
 
9 9
 export default withLayout((props) => {
10
-  const { hotelId, hotelName } = props.router.params
10
+  const { hotelId, hotelName, roomId } = props.router.params
11 11
   const [roomModel, setRoomModel] = useState({
12 12
     hotelId,
13 13
     roomName: '',
@@ -32,58 +32,68 @@ export default withLayout((props) => {
32 32
     })
33 33
   }
34 34
   const sumbit = () => {
35
-    if(
36
-    roomModel.roomName!=''&&
37
-    roomModel.address!=''&&
38
-    roomModel.location!=''&&
39
-    roomModel.weight!=''
40
-    )
41
-     { 
42
-      saveRoom(roomModel).then(() => {       
43
-          Taro.showModal({
44
-            title: '保存成功',
45
-            showCancel:false
46
-          }).then(() => {
47
-            Taro.navigateBack()
48
-          })
49
-      })       
50
-     } else{
51
-       Taro.showToast({
35
+    if (
36
+      roomModel.roomName != '' &&
37
+      roomModel.address != '' &&
38
+      roomModel.location != '' &&
39
+      roomModel.weight != ''
40
+    ) {
41
+      const seveices = roomId ? updateRoom : saveRoom
42
+      seveices(roomModel, roomId).then(() => {
43
+        Taro.showModal({
44
+          title: roomId ? '修改成功' : '保存成功',
45
+          showCancel: false
46
+        }).then(() => {
47
+          Taro.navigateBack()
48
+        })
49
+      })
50
+    } else {
51
+      Taro.showToast({
52 52
         title: '有必填项未填哦',
53 53
         icon: 'none',
54 54
       })
55
-     }
56
-      
55
+    }
57 56
   }
57
+
58
+  useEffect(() => {
59
+    if (roomId) {
60
+      getRoomDetail(roomId).then((res) => {
61
+        setRoomModel(res)
62
+      })
63
+    }
64
+  }, [])
65
+
66
+
67
+
58 68
   return (
59 69
     <view className='page-index'>
60 70
       <CustomNav title={hotelName} />
61 71
       <view className='from-room'  >
62 72
         <mp-form models={roomModel} >
63 73
           <mp-cells title='请填写新增的房源信息' footer='  ' >
64
-            <mp-cell prop='roomName' title='房屋名称:' extClass='font'>
65
-              <input focus dataField='roomName' onInput={(e) => setRoomModel({ ...roomModel, roomName: e.detail.value })} value={roomModel.roomName}  placeholder='请输入房屋名称(必填)' />
74
+            <mp-cell title='房屋名称:' extClass='font'>
75
+              <input onInput={(e) => setRoomModel({ ...roomModel, roomName: e.detail.value })} value={roomModel.roomName} placeholder='请输入房屋名称(必填)' />
66 76
             </mp-cell>
67
-            <mp-cell prop='address' title='位置信息:' extClass='font'>
68
-              <input dataField='address' onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address}  placeholder='请输入房屋位置(必填)' />
77
+            <mp-cell title='位置信息:' extClass='font'>
78
+              <input onInput={(e) => setRoomModel({ ...roomModel, address: e.detail.value })} value={roomModel.address} placeholder='请输入房屋位置(必填)' />
69 79
             </mp-cell>
70
-            <mp-cell prop='location' title='定位经纬度:' extClass='font'>
80
+            <mp-cell title='定位经纬度:' extClass='font'>
71 81
               <label onClick={onRoomMap}>{roomModel.location == '' ? '房间定位(必填)' : roomModel.location}</label>
72 82
             </mp-cell>
73
-            <mp-cell prop='parkingAddress' title='停车场位置:' extClass='font'>
74
-              <input dataField='parkingAddress' onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress}  placeholder='请输入停车场位置' />
83
+            <mp-cell title='停车场位置:' extClass='font'>
84
+              <input onInput={(e) => setRoomModel({ ...roomModel, parkingAddress: e.detail.value })} value={roomModel.parkingAddress} placeholder='请输入停车场位置' />
75 85
             </mp-cell>
76
-            <mp-cell prop='parkingLocation' title='定位经纬度:' extClass='font'>
86
+            <mp-cell title='定位经纬度:' extClass='font'>
77 87
               <label onClick={onParkMap}>{roomModel.parkingLocation == '' ? '停车场定位' : roomModel.parkingLocation}</label>
78 88
             </mp-cell>
79
-            <mp-cell prop='wifiName' title='Wi-Fi名称:' extClass='font'>
80
-              <input dataField='wifiName' onInput={(e) => setRoomModel({ ...roomModel, wifiName: e.detail.value })} value={roomModel.wifiName}  placeholder='请输入wifi名称' />
89
+            <mp-cell title='Wi-Fi名称:' extClass='font'>
90
+              <input onInput={(e) => setRoomModel({ ...roomModel, wifiName: e.detail.value })} value={roomModel.wifiName} placeholder='请输入wifi名称' />
81 91
             </mp-cell>
82
-            <mp-cell prop='wifiPassword' title='Wi-Fi密码:' extClass='font'>
83
-              <input dataField='wifiPassword' onInput={(e) => setRoomModel({ ...roomModel, wifiPassword: e.detail.value })} value={roomModel.wifiPassword}  placeholder='请输入wifi密码' />
92
+            <mp-cell title='Wi-Fi密码:' extClass='font'>
93
+              <input onInput={(e) => setRoomModel({ ...roomModel, wifiPassword: e.detail.value })} value={roomModel.wifiPassword} placeholder='请输入wifi密码' />
84 94
             </mp-cell>
85
-            <mp-cell prop='weight' title='权重:' extClass='font'>
86
-              <input type='number' dataField='weight'  onInput={(e) => setRoomModel({ ...roomModel, weight: e.detail.value })} placeholder='请输入权重(必填)' />
95
+            <mp-cell title='权重:' extClass='font'>
96
+              <input type='number' value={roomModel.weight} onInput={(e) => setRoomModel({ ...roomModel, weight: e.detail.value })} placeholder='请输入权重(必填)' />
87 97
             </mp-cell>
88 98
             <mp-cell>
89 99
               <button className='button-OK' onClick={sumbit}>确定</button>

+ 1
- 2
src/hotel/pages/landlord/landlord.jsx 查看文件

@@ -10,7 +10,6 @@ import onhouseImg from '@/assets/icons/landlord/房源管理按下.png'
10 10
 import withLayout from '@/layouts'
11 11
 import { getHotelManage, getAccountLogList, getNowHotelManage } from '@/services/landlord'
12 12
 import CustomNav from '@/components/CustomNav'
13
-
14 13
 import './landlord.less'
15 14
 
16 15
 export default withLayout((props) => {
@@ -20,7 +19,7 @@ export default withLayout((props) => {
20 19
 
21 20
   const [hotelList, setHotelList] = useState([])
22 21
   const [hotel, setHotel] = useState()
23
-  const [account, setAccount] = useState()
22
+  const [account, setAccount] = useState({})
24 23
   const [accountlog, setAccountLog] = useState([])
25 24
 
26 25
   const houseRef = useRef()

+ 2
- 2
src/hotel/pages/landlord/roomOrder/roomOrder.jsx 查看文件

@@ -49,10 +49,10 @@ export default withLayout((props) => {
49 49
 
50 50
         {
51 51
           detail.length==0?<View className='houseCard'>暂无入住人数据</View>
52
-           :detail?.map((item) =>
52
+           :detail.map((item) =>
53 53
             <View className='houseCard'>
54 54
               {
55
-                item.personList?.map((item2) =>
55
+                (item.personList||[]).map((item2) =>
56 56
                   <View className='operation'>
57 57
                     <View style={{display:'inline-block'}} onClick={()=>CopyName(item2.customerName)}>
58 58
                       <Label>{item2.customerName}</Label>

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

@@ -2,32 +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 AttractionsCollect from '@/components/CollectList/AttractionsCollect'
19
-import FoodCollect from '@/components/CollectList/FoodCollect'
20
-
21
-
6
+import MyCollect from '@/components/CollectList/MyCollect'
22 7
 import './style.less'
23 8
 
24
-
25 9
 export default withLayout((props) => {
26 10
   const { router, person, location } = props
27
-  console.log("🚀 ~ file: index.jsx ~ line 27 ~ withLayout ~ props", props)
28 11
   const [collectContent, setCollectContent] = useState([])
29
-
30
-
12
+  console.log("🚀 ~ file: index.jsx ~ line 12 ~ withLayout ~ collectContent", collectContent)
31 13
 
32 14
   useEffect(() => {
33 15
     getCollectList({
@@ -40,29 +22,14 @@ export default withLayout((props) => {
40 22
     })
41 23
   }, [location])
42 24
 
43
-
44
-
45
-
46 25
   return (
47 26
     <view className='box-content'>
48 27
       <CustomNav title='我的收藏' />
49
-
50 28
       <view>
51 29
         {
52
-          collectContent.map((item, index) => {
53
-            return <FoodCollect key={(index)} item={item} />
54
-          })
55
-
30
+          collectContent.map((item, index) => { return <MyCollect key={(index)} item={item} /> })
56 31
         }
57
-
58
-
59 32
       </view>
60
-      {/* {
61
-        collectContent.map((item, index) => {
62
-          return <AttractionsCollect key={(index)} item={item} />
63
-        })
64
-
65
-      } */}
66 33
       <view className='foot'>
67 34
         已经到底了~
68 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>

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

@@ -86,7 +86,7 @@ export default withLayout((props) => {
86 86
         onscrolltolower={pageLoadMore}
87 87
       >
88 88
         <view>
89
-          {list?.map((item) => {
89
+          {(list||[]).map((item) => {
90 90
             return (
91 91
               <view class="wrapper" key={item.orderId}>
92 92
                 <view class="left-complete-one">
@@ -98,7 +98,7 @@ export default withLayout((props) => {
98 98
                   {/* 评分 */}
99 99
                   <view className="card-box-star">
100 100
                     {scoreList.map((_, index) => {
101
-                      const src = index + 1 < item.score ? starOn : starOff;
101
+                      const src = index + 1 <= item.score ? starOn : starOff;
102 102
                       return (
103 103
                         <image
104 104
                           className="card-star-image"

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

@@ -12,6 +12,7 @@ import Taro, { useDidShow } from "@tarojs/taro";
12 12
 import { getPackageDetail } from "@/services/home";
13 13
 import { saveOrder, getOrderSub, payOrder } from "@/services/payOrder";
14 14
 import formatTime from "@/utils/formatTime";
15
+import formatPrice from "@/utils/formatPrice";
15 16
 
16 17
 export default withLayout((props) => {
17 18
   const { router, person } = props;
@@ -116,7 +117,7 @@ export default withLayout((props) => {
116 117
         ).then((res) => {
117 118
           setPayInfo(res);
118 119
           requestPayment(res);
119
-        }).catch(()=>{
120
+        }).catch(() => {
120 121
           Taro.hideLoading()
121 122
           Taro.showToast({
122 123
             title: "支付失败",
@@ -129,7 +130,7 @@ export default withLayout((props) => {
129 130
         payOrder(orderId).then((res) => {
130 131
           setPayInfo(res);
131 132
           requestPayment(res);
132
-        }).catch(()=>{
133
+        }).catch(() => {
133 134
           Taro.hideLoading()
134 135
           Taro.showToast({
135 136
             title: "支付失败",
@@ -216,13 +217,13 @@ export default withLayout((props) => {
216 217
         </view>
217 218
       </Popup>
218 219
       <view class="coupon-list">
219
-        {list?.map((item) => {
220
+        {(list || []).map((item) => {
220 221
           return (
221
-            <view class="wrapper">
222
+            <view class="wrapper" key={item.orderId}>
222 223
               <view class="left-complete-one">
223 224
                 <image className="left-image-1" src={ProCard_hot}></image>
224 225
                 <view className="left-viewText">
225
-                  返现¥{(item.cashback || 0) / 100}
226
+                  返现¥{formatPrice(item.cashback)}
226 227
                 </view>
227 228
                 <view className="title-image">
228 229
                   <image
@@ -237,9 +238,9 @@ export default withLayout((props) => {
237 238
                     <view className="title-text">{item.description}</view>
238 239
                   </view>
239 240
                   <text className="title-money">
240
-                    ¥{(item.actualPrice || item.unitPrice || 0) / 100}元
241
+                    ¥{formatPrice(item.actualPrice || item.unitPrice)}元
241 242
                     <text className="title-money-2">
242
-                      门市价{(item.standardPrice || 0) / 100}元
243
+                      门市价{formatPrice(item.standardPrice)}元
243 244
                     </text>
244 245
                   </text>
245 246
                   <view className="title-time">
@@ -290,17 +291,17 @@ export default withLayout((props) => {
290 291
         <view className="button-box-button-box">
291 292
           <view className="button-text-image">
292 293
             <text className="button-text-money-hot">
293
-              返现¥{(totalPrice?.cashback || 0) / 100}
294
+              返现¥{formatPrice(totalPrice?.cashback || 0)}
294 295
             </text>
295 296
             <image className="button-image" src={ProCard_hot}>
296 297
               123123
297 298
             </image>
298 299
             <view className="button-text-money">
299
-              门店市面价:{(totalPrice?.standardPrice || 0) / 100}元
300
+              门店市面价:{formatPrice(totalPrice?.standardPrice || 0)}元
300 301
             </view>
301 302
           </view>
302 303
           <Button className="button-box-one" onClick={() => onShowPay()}>
303
-            ¥{(totalPrice?.actualPrice || 0) / 100}元
304
+            ¥{formatPrice(totalPrice?.actualPrice || 0)}元
304 305
             <text className="button-text-one">支付订单</text>
305 306
           </Button>
306 307
         </view>

+ 22
- 8
src/pages/TobeShop/index.jsx 查看文件

@@ -1,8 +1,11 @@
1
+import Taro from "@tarojs/taro";
2
+import { useState, useEffect } from "react";
1 3
 import withLayout from "@/layouts";
2
-
3 4
 import CustomNav from "@/components/CustomNav";
5
+import { getShopDetail, getShopPackage, getExtendContent } from '@/services/home'
4 6
 import Popup from "@/components/Popup";
5
-import { useState, useEffect } from "react";
7
+import formatPrice from "@/utils/formatPrice";
8
+
6 9
 import LocationBig from "@/assets/icons/UserCenter/LocationBig.png";
7 10
 import Perfection from "@/assets/icons/UserCenter/Perfection.png";
8 11
 import Check_OK from "@/assets/icons/UserCenter/Check_OK.png";
@@ -14,21 +17,31 @@ import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
14 17
 import { Button, Icon, Text, Textarea } from "@tarojs/components";
15 18
 import { getVerifyTargetList, putVerifyTarget } from "@/services/payOrder";
16 19
 import formatTime from '@/utils/formatTime'
20
+
17 21
 import "./style.less";
18
-import Taro from "@tarojs/taro";
19 22
 
20 23
 export default withLayout((props) => {
21 24
   const { router, person } = props;
25
+  console.log("🚀 ~ file: index.jsx ~ line 22 ~ withLayout ~ props", props)
22 26
   const { id, subOrderId } = props.router.params;
23 27
   const [showDialog, setShowDialog] = useState(false);
24 28
   //核销
25 29
   const [Consumption, setConsumption] = useState(false);
26 30
 
27 31
   const [checked, setChecked] = useState();
32
+  const [shopContent, setShopContent] = useState([])
28 33
 
34
+  const [list, setList] = useState([]);
35
+
36
+
37
+  const getShop = () => {
38
+    getShopDetail(id).then(e => {
39
+      setShopContent(e)
40
+
41
+    })
42
+  }
29 43
 
30 44
 
31
-  const [list, setList] = useState([]);
32 45
 
33 46
   const getList = (params) => {
34 47
     getVerifyTargetList({
@@ -51,6 +64,7 @@ export default withLayout((props) => {
51 64
 
52 65
   useEffect(() => {
53 66
     getList();
67
+    getShop();
54 68
   }, []);
55 69
 
56 70
   const ShowMoldeOn = () => {
@@ -123,7 +137,7 @@ export default withLayout((props) => {
123 137
         <view className="position-header">
124 138
           <image className="position-LocationBig" src={LocationBig} />
125 139
           <text cla="position-LocationBig-text">
126
-            当前所在店铺:SEOUL·创意韩国料理
140
+            当前所在店铺:{shopContent?.shopName || []}
127 141
           </text>
128 142
         </view>
129 143
         <view className="shop-image">
@@ -135,7 +149,7 @@ export default withLayout((props) => {
135 149
           <text className="shop-title-title">请选择你要核销的套餐</text>
136 150
         </view>
137 151
         <view>
138
-          {list?.map((item) => {
152
+          {(list || []).map((item) => {
139 153
 
140 154
             return (
141 155
               <view class="wrapper" key={item.verifyNo} onClick={() => setChecked(item.verifyNo)}>
@@ -144,7 +158,7 @@ export default withLayout((props) => {
144 158
                     <image className="Check_OK-image" src={item.verifyNo == checked ? Check_OK : Check_NO} />
145 159
                   </view>
146 160
                   <image className="left-image-1" src={ProCard_hot}></image>
147
-                  <view className="left-viewText">返现¥16.00</view>
161
+                  <view className="left-viewText">返现¥{item.cashback}</view>
148 162
                   <view className="title-image">
149 163
                     <image
150 164
                       className="image-1"
@@ -161,7 +175,7 @@ export default withLayout((props) => {
161 175
                       </view>
162 176
                     </view>
163 177
                     <text className="title-money">
164
-                      ¥{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>
165 179
                     </text>
166 180
                     <view className="title-time">
167 181
                       有效期:{formatTime(item?.createDate, "yyyy/MM/dd")}-

+ 4
- 3
src/pages/TobeShop/style.less 查看文件

@@ -89,7 +89,6 @@
89 89
       position: absolute;
90 90
       width: auto;
91 91
       height: 44.3px;
92
-      position: absolute;
93 92
       left: 200px;
94 93
       top: 28px;
95 94
       font-size: 20px;
@@ -109,6 +108,7 @@
109 108
 
110 109
     .left-complete-one {
111 110
       // padding-left: 64px;
111
+      width: 560px;
112 112
       padding-top: 87px;
113 113
       padding-bottom: 43px;
114 114
       position: relative;
@@ -141,7 +141,7 @@
141 141
         width: 145px;
142 142
         height: 44px;
143 143
         position: absolute;
144
-        margin-left: 75px;
144
+        margin-left: 88px;
145 145
         top: 22px;
146 146
       }
147 147
       .left-viewText {
@@ -162,6 +162,7 @@
162 162
         border-radius: 24px;
163 163
         overflow: hidden;
164 164
         position: relative;
165
+        flex: none;
165 166
         .image-1 {
166 167
           width: 100%;
167 168
           height: 145px;
@@ -260,7 +261,7 @@
260 261
     background-repeat: no-repeat;
261 262
     width: 129px;
262 263
     border-radius: 0 15px 15px 0;
263
-    position: relative;
264
+    // position: relative;
264 265
     //右面部分
265 266
     .right-content {
266 267
       // width: 100px;

+ 222
- 142
src/pages/details/foodDetails/foodDetails.jsx 查看文件

@@ -1,82 +1,105 @@
1
-import CustomNav from '@/components/CustomNav'
2
-import withLayout from '@/layouts'
3
-import { getShopDetail, getShopPackage, getExtendContent } from '@/services/home'
4
-import { useState, useEffect, useRef } from 'react'
5
-import { Button, Swiper, SwiperItem } from '@tarojs/components';
6
-import Star from '@/components/Star/Star.jsx'
7
-import Cards from '@/components/foodCards/foodCards.jsx'
8
-import ax from '@/assets/icons/housemantj/onlove.png'
9
-import yysj from '@/assets/icons/housemantj/营业时间.png'
10
-import dw from '@/assets/icons/housemantj/地址.png'
11
-import zhuandao from '@/assets/icons/housemantj/backTop.png'
12
-import titlezs from '@/assets/icons/housemantj/标题装饰.png'
13
-import showMore from '@/assets/icons/housemantj/查看更多.png'
14
-import share from '@/assets/icons/housemantj/景点分享.png'
15
-import good from '@/assets/icons/housemantj/景点爆赞.png'
16
-import baozan from '@/assets/icons/housemantj/爆赞.png'
17
-import weibaozan from '@/assets/icons/housemantj/未赞.png'
18
-import Taro,{ useShareAppMessage } from '@tarojs/taro'
19
-import useSave from "@/utils/hooks/useSave"
20
-import useLike from "@/utils/hooks/useLike"
21
-import Extend from '../components/Extend/extend'
22
-import './foodDetails.less'
1
+import CustomNav from "@/components/CustomNav";
2
+import withLayout from "@/layouts";
3
+import {
4
+  getShopDetail,
5
+  getShopPackage,
6
+  getExtendContent,
7
+} from "@/services/home";
8
+import { getVerifyTargetList } from "@/services/payOrder";
9
+import { useState, useEffect, useRef } from "react";
10
+import { Button, Swiper, SwiperItem } from "@tarojs/components";
11
+import Star from "@/components/Star/Star.jsx";
12
+import Cards from "@/components/foodCards/foodCards.jsx";
13
+import ax from "@/assets/icons/housemantj/onlove.png";
14
+import yysj from "@/assets/icons/housemantj/营业时间.png";
15
+import dw from "@/assets/icons/housemantj/地址.png";
16
+import zhuandao from "@/assets/icons/housemantj/backTop.png";
17
+import titlezs from "@/assets/icons/housemantj/标题装饰.png";
18
+import showMore from "@/assets/icons/housemantj/查看更多.png";
19
+import share from "@/assets/icons/housemantj/景点分享.png";
20
+import good from "@/assets/icons/housemantj/景点爆赞.png";
21
+import baozan from "@/assets/icons/housemantj/爆赞.png";
22
+import weibaozan from "@/assets/icons/housemantj/未赞.png";
23
+import Taro, { useShareAppMessage } from "@tarojs/taro";
24
+import useSave from "@/utils/hooks/useSave";
25
+import useLike from "@/utils/hooks/useLike";
26
+import Extend from "../components/Extend/extend";
27
+import "./foodDetails.less";
23 28
 
24 29
 export default withLayout((props) => {
25
-  const { router, person } = props
26
-  const { id, subOrderId } = props.router.params
30
+  const { router, person } = props;
31
+  const { id, subOrderId, scene } = props.router.params;
27 32
   // console.log(id,subOrderId,'--333-----')
28 33
   useEffect(() => {
29
-    console.log(id, subOrderId, '-------')
34
+    console.log(id, subOrderId, "-------");
30 35
     if (id && subOrderId) {
31 36
       Taro.navigateTo({
32 37
         url: `/pages/TobeShop/index?id=${id}&subOrderId=${subOrderId}`,
33 38
       });
34 39
     }
35
-  }, [id, subOrderId])
40
+  }, [id, subOrderId]);
41
+
42
+  useEffect(() => {
43
+
44
+    if (id && scene) {
45
+      getVerifyTargetList({
46
+        shopId: id,
47
+        isMine: true,
48
+        isVerified: 0,
49
+      }).then((res) => {
50
+        if(res?.records?.length>0){
51
+          Taro.navigateTo({
52
+            url: `/pages/TobeShop/index?id=${id}`,
53
+          });
54
+        }
55
+       
56
+      });
57
+    }
58
+  }, [id, scene]);
59
+  
36 60
   //商铺基础信息
37
-  const [detail, setDetail] = useState({})
38
-  console.log("🚀 ~ file: foodDetails.jsx ~ line 38 ~ withLayout ~ setDetail", setDetail)
61
+  const [detail, setDetail] = useState({});
39 62
   //商铺套餐
40
-  const [spackage, setPackage] = useState([])
63
+  const [spackage, setPackage] = useState([]);
41 64
   //banner图集数组
42
-  const [imglist, setimglist] = useState([])
43
-  const [index, setIndex] = useState(0)
65
+  const [imglist, setimglist] = useState([]);
66
+  const [index, setIndex] = useState(0);
44 67
   const handchange = (e) => {
45
-    setIndex(e.detail.current)
46
-  }
68
+    setIndex(e.detail.current);
69
+  };
47 70
 
48
-  const [isSaved, toggleSave] = useSave(detail.isSaved, 'shop', id)
49
-  const [isLike, toggleLike] = useLike(detail.isLike, 'shop', id)
71
+  const [isSaved, toggleSave] = useSave(detail.isSaved, "shop", id);
72
+  const [isLike, toggleLike] = useLike(detail.isLike, "shop", id);
50 73
 
51 74
   //当前套餐总数
52
-  const [newpgNum, setNewpgNum] = useState(0)
75
+  const [newpgNum, setNewpgNum] = useState(0);
53 76
   //全部套餐个数
54
-  const [AllpgNum, setAllpgNum] = useState(0)
77
+  const [AllpgNum, setAllpgNum] = useState(0);
55 78
   //套餐当前页数
56
-  const [page, setpage] = useState(2)
79
+  const [page, setpage] = useState(2);
57 80
   const pgMore = () => {
58
-    setpage(page + 1)
81
+    setpage(page + 1);
59 82
     getShopPackage(id, { pageNum: page }).then((res) => {
60
-      setPackage([...spackage, ...res.records])
61
-      setNewpgNum(newpgNum + res.records.length)
62
-    })
63
-  }
83
+      setPackage([...spackage, ...res.records]);
84
+      setNewpgNum(newpgNum + res.records.length);
85
+    });
86
+  };
64 87
   //本店指南
65
-  const [extend, setExtend] = useState([])
88
+  const [extend, setExtend] = useState([]);
66 89
 
67 90
   //当前指南总数
68
-  const [newextNum, setNewextNum] = useState(0)
91
+  const [newextNum, setNewextNum] = useState(0);
69 92
   //全部指南个数
70
-  const [AllextNum, setAllextNum] = useState(0)
93
+  const [AllextNum, setAllextNum] = useState(0);
71 94
   //指南当前页数
72
-  const [epage, setepage] = useState(2)
95
+  const [epage, setepage] = useState(2);
73 96
   const extendMore = () => {
74
-    setepage(epage + 1)
75
-    getExtendContent('shop', id, { pageNum: epage }).then((res) => {
76
-      setExtend([...extend, ...res.records])
77
-      setNewextNum(newextNum + res.records.length)
78
-    })
79
-  }
97
+    setepage(epage + 1);
98
+    getExtendContent("shop", id, { pageNum: epage }).then((res) => {
99
+      setExtend([...extend, ...res.records]);
100
+      setNewextNum(newextNum + res.records.length);
101
+    });
102
+  };
80 103
   const openMap = () => {
81 104
     Taro.openLocation({
82 105
       longitude: log.current - 0,
@@ -84,134 +107,191 @@ export default withLayout((props) => {
84 107
       name: detail.shopName,
85 108
       address: detail.address,
86 109
       scale: 12,
87
-    })
88
-  }
89
-  const log = useRef('')
90
-  const lat = useRef('')
110
+    });
111
+  };
112
+  const log = useRef("");
113
+  const lat = useRef("");
91 114
 
92 115
   useEffect(() => {
93 116
     getShopDetail(id).then((res) => {
94
-      setDetail(res)
95
-      log.current = (res.locaton).toString().split(',')[0]
96
-      lat.current = (res.locaton).toString().split(',')[1]
97
-      setimglist(res.imageList || [])
98
-    })
117
+      setDetail(res);
118
+      log.current = res.locaton.toString().split(",")[0];
119
+      lat.current = res.locaton.toString().split(",")[1];
120
+      setimglist(res.imageList || []);
121
+    });
99 122
     getShopPackage(id).then((res) => {
100
-      setPackage(res.records || [])
101
-      setNewpgNum(res.records.length)
102
-      setAllpgNum(res.total)
103
-    })
104
-    getExtendContent('shop', id).then((res) => {
105
-      setExtend(res.records || [])
106
-      setAllextNum(res.total)
107
-      setNewextNum(res.records.length)
108
-    })
109
-  }, [])
110
-  const star = parseFloat(((detail.sweetScore + detail.environmentScore + detail.serviceScore) / 3).toFixed(1));
111
-  
123
+      setPackage(res.records || []);
124
+      setNewpgNum(res.records.length);
125
+      setAllpgNum(res.total);
126
+    });
127
+    getExtendContent("shop", id).then((res) => {
128
+      setExtend(res.records || []);
129
+      setAllextNum(res.total);
130
+      setNewextNum(res.records.length);
131
+    });
132
+  }, []);
133
+  const star = parseFloat(
134
+    (
135
+      (detail.sweetScore + detail.environmentScore + detail.serviceScore) /
136
+      3
137
+    ).toFixed(1)
138
+  );
139
+
112 140
   // 分享
113
-  useShareAppMessage(()=>{
114
-      return {
115
-        title: detail.shopName,
116
-        path: `/pages/details/foodDetails/foodDetails?id=${id}`,
117
-        imageUrl: detail.poster,
118
-      }
119
-    
120
-  })
141
+  useShareAppMessage(() => {
142
+    return {
143
+      title: detail.shopName,
144
+      path: `/pages/details/foodDetails/foodDetails?id=${id}`,
145
+      imageUrl: detail.poster,
146
+    };
147
+  });
121 148
 
122 149
   return (
123
-    <view className='page-index'>
124
-      <view className='index-navbar'>
125
-        <CustomNav title='十公里' />
150
+    <view className="page-index">
151
+      <view className="index-navbar">
152
+        <CustomNav title="十公里" />
126 153
       </view>
127
-      <view style={{ overflow: 'auto', padding: '0 30rpx', background: '#F8F8F8' }}>
128
-        <scroll-view scroll-y='true' scroll-view='true' bindscrolltoupper='upper' bindscrolltolower='lower' bindscroll='scroll'>
129
-          <view className='storeDetails'>
154
+      <view
155
+        style={{ overflow: "auto", padding: "0 30rpx", background: "#F8F8F8" }}
156
+      >
157
+        <scroll-view
158
+          scroll-y="true"
159
+          scroll-view="true"
160
+          bindscrolltoupper="upper"
161
+          bindscrolltolower="lower"
162
+          bindscroll="scroll"
163
+        >
164
+          <view className="storeDetails">
130 165
             <Swiper
131
-              className='.swiper'
166
+              className=".swiper"
132 167
               circular
133 168
               current={index}
134 169
               onChange={handchange}
135 170
             >
136
-              {
137
-                imglist.map((item) =>
138
-                  <SwiperItem>
139
-                    <image src={item.url} className='storeImage' >
140
-                      <view className='tpPage'>
141
-                        <text>{index + 1}/{imglist.length}</text>
142
-                      </view>
143
-                    </image>
144
-                  </SwiperItem>
145
-                )
146
-              }
171
+              {imglist.map((item) => (
172
+                <SwiperItem>
173
+                  <image src={item.url} className="storeImage">
174
+                    <view className="tpPage">
175
+                      <text>
176
+                        {index + 1}/{imglist.length}
177
+                      </text>
178
+                    </view>
179
+                  </image>
180
+                </SwiperItem>
181
+              ))}
147 182
             </Swiper>
148
-            <view className='storeJs'>
149
-              <view style={{ overflow: 'hidden' }}>
150
-                <view className='storeName'>{detail.shopName}</view>
151
-                <view className='sprice'>
152
-                  <text className='t1'>¥</text>
183
+            <view className="storeJs">
184
+              <view style={{ overflow: "hidden" }}>
185
+                <view className="storeName">{detail.shopName}</view>
186
+                <view className="sprice">
187
+                  <text className="t1">¥</text>
153 188
                   {detail.averagePrice / 100}/人
154
-                  <view className='bzRight'>
155
-                    <image src={baozan} style={{ width: '15px', height: '15px', marginRight: '11rpx', marginBottom: '-2px' }} />
156
-                    爆赞{detail.likeNum}</view>
189
+                  <view className="bzRight">
190
+                    <image
191
+                      src={baozan}
192
+                      style={{
193
+                        width: "15px",
194
+                        height: "15px",
195
+                        marginRight: "11rpx",
196
+                        marginBottom: "-2px",
197
+                      }}
198
+                    />
199
+                    爆赞{detail.likeNum}
200
+                  </view>
157 201
                 </view>
158 202
               </view>
159
-              <view className='appraise'>
160
-                <Star star={star} />{star}
161
-                <view style={{ float: 'right', marginTop: '5px' }}>
162
-                  <text className='comment'>点评:</text>
163
-                  <text className='t1'>口味:{detail.sweetScore}</text>
164
-                  <text className='t1'>环境:{detail.environmentScore}</text>
165
-                  <text className='t1'>服务:{detail.serviceScore}</text>
203
+              <view className="appraise">
204
+                <Star star={star} />
205
+                {star}
206
+                <view style={{ float: "right", marginTop: "5px" }}>
207
+                  <text className="comment">点评:</text>
208
+                  <text className="t1">口味:{detail.sweetScore}</text>
209
+                  <text className="t1">环境:{detail.environmentScore}</text>
210
+                  <text className="t1">服务:{detail.serviceScore}</text>
166 211
                 </view>
167 212
               </view>
168
-              <view className='yysj'>
169
-                <image src={yysj} className='yysjImg' />营业时间:{detail.businessHours}
213
+              <view className="yysj">
214
+                <image src={yysj} className="yysjImg" />
215
+                营业时间:{detail.businessHours}
170 216
               </view>
171
-              <view className='dpPosition' onClick={openMap}>
172
-                <image src={dw} className='dwTip' />
217
+              <view className="dpPosition" onClick={openMap}>
218
+                <image src={dw} className="dwTip" />
173 219
                 <view>
174
-                  {detail.address}<image src={zhuandao} className='zhuandao' />
220
+                  {detail.address}
221
+                  <image src={zhuandao} className="zhuandao" />
175 222
                 </view>
176 223
               </view>
177 224
             </view>
178 225
           </view>
179
-          <view style={{ position: 'relative', display: spackage == '' ? 'none' : '' }}>
180
-            <view className='title'>
181
-              <image src={titlezs} /><text>返现套餐</text>
226
+          <view
227
+            style={{
228
+              position: "relative",
229
+              display: spackage == "" ? "none" : "",
230
+            }}
231
+          >
232
+            <view className="title">
233
+              <image src={titlezs} />
234
+              <text>返现套餐</text>
182 235
             </view>
183
-            {spackage?.map((item) => <Cards star={star} item={item} />)}
184
-            <view className='showMore' style={{ display: newpgNum == AllpgNum ? 'none' : '' }} onClick={pgMore}>
236
+            {(spackage || []).map((item) => (
237
+              <Cards star={star} item={item} />
238
+            ))}
239
+            <view
240
+              className="showMore"
241
+              style={{ display: newpgNum == AllpgNum ? "none" : "" }}
242
+              onClick={pgMore}
243
+            >
185 244
               <view>查看更多</view>
186
-              <image src={showMore} className='moreTip' />
245
+              <image src={showMore} className="moreTip" />
187 246
             </view>
188 247
           </view>
189
-          <view style={{ position: 'relative', display: extend == '' ? 'none' : '' }}>
190
-            <view className='title'>
248
+          <view
249
+            style={{
250
+              position: "relative",
251
+              display: extend == "" ? "none" : "",
252
+            }}
253
+          >
254
+            <view className="title">
191 255
               <image src={titlezs} />
192 256
               <text>本店指南</text>
193 257
             </view>
194
-            {extend?.map((item) => <Extend item={item} />)}
195
-            <view className='showMore' style={{ display: newextNum == AllextNum ? 'none' : '' }} onClick={extendMore}>
258
+            {(extend || []).map((item) => (
259
+              <Extend item={item} />
260
+            ))}
261
+            <view
262
+              className="showMore"
263
+              style={{ display: newextNum == AllextNum ? "none" : "" }}
264
+              onClick={extendMore}
265
+            >
196 266
               <view>查看更多</view>
197
-              <image src={showMore} className='moreTip' />
267
+              <image src={showMore} className="moreTip" />
198 268
             </view>
199 269
           </view>
200
-          <view className='botton' style={{ display: newextNum == AllextNum ? '' : 'none' }}>已经到底了~</view>
270
+          <view
271
+            className="botton"
272
+            style={{ display: newextNum == AllextNum ? "" : "none" }}
273
+          >
274
+            已经到底了~
275
+          </view>
201 276
         </scroll-view>
202 277
       </view>
203
-      <view className='bottomTab'>
204
-        <Button openType='share' className='sharebtn'>分享</Button>
205
-        <view className='tab'>
206
-          <image className='share' src={share} />分享
278
+      <view className="bottomTab">
279
+        <Button openType="share" className="sharebtn">
280
+          分享
281
+        </Button>
282
+        <view className="tab">
283
+          <image className="share" src={share} />
284
+          分享
207 285
         </view>
208
-        <view className='tab' onClick={toggleLike}>
209
-          <image className='good' src={isLike > 0 ? baozan : weibaozan} />{isLike > 0 ? '已爆赞' : '爆赞'}
286
+        <view className="tab" onClick={toggleLike}>
287
+          <image className="good" src={isLike > 0 ? baozan : weibaozan} />
288
+          {isLike > 0 ? "已爆赞" : "爆赞"}
210 289
         </view>
211
-        <view className='tab' onClick={toggleSave}>
212
-          <image className='collection' src={isSaved > 0 ? ax : good} />{isSaved > 0 ? '已收藏' : '加入收藏'}
290
+        <view className="tab" onClick={toggleSave}>
291
+          <image className="collection" src={isSaved > 0 ? ax : good} />
292
+          {isSaved > 0 ? "已收藏" : "加入收藏"}
213 293
         </view>
214 294
       </view>
215 295
     </view>
216
-  )
217
-})
296
+  );
297
+});

+ 13
- 11
src/pages/details/mjDetails/sceneryDetails.jsx 查看文件

@@ -16,19 +16,20 @@ import useSave from "@/utils/hooks/useSave"
16 16
 import useLike from "@/utils/hooks/useLike"
17 17
 import Cards from '@/components/foodCards/foodCards.jsx'
18 18
 import Taro,{ useShareAppMessage } from '@tarojs/taro'
19
-import { getResourceList } from '@/services/home'
19
+import { getTouristDistance } from '@/services/home'
20 20
 import Extend from '../components/Extend/extend'
21 21
 import './sceneryDetails.less'
22 22
 
23 23
 
24 24
 
25 25
 export default withLayout((props) => {
26
-  const { router, person } = props
27
-  const { id, distance, location } = props.router.params
26
+  const { router, person ,location } = props
27
+  const { id} = props.router.params
28 28
   const [detail, setDetail] = useState({})
29 29
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'tourist', id)
30 30
   const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
31
-
31
+  const [distance,setDistance]=useState()
32
+  const [tslocation,setTsLocation]=useState('')
32 33
   //banner图集数组
33 34
   const [imglist, setimglist] = useState([])
34 35
   const [index, setIndex] = useState(0)
@@ -66,8 +67,6 @@ export default withLayout((props) => {
66 67
   }
67 68
   const log = useRef('')
68 69
   const lat = useRef('')
69
-
70
-
71 70
   useEffect(() => {
72 71
     getTouristDetail(id).then((res) => {
73 72
       log.current = (res.locaton).toString().split(',')[0]
@@ -81,11 +80,14 @@ export default withLayout((props) => {
81 80
       setAllextNum(res.total)
82 81
       setNewextNum(res.records.length)
83 82
     })
84
-    getRecommendList({ location: location }).then((res) => {
83
+    getTouristDistance('tourist',id,{location:location}).then((res)=>{
84
+      setDistance((res.distance / 1000).toFixed(2))
85
+      setTsLocation(res.lng + ',' + res.lat)
86
+    })    
87
+    getRecommendList({ location: tslocation }).then((res) => {
85 88
       setRecommend(res || [])
86 89
     })
87
-  }, [])
88
-  
90
+  }, []) 
89 91
   // 分享
90 92
   useShareAppMessage(()=>{
91 93
     return {
@@ -148,7 +150,7 @@ export default withLayout((props) => {
148 150
             <view className='title'>
149 151
               <image src={titlejd} />景点介绍
150 152
             </view>
151
-            {extend?.map((item) => <Extend item={item} />)}
153
+            {(extend||[]).map((item) => <Extend item={item} />)}
152 154
             <view className='showMore' style={{ display: newextNum == AllextNum ? 'none' : '' }} onClick={extendMore}>
153 155
               <view>点击查看更多</view>
154 156
               <image src={showMore} className='moreTip' />
@@ -158,7 +160,7 @@ export default withLayout((props) => {
158 160
             <view className='title'>
159 161
               <image src={titlems} />老板推荐好吃的
160 162
             </view>
161
-            {recommend?.map((item) => <Cards item={item} />)}
163
+            {(recommend||[]).map((item) => <Cards item={item} />)}
162 164
           </view>
163 165
           <view className='bottom'>已经到底了~</view>
164 166
         </scroll-view>

+ 1
- 1
src/pages/index/components/Card.js 查看文件

@@ -16,7 +16,7 @@ export default (props) => {
16 16
   const Detail = () => {
17 17
     if (item.targetType == 'tourist') {
18 18
       let loc = item.lng + ',' + item.lat
19
-      Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}&distance=${(item.distance / 1000).toFixed(2)}&location=${loc}` });
19
+      Taro.navigateTo({ url: `/pages/details/mjDetails/sceneryDetails?id=${item.targetId}` });
20 20
     }
21 21
     else {
22 22
       Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })

+ 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'>

+ 4
- 6
src/pages/index/tabs/Mine.jsx 查看文件

@@ -31,7 +31,6 @@ export default (props) => {
31 31
   const hasAvatar = !!person.avatar
32 32
   const [orderNum, setOrderNum] = useState([])
33 33
 
34
-  console.log('--------DefaultImage-----', DefaultImage)
35 34
 
36 35
   const ShowMoldeOn = () => {
37 36
     setShowCutover(true)
@@ -46,7 +45,6 @@ export default (props) => {
46 45
   }, [])
47 46
 
48 47
 
49
-
50 48
   // 通过getUserProfile获取微信用户信息
51 49
   const handleGetUserProfile = () => {
52 50
     if (hasAvatar) return;
@@ -115,7 +113,7 @@ export default (props) => {
115 113
 
116 114
       <view className='User-box'>
117 115
         {/* 身份切换 */}
118
-        <ToggleRole showCutover={showCutover} onClose={onClose} role='normal' />
116
+        <ToggleRole showCutover={showCutover} maskClosable={showCutover} onClose={onClose} role='normal' />
119 117
         <view className='User-info'>
120 118
           <view className='User-photos-box'>
121 119
             <image src={person.avatar || DefaultImage} className='User-photos' />
@@ -135,12 +133,12 @@ export default (props) => {
135 133
             <view className='buy-list-Paybox' onClick={handleTobePaid} >
136 134
               <image className='buy-list-PayLogo' src={awaitPay} />
137 135
               <view className='buy-list-goPay'>待支付</view>
138
-              <view className='buy-list-OrderNumber'>{orderNum?.unPayNum}笔订单</view>
136
+              <view className='buy-list-OrderNumber'>{orderNum?.unPayNum || '0'}笔订单</view>
139 137
             </view>
140 138
             <view className='buy-list-Paybox ' onClick={handleTobeWritten} >
141 139
               <image className='buy-list-PayLogo' src={ToShop} />
142 140
               <view className='buy-list-goPay'>待核销</view>
143
-              <view className='buy-list-OrderNumber'>{orderNum?.unVerifiedNum}个订单</view>
141
+              <view className='buy-list-OrderNumber'>{orderNum?.unVerifiedNum || '0'}个订单</view>
144 142
             </view>
145 143
             <view className='buy-list-Paybox ' onClick={handleAllOrder} >
146 144
               <image className='buy-list-PayLogo' src={AllOrder} />
@@ -150,7 +148,7 @@ export default (props) => {
150 148
             <view className='buy-list-Paybox ' onClick={handleRefund} >
151 149
               <image className='buy-list-PayLogo' src={Refund} />
152 150
               <view className='buy-list-goPay'>退款/售后</view>
153
-              <view className='buy-list-OrderNumber'>{orderNum?.refundNum}笔订单</view>
151
+              <view className='buy-list-OrderNumber'>{orderNum?.refundNum || '0'}笔订单</view>
154 152
             </view>
155 153
           </view>
156 154
           <view className='Badge-box'>

+ 4
- 3
src/pages/index/tabs/Recommend.jsx 查看文件

@@ -34,13 +34,14 @@ export default (props) => {
34 34
       setQueryParams({ location: location, pageNum: 1, pageSize: 10, typeId: '' })
35 35
     }
36 36
   }
37
-
38 37
   useEffect(() => {
39 38
     //查询分类标签表
40 39
     getIndexType({ pageSize: 20 }).then((res) => {
41 40
       setTypeList(res.records || [])
42
-    })    
41
+    })
43 42
   }, [])
43
+
44
+
44 45
   const onSearch = () => {
45 46
     // 用绝对路径
46 47
     Taro.navigateTo({ url: '/pages/search/search' });
@@ -75,7 +76,7 @@ export default (props) => {
75 76
       </view>
76 77
 
77 78
       <List
78
-        style={{ height: 'calc(100% - 160px)' }}
79
+        style={{ height: 'calc(100% - 145px)' }}
79 80
         request={getResourceList}
80 81
         params={queryParams}
81 82
         onDataChange={setAllList}

+ 1
- 1
src/pages/search/search.jsx 查看文件

@@ -35,7 +35,7 @@ export default withLayout((props) => {
35 35
                 <view className='hotSearch'>热门搜索</view>
36 36
                 <view className='hotSearchtip'>
37 37
                     {
38
-                        hotList?.map((item) => <view onClick={()=>hotSearch(item.word)}>{item.word}</view>)
38
+                        (hotList||[]).map((item) => <view onClick={()=>hotSearch(item.word)}>{item.word}</view>)
39 39
                     }
40 40
                 </view>
41 41
             </view>

+ 19
- 20
src/pages/searchResult/searchResult.jsx 查看文件

@@ -4,19 +4,20 @@ import iconsearch from '../../assets/icons/housemantj/search.png'
4 4
 import CustomNav from '@/components/CustomNav'
5 5
 import Taro from '@tarojs/taro'
6 6
 import Card from '../index/components/Card'
7
-import {getResourceList } from '@/services/home'
7
+import { getResourceList } from '@/services/home'
8
+import List from '@/components/List';
8 9
 import './searchResult.less'
9 10
 import withLayout from '@/layouts'
10 11
 
11 12
 
12 13
 
13 14
 export default withLayout((props) => {
14
-  const { router, person,location } = props
15
-  const { q} = props.router.params
15
+  const { router, person, location } = props
16
+  const { q } = props.router.params
16 17
 
17 18
   // 横向tab
18 19
   const [activeTab, setActiveTab] = useState(0)
19
-  const [queryParams, setQueryParams] = useState({q:q, location: location, pageNum: 1, pageSize: 10, typeId: '' })
20
+  const [queryParams, setQueryParams] = useState({ q: q, location: location, pageNum: 1, pageSize: 10, typeId: '' })
20 21
 
21 22
   // 获取资源表信息
22 23
   const [alllist, setAllList] = useState([])
@@ -35,13 +36,13 @@ export default withLayout((props) => {
35 36
     const { index } = e.detail
36 37
     setActiveTab(index)
37 38
     if (index == 0) {
38
-      setQueryParams({q:q, location: location, pageNum: 1, pageSize: 10, typeId: '' })
39
+      setQueryParams({ q: q, location: location, pageNum: 1, pageSize: 10, typeId: '' })
39 40
     }
40
-    else if(index==1){
41
-      setQueryParams({q:q,targetType:'shop', location: location, pageNum: 1, pageSize: 10, typeId: '' })      
41
+    else if (index == 1) {
42
+      setQueryParams({ q: q, targetType: 'shop', location: location, pageNum: 1, pageSize: 10, typeId: '' })
42 43
     }
43
-    else{
44
-      setQueryParams({q:q,targetType:'tourist', location: location, pageNum: 1, pageSize: 10, typeId: '' })
44
+    else {
45
+      setQueryParams({ q: q, targetType: 'tourist', location: location, pageNum: 1, pageSize: 10, typeId: '' })
45 46
     }
46 47
   }
47 48
 
@@ -52,11 +53,6 @@ export default withLayout((props) => {
52 53
     Taro.navigateTo({ url: '/pages/search/search' });
53 54
   }
54 55
 
55
-  useEffect(() => {
56
-    getResourceList(queryParams).then((res) => {
57
-      setAllList(res.records || [])
58
-    })
59
-  }, [queryParams])
60 56
 
61 57
 
62 58
 
@@ -82,15 +78,18 @@ export default withLayout((props) => {
82 78
           >
83 79
           </mp-tabs>
84 80
         </view>
85
-
86
-        <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{height:'100vh'}} >
87
-          <view className="waterfall">
81
+        <List
82
+          style={{ height: 'calc(100% - 90px)' }}
83
+          request={getResourceList}
84
+          params={queryParams}
85
+          onDataChange={setAllList}
86
+        >
87
+          <view className='waterfall'>
88 88
             {
89
-              alllist?.map((item) => <Card key={item.resourceNo} item={item} />)
89
+              alllist.map((item) => <Card key={item.resourceNo} item={item} />)
90 90
             }
91 91
           </view>
92
-          <view className='botton'>已经到底了~</view>
93
-        </scroll-view>
92
+        </List>
94 93
       </view>
95 94
     </view>
96 95
   )

+ 7
- 0
src/services/home.js 查看文件

@@ -103,6 +103,13 @@ export const getExtendContent = (type, id, params) => request(`/${type}/${id}/co
103 103
  */
104 104
 export const getTouristDetail = (id) => request(`/tourist/${id}`)
105 105
 
106
+/**
107
+ * 获取景点距离定位 用于通过景点分享功能进入景点详情页的客户
108
+ * @param {*} id 
109
+ * @returns 
110
+ */
111
+ export const getTouristDistance = (targetType,targetId,params) => request(`/resource/${targetType}/${targetId}`,{params})
112
+
106 113
 /**
107 114
  * 获取推荐套餐列表
108 115
  * @returns 

+ 39
- 17
src/services/landlord.js 查看文件

@@ -6,14 +6,22 @@ import request from '@/utils/request'
6 6
  * @param {*} id 
7 7
  * @returns 
8 8
  */
9
- export const getHotelDetail = (id) => request(`/taHotel/${id}`)
10
- 
9
+export const getHotelDetail = (id) => request(`/taHotel/${id}`)
10
+
11 11
 /**
12 12
  * 查询指定名宿的账户
13 13
  * @param {*} params 
14 14
  * @returns 
15 15
  */
16
- export const getNowHotelManage = (id,params) => request(`/hotel/manage/${id}`, { params })
16
+export const getNowHotelManage = (id, params) => request(`/hotel/manage/${id}`, { params })
17
+
18
+
19
+/**
20
+* 查询指定商铺的账户
21
+* @param {*} params 
22
+* @returns 
23
+*/
24
+export const getNowShopManage = (id, params) => request(`/shop/manage/${id}`, { params })
17 25
 
18 26
 
19 27
 /**
@@ -21,35 +29,49 @@ import request from '@/utils/request'
21 29
  * @param {*} params 
22 30
  * @returns 
23 31
  */
24
- export const getHotelManage = (params) => request('/hotel/manage/index', { params })
32
+export const getHotelManage = (params) => request('/hotel/manage/index', { params })
25 33
 
26 34
 /**
27 35
  * 查询指定名宿的账户流水
28 36
  * @param {*} params 
29 37
  * @returns 
30 38
  */
31
- export const getAccountLogList = (id) => request(`/hotel/account/${id}/log`)
39
+export const getAccountLogList = (id) => request(`/hotel/account/${id}/log`)
32 40
 
33 41
 /**
34 42
  * 房源列表
35 43
  * @param {*} id 
36 44
  * @returns 
37 45
  */
38
- export const getRoomList = (params) => request('/taRoom',{params})
46
+export const getRoomList = (params) => request('/taRoom', { params })
39 47
 
40 48
 /**
41 49
  * 保存房源
42 50
  * @param {*} data 
43 51
  * @returns 
44 52
  */
45
- export const saveRoom = (data) => request('/taRoom', { method: 'post', data })
53
+export const saveRoom = (data) => request('/taRoom', { method: 'post', data })
46 54
 
47
- /**
48
- * 删除房源
55
+/**
56
+* 删除房源
57
+* @param {*} data 
58
+* @returns 
59
+*/
60
+export const deleteRoom = (id) => request(`/taRoom/${id}`, { method: 'delete' })
61
+
62
+/**
63
+* 房源详情
64
+* @param {*} id 
65
+* @returns 
66
+*/
67
+export const getRoomDetail = (id) => request(`/taRoom/${id}`)
68
+
69
+/**
70
+ * 更新房源
49 71
  * @param {*} data 
50 72
  * @returns 
51 73
  */
52
-  export const deleteRoom = (id) => request(`/taRoom/${id}`, { method: 'delete'})
74
+export const updateRoom = (data, id) => request(`/taRoom/${id}`, { method: 'put', data })
53 75
 
54 76
 
55 77
 /**
@@ -57,10 +79,10 @@ import request from '@/utils/request'
57 79
  * @param {*} data 
58 80
  * @returns 
59 81
  */
60
- export const shareRoom = (data) => request('/roomOrder', { method: 'post', data })
61
- /**
62
- * 查看历史入住人列表
63
- * @param {*} id 
64
- * @returns 
65
- */
66
-  export const getRoomOrderList = (params) => request('/roomOrder',{params})
82
+export const shareRoom = (data) => request('/roomOrder', { method: 'post', data })
83
+/**
84
+* 查看历史入住人列表
85
+* @param {*} id 
86
+* @returns 
87
+*/
88
+export const getRoomOrderList = (params) => request('/roomOrder', { params })

+ 1
- 1
src/services/shopBoss.js 查看文件

@@ -23,7 +23,7 @@ export const getShopMoney = (id, amountType) => request(`/shop/${id}/account?amo
23 23
  * @param {*} 
24 24
  * @returns 
25 25
  */
26
-export const getAccount = (id,) => request(`/shop/account/${id}/log`, { id })
26
+export const getAccount = (id, params) => request(`/shop/account/${id}/log`, { params })
27 27
 
28 28
 
29 29
 /**

+ 47
- 43
src/shop/components/ShopKeeper/shopKeeper.jsx 查看文件

@@ -1,4 +1,4 @@
1
-import { React, useState, useEffect, } from 'react'
1
+import { React, useState, useEffect, useRef } from 'react'
2 2
 import Taro, { useRouter } from '@tarojs/taro'
3 3
 import CustomNav from '@/components/CustomNav'
4 4
 import Picker from '@/components/Picker'
@@ -6,29 +6,40 @@ import Popup from '@/components/Popup'
6 6
 import ShopUsed from '@/components/ShopUsed' //已核销
7 7
 import ShopUnused from '@/components/ShopUnused' //未核销
8 8
 import SearchBar from '@/components/SearchBar'
9
+import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
10
+import List from '@/components/List';
9 11
 
10 12
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
11 13
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
12 14
 import iconsearch from '@/assets/icons/housemantj/search.png'
13 15
 import ms from '@/assets/icons/housemantj/ms3.jpg'
16
+import ToggleRole from '@/components/toggleRole/ToggleRole'
17
+
14 18
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
15
-import touristON from '@/assets/icons/UserCenter/touristON.png'
16
-import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
17
-import hotelBossON from '@/assets/icons/UserCenter/hotelBossON.png'
18
-import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
19
-import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
20
-import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
21 19
 import './shopKeeper.less'
22
-import ToggleRole from '@/components/toggleRole/ToggleRole'
20
+import { useMemo } from 'react'
23 21
 
24 22
 
25 23
 export default (props) => {
26
-  const { shopList, shop, onHotelChange, shopMoney, verifiedOrder, onVarified, onVarifiedTwo } = props
27
-  const shopId = shop?.shopId
28
-  const [activeTab, setActiveTab] = useState(0)
24
+  const { shopList, shop, onHotelChange, shopMoney, verifiedOrder, isVerified, onVarified, onVarifiedTwo, setVer } = props
29 25
   const { params } = useRouter()
30 26
   const { tabJump } = params || {}
31 27
 
28
+  const [activeTab, setActiveTab] = useState(0)
29
+  const [phone, setPhone] = useState()
30
+  // const [isVerified, setisVerified] = useState(0)
31
+  // const [queryParams, setQueryParams] = useState({ isVerified: isVerified, pageNum: 1, pageSize: 10, shopId: shop?.shopId, phone: phone })
32
+
33
+  const queryParams = useMemo(() => ({
34
+    shopId: shop?.shopId,
35
+    isVerified: `${tabJump}` === '1' ? 1 : 0,
36
+    phone: phone || '',
37
+  }), [phone, shop?.shopId, tabJump])
38
+
39
+
40
+  // 获取资源表信息
41
+  const [alllist, setAllList] = useState([])
42
+
32 43
   const [isyear, setYear] = useState(true)
33 44
   const [isMomth, setMonth] = useState(false)
34 45
   //小眼睛开关
@@ -45,6 +56,10 @@ export default (props) => {
45 56
   }
46 57
 
47 58
 
59
+  const handelSearch = (e) => {
60
+    const val = e.detail.value
61
+    setPhone(val)
62
+  }
48 63
   useEffect(() => {
49 64
     if (tabJump) {
50 65
       setActiveTab(tabJump - 0)
@@ -54,13 +69,6 @@ export default (props) => {
54 69
   const handleTabChange = (e) => {
55 70
     const { index } = e.detail
56 71
     setActiveTab(index)
57
-    if (index === 1) {
58
-      onVarified()
59
-
60
-    } else {
61
-      onVarifiedTwo()
62
-
63
-    }
64 72
   }
65 73
   const tabs = [
66 74
     {
@@ -71,16 +79,12 @@ export default (props) => {
71 79
     },
72 80
   ]
73 81
 
74
-
82
+  //给父组件传val
75 83
   const handleVarified = () => {
76 84
     onVarified()
77 85
   }
78 86
 
79 87
 
80
-  const onSearch = (e) => {
81
-    console.log('eeeeeeeeeeeeeeeeee', e.detail.value);
82
-  }
83
-
84 88
   const [showCutover, setShowCutover] = useState(false)
85 89
   const ShowMoldeOn = () => {
86 90
     setShowCutover(true)
@@ -92,7 +96,7 @@ export default (props) => {
92 96
     <view>
93 97
       <view>
94 98
       </view>
95
-      <ToggleRole showCutover={showCutover} onClose={onClose} role='shop' />
99
+      <ToggleRole showCutover={showCutover} maskClosable={showCutover} onClose={onClose} role='shop' />
96 100
       <view style={{ padding: '30rpx', height: '100%' }}>
97 101
         <scroll-view scroll-y scroll-view='true' bindscrolltoupper='upper' bindscrolltolower='lower' bindscroll='scroll' style={{ height: 'calc(100vh - 120px)' }}>
98 102
           <view className='storexx'>
@@ -121,7 +125,7 @@ export default (props) => {
121 125
           </view>
122 126
           <view className='search'>
123 127
 
124
-            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={onSearch} />
128
+            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={handelSearch} />
125 129
           </view>
126 130
           <view className='index-tabs'>
127 131
             <mp-tabs
@@ -135,38 +139,38 @@ export default (props) => {
135 139
             >
136 140
             </mp-tabs>
137 141
           </view>
138
-          {
139
-            verifiedOrder.map
140
-
141
-          }
142 142
           <view>
143 143
             {/* 未核销 */}
144 144
             {activeTab === 0 &&
145 145
               <>
146
-                {
147
-                  verifiedOrder.map((item, index) => {
148
-
149
-                    return <ShopUnused key={(index)} item={item} />
150
-                  })
151
-                }
146
+                <List
147
+                  style={{ height: '50%' }}
148
+                  request={getVerifiedOrder}
149
+                  params={queryParams}
150
+                  onDataChange={setAllList}
151
+                  render={({ item, index }) => <ShopUnused key={(index)} item={item} />}
152
+                >
153
+                </List>
152 154
               </>
155
+
153 156
             }
154 157
             {/* 已核销 */}
155 158
             {activeTab === 1 &&
156 159
               <>
157
-                {
158
-                  verifiedOrder.map((item, index) => {
159
-
160
-                    return <ShopUsed verifiedOrder={verifiedOrder} key={(index)} item={item} />
161
-                  })
162
-                }
163
-
160
+                <List
161
+                  style={{ height: '50%' }}
164 162
 
163
+                  request={getVerifiedOrder}
164
+                  params={queryParams}
165
+                  onDataChange={setAllList}
166
+                  render={({ item, index }) => <ShopUsed verifiedOrder={verifiedOrder} key={(index)} item={item} />}
167
+                >
168
+                </List>
165 169
 
166 170
               </>
167 171
             }
168 172
           </view>
169
-          <view className='botton'>已经到底了~</view>
173
+          {/* <view className='botton'>已经到底了~</view> */}
170 174
         </scroll-view>
171 175
       </view>
172 176
     </view>

+ 19
- 22
src/shop/components/Sparead/spreadMoney.jsx 查看文件

@@ -1,8 +1,10 @@
1
-import { useState, useEffect } from 'react'
1
+import { useState, useEffect, useMemo } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import CustomNav from '@/components/CustomNav'
4 4
 import Popup from '@/components/Popup'
5
+import List from '@/components/List';
5 6
 import Picker from '@/components/Picker'
7
+import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
6 8
 import ShopCommission from '@/components/ShopCommission'
7 9
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
8 10
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
@@ -10,34 +12,30 @@ import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
10 12
 import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
11 13
 import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
12 14
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
13
-import { getAccount } from '@/services/shopBoss'
14 15
 import ToggleRole from '@/components/toggleRole/ToggleRole'
15 16
 
16 17
 
17 18
 import './spreadMoney.less'
18 19
 
20
+const getList = (id) => (params) => getAccount(id, params)
21
+
19 22
 export default (props) => {
20 23
   const { shopList, shop, onHotelChange, shopMoney } = props
21 24
   const [showCutover, setShowCutover] = useState(false)
22 25
   const [isyear, setYear] = useState(false)
23 26
   const [isMomth, setMonth] = useState(false)
24
-  const [shopAccount, setShopAccount] = useState([])
25 27
   const acc = shopMoney?.acc
26 28
   const { accountId } = acc
27 29
 
30
+  const queryParams = useMemo(() => ({
28 31
 
32
+  }), [])
29 33
 
30 34
 
35
+  const reqestAPI = getList(shopMoney?.acc?.accountId)
31 36
 
32 37
 
33
-  useEffect(() => {
34
-    getAccount(accountId).then((e) => {
35
-      const accContent = e.records
36
-      setShopAccount(accContent)
37
-
38
-    })
39 38
 
40
-  }, [accountId])
41 39
 
42 40
   //小眼睛开关
43 41
   const handleYear = () => {
@@ -65,7 +63,7 @@ export default (props) => {
65 63
     <view>
66 64
       <view>
67 65
       </view>
68
-      <ToggleRole showCutover={showCutover} onClose={onClose} role='shop' />
66
+      <ToggleRole showCutover={showCutover} maskClosable={showCutover} onClose={onClose} role='shop' />
69 67
       <view style={{ padding: '30rpx', height: '100%' }}>
70 68
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 120px)' }}>
71 69
           <view className='storexx'>
@@ -78,7 +76,7 @@ export default (props) => {
78 76
               <view className='sleft'>
79 77
                 <view className='lword'>全年推广收入(税前)</view>
80 78
                 <view className='yearMoney'>
81
-                  <text>{isyear ? shopMoney?.totalCharges / 100 : '******'}</text>元
79
+                  <text>{isyear ? (shopMoney?.totalCharges / 100).toFixed(2) : '******'}</text>元
82 80
                   <image className='micon' src={isyear ? eyes : ceyes} onClick={handleYear} />
83 81
                 </view>
84 82
               </view>
@@ -86,21 +84,20 @@ export default (props) => {
86 84
               <view className='sright'>
87 85
                 <view className='rword'>当月推广收入(税前)</view>
88 86
                 <view className='monthMoney'>
89
-                  <text>{isMomth ? shopMoney?.currentCharges / 100 : '******'}</text>元
87
+                  <text>{isMomth ? (shopMoney?.currentCharges / 100).toFixed(2) : '******'}</text>元
90 88
                   <image className='micon2' src={isMomth ? eyes : ceyes} onClick={handleMonth}></image>
91 89
                 </view></view>
92 90
             </view>
93 91
           </view>
94 92
           <view className='title'>推广收入记录</view>
95
-          {
96
-            shopAccount.map((item, index) => {
97
-              return (
98
-                <ShopCommission key={(index)} item={item} />
99
-
100
-              )
101
-            })
102
-          }
103
-          <view className='botton'>已经到底了~</view>
93
+          <List
94
+            style={{ height: 'calc(100% - 145px)' }}
95
+            request={reqestAPI}
96
+            params={queryParams}
97
+
98
+            render={({ item, index }) => <ShopCommission key={(index)} item={item} />}
99
+          >
100
+          </List>
104 101
         </scroll-view>
105 102
       </view>
106 103
 

+ 42
- 25
src/shop/pages/spread/spreadIndex.jsx 查看文件

@@ -2,14 +2,16 @@ import React, { useState, useEffect } from 'react'
2 2
 import CustomNav from '@/components/CustomNav'
3 3
 import { useRouter } from '@tarojs/taro'
4 4
 import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
5
-import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
6
-import Sparead from '../../components/Sparead/spreadMoney'
5
+
7 6
 import TabBar from '@/components/CustTabBar'
8 7
 import shopImg from '@/assets/icons/shopKeeper/订单收入.png'
9 8
 import onShopImg from '@/assets/icons/shopKeeper/订单收入按下.png'
10 9
 import spareadImg from '@/assets/icons/shopKeeper/推广收入.png'
11 10
 import onSpareadImg from '@/assets/icons/shopKeeper/推广收入按下.png'
12 11
 import withLayout from '@/layouts'
12
+import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
13
+import Sparead from '../../components/Sparead/spreadMoney'
14
+
13 15
 
14 16
 import './spreadIndex.less'
15 17
 
@@ -28,6 +30,7 @@ export default withLayout((props) => {
28 30
   const [isVerified, setisVerified] = useState(0)
29 31
   const [shopMoney, setShopMoney] = useState([])
30 32
   const [verifiedOrder, setVerifiedOrder] = useState([])
33
+
31 34
   const handleTabChange = (e) => {
32 35
     const { index } = e.detail
33 36
     setCurrentTab(index)
@@ -36,7 +39,7 @@ export default withLayout((props) => {
36 39
   const handelType = () => {
37 40
     setAmountType('commission')
38 41
   }
39
-
42
+  //商铺列表
40 43
   useEffect(() => {
41 44
     getShopList().then((res) => {
42 45
       const { shopList: list, shop: current } = res
@@ -47,22 +50,30 @@ export default withLayout((props) => {
47 50
   }, [])
48 51
 
49 52
 
53
+  // 搜索核销手机号
54
+  const setVer = (e) => {
55
+    setVerifiedOrder(e.records)
56
+
57
+
58
+
59
+  }
60
+
50 61
   //未核销订单列表
51
-  useEffect(() => {
52
-    getVerifiedOrder({
53
-      isVerified: isVerified,
54
-      pageNum: 1,
55
-      pageSize: 99,
56
-      shopId: shopId,
62
+  // useEffect(() => {
63
+  //   getVerifiedOrder({
64
+  //     isVerified: isVerified,
65
+  //     pageNum: 1,
66
+  //     pageSize: 99,
67
+  //     shopId: shopId,
57 68
 
58
-    }).then((res) => {
59
-      const order = res.records
60
-      setVerifiedOrder(order)
69
+  //   }).then((res) => {
70
+  //     const order = res.records
71
+  //     setVerifiedOrder(order)
61 72
 
62
-    })
73
+  //   })
63 74
 
64 75
 
65
-  }, [shopId, isVerified])
76
+  // }, [shopId, isVerified])
66 77
 
67 78
 
68 79
   const onVarified = () => {
@@ -82,19 +93,25 @@ export default withLayout((props) => {
82 93
       })
83 94
     }
84 95
 
85
-  }, [amountType, shopId])
86
-
96
+  }, [amountType, shopId, currentTab])
87 97
 
98
+  //店铺选择
88 99
   const handleHotelChange = (current) => {
89 100
     console.log('已选择店铺', current);
90
-    // getNowHotelManage(current.shopId).then((res) => {
91
-    //   const { account: acc } = res
92
-    //   setAccount(acc)
93
-    //   setHotel(current)
94
-    //   getAccountLogList(acc.accountId).then((res2) => {
95
-    //     setAccountLog(res2.records || [])
96
-    //   })
97
-    // })
101
+    getShopMoney(current.shopId, amountType).then((e) => {
102
+      setShop(current)
103
+      getVerifiedOrder({
104
+        isVerified: isVerified,
105
+        pageNum: 1,
106
+        pageSize: 99,
107
+        shopId: current.shopId,
108
+
109
+      }).then((res) => {
110
+        const order = res.records
111
+        setVerifiedOrder(order)
112
+
113
+      })
114
+    })
98 115
   }
99 116
 
100 117
   useEffect(() => {
@@ -107,7 +124,7 @@ export default withLayout((props) => {
107 124
     <view className='page-index'>
108 125
       <CustomNav title={shop?.shopName} />
109 126
       <view className='index-container'>
110
-        {currentTab === 0 && <ShopKeeper onVarifiedTwo={onVarifiedTwo} onVarified={onVarified} verifiedOrder={verifiedOrder} shopList={shopList} shop={shop} onHotelChange={handleHotelChange} shopMoney={shopMoney} />
127
+        {currentTab === 0 && <ShopKeeper isVerified={isVerified} setVer={setVer} onVarifiedTwo={onVarifiedTwo} onVarified={onVarified} verifiedOrder={verifiedOrder} shopList={shopList} shop={shop} shopId={shopId} onHotelChange={handleHotelChange} shopMoney={shopMoney} />
111 128
         }
112 129
         {currentTab === 1 && <Sparead shopList={shopList} shop={shop} verifiedOrder={verifiedOrder} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
113 130
       </view>

+ 1
- 0
src/utils/formatPrice.js 查看文件

@@ -0,0 +1 @@
1
+export default (t) => ((t || 0) / 100).toFixed(2);