|
@@ -3,6 +3,7 @@ import CustomNav from '@/components/CustomNav'
|
3
|
3
|
import { useRouter } from '@tarojs/taro'
|
4
|
4
|
import { getShopList, getShopMoney, getAccount, getVerifiedOrder, setGetVerifiedOrder } from '@/services/shopBoss'
|
5
|
5
|
import { withSubscribeMessage } from '@/utils/subscribeMessage'
|
|
6
|
+import SpinBox from "@/components/Spin/SpinBox";
|
6
|
7
|
import withLayout from '@/layouts'
|
7
|
8
|
import {
|
8
|
9
|
TPL_MESSAGE_SHOP_PAY_SUCCESS,
|
|
@@ -25,6 +26,7 @@ export default withLayout((props) => {
|
25
|
26
|
const [shopList, setShopList] = useState([])
|
26
|
27
|
const [shop, setShop] = useState()
|
27
|
28
|
const shopId = shop?.shopId
|
|
29
|
+ const [loading, setLoading] = useState(false)
|
28
|
30
|
|
29
|
31
|
const [amountType, setAmountType] = useState('order')
|
30
|
32
|
const [isVerified, setisVerified] = useState(0)
|
|
@@ -40,7 +42,6 @@ export default withLayout((props) => {
|
40
|
42
|
if (listRef.current?.context) {
|
41
|
43
|
listRef.current.context.scrollTo({ top: 0 })
|
42
|
44
|
}
|
43
|
|
-
|
44
|
45
|
withSubscribeMessage([TPL_MESSAGE_SHOP_PAY_SUCCESS, TPL_MESSAGE_SHOP_VERIFY_RESULT])
|
45
|
46
|
}
|
46
|
47
|
//商铺列表
|
|
@@ -69,10 +70,12 @@ export default withLayout((props) => {
|
69
|
70
|
}
|
70
|
71
|
|
71
|
72
|
useEffect(() => {
|
|
73
|
+ setLoading(true)
|
72
|
74
|
if (shopId) {
|
73
|
75
|
getShopMoney(shopId, amountType).then((e) => {
|
74
|
76
|
setShopMoney(e)
|
75
|
|
- })
|
|
77
|
+ setLoading(false)
|
|
78
|
+ }).catch(setLoading(false))
|
76
|
79
|
}
|
77
|
80
|
|
78
|
81
|
}, [amountType, shopId, currentTab])
|
|
@@ -100,7 +103,7 @@ export default withLayout((props) => {
|
100
|
103
|
}, [tab])
|
101
|
104
|
|
102
|
105
|
return (
|
103
|
|
- <view className='page-index'>
|
|
106
|
+ <SpinBox loading={loading} className='page-index'>
|
104
|
107
|
<view className='index-navbar'>
|
105
|
108
|
<CustomNav title={shop?.shopName} />
|
106
|
109
|
</view>
|
|
@@ -112,7 +115,7 @@ export default withLayout((props) => {
|
112
|
115
|
<view className='index-tabbar'>
|
113
|
116
|
<mp-tabbar extClass='custom-tabbar' current={currentTab} list={tabList} onChange={handleTabChange}></mp-tabbar>
|
114
|
117
|
</view>
|
115
|
|
- </view>
|
|
118
|
+ </SpinBox>
|
116
|
119
|
|
117
|
120
|
)
|
118
|
121
|
|