吃个甘蔗嚼一年 3 anni fa
parent
commit
55860cf627

+ 0
- 47
src/components/CollectList/AttractionsCollect/index.jsx Vedi File

@@ -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 Vedi File

@@ -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 Vedi File

@@ -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
 }

+ 1
- 1
src/services/shopBoss.js Vedi File

@@ -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
 /**

+ 41
- 15
src/shop/components/ShopKeeper/shopKeeper.jsx Vedi File

@@ -7,6 +7,7 @@ import ShopUsed from '@/components/ShopUsed' //已核销
7 7
 import ShopUnused from '@/components/ShopUnused' //未核销
8 8
 import SearchBar from '@/components/SearchBar'
9 9
 import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
10
+import List from '@/components/List';
10 11
 
11 12
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
12 13
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
@@ -25,12 +26,20 @@ import './shopKeeper.less'
25 26
 
26 27
 
27 28
 export default (props) => {
28
-  const { shopList, shop, onHotelChange, shopMoney, verifiedOrder, onVarified, onVarifiedTwo, setVer } = props
29
+  const { shopList, shop, onHotelChange, shopMoney, isVerified, verifiedOrder, onVarified, onVarifiedTwo, setVer } = props
29 30
   const shopId = shop?.shopId
30 31
   const [activeTab, setActiveTab] = useState(0)
31 32
   const { params } = useRouter()
32 33
   const { tabJump } = params || {}
33 34
 
35
+  const [queryParams, setQueryParams] = useState({ isVerified: isVerified, pageNum: 1, pageSize: 10, shopId: '' })
36
+
37
+
38
+
39
+
40
+  // 获取资源表信息
41
+  const [alllist, setAllList] = useState([])
42
+
34 43
   const [isyear, setYear] = useState(true)
35 44
   const [isMomth, setMonth] = useState(false)
36 45
   //小眼睛开关
@@ -73,12 +82,8 @@ export default (props) => {
73 82
     },
74 83
   ]
75 84
 
76
-  const [vale, setVale] = useState('')
77
-
78
-  const phoneVale = () => {
79
-
80
-  }
81 85
 
86
+  //给父组件传val
82 87
   const handleVarified = () => {
83 88
     onVarified()
84 89
   }
@@ -168,30 +173,51 @@ export default (props) => {
168 173
             {/* 未核销 */}
169 174
             {activeTab === 0 &&
170 175
               <>
171
-                {
172
-                  verifiedOrder.map((item, index) => {
173
-
174
-                    return <ShopUnused key={(index)} item={item} />
175
-                  })
176
-                }
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>
177 189
               </>
190
+
178 191
             }
179 192
             {/* 已核销 */}
180 193
             {activeTab === 1 &&
181 194
               <>
182
-                {
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
+                {/* {
183 209
                   verifiedOrder.map((item, index) => {
184 210
 
185 211
                     return <ShopUsed verifiedOrder={verifiedOrder} key={(index)} item={item} />
186 212
                   })
187
-                }
213
+                } */}
188 214
 
189 215
 
190 216
 
191 217
               </>
192 218
             }
193 219
           </view>
194
-          <view className='botton'>已经到底了~</view>
220
+          {/* <view className='botton'>已经到底了~</view> */}
195 221
         </scroll-view>
196 222
       </view>
197 223
     </view>

+ 17
- 4
src/shop/components/Sparead/spreadMoney.jsx Vedi File

@@ -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
 

+ 3
- 1
src/shop/pages/spread/spreadIndex.jsx Vedi File

@@ -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)
@@ -86,6 +87,7 @@ export default withLayout((props) => {
86 87
   useEffect(() => {
87 88
     if (shopId) {
88 89
       getShopMoney(shopId, amountType).then((e) => {
90
+
89 91
         setShopMoney(e)
90 92
 
91 93
       })
@@ -116,7 +118,7 @@ export default withLayout((props) => {
116 118
     <view className='page-index'>
117 119
       <CustomNav title={shop?.shopName} />
118 120
       <view className='index-container'>
119
-        {currentTab === 0 && <ShopKeeper setVer={setVer} 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} />
120 122
         }
121 123
         {currentTab === 1 && <Sparead shopList={shopList} shop={shop} verifiedOrder={verifiedOrder} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
122 124
       </view>