소스 검색

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

张延森 3 년 전
부모
커밋
20b6090072
45개의 변경된 파일829개의 추가작업 그리고 861개의 파일을 삭제
  1. BIN
      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

BIN
src/assets/icons/GuideCheck/refund.png 파일 보기


+ 3
- 3
src/components/BossCard/index.jsx 파일 보기

47
         <view class='left-complete-one'  >
47
         <view class='left-complete-one'  >
48
           <image className='left-image-1' src={ProCard_hot}></image>
48
           <image className='left-image-1' src={ProCard_hot}></image>
49
           <view className='left-viewText'>
49
           <view className='left-viewText'>
50
-            返现¥{item.cashback / 100}
50
+            返现¥{(item.cashback / 100)?.toFixed(2)}
51
           </view>
51
           </view>
52
           {/* 评分 */}
52
           {/* 评分 */}
53
           <view className='card-box-star'>
53
           <view className='card-box-star'>
54
             <Star star={star} />
54
             <Star star={star} />
55
             <text className='card-star-text' >{star}</text>
55
             <text className='card-star-text' >{star}</text>
56
           </view>
56
           </view>
57
-          <view className='title-image'  onClick={() => { goFood() }}>
57
+          <view className='title-image' onClick={() => { goFood() }}>
58
             <image className='image-1' mode='scaleToFill' src={item.poster}></image>
58
             <image className='image-1' mode='scaleToFill' src={item.poster}></image>
59
             <image className='image-2' src={food}></image>
59
             <image className='image-2' src={food}></image>
60
           </view>
60
           </view>
62
             <view className='Pro-title' onClick={() => { goFood() }} >
62
             <view className='Pro-title' onClick={() => { goFood() }} >
63
               <view className='title-text'>{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</view>
63
               <view className='title-text'>{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</view>
64
             </view>
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
             <view className='title-position-on'>
66
             <view className='title-position-on'>
67
               <image className='title-position' src={position} />
67
               <image className='title-position' src={position} />
68
               <text className='title-position-image'>{city.areaPName}/{city.areaName}</text>
68
               <text className='title-position-image'>{city.areaPName}/{city.areaName}</text>

+ 0
- 47
src/components/CollectList/AttractionsCollect/index.jsx 파일 보기

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
-@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
 import { getShopDetail, getShopcity } from '@/services/home'
5
 import { getShopDetail, getShopcity } from '@/services/home'
6
 import { useState, useEffect } from 'react'
6
 import { useState, useEffect } from 'react'
7
 import { View } from '@tarojs/components'
7
 import { View } from '@tarojs/components'
8
-
8
+import formatPrice from "@/utils/formatPrice";
9
 import Star from '@/components/Star/Star.jsx'
9
 import Star from '@/components/Star/Star.jsx'
10
 import position from '@/assets/icons/GuideCheck/position_logo.png'
10
 import position from '@/assets/icons/GuideCheck/position_logo.png'
11
 import SeeDetails from '@/assets/icons/GuideCheck/SeeDetails.png'
11
 import SeeDetails from '@/assets/icons/GuideCheck/SeeDetails.png'
19
 
19
 
20
 
20
 
21
 
21
 
22
-
23
 import './style.less'
22
 import './style.less'
24
 
23
 
25
 export default (props) => {
24
 export default (props) => {
26
   const { item, cardNavigateTo } = props
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
   const targetType = item.targetType
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
   const star = parseFloat(((item.sweetScore + item.environmentScore + item.serviceScore) / 3).toFixed(1));
32
   const star = parseFloat(((item.sweetScore + item.environmentScore + item.serviceScore) / 3).toFixed(1));
69
             <view class='left-complete-one'   >
38
             <view class='left-complete-one'   >
70
               <image className='left-image-1' src={ProCard_hot} style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} ></image>
39
               <image className='left-image-1' src={ProCard_hot} style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} ></image>
71
               <view className='left-viewText'  >
40
               <view className='left-viewText'  >
72
-                返现¥{item.cashback / 100}
41
+                返现¥{formatPrice(item.cashback)}
73
               </view>
42
               </view>
74
               {/* 评分 */}
43
               {/* 评分 */}
75
               <view className='card-box-star' style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} >
44
               <view className='card-box-star' style={{ display: item.targetType === 'shop_package' ? '' : 'none' }} >
76
                 <Star star={star} />
45
                 <Star star={star} />
77
                 <text className='card-star-text' >{star}</text>
46
                 <text className='card-star-text' >{star}</text>
78
               </view>
47
               </view>
79
-              <view className='title-image' onClick={() => { goFood() }}>
48
+              <view className='title-image' >
80
                 <image className='image-1' mode='scaleToFill' src={item.poster}></image>
49
                 <image className='image-1' mode='scaleToFill' src={item.poster}></image>
81
                 <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
50
                 <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
82
               </view>
51
               </view>
83
               <view className='title-content'>
52
               <view className='title-content'>
84
-                <view className='Pro-title' onClick={() => { goFood() }} >
53
+                <view className='Pro-title'  >
85
                   <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
54
                   <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
86
                 </view>
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
                 <view className='title-position-on'>
57
                 <view className='title-position-on'>
89
                   <image className='title-position' src={position} />
58
                   <image className='title-position' src={position} />
90
                   <text className='title-position-image'>{item.areaPName}/{item.areaName}</text>
59
                   <text className='title-position-image'>{item.areaPName}/{item.areaName}</text>
92
               </view>
61
               </view>
93
             </view>
62
             </view>
94
             <view class='right-complete-two'>
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
                 {/* <view className='right-number'>×1</view> */}
65
                 {/* <view className='right-number'>×1</view> */}
97
                 <image className='right-image' src={SeeDetails} />
66
                 <image className='right-image' src={SeeDetails} />
98
                 <view className='right-title'>查看详情</view>
67
                 <view className='right-title'>查看详情</view>
106
           targetType !== "shop_package" && (
75
           targetType !== "shop_package" && (
107
             <view class='wrapper-tourist'>
76
             <view class='wrapper-tourist'>
108
               <view class='left-complete-one'   >
77
               <view class='left-complete-one'   >
109
-                <view className='title-image' onClick={() => { goFood() }}>
78
+                <view className='title-image'>
110
                   <image className='image-1' mode='scaleToFill' src={item.poster}></image>
79
                   <image className='image-1' mode='scaleToFill' src={item.poster}></image>
111
                   <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
80
                   <image className='image-2' src={item.targetType === 'tourist' ? Attractions : food}></image>
112
                 </view>
81
                 </view>
113
                 <view className='title-content'>
82
                 <view className='title-content'>
114
-                  <view className='Pro-title' onClick={() => { goFood() }} >
83
+                  <view className='Pro-title'  >
115
                     <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
84
                     <view className='title-text'>{(item.title).toString().length > 25 ? (item.title).substring(0, 25) + '...' : (item.title)}</view>
116
                   </view>
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
                   </view>
90
                   </view>
122
                   <view className='title-position-on'>
91
                   <view className='title-position-on'>
123
-
124
                     <image className='title-position' src={position} />
92
                     <image className='title-position' src={position} />
125
-
126
                     <text className='title-position-image'>{item.areaPName}/{item.areaName}</text>
93
                     <text className='title-position-image'>{item.areaPName}/{item.areaName}</text>
127
-
128
                   </view>
94
                   </view>
129
                 </view>
95
                 </view>
130
               </view>
96
               </view>
131
               <view class='right-complete-two'>
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
                   {/* <view className='right-number'>×1</view> */}
99
                   {/* <view className='right-number'>×1</view> */}
134
                   <image className='right-image' src={SeeDetails} />
100
                   <image className='right-image' src={SeeDetails} />
135
                   <view className='right-title'>查看详情</view>
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
 import image from "@/assets/icons/ProCard/8kb.jpg";
5
 import image from "@/assets/icons/ProCard/8kb.jpg";
6
 import food from "@/assets/icons/ProCard/food.png";
6
 import food from "@/assets/icons/ProCard/food.png";
7
 import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
7
 import ProCard_hot from "@/assets/icons/ProCard/ProCard_hot.png";
8
+import refund from "@/assets/icons/GuideCheck/refund.png";
8
 
9
 
9
 import Evaluation from "@/assets/icons/UserCenter/Evaluation.png";
10
 import Evaluation from "@/assets/icons/UserCenter/Evaluation.png";
10
 import Null from "@/assets/icons/UserCenter/null_logo.png";
11
 import Null from "@/assets/icons/UserCenter/null_logo.png";
15
 import starOff from "@/assets/icons/GuideCheck/starOff.png";
16
 import starOff from "@/assets/icons/GuideCheck/starOff.png";
16
 import AlreadyUsed from "../AlreadyUsed";
17
 import AlreadyUsed from "../AlreadyUsed";
17
 import "./style.less";
18
 import "./style.less";
19
+import { useDidShow } from "@tarojs/taro";
18
 
20
 
19
 const scoreList = new Array(5).fill(0);
21
 const scoreList = new Array(5).fill(0);
20
 const score = "3.9";
22
 const score = "3.9";
21
 
23
 
22
 const dict = {
24
 const dict = {
23
-  0: { status: 0 },
24
-  1: { status: 1 },
25
+  0: { status: 0,isVerified: 0  },
26
+  1: { status: 1,isVerified: 0 },
25
   2: { isVerified: 1 },
27
   2: { isVerified: 1 },
26
-  3: { status: 9 },
28
+  3: { status: 9,isVerified: 0 },
27
 };
29
 };
28
 export default (props) => {
30
 export default (props) => {
29
   const { type } = props;
31
   const { type } = props;
32
   const [pageNum, setNumber] = useState(1);
34
   const [pageNum, setNumber] = useState(1);
33
   const [HasNextPage, setHasNextPage] = useState(true);
35
   const [HasNextPage, setHasNextPage] = useState(true);
34
 
36
 
37
+  useDidShow(()=>{
38
+    setNumber(1)
39
+  })
40
+
35
   useEffect(() => {
41
   useEffect(() => {
36
-    getList();
42
+    if(pageNum){
43
+      getList();
44
+    }
45
+    
37
   }, [pageNum]);
46
   }, [pageNum]);
38
 
47
 
39
   const pageRefresh = () => {
48
   const pageRefresh = () => {
46
     getOrderSub({
55
     getOrderSub({
47
       pageNum,
56
       pageNum,
48
       pageSize: 10,
57
       pageSize: 10,
58
+      isVerified: '',
49
       ...(type !== undefined ? dict[type] : null),
59
       ...(type !== undefined ? dict[type] : null),
50
     }).then((res) => {
60
     }).then((res) => {
51
       setList(
61
       setList(
76
 
86
 
77
   //核销
87
   //核销
78
   const onWriteOff = (item) => {
88
   const onWriteOff = (item) => {
89
+    // 本地测试用
79
     // Taro.navigateTo({
90
     // Taro.navigateTo({
80
     //   url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}&subOrderId=${item.subOrderId}`,
91
     //   url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}&subOrderId=${item.subOrderId}`,
81
     // });
92
     // });
123
                   <view class="left-complete-one">
134
                   <view class="left-complete-one">
124
                     <image className="left-image-1" src={ProCard_hot}></image>
135
                     <image className="left-image-1" src={ProCard_hot}></image>
125
                     <view className="left-viewText">
136
                     <view className="left-viewText">
126
-                      返现¥{item.cashback / 100}
137
+                      返现¥{(item.cashback / 100).toFixed(2)}
127
                     </view>
138
                     </view>
128
                     <view className="title-image">
139
                     <view className="title-image">
129
                       <image
140
                       <image
143
                         </view>
154
                         </view>
144
                       </view>
155
                       </view>
145
                       <text className="title-money">
156
                       <text className="title-money">
146
-                        ¥{item.unitPrice / 100}元
157
+                        ¥{(item.unitPrice / 100).toFixed(2)}元
147
                       </text>
158
                       </text>
148
                       <view className="title-time">
159
                       <view className="title-time">
149
                         有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
160
                         有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
177
                   <view class="left-complete-one">
188
                   <view class="left-complete-one">
178
                     <image className="left-image-1" src={ProCard_hot}></image>
189
                     <image className="left-image-1" src={ProCard_hot}></image>
179
                     <view className="left-viewText">
190
                     <view className="left-viewText">
180
-                      返现¥{item.cashback / 100}
191
+                      返现¥{(item.cashback / 100).toFixed(2)}
181
                     </view>
192
                     </view>
182
                     <view className="title-image">
193
                     <view className="title-image">
183
                       <image
194
                       <image
197
                         </view>
208
                         </view>
198
                       </view>
209
                       </view>
199
                       <text className="title-money">
210
                       <text className="title-money">
200
-                        ¥{item.unitPrice / 100}元
211
+                        ¥{(item.unitPrice / 100).toFixed(2)}元
201
                       </text>
212
                       </text>
202
                       <view className="title-time">
213
                       <view className="title-time">
203
                         有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
214
                         有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
217
                 </view>
228
                 </view>
218
               </view>
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
           if (item.status === 9) {
279
           if (item.status === 9) {
227
                   <view class="left-complete-one">
284
                   <view class="left-complete-one">
228
                     <image className="left-image-1" src={ProCard_hot}></image>
285
                     <image className="left-image-1" src={ProCard_hot}></image>
229
                     <view className="left-viewText">
286
                     <view className="left-viewText">
230
-                      返现¥{item.cashback / 100}
287
+                      返现¥{(item.cashback / 100).toFixed(2)}
231
                     </view>
288
                     </view>
232
                     {/* 评分 */}
289
                     {/* 评分 */}
233
                     <view className="card-box-star">
290
                     <view className="card-box-star">
261
                         </view>
318
                         </view>
262
                       </view>
319
                       </view>
263
                       <text className="title-money">
320
                       <text className="title-money">
264
-                        ¥{item.unitPrice / 100}元
321
+                        ¥{(item.unitPrice / 100).toFixed(2)}元
265
                       </text>
322
                       </text>
266
                       <view className="title-time">
323
                       <view className="title-time">
267
                         有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
324
                         有效期:{formatTime(item?.startTime, "yyyy/MM/dd")}-
287
                   <view class="left-complete-one">
344
                   <view class="left-complete-one">
288
                     <image className="left-image-1" src={ProCard_hot}></image>
345
                     <image className="left-image-1" src={ProCard_hot}></image>
289
                     <view className="left-viewText">
346
                     <view className="left-viewText">
290
-                      返现¥{item.cashback / 100}
347
+                      返现¥{(item.cashback / 100).toFixed(2)}
291
                     </view>
348
                     </view>
292
                     {/* 评分 */}
349
                     {/* 评分 */}
293
                     <view className="card-box-star">
350
                     <view className="card-box-star">
322
                         </view>
379
                         </view>
323
                       </view>
380
                       </view>
324
                       <text className="title-money">
381
                       <text className="title-money">
325
-                        ¥{item.unitPrice / 100}元
382
+                        ¥{(item.unitPrice / 100).toFixed(2)}元
326
                       </text>
383
                       </text>
327
                       <view className="title-time">
384
                       <view className="title-time">
328
                         核销时间:{" "}
385
                         核销时间:{" "}

+ 27
- 17
src/components/List/index.jsx 파일 보기

9
     params,
9
     params,
10
     pageSize = 10,
10
     pageSize = 10,
11
     onError,
11
     onError,
12
+    shopId,
12
     onDataChange,
13
     onDataChange,
13
     ...leftProps
14
     ...leftProps
14
   } = props
15
   } = props
17
   const [payload, setPayload] = useState({})
18
   const [payload, setPayload] = useState({})
18
   const [list, setList] = useState([])
19
   const [list, setList] = useState([])
19
   const pageRef = useRef({ current: 1, pages: 0 })
20
   const pageRef = useRef({ current: 1, pages: 0 })
21
+  const hasMore = pageRef.current.current < pageRef.current.pages
20
 
22
 
21
   // 滚动
23
   // 滚动
22
   const handleScrollToLower = (e) => {
24
   const handleScrollToLower = (e) => {
23
     const loading = loadingRef.current
25
     const loading = loadingRef.current
24
-    const hasMore = pageRef.current.current < pageRef.current.pages
25
 
26
 
26
     if (!loading && hasMore) {
27
     if (!loading && hasMore) {
27
       setPayload({
28
       setPayload({
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
     Taro.showLoading()
38
     Taro.showLoading()
46
     loadingRef.current = true
39
     loadingRef.current = true
47
-    request(payload).then((res) => {
40
+    request(queryParams).then((res) => {
48
       const { records, ...pageInfo } = res || {}
41
       const { records, ...pageInfo } = res || {}
49
-
50
       const lst = pageInfo.current === 1 ? records || [] : list.concat(records || [])
42
       const lst = pageInfo.current === 1 ? records || [] : list.concat(records || [])
51
       setList(lst)
43
       setList(lst)
52
       if (onDataChange) {
44
       if (onDataChange) {
64
         onError(err)
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
   return (
78
   return (
70
     <ScrollView
79
     <ScrollView
72
       onScrollToLower={handleScrollToLower}
81
       onScrollToLower={handleScrollToLower}
73
       {...leftProps}
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
     </ScrollView>
89
     </ScrollView>
80
   )
90
   )
81
 }
91
 }

+ 2
- 2
src/components/OrderMolded/index.jsx 파일 보기

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

+ 2
- 2
src/components/PayOrderCard/index.jsx 파일 보기

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

+ 2
- 5
src/components/Popup/index.jsx 파일 보기

2
 import './style.less'
2
 import './style.less'
3
 
3
 
4
 export default (props) => {
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
   return (
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
       {props.children}
8
       {props.children}
12
     </mp-dialog>
9
     </mp-dialog>
13
   )
10
   )

+ 1
- 4
src/components/ShopCommission/index.jsx 파일 보기

1
-import Taro from '@tarojs/taro'
2
-import { useEffect } from 'react'
3
 
1
 
4
-import { getAccount } from '@/services/shopBoss'
5
 
2
 
6
 import formatTimes from '@/utils/formatTime'
3
 import formatTimes from '@/utils/formatTime'
7
 
4
 
19
       <view className='spreadDate'>日期:<text>{formatTimes(item.createDate, "yyyy/MM/dd")}</text></view>
16
       <view className='spreadDate'>日期:<text>{formatTimes(item.createDate, "yyyy/MM/dd")}</text></view>
20
       <view className='card'>
17
       <view className='card'>
21
         <view className='spreadTime'>时&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;间:<text>{formatTimes(item.createDate, "yyyy/MM/dd hh:ss")}</text></view>
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
       </view>
20
       </view>
24
     </view>
21
     </view>
25
   )
22
   )

+ 3
- 4
src/components/ShopUnused/index.jsx 파일 보기

1
 import Taro from '@tarojs/taro'
1
 import Taro from '@tarojs/taro'
2
 import { useState, useEffect } from 'react'
2
 import { useState, useEffect } from 'react'
3
 import formatTimes from '@/utils/formatTime'
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
 import './style.less'
6
 import './style.less'
8
 
7
 
9
 
8
 
26
         <image className='orderImg' src={item.poster} mode='aspectFit' />
25
         <image className='orderImg' src={item.poster} mode='aspectFit' />
27
         <view className='orderRight'>
26
         <view className='orderRight'>
28
           <view className='foodName'>{item.description}</view>
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
           <view>已下单:等待客户上门就餐</view>
29
           <view>已下单:等待客户上门就餐</view>
31
         </view>
30
         </view>
32
         <view className='line' />
31
         <view className='line' />

+ 5
- 4
src/components/ShopUsed/index.jsx 파일 보기

29
   }
29
   }
30
 
30
 
31
 
31
 
32
-  useEffect(() => {
33
 
32
 
34
-  }, [])
35
 
33
 
36
   return (
34
   return (
37
     <View className='orderCard'>
35
     <View className='orderCard'>
38
       <View style={{ overflow: 'hidden' }}>
36
       <View style={{ overflow: 'hidden' }}>
39
         <View className='orderId'>订单编号:{item.orderId}</View>
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
       </View>
39
       </View>
42
       <View className='order'>
40
       <View className='order'>
43
         <Image className='orderImg' src={item.poster} mode='aspectFit' />
41
         <Image className='orderImg' src={item.poster} mode='aspectFit' />
47
         </View>
45
         </View>
48
         <View className='line' />
46
         <View className='line' />
49
         <View className='phone'>客户手机:<Text>{item.phone.replace(/^(\d{3})\d{4}(\d+)/, "$1****$2") || ''}</Text>
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
       </View>
52
       </View>
52
     </View>
53
     </View>
53
   )
54
   )

+ 10
- 5
src/components/Star/Star.jsx 파일 보기

2
 import hongxin from '@/assets/icons/housemantj/已收藏.png'
2
 import hongxin from '@/assets/icons/housemantj/已收藏.png'
3
 import baixin from '@/assets/icons/housemantj/收藏.png'
3
 import baixin from '@/assets/icons/housemantj/收藏.png'
4
 import './Star.less'
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
 export default (props) => {
10
 export default (props) => {
6
   const {star}=props
11
   const {star}=props
12
+
13
+
7
   return (
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
     <view className='foodCard'>
51
     <view className='foodCard'>
52
       <view className='fCleft'>
52
       <view className='fCleft'>
53
         <view className='backMoney'>
53
         <view className='backMoney'>
54
-          返现¥{item.cashback / 100}
54
+          返现¥{(item.cashback / 100).toFixed(2)}
55
         </view>
55
         </view>
56
         <view className='appraise'>
56
         <view className='appraise'>
57
           <Star star={star} />
57
           <Star star={star} />
66
             <view className='textword'  onClick={() => { goFood() }} >{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</view>
66
             <view className='textword'  onClick={() => { goFood() }} >{(item.description).toString().length > 25 ? (item.description).substring(0, 25) + '...' : (item.description)}</view>
67
             <view className='jiage' onClick={() => { goFood() }} >
67
             <view className='jiage' onClick={() => { goFood() }} >
68
               <text className='rmb' >¥&nbsp;&nbsp;</text>
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
             </view>
71
             </view>
72
             <view className='address'>
72
             <view className='address'>
73
               <image className='dw' src={wz} />
73
               <image className='dw' src={wz} />

+ 2
- 5
src/components/toggleRole/ToggleRole.jsx 파일 보기

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

+ 19
- 14
src/hotel/components/HouseManage/houseManage.jsx 파일 보기

37
             getRoomList({ hotelId: hotel.hotelId }).then((res) => {
37
             getRoomList({ hotelId: hotel.hotelId }).then((res) => {
38
               setDetail(res.records || [])
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
   const [showCutover, setShowCutover] = useState(false)
49
   const [showCutover, setShowCutover] = useState(false)
54
   const onClose = () => {
56
   const onClose = () => {
55
     setShowCutover(false)
57
     setShowCutover(false)
56
   }
58
   }
59
+  const onClose2 = () => {
60
+    setShowCard(false)
61
+  }
57
   useEffect(() => {
62
   useEffect(() => {
58
     //首次加载页面时
63
     //首次加载页面时
59
     if (!mounted.current && hotel.hotelId) {
64
     if (!mounted.current && hotel.hotelId) {
95
     Taro.navigateTo({ url: `/hotel/pages/landlord/roomOrder/roomOrder?roomId=${val.roomId}&roomName=${val.roomName}` });
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
       getRoomList({ hotelId: hotel.hotelId }).then((res) => {
105
       getRoomList({ hotelId: hotel.hotelId }).then((res) => {
101
         setDetail(res.records || [])
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
   return (
115
   return (
111
     <view>
116
     <view>
112
       <view style={{ padding: '0 30rpx', height: '100%' }}>
117
       <view style={{ padding: '0 30rpx', height: '100%' }}>
113
-        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch}/>
118
+        <SearchBar placeholder='请输入房源名搜索' onBlur={onSearch} />
114
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
119
         <ShareRoom showCutover={showCutover} onClose={onClose} room={room} onFinish={handleFinish} />
115
-        <ShareCard showCutover={showCard} onClose={onClose} />
120
+        <ShareCard showCutover={showCard} onClose={onClose2} />
116
         <scroll-view scroll-y="true" scroll-view='true' bindscrolltoupper="upper" bindscrolltolower="lower" bindscroll="scroll" style={{ height: 'calc(100vh - 244px)' }}>
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
               <view className='houseCard'>
124
               <view className='houseCard'>
120
-                <view className='houseName'>{item.roomName}</view>
125
+                <view className='houseName' onClick={() => { handelDetail(item) }} >{item.roomName || ''}</view>
121
                 <view className='operation'>
126
                 <view className='operation'>
122
                   <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
127
                   <view onClick={() => handelOrder(item)}><image src={see} />查看入住人</view>
123
                   <view onClick={() => ShowMoldeOn(item)}><image src={share} />分享链接</view>
128
                   <view onClick={() => ShowMoldeOn(item)}><image src={share} />分享链接</view>

+ 66
- 34
src/hotel/components/Income/income.jsx 파일 보기

1
 import { useState } from 'react'
1
 import { useState } from 'react'
2
-import './income.less'
3
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
2
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
4
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
3
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
5
 import sImg from '@/assets/icons/landlord/我的收入2.png'
4
 import sImg from '@/assets/icons/landlord/我的收入2.png'
7
 import ToggleRole from '@/components/toggleRole/ToggleRole'
6
 import ToggleRole from '@/components/toggleRole/ToggleRole'
8
 import Picker from '@/components/Picker'
7
 import Picker from '@/components/Picker'
9
 import formatTime from "@/utils/formatTime";
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
 export default (props) => {
16
 export default (props) => {
13
   const { hotelList, hotel, account, onHotelChange, accountlog } = props
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
   const handleHotelChange = (hotelId, current) => {
25
   const handleHotelChange = (hotelId, current) => {
16
     onHotelChange(current)
26
     onHotelChange(current)
17
   }
27
   }
29
     setShowCutover(true)
39
     setShowCutover(true)
30
   }
40
   }
31
   const onClose = () => {
41
   const onClose = () => {
32
-    console.log('11111111')
33
     setShowCutover(false)
42
     setShowCutover(false)
34
   }
43
   }
35
   return (
44
   return (
36
     <view>
45
     <view>
37
-      <ToggleRole role='hotel' showCutover={showCutover} onClose={onClose} />
46
+      <ToggleRole role='hotel' showCutover={showCutover} maskClosable={showCutover} onClose={onClose} />
38
       <view style={{ padding: '30rpx', height: '100%' }}>
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
               </view>
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
             </view>
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
           </view>
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
                 </view>
103
                 </view>
104
+              </view>
73
             )
105
             )
74
           }
106
           }
75
-          {accountlog.length != '' ? <view className='botton'>已经到底了~</view> : ''}
107
+        <view className='botton' >已经到底了~</view>
76
         </scroll-view>
108
         </scroll-view>
77
       </view>
109
       </view>
78
     </view>
110
     </view>

+ 30
- 4
src/hotel/components/shareRoom/ShareRoom.jsx 파일 보기

30
   }
30
   }
31
   return (
31
   return (
32
     <Popup show={showCutover} onClose={onClose}>
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
         <Label style={{color:'black'}}>请输入入住人信息</Label>
62
         <Label style={{color:'black'}}>请输入入住人信息</Label>
36
         <mp-cells    footer='  ' >
63
         <mp-cells    footer='  ' >
37
           <mp-cell title='入住人数:' extClass='font'>
64
           <mp-cell title='入住人数:' extClass='font'>
49
           </mp-cell>
76
           </mp-cell>
50
           <mp-cell>
77
           <mp-cell>
51
             <Button className='cancel' onClick={onClose}>取消</Button><Button className='btn' onClick={handelShare}>分享</Button>
78
             <Button className='cancel' onClick={onClose}>取消</Button><Button className='btn' onClick={handelShare}>分享</Button>
52
-            {/* <button className='button-OK' onClick={sumbit}>确定</button> */}
53
           </mp-cell>
79
           </mp-cell>
54
         </mp-cells>
80
         </mp-cells>
55
-      </mp-form>
81
+      </mp-form> */}
56
       </View>
82
       </View>
57
 
83
 
58
 
84
 

+ 46
- 15
src/hotel/components/shareRoom/ShareRoom.less 파일 보기

1
 .from-room{
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
   .cancel{
39
   .cancel{
8
-    width: 150px;
9
-    height: 70px;
40
+    color: #274290;
10
     display: inline-block;
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
     border-radius: 12px;
46
     border-radius: 12px;
13
-    font-size: 36px;
14
-    margin-right: 20px;
15
   }
47
   }
16
   .btn {
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
     border-radius: 12px;
52
     border-radius: 12px;
23
-    font-size: 36px;
53
+    display: inline-block;
24
     color: #fff;
54
     color: #fff;
25
   }
55
   }
26
 }
56
 }
57
+
27
   
58
   
28
   
59
   

+ 45
- 35
src/hotel/pages/landlord/addRoom/addRoom.jsx 파일 보기

3
 import CustomNav from '@/components/CustomNav'
3
 import CustomNav from '@/components/CustomNav'
4
 import { useEffect, useState } from "react"
4
 import { useEffect, useState } from "react"
5
 import './addRoom.less'
5
 import './addRoom.less'
6
-import { saveRoom, getHotelDetail } from '@/services/landlord'
6
+import { saveRoom, getRoomDetail, updateRoom } from '@/services/landlord'
7
 
7
 
8
 
8
 
9
 export default withLayout((props) => {
9
 export default withLayout((props) => {
10
-  const { hotelId, hotelName } = props.router.params
10
+  const { hotelId, hotelName, roomId } = props.router.params
11
   const [roomModel, setRoomModel] = useState({
11
   const [roomModel, setRoomModel] = useState({
12
     hotelId,
12
     hotelId,
13
     roomName: '',
13
     roomName: '',
32
     })
32
     })
33
   }
33
   }
34
   const sumbit = () => {
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
         title: '有必填项未填哦',
52
         title: '有必填项未填哦',
53
         icon: 'none',
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
   return (
68
   return (
59
     <view className='page-index'>
69
     <view className='page-index'>
60
       <CustomNav title={hotelName} />
70
       <CustomNav title={hotelName} />
61
       <view className='from-room'  >
71
       <view className='from-room'  >
62
         <mp-form models={roomModel} >
72
         <mp-form models={roomModel} >
63
           <mp-cells title='请填写新增的房源信息' footer='  ' >
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
             </mp-cell>
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
             </mp-cell>
79
             </mp-cell>
70
-            <mp-cell prop='location' title='定位经纬度:' extClass='font'>
80
+            <mp-cell title='定位经纬度:' extClass='font'>
71
               <label onClick={onRoomMap}>{roomModel.location == '' ? '房间定位(必填)' : roomModel.location}</label>
81
               <label onClick={onRoomMap}>{roomModel.location == '' ? '房间定位(必填)' : roomModel.location}</label>
72
             </mp-cell>
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
             </mp-cell>
85
             </mp-cell>
76
-            <mp-cell prop='parkingLocation' title='定位经纬度:' extClass='font'>
86
+            <mp-cell title='定位经纬度:' extClass='font'>
77
               <label onClick={onParkMap}>{roomModel.parkingLocation == '' ? '停车场定位' : roomModel.parkingLocation}</label>
87
               <label onClick={onParkMap}>{roomModel.parkingLocation == '' ? '停车场定位' : roomModel.parkingLocation}</label>
78
             </mp-cell>
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
             </mp-cell>
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
             </mp-cell>
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
             </mp-cell>
97
             </mp-cell>
88
             <mp-cell>
98
             <mp-cell>
89
               <button className='button-OK' onClick={sumbit}>确定</button>
99
               <button className='button-OK' onClick={sumbit}>确定</button>

+ 1
- 2
src/hotel/pages/landlord/landlord.jsx 파일 보기

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

+ 2
- 2
src/hotel/pages/landlord/roomOrder/roomOrder.jsx 파일 보기

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

+ 3
- 36
src/pages/MineUserAll/Collect/index.jsx 파일 보기

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

+ 12
- 12
src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx 파일 보기

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

+ 2
- 2
src/pages/MineUserAll/RefundMoney/index.jsx 파일 보기

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

+ 11
- 10
src/pages/PayOrder/index.jsx 파일 보기

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

+ 22
- 8
src/pages/TobeShop/index.jsx 파일 보기

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

+ 4
- 3
src/pages/TobeShop/style.less 파일 보기

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

+ 222
- 142
src/pages/details/foodDetails/foodDetails.jsx 파일 보기

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
 export default withLayout((props) => {
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
   // console.log(id,subOrderId,'--333-----')
32
   // console.log(id,subOrderId,'--333-----')
28
   useEffect(() => {
33
   useEffect(() => {
29
-    console.log(id, subOrderId, '-------')
34
+    console.log(id, subOrderId, "-------");
30
     if (id && subOrderId) {
35
     if (id && subOrderId) {
31
       Taro.navigateTo({
36
       Taro.navigateTo({
32
         url: `/pages/TobeShop/index?id=${id}&subOrderId=${subOrderId}`,
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
   //banner图集数组
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
   const handchange = (e) => {
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
   const pgMore = () => {
80
   const pgMore = () => {
58
-    setpage(page + 1)
81
+    setpage(page + 1);
59
     getShopPackage(id, { pageNum: page }).then((res) => {
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
   const extendMore = () => {
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
   const openMap = () => {
103
   const openMap = () => {
81
     Taro.openLocation({
104
     Taro.openLocation({
82
       longitude: log.current - 0,
105
       longitude: log.current - 0,
84
       name: detail.shopName,
107
       name: detail.shopName,
85
       address: detail.address,
108
       address: detail.address,
86
       scale: 12,
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
   useEffect(() => {
115
   useEffect(() => {
93
     getShopDetail(id).then((res) => {
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
     getShopPackage(id).then((res) => {
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
   return (
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
       </view>
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
             <Swiper
165
             <Swiper
131
-              className='.swiper'
166
+              className=".swiper"
132
               circular
167
               circular
133
               current={index}
168
               current={index}
134
               onChange={handchange}
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
             </Swiper>
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
                   {detail.averagePrice / 100}/人
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
                 </view>
201
                 </view>
158
               </view>
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
                 </view>
211
                 </view>
167
               </view>
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
               </view>
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
                 <view>
219
                 <view>
174
-                  {detail.address}<image src={zhuandao} className='zhuandao' />
220
+                  {detail.address}
221
+                  <image src={zhuandao} className="zhuandao" />
175
                 </view>
222
                 </view>
176
               </view>
223
               </view>
177
             </view>
224
             </view>
178
           </view>
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
             </view>
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
               <view>查看更多</view>
244
               <view>查看更多</view>
186
-              <image src={showMore} className='moreTip' />
245
+              <image src={showMore} className="moreTip" />
187
             </view>
246
             </view>
188
           </view>
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
               <image src={titlezs} />
255
               <image src={titlezs} />
192
               <text>本店指南</text>
256
               <text>本店指南</text>
193
             </view>
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
               <view>查看更多</view>
266
               <view>查看更多</view>
197
-              <image src={showMore} className='moreTip' />
267
+              <image src={showMore} className="moreTip" />
198
             </view>
268
             </view>
199
           </view>
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
         </scroll-view>
276
         </scroll-view>
202
       </view>
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
         </view>
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
         </view>
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
         </view>
293
         </view>
214
       </view>
294
       </view>
215
     </view>
295
     </view>
216
-  )
217
-})
296
+  );
297
+});

+ 13
- 11
src/pages/details/mjDetails/sceneryDetails.jsx 파일 보기

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

+ 1
- 1
src/pages/index/components/Card.js 파일 보기

16
   const Detail = () => {
16
   const Detail = () => {
17
     if (item.targetType == 'tourist') {
17
     if (item.targetType == 'tourist') {
18
       let loc = item.lng + ',' + item.lat
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
     else {
21
     else {
22
       Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })
22
       Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.targetId}` })

+ 2
- 2
src/pages/index/tabs/Guide.jsx 파일 보기

245
                   <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
245
                   <image mode='scaleToFill' className='title-image-cup' src={BlackSpot} />
246
                   <text className='title-title-boss' >更多指引</text>
246
                   <text className='title-title-boss' >更多指引</text>
247
                 </view>
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
                 <view className='showMore' style={{ display: newextNum == AllextNum ? 'none' : '' }} onClick={extendMore}>
250
                 <view className='showMore' style={{ display: newextNum == AllextNum ? 'none' : '' }} onClick={extendMore}>
251
                   <view>点击查看更多</view>
251
                   <view>点击查看更多</view>
261
             <text className='title-title-boss' >老板推荐好吃的</text>
261
             <text className='title-title-boss' >老板推荐好吃的</text>
262
           </view>
262
           </view>
263
         </view>
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
         {/* <view className='Guide-Content-box-two'>
266
         {/* <view className='Guide-Content-box-two'>
267
           <view className='title-image-two'>
267
           <view className='title-image-two'>

+ 4
- 6
src/pages/index/tabs/Mine.jsx 파일 보기

31
   const hasAvatar = !!person.avatar
31
   const hasAvatar = !!person.avatar
32
   const [orderNum, setOrderNum] = useState([])
32
   const [orderNum, setOrderNum] = useState([])
33
 
33
 
34
-  console.log('--------DefaultImage-----', DefaultImage)
35
 
34
 
36
   const ShowMoldeOn = () => {
35
   const ShowMoldeOn = () => {
37
     setShowCutover(true)
36
     setShowCutover(true)
46
   }, [])
45
   }, [])
47
 
46
 
48
 
47
 
49
-
50
   // 通过getUserProfile获取微信用户信息
48
   // 通过getUserProfile获取微信用户信息
51
   const handleGetUserProfile = () => {
49
   const handleGetUserProfile = () => {
52
     if (hasAvatar) return;
50
     if (hasAvatar) return;
115
 
113
 
116
       <view className='User-box'>
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
         <view className='User-info'>
117
         <view className='User-info'>
120
           <view className='User-photos-box'>
118
           <view className='User-photos-box'>
121
             <image src={person.avatar || DefaultImage} className='User-photos' />
119
             <image src={person.avatar || DefaultImage} className='User-photos' />
135
             <view className='buy-list-Paybox' onClick={handleTobePaid} >
133
             <view className='buy-list-Paybox' onClick={handleTobePaid} >
136
               <image className='buy-list-PayLogo' src={awaitPay} />
134
               <image className='buy-list-PayLogo' src={awaitPay} />
137
               <view className='buy-list-goPay'>待支付</view>
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
             </view>
137
             </view>
140
             <view className='buy-list-Paybox ' onClick={handleTobeWritten} >
138
             <view className='buy-list-Paybox ' onClick={handleTobeWritten} >
141
               <image className='buy-list-PayLogo' src={ToShop} />
139
               <image className='buy-list-PayLogo' src={ToShop} />
142
               <view className='buy-list-goPay'>待核销</view>
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
             </view>
142
             </view>
145
             <view className='buy-list-Paybox ' onClick={handleAllOrder} >
143
             <view className='buy-list-Paybox ' onClick={handleAllOrder} >
146
               <image className='buy-list-PayLogo' src={AllOrder} />
144
               <image className='buy-list-PayLogo' src={AllOrder} />
150
             <view className='buy-list-Paybox ' onClick={handleRefund} >
148
             <view className='buy-list-Paybox ' onClick={handleRefund} >
151
               <image className='buy-list-PayLogo' src={Refund} />
149
               <image className='buy-list-PayLogo' src={Refund} />
152
               <view className='buy-list-goPay'>退款/售后</view>
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
             </view>
152
             </view>
155
           </view>
153
           </view>
156
           <view className='Badge-box'>
154
           <view className='Badge-box'>

+ 4
- 3
src/pages/index/tabs/Recommend.jsx 파일 보기

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

+ 1
- 1
src/pages/search/search.jsx 파일 보기

35
                 <view className='hotSearch'>热门搜索</view>
35
                 <view className='hotSearch'>热门搜索</view>
36
                 <view className='hotSearchtip'>
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
                 </view>
40
                 </view>
41
             </view>
41
             </view>

+ 19
- 20
src/pages/searchResult/searchResult.jsx 파일 보기

4
 import CustomNav from '@/components/CustomNav'
4
 import CustomNav from '@/components/CustomNav'
5
 import Taro from '@tarojs/taro'
5
 import Taro from '@tarojs/taro'
6
 import Card from '../index/components/Card'
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
 import './searchResult.less'
9
 import './searchResult.less'
9
 import withLayout from '@/layouts'
10
 import withLayout from '@/layouts'
10
 
11
 
11
 
12
 
12
 
13
 
13
 export default withLayout((props) => {
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
   // 横向tab
18
   // 横向tab
18
   const [activeTab, setActiveTab] = useState(0)
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
   const [alllist, setAllList] = useState([])
23
   const [alllist, setAllList] = useState([])
35
     const { index } = e.detail
36
     const { index } = e.detail
36
     setActiveTab(index)
37
     setActiveTab(index)
37
     if (index == 0) {
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
     Taro.navigateTo({ url: '/pages/search/search' });
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
           >
78
           >
83
           </mp-tabs>
79
           </mp-tabs>
84
         </view>
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
           </view>
91
           </view>
92
-          <view className='botton'>已经到底了~</view>
93
-        </scroll-view>
92
+        </List>
94
       </view>
93
       </view>
95
     </view>
94
     </view>
96
   )
95
   )

+ 7
- 0
src/services/home.js 파일 보기

103
  */
103
  */
104
 export const getTouristDetail = (id) => request(`/tourist/${id}`)
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
  * @returns 
115
  * @returns 

+ 39
- 17
src/services/landlord.js 파일 보기

6
  * @param {*} id 
6
  * @param {*} id 
7
  * @returns 
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
  * @param {*} params 
13
  * @param {*} params 
14
  * @returns 
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
  * @param {*} params 
29
  * @param {*} params 
22
  * @returns 
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
  * @param {*} params 
36
  * @param {*} params 
29
  * @returns 
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
  * @param {*} id 
43
  * @param {*} id 
36
  * @returns 
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
  * @param {*} data 
50
  * @param {*} data 
43
  * @returns 
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
  * @param {*} data 
71
  * @param {*} data 
50
  * @returns 
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
  * @param {*} data 
79
  * @param {*} data 
58
  * @returns 
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
  * @param {*} 
23
  * @param {*} 
24
  * @returns 
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
-import { React, useState, useEffect, } from 'react'
1
+import { React, useState, useEffect, useRef } from 'react'
2
 import Taro, { useRouter } from '@tarojs/taro'
2
 import Taro, { useRouter } from '@tarojs/taro'
3
 import CustomNav from '@/components/CustomNav'
3
 import CustomNav from '@/components/CustomNav'
4
 import Picker from '@/components/Picker'
4
 import Picker from '@/components/Picker'
6
 import ShopUsed from '@/components/ShopUsed' //已核销
6
 import ShopUsed from '@/components/ShopUsed' //已核销
7
 import ShopUnused from '@/components/ShopUnused' //未核销
7
 import ShopUnused from '@/components/ShopUnused' //未核销
8
 import SearchBar from '@/components/SearchBar'
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
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
12
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
11
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
13
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
12
 import iconsearch from '@/assets/icons/housemantj/search.png'
14
 import iconsearch from '@/assets/icons/housemantj/search.png'
13
 import ms from '@/assets/icons/housemantj/ms3.jpg'
15
 import ms from '@/assets/icons/housemantj/ms3.jpg'
16
+import ToggleRole from '@/components/toggleRole/ToggleRole'
17
+
14
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
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
 import './shopKeeper.less'
19
 import './shopKeeper.less'
22
-import ToggleRole from '@/components/toggleRole/ToggleRole'
20
+import { useMemo } from 'react'
23
 
21
 
24
 
22
 
25
 export default (props) => {
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
   const { params } = useRouter()
25
   const { params } = useRouter()
30
   const { tabJump } = params || {}
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
   const [isyear, setYear] = useState(true)
43
   const [isyear, setYear] = useState(true)
33
   const [isMomth, setMonth] = useState(false)
44
   const [isMomth, setMonth] = useState(false)
34
   //小眼睛开关
45
   //小眼睛开关
45
   }
56
   }
46
 
57
 
47
 
58
 
59
+  const handelSearch = (e) => {
60
+    const val = e.detail.value
61
+    setPhone(val)
62
+  }
48
   useEffect(() => {
63
   useEffect(() => {
49
     if (tabJump) {
64
     if (tabJump) {
50
       setActiveTab(tabJump - 0)
65
       setActiveTab(tabJump - 0)
54
   const handleTabChange = (e) => {
69
   const handleTabChange = (e) => {
55
     const { index } = e.detail
70
     const { index } = e.detail
56
     setActiveTab(index)
71
     setActiveTab(index)
57
-    if (index === 1) {
58
-      onVarified()
59
-
60
-    } else {
61
-      onVarifiedTwo()
62
-
63
-    }
64
   }
72
   }
65
   const tabs = [
73
   const tabs = [
66
     {
74
     {
71
     },
79
     },
72
   ]
80
   ]
73
 
81
 
74
-
82
+  //给父组件传val
75
   const handleVarified = () => {
83
   const handleVarified = () => {
76
     onVarified()
84
     onVarified()
77
   }
85
   }
78
 
86
 
79
 
87
 
80
-  const onSearch = (e) => {
81
-    console.log('eeeeeeeeeeeeeeeeee', e.detail.value);
82
-  }
83
-
84
   const [showCutover, setShowCutover] = useState(false)
88
   const [showCutover, setShowCutover] = useState(false)
85
   const ShowMoldeOn = () => {
89
   const ShowMoldeOn = () => {
86
     setShowCutover(true)
90
     setShowCutover(true)
92
     <view>
96
     <view>
93
       <view>
97
       <view>
94
       </view>
98
       </view>
95
-      <ToggleRole showCutover={showCutover} onClose={onClose} role='shop' />
99
+      <ToggleRole showCutover={showCutover} maskClosable={showCutover} onClose={onClose} role='shop' />
96
       <view style={{ padding: '30rpx', height: '100%' }}>
100
       <view style={{ padding: '30rpx', height: '100%' }}>
97
         <scroll-view scroll-y scroll-view='true' bindscrolltoupper='upper' bindscrolltolower='lower' bindscroll='scroll' style={{ height: 'calc(100vh - 120px)' }}>
101
         <scroll-view scroll-y scroll-view='true' bindscrolltoupper='upper' bindscrolltolower='lower' bindscroll='scroll' style={{ height: 'calc(100vh - 120px)' }}>
98
           <view className='storexx'>
102
           <view className='storexx'>
121
           </view>
125
           </view>
122
           <view className='search'>
126
           <view className='search'>
123
 
127
 
124
-            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={onSearch} />
128
+            <SearchBar placeholder='搜索订单(输入客户手机号码)' onBlur={handelSearch} />
125
           </view>
129
           </view>
126
           <view className='index-tabs'>
130
           <view className='index-tabs'>
127
             <mp-tabs
131
             <mp-tabs
135
             >
139
             >
136
             </mp-tabs>
140
             </mp-tabs>
137
           </view>
141
           </view>
138
-          {
139
-            verifiedOrder.map
140
-
141
-          }
142
           <view>
142
           <view>
143
             {/* 未核销 */}
143
             {/* 未核销 */}
144
             {activeTab === 0 &&
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
             {activeTab === 1 &&
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
           </view>
172
           </view>
169
-          <view className='botton'>已经到底了~</view>
173
+          {/* <view className='botton'>已经到底了~</view> */}
170
         </scroll-view>
174
         </scroll-view>
171
       </view>
175
       </view>
172
     </view>
176
     </view>

+ 19
- 22
src/shop/components/Sparead/spreadMoney.jsx 파일 보기

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

+ 42
- 25
src/shop/pages/spread/spreadIndex.jsx 파일 보기

2
 import CustomNav from '@/components/CustomNav'
2
 import CustomNav from '@/components/CustomNav'
3
 import { useRouter } from '@tarojs/taro'
3
 import { useRouter } from '@tarojs/taro'
4
 import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
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
 import TabBar from '@/components/CustTabBar'
6
 import TabBar from '@/components/CustTabBar'
8
 import shopImg from '@/assets/icons/shopKeeper/订单收入.png'
7
 import shopImg from '@/assets/icons/shopKeeper/订单收入.png'
9
 import onShopImg from '@/assets/icons/shopKeeper/订单收入按下.png'
8
 import onShopImg from '@/assets/icons/shopKeeper/订单收入按下.png'
10
 import spareadImg from '@/assets/icons/shopKeeper/推广收入.png'
9
 import spareadImg from '@/assets/icons/shopKeeper/推广收入.png'
11
 import onSpareadImg from '@/assets/icons/shopKeeper/推广收入按下.png'
10
 import onSpareadImg from '@/assets/icons/shopKeeper/推广收入按下.png'
12
 import withLayout from '@/layouts'
11
 import withLayout from '@/layouts'
12
+import ShopKeeper from '../../components/ShopKeeper/shopKeeper'
13
+import Sparead from '../../components/Sparead/spreadMoney'
14
+
13
 
15
 
14
 import './spreadIndex.less'
16
 import './spreadIndex.less'
15
 
17
 
28
   const [isVerified, setisVerified] = useState(0)
30
   const [isVerified, setisVerified] = useState(0)
29
   const [shopMoney, setShopMoney] = useState([])
31
   const [shopMoney, setShopMoney] = useState([])
30
   const [verifiedOrder, setVerifiedOrder] = useState([])
32
   const [verifiedOrder, setVerifiedOrder] = useState([])
33
+
31
   const handleTabChange = (e) => {
34
   const handleTabChange = (e) => {
32
     const { index } = e.detail
35
     const { index } = e.detail
33
     setCurrentTab(index)
36
     setCurrentTab(index)
36
   const handelType = () => {
39
   const handelType = () => {
37
     setAmountType('commission')
40
     setAmountType('commission')
38
   }
41
   }
39
-
42
+  //商铺列表
40
   useEffect(() => {
43
   useEffect(() => {
41
     getShopList().then((res) => {
44
     getShopList().then((res) => {
42
       const { shopList: list, shop: current } = res
45
       const { shopList: list, shop: current } = res
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
   const onVarified = () => {
79
   const onVarified = () => {
82
       })
93
       })
83
     }
94
     }
84
 
95
 
85
-  }, [amountType, shopId])
86
-
96
+  }, [amountType, shopId, currentTab])
87
 
97
 
98
+  //店铺选择
88
   const handleHotelChange = (current) => {
99
   const handleHotelChange = (current) => {
89
     console.log('已选择店铺', current);
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
   useEffect(() => {
117
   useEffect(() => {
107
     <view className='page-index'>
124
     <view className='page-index'>
108
       <CustomNav title={shop?.shopName} />
125
       <CustomNav title={shop?.shopName} />
109
       <view className='index-container'>
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
         {currentTab === 1 && <Sparead shopList={shopList} shop={shop} verifiedOrder={verifiedOrder} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
129
         {currentTab === 1 && <Sparead shopList={shopList} shop={shop} verifiedOrder={verifiedOrder} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
113
       </view>
130
       </view>

+ 1
- 0
src/utils/formatPrice.js 파일 보기

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