Explorar el Código

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

zlisen hace 3 años
padre
commit
4293ac8a92

+ 0
- 47
src/components/CollectList/AttractionsCollect/index.jsx Ver fichero

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

+ 0
- 228
src/components/CollectList/AttractionsCollect/style.less Ver fichero

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

+ 24
- 15
src/components/List/index.jsx Ver fichero

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

+ 2
- 2
src/components/Popup/index.jsx Ver fichero

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

+ 6
- 2
src/components/ShopUnused/index.jsx Ver fichero

@@ -4,6 +4,8 @@ import formatTimes from '@/utils/formatTime'
4 4
 import iconsearch from '@/assets/icons/housemantj/search.png'
5 5
 import ms from '@/assets/icons/housemantj/ms3.jpg'
6 6
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
7
+import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
8
+
7 9
 import './style.less'
8 10
 
9 11
 
@@ -12,9 +14,11 @@ export default (props) => {
12 14
 
13 15
 
14 16
 
15
-  useEffect(() => {
17
+  // useEffect(() => {
18
+  //   getVerifiedOrder({ phone: '18082043755' }).then((res) => {
16 19
 
17
-  }, [])
20
+  //   })
21
+  // }, [])
18 22
 
19 23
   return (
20 24
     <view className='orderCard'>

+ 5
- 4
src/components/ShopUsed/index.jsx Ver fichero

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

+ 2
- 2
src/components/toggleRole/ToggleRole.jsx Ver fichero

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

+ 0
- 6
src/pages/MineUserAll/Collect/index.jsx Ver fichero

@@ -15,7 +15,6 @@ import ProCard_hot from '@/assets/icons/ProCard/ProCard_hot.png'
15 15
 import position from '@/assets/icons/GuideCheck/position_logo.png'
16 16
 import starOn from '@/assets/icons/GuideCheck/starOn.png'
17 17
 import starOff from '@/assets/icons/GuideCheck/starOff.png'
18
-import AttractionsCollect from '@/components/CollectList/AttractionsCollect'
19 18
 import FoodCollect from '@/components/CollectList/FoodCollect'
20 19
 
21 20
 
@@ -57,12 +56,7 @@ export default withLayout((props) => {
57 56
 
58 57
 
59 58
       </view>
60
-      {/* {
61
-        collectContent.map((item, index) => {
62
-          return <AttractionsCollect key={(index)} item={item} />
63
-        })
64 59
 
65
-      } */}
66 60
       <view className='foot'>
67 61
         已经到底了~
68 62
       </view>

+ 8
- 3
src/pages/details/mjDetails/sceneryDetails.jsx Ver fichero

@@ -24,7 +24,7 @@ import './sceneryDetails.less'
24 24
 
25 25
 export default withLayout((props) => {
26 26
   const { router, person ,location } = props
27
-  const { id, distance, location2 } = props.router.params
27
+  const { id, distance, loc } = props.router.params
28 28
   const [detail, setDetail] = useState({})
29 29
   const [isSaved, toggleSave] = useSave(detail.isSaved, 'tourist', id)
30 30
   const [isLike, toggleLike] = useLike(detail.isLike, 'tourist', id)
@@ -66,7 +66,8 @@ export default withLayout((props) => {
66 66
   }
67 67
   const log = useRef('')
68 68
   const lat = useRef('')
69
-
69
+  const [queryParams, setQueryParams] = useState({ location: location, pageNum: 1, pageSize: 10, typeId: '',targetId:id  })
70
+  const [nloction,setNLoction]=useState()
70 71
 
71 72
   useEffect(() => {
72 73
     getTouristDetail(id).then((res) => {
@@ -81,9 +82,13 @@ export default withLayout((props) => {
81 82
       setAllextNum(res.total)
82 83
       setNewextNum(res.records.length)
83 84
     })
84
-    getRecommendList({ location: location }).then((res) => {
85
+    getRecommendList({ location: loc }).then((res) => {
85 86
       setRecommend(res || [])
86 87
     })
88
+    getResourceList(queryParams).then((res)=>{
89
+      console.log(queryParams)
90
+      console.log(res)
91
+    })
87 92
   }, [])
88 93
   
89 94
   // 分享

+ 1
- 1
src/pages/index/components/Card.js Ver fichero

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

+ 4
- 6
src/pages/index/tabs/Mine.jsx Ver fichero

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

+ 1
- 1
src/pages/index/tabs/Recommend.jsx Ver fichero

@@ -76,7 +76,7 @@ export default (props) => {
76 76
       </view>
77 77
 
78 78
       <List
79
-        style={{ height: 'calc(100% - 160px)' }}
79
+        style={{ height: 'calc(100% - 145px)' }}
80 80
         request={getResourceList}
81 81
         params={queryParams}
82 82
         onDataChange={setAllList}

+ 1
- 1
src/pages/searchResult/searchResult.jsx Ver fichero

@@ -79,7 +79,7 @@ export default withLayout((props) => {
79 79
           </mp-tabs>
80 80
         </view>
81 81
         <List
82
-          style={{ height: 'calc(100% - 160px)' }}
82
+          style={{ height: 'calc(100% - 90px)' }}
83 83
           request={getResourceList}
84 84
           params={queryParams}
85 85
           onDataChange={setAllList}

+ 1
- 1
src/services/shopBoss.js Ver fichero

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

+ 67
- 16
src/shop/components/ShopKeeper/shopKeeper.jsx Ver fichero

@@ -6,11 +6,15 @@ import Popup from '@/components/Popup'
6 6
 import ShopUsed from '@/components/ShopUsed' //已核销
7 7
 import ShopUnused from '@/components/ShopUnused' //未核销
8 8
 import SearchBar from '@/components/SearchBar'
9
+import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
10
+import List from '@/components/List';
9 11
 
10 12
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
11 13
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
12 14
 import iconsearch from '@/assets/icons/housemantj/search.png'
13 15
 import ms from '@/assets/icons/housemantj/ms3.jpg'
16
+import ToggleRole from '@/components/toggleRole/ToggleRole'
17
+
14 18
 import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
15 19
 import touristON from '@/assets/icons/UserCenter/touristON.png'
16 20
 import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
@@ -19,16 +23,23 @@ import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
19 23
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
20 24
 import shopBossOFF from '@/assets/icons/UserCenter/shopBossOFF.png'
21 25
 import './shopKeeper.less'
22
-import ToggleRole from '@/components/toggleRole/ToggleRole'
23 26
 
24 27
 
25 28
 export default (props) => {
26
-  const { shopList, shop, onHotelChange, shopMoney, verifiedOrder, onVarified, onVarifiedTwo } = props
29
+  const { shopList, shop, onHotelChange, shopMoney, isVerified, verifiedOrder, onVarified, onVarifiedTwo, setVer } = props
27 30
   const shopId = shop?.shopId
28 31
   const [activeTab, setActiveTab] = useState(0)
29 32
   const { params } = useRouter()
30 33
   const { tabJump } = params || {}
31 34
 
35
+  const [queryParams, setQueryParams] = useState({ isVerified: isVerified, pageNum: 1, pageSize: 10, shopId: '' })
36
+
37
+
38
+
39
+
40
+  // 获取资源表信息
41
+  const [alllist, setAllList] = useState([])
42
+
32 43
   const [isyear, setYear] = useState(true)
33 44
   const [isMomth, setMonth] = useState(false)
34 45
   //小眼睛开关
@@ -72,13 +83,36 @@ export default (props) => {
72 83
   ]
73 84
 
74 85
 
86
+  //给父组件传val
75 87
   const handleVarified = () => {
76 88
     onVarified()
77 89
   }
78 90
 
79 91
 
80 92
   const onSearch = (e) => {
81
-    console.log('eeeeeeeeeeeeeeeeee', e.detail.value);
93
+    const val = e.detail.value
94
+    if (val !== '') {
95
+      getVerifiedOrder({
96
+        phone: val,
97
+        pageNum: 1,
98
+        pageSize: 10,
99
+
100
+      }).then((res) => {
101
+        setVer(res)
102
+
103
+      })
104
+    } else {
105
+      getVerifiedOrder({
106
+        shopId: shopId,
107
+        pageNum: 1,
108
+        pageSize: 10,
109
+
110
+      }).then((res) => {
111
+        setVer(res)
112
+
113
+      })
114
+    }
115
+
82 116
   }
83 117
 
84 118
   const [showCutover, setShowCutover] = useState(false)
@@ -135,38 +169,55 @@ export default (props) => {
135 169
             >
136 170
             </mp-tabs>
137 171
           </view>
138
-          {
139
-            verifiedOrder.map
140
-
141
-          }
142 172
           <view>
143 173
             {/* 未核销 */}
144 174
             {activeTab === 0 &&
145 175
               <>
146
-                {
147
-                  verifiedOrder.map((item, index) => {
148
-
149
-                    return <ShopUnused key={(index)} item={item} />
150
-                  })
151
-                }
176
+                <List
177
+                  style={{ height: 'calc(100% - 145px)' }}
178
+                  request={getVerifiedOrder}
179
+                  params={queryParams}
180
+                  onDataChange={setAllList}
181
+                >
182
+                  {
183
+                    alllist.map((item, index) => {
184
+
185
+                      return <ShopUnused key={(index)} item={item} />
186
+                    })
187
+                  }
188
+                </List>
152 189
               </>
190
+
153 191
             }
154 192
             {/* 已核销 */}
155 193
             {activeTab === 1 &&
156 194
               <>
157
-                {
195
+                <List
196
+                  style={{ height: 'calc(100% - 145px)' }}
197
+                  request={getVerifiedOrder}
198
+                  params={queryParams}
199
+                  onDataChange={setAllList}
200
+                >
201
+                  {
202
+                    alllist.map((item, index) => {
203
+
204
+                      return <ShopUsed verifiedOrder={verifiedOrder} key={(index)} item={item} />
205
+                    })
206
+                  }
207
+                </List>
208
+                {/* {
158 209
                   verifiedOrder.map((item, index) => {
159 210
 
160 211
                     return <ShopUsed verifiedOrder={verifiedOrder} key={(index)} item={item} />
161 212
                   })
162
-                }
213
+                } */}
163 214
 
164 215
 
165 216
 
166 217
               </>
167 218
             }
168 219
           </view>
169
-          <view className='botton'>已经到底了~</view>
220
+          {/* <view className='botton'>已经到底了~</view> */}
170 221
         </scroll-view>
171 222
       </view>
172 223
     </view>

+ 17
- 4
src/shop/components/Sparead/spreadMoney.jsx Ver fichero

@@ -2,7 +2,9 @@ import { useState, useEffect } from 'react'
2 2
 import Taro from '@tarojs/taro'
3 3
 import CustomNav from '@/components/CustomNav'
4 4
 import Popup from '@/components/Popup'
5
+import List from '@/components/List';
5 6
 import Picker from '@/components/Picker'
7
+import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
6 8
 import ShopCommission from '@/components/ShopCommission'
7 9
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
8 10
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
@@ -10,12 +12,13 @@ import cutoverUser from '@/assets/icons/UserCenter/cutoverUser.png'
10 12
 import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
11 13
 import hotelBossOFF from '@/assets/icons/UserCenter/hotelBossOFF.png'
12 14
 import shopBossON from '@/assets/icons/UserCenter/shopBossON.png'
13
-import { getAccount } from '@/services/shopBoss'
14 15
 import ToggleRole from '@/components/toggleRole/ToggleRole'
15 16
 
16 17
 
17 18
 import './spreadMoney.less'
18 19
 
20
+const getList = (id) => (params) => getAccount(id, params)
21
+
19 22
 export default (props) => {
20 23
   const { shopList, shop, onHotelChange, shopMoney } = props
21 24
   const [showCutover, setShowCutover] = useState(false)
@@ -25,7 +28,11 @@ export default (props) => {
25 28
   const acc = shopMoney?.acc
26 29
   const { accountId } = acc
27 30
 
31
+  const reqestAPI = getList(accountId)
32
+
28 33
 
34
+  // 获取资源表信息
35
+  const [alllist, setAllList] = useState([])
29 36
 
30 37
 
31 38
 
@@ -92,15 +99,21 @@ export default (props) => {
92 99
             </view>
93 100
           </view>
94 101
           <view className='title'>推广收入记录</view>
95
-          {
102
+          <List
103
+            style={{ height: 'calc(100% - 145px)' }}
104
+            request={reqestAPI}
105
+            render={({ item, index }) => <ShopCommission key={(index)} item={item} />}
106
+          >
107
+          </List>
108
+          {/* {
96 109
             shopAccount.map((item, index) => {
97 110
               return (
98 111
                 <ShopCommission key={(index)} item={item} />
99 112
 
100 113
               )
101 114
             })
102
-          }
103
-          <view className='botton'>已经到底了~</view>
115
+          } */}
116
+          {/* <view className='botton'>已经到底了~</view> */}
104 117
         </scroll-view>
105 118
       </view>
106 119
 

+ 12
- 1
src/shop/pages/spread/spreadIndex.jsx Ver fichero

@@ -39,6 +39,7 @@ export default withLayout((props) => {
39 39
 
40 40
   useEffect(() => {
41 41
     getShopList().then((res) => {
42
+      console.log("🚀 ~ file: spreadIndex.jsx ~ line 42 ~ getShopList ~ res", res)
42 43
       const { shopList: list, shop: current } = res
43 44
       setShopList(list)
44 45
       setShop(current)
@@ -47,6 +48,15 @@ export default withLayout((props) => {
47 48
   }, [])
48 49
 
49 50
 
51
+  // 搜索核销手机号
52
+  const setVer = (e) => {
53
+    setVerifiedOrder(e.records)
54
+
55
+
56
+
57
+  }
58
+
59
+
50 60
   //未核销订单列表
51 61
   useEffect(() => {
52 62
     getVerifiedOrder({
@@ -77,6 +87,7 @@ export default withLayout((props) => {
77 87
   useEffect(() => {
78 88
     if (shopId) {
79 89
       getShopMoney(shopId, amountType).then((e) => {
90
+
80 91
         setShopMoney(e)
81 92
 
82 93
       })
@@ -107,7 +118,7 @@ export default withLayout((props) => {
107 118
     <view className='page-index'>
108 119
       <CustomNav title={shop?.shopName} />
109 120
       <view className='index-container'>
110
-        {currentTab === 0 && <ShopKeeper onVarifiedTwo={onVarifiedTwo} onVarified={onVarified} verifiedOrder={verifiedOrder} shopList={shopList} shop={shop} onHotelChange={handleHotelChange} shopMoney={shopMoney} />
121
+        {currentTab === 0 && <ShopKeeper isVerified={isVerified} setVer={setVer} onVarifiedTwo={onVarifiedTwo} onVarified={onVarified} verifiedOrder={verifiedOrder} shopList={shopList} shop={shop} onHotelChange={handleHotelChange} shopMoney={shopMoney} />
111 122
         }
112 123
         {currentTab === 1 && <Sparead shopList={shopList} shop={shop} verifiedOrder={verifiedOrder} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
113 124
       </view>