吃个甘蔗嚼一年 3 年之前
父節點
當前提交
a80bc79c52

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

@@ -1,6 +1,8 @@
1 1
 import Taro from '@tarojs/taro'
2 2
 import { useEffect } from 'react'
3
+
3 4
 import { getAccount } from '@/services/shopBoss'
5
+
4 6
 import formatTimes from '@/utils/formatTime'
5 7
 
6 8
 import './style.less'
@@ -11,6 +13,7 @@ export default (props) => {
11 13
   const { item } = props
12 14
 
13 15
 
16
+
14 17
   return (
15 18
     <view className='spreadCard'>
16 19
       <view className='spreadDate'>日期:<text>{formatTimes(item.createDate, "yyyy/MM/dd")}</text></view>

+ 1
- 0
src/components/ShopUsed/style.less 查看文件

@@ -61,6 +61,7 @@
61 61
       height: 2px;
62 62
       background: #000;
63 63
       opacity: 0.1;
64
+      margin-top: 100px;
64 65
     }
65 66
     .phone{
66 67
       font-size: 24px;

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

@@ -42,6 +42,6 @@ export const getVerifiedOrder = (data) => request(`/verifyTarget`, { data })
42 42
  * @param {*} 
43 43
  * @returns 
44 44
  */
45
-export const setGetVerifiedOrder = (id) => request(`/verifyTarget​/${id}`, { method: 'put', id })
46 45
 
47 46
 
47
+export const setGetVerifiedOrder = (id) => request(`/verifyTarget/${id}/confirm`, { method: 'put', id })

+ 26
- 15
src/shop/components/ShopKeeper/shopKeeper.jsx 查看文件

@@ -6,6 +6,7 @@ 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
+
9 10
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
10 11
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
11 12
 import iconsearch from '@/assets/icons/housemantj/search.png'
@@ -22,7 +23,8 @@ import ToggleRole from '@/components/toggleRole/ToggleRole'
22 23
 
23 24
 
24 25
 export default (props) => {
25
-  const { shopList, shop, onHotelChange, shopMoney, verifiedOrder } = props
26
+  const { shopList, shop, onHotelChange, shopMoney, verifiedOrder, onVarified, onVarifiedTwo } = props
27
+  const shopId = shop?.shopId
26 28
   const [activeTab, setActiveTab] = useState(0)
27 29
   const { params } = useRouter()
28 30
   const { tabJump } = params || {}
@@ -38,22 +40,11 @@ export default (props) => {
38 40
   }
39 41
 
40 42
 
41
-  const handleHotelChange = (shopId, current) => {
43
+  const handleHotelChange = (e, current) => {
42 44
     onHotelChange(current)
43 45
   }
44 46
 
45 47
 
46
-
47
-
48
-
49
-
50
-  const handleChange = (e) => {
51
-    console.log("🚀 ~ file: shopKeeper.jsx ~ line 67 ~ handleChange ~ e", e)
52
-
53
-
54
-  }
55
-
56
-
57 48
   useEffect(() => {
58 49
     if (tabJump) {
59 50
       setActiveTab(tabJump - 0)
@@ -63,6 +54,13 @@ export default (props) => {
63 54
   const handleTabChange = (e) => {
64 55
     const { index } = e.detail
65 56
     setActiveTab(index)
57
+    if (index === 1) {
58
+      onVarified()
59
+
60
+    } else {
61
+      onVarifiedTwo()
62
+
63
+    }
66 64
   }
67 65
   const tabs = [
68 66
     {
@@ -73,6 +71,12 @@ export default (props) => {
73 71
     },
74 72
   ]
75 73
 
74
+
75
+  const handleVarified = () => {
76
+    onVarified()
77
+  }
78
+
79
+
76 80
   const onSeacrh = (e) => {
77 81
     console.log('eeeeeeeeeeeeeeeeee', e.detail.value);
78 82
   }
@@ -146,12 +150,19 @@ export default (props) => {
146 150
                   })
147 151
                 }
148 152
               </>
149
-
150 153
             }
151 154
             {/* 已核销 */}
152 155
             {activeTab === 1 &&
153 156
               <>
154
-                <ShopUsed />
157
+                {
158
+                  verifiedOrder.map((item, index) => {
159
+
160
+                    return <ShopUsed verifiedOrder={verifiedOrder} key={(index)} item={item} />
161
+                  })
162
+                }
163
+
164
+
165
+
155 166
               </>
156 167
             }
157 168
           </view>

+ 16
- 9
src/shop/pages/spread/spreadIndex.jsx 查看文件

@@ -21,11 +21,11 @@ export default withLayout((props) => {
21 21
   const { tab } = params || {}
22 22
   const [currentTab, setCurrentTab] = useState(0)
23 23
   const [shopList, setShopList] = useState([])
24
-  console.log("🚀 ~ file: spreadIndex.jsx ~ line 24 ~ withLayout ~ shopList", shopList)
25 24
   const [shop, setShop] = useState()
26 25
   const shopId = shop?.shopId
27 26
 
28 27
   const [amountType, setAmountType] = useState('order')
28
+  const [isVerified, setisVerified] = useState(0)
29 29
   const [shopMoney, setShopMoney] = useState([])
30 30
   const [verifiedOrder, setVerifiedOrder] = useState([])
31 31
   const handleTabChange = (e) => {
@@ -50,7 +50,7 @@ export default withLayout((props) => {
50 50
   //未核销订单列表
51 51
   useEffect(() => {
52 52
     getVerifiedOrder({
53
-      isVerified: 0,
53
+      isVerified: isVerified,
54 54
       pageNum: 1,
55 55
       pageSize: 99,
56 56
       shopId: shopId,
@@ -58,11 +58,21 @@ export default withLayout((props) => {
58 58
     }).then((res) => {
59 59
       const order = res.records
60 60
       setVerifiedOrder(order)
61
-      console.log("🚀 ~ file: spreadIndex.jsx ~ line 49 ~ getVerifiedOrder ~ res", res)
62 61
 
63 62
     })
64 63
 
65
-  }, [shopId])
64
+
65
+  }, [shopId, isVerified])
66
+
67
+
68
+  const onVarified = () => {
69
+    setisVerified(1)
70
+  }
71
+
72
+
73
+  const onVarifiedTwo = () => {
74
+    setisVerified(0)
75
+  }
66 76
 
67 77
   useEffect(() => {
68 78
     if (shopId) {
@@ -96,13 +106,10 @@ export default withLayout((props) => {
96 106
   return (
97 107
     <view className='page-index'>
98 108
       <CustomNav title={shop?.shopName} />
99
-
100 109
       <view className='index-container'>
101
-        {currentTab === 0 && <ShopKeeper verifiedOrder={verifiedOrder} shopList={shopList} shop={shop} onHotelChange={handleHotelChange} shopMoney={shopMoney} />
102
-
103
-
110
+        {currentTab === 0 && <ShopKeeper onVarifiedTwo={onVarifiedTwo} onVarified={onVarified} verifiedOrder={verifiedOrder} shopList={shopList} shop={shop} onHotelChange={handleHotelChange} shopMoney={shopMoney} />
104 111
         }
105
-        {currentTab === 1 && <Sparead shopList={shopList} shop={shop} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
112
+        {currentTab === 1 && <Sparead shopList={shopList} shop={shop} verifiedOrder={verifiedOrder} onHotelChange={handleHotelChange} shopMoney={shopMoney} />}
106 113
       </view>
107 114
       <view className='index-tabbar'>
108 115
         <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>