吃个甘蔗嚼一年 3 years ago
parent
commit
a80bc79c52

+ 3
- 0
src/components/ShopCommission/index.jsx View File

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

+ 1
- 0
src/components/ShopUsed/style.less View File

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

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

42
  * @param {*} 
42
  * @param {*} 
43
  * @returns 
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 View File

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
+
9
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
10
 import eyes from '@/assets/icons/shopKeeper/小眼睛.png'
10
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
11
 import ceyes from '@/assets/icons/shopKeeper/小眼睛-闭上.png'
11
 import iconsearch from '@/assets/icons/housemantj/search.png'
12
 import iconsearch from '@/assets/icons/housemantj/search.png'
22
 
23
 
23
 
24
 
24
 export default (props) => {
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
   const [activeTab, setActiveTab] = useState(0)
28
   const [activeTab, setActiveTab] = useState(0)
27
   const { params } = useRouter()
29
   const { params } = useRouter()
28
   const { tabJump } = params || {}
30
   const { tabJump } = params || {}
38
   }
40
   }
39
 
41
 
40
 
42
 
41
-  const handleHotelChange = (shopId, current) => {
43
+  const handleHotelChange = (e, current) => {
42
     onHotelChange(current)
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
   useEffect(() => {
48
   useEffect(() => {
58
     if (tabJump) {
49
     if (tabJump) {
59
       setActiveTab(tabJump - 0)
50
       setActiveTab(tabJump - 0)
63
   const handleTabChange = (e) => {
54
   const handleTabChange = (e) => {
64
     const { index } = e.detail
55
     const { index } = e.detail
65
     setActiveTab(index)
56
     setActiveTab(index)
57
+    if (index === 1) {
58
+      onVarified()
59
+
60
+    } else {
61
+      onVarifiedTwo()
62
+
63
+    }
66
   }
64
   }
67
   const tabs = [
65
   const tabs = [
68
     {
66
     {
73
     },
71
     },
74
   ]
72
   ]
75
 
73
 
74
+
75
+  const handleVarified = () => {
76
+    onVarified()
77
+  }
78
+
79
+
76
   const onSeacrh = (e) => {
80
   const onSeacrh = (e) => {
77
     console.log('eeeeeeeeeeeeeeeeee', e.detail.value);
81
     console.log('eeeeeeeeeeeeeeeeee', e.detail.value);
78
   }
82
   }
146
                   })
150
                   })
147
                 }
151
                 }
148
               </>
152
               </>
149
-
150
             }
153
             }
151
             {/* 已核销 */}
154
             {/* 已核销 */}
152
             {activeTab === 1 &&
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
           </view>
168
           </view>

+ 16
- 9
src/shop/pages/spread/spreadIndex.jsx View File

21
   const { tab } = params || {}
21
   const { tab } = params || {}
22
   const [currentTab, setCurrentTab] = useState(0)
22
   const [currentTab, setCurrentTab] = useState(0)
23
   const [shopList, setShopList] = useState([])
23
   const [shopList, setShopList] = useState([])
24
-  console.log("🚀 ~ file: spreadIndex.jsx ~ line 24 ~ withLayout ~ shopList", shopList)
25
   const [shop, setShop] = useState()
24
   const [shop, setShop] = useState()
26
   const shopId = shop?.shopId
25
   const shopId = shop?.shopId
27
 
26
 
28
   const [amountType, setAmountType] = useState('order')
27
   const [amountType, setAmountType] = useState('order')
28
+  const [isVerified, setisVerified] = useState(0)
29
   const [shopMoney, setShopMoney] = useState([])
29
   const [shopMoney, setShopMoney] = useState([])
30
   const [verifiedOrder, setVerifiedOrder] = useState([])
30
   const [verifiedOrder, setVerifiedOrder] = useState([])
31
   const handleTabChange = (e) => {
31
   const handleTabChange = (e) => {
50
   //未核销订单列表
50
   //未核销订单列表
51
   useEffect(() => {
51
   useEffect(() => {
52
     getVerifiedOrder({
52
     getVerifiedOrder({
53
-      isVerified: 0,
53
+      isVerified: isVerified,
54
       pageNum: 1,
54
       pageNum: 1,
55
       pageSize: 99,
55
       pageSize: 99,
56
       shopId: shopId,
56
       shopId: shopId,
58
     }).then((res) => {
58
     }).then((res) => {
59
       const order = res.records
59
       const order = res.records
60
       setVerifiedOrder(order)
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
   useEffect(() => {
77
   useEffect(() => {
68
     if (shopId) {
78
     if (shopId) {
96
   return (
106
   return (
97
     <view className='page-index'>
107
     <view className='page-index'>
98
       <CustomNav title={shop?.shopName} />
108
       <CustomNav title={shop?.shopName} />
99
-
100
       <view className='index-container'>
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
       </view>
113
       </view>
107
       <view className='index-tabbar'>
114
       <view className='index-tabbar'>
108
         <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>
115
         <TabBar extClass='custom-tabbar bottomTab' current={currentTab} onChange={handleTabChange}>