吃个甘蔗嚼一年 3 år sedan
förälder
incheckning
25fc55113b

+ 31
- 21
src/components/CompoentsOrder/complete/index.jsx Visa fil

@@ -2,12 +2,14 @@ import React, { useState, useEffect } from "react";
2 2
 import Taro, { useDidShow, AtSwipeAction } from "@tarojs/taro";
3 3
 import { getOrderSub, deleteOrder } from "@/services/payOrder";
4 4
 import NoData from '@/components/NoData'
5
+import SpinBox from "@/components/Spin/SpinBox";
6
+
5 7
 import ico_delete from '../../../assets/icons/ProCard/ico_delete.png'
6 8
 import AlreadyUsed from "../AlreadyUsed";
7 9
 import OrderCard from '../OrderCard'
8 10
 import "./style.less";
9 11
 import { View } from "@tarojs/components";
10
-import SlideViewOrder from '@/components/SlideViewOrder';
12
+
11 13
 
12 14
 
13 15
 const dict = {
@@ -22,6 +24,7 @@ export default (props) => {
22 24
   const [IsPull, setPull] = useState(false);
23 25
   const [pageNum, setNumber] = useState(1);
24 26
   const [HasNextPage, setHasNextPage] = useState(true);
27
+  const [loading, setLoading] = useState(false)
25 28
 
26 29
   useDidShow(() => {
27 30
     setNumber(1)
@@ -34,12 +37,10 @@ export default (props) => {
34 37
 
35 38
   }, [pageNum]);
36 39
 
37
-  const pageRefresh = () => {
38
-    // 页面下拉刷新回调
39
-    setPull(true);
40
-  };
40
+
41 41
 
42 42
   const getList = () => {
43
+    setLoading(true)
43 44
     setHasNextPage(false);
44 45
     getOrderSub({
45 46
       pageNum,
@@ -52,7 +53,11 @@ export default (props) => {
52 53
       );
53 54
       setHasNextPage(res.current < res.pages);
54 55
       setPull(false);
55
-    });
56
+      setLoading(false)
57
+
58
+    }).catch(e => {
59
+      setLoading(false)
60
+    })
56 61
   };
57 62
 
58 63
   const pageLoadMore = () => {
@@ -103,10 +108,6 @@ export default (props) => {
103 108
       <scroll-view
104 109
         scrollY
105 110
         style={{ height: '100%' }}
106
-        refresher-enabled
107
-        refresher-triggered={IsPull}
108
-        onrefresherrefresh={pageRefresh}
109
-        refresher-background='#fff'
110 111
         onscrolltolower={pageLoadMore}
111 112
       >
112 113
         {
@@ -118,27 +119,36 @@ export default (props) => {
118 119
                 /* 待支付 */
119 120
                 if (item.status === 0) {
120 121
                   return (
121
-                    // <SlideViewOrder del onDelete={() => slideButtonTap(item)}>
122
-                    <view key={`${type}-${item.orderId}`}  >
123
-                      <OrderCard item={item} handeDelete={slideButtonTap} />
124
-                    </view>
125
-                    // </SlideViewOrder>
122
+                    <SpinBox loading={loading} className='index-container' >
123
+
124
+                      <view key={`${type}-${item.orderId}`}  >
125
+                        <OrderCard item={item} handeDelete={slideButtonTap} />
126
+                      </view>
127
+                    </SpinBox>
126 128
                   );
127 129
                 }
128 130
                 /* 已使用 */
129 131
                 else if (item.isVerified == 1) {
130 132
                   return (
131
-                    <view key={`${type}-${item.orderId}`}>
132
-                      <OrderCard item={item} setShowCutover={setShowCutover} show={show} />
133
-                    </view>
133
+                    <SpinBox loading={loading} className='index-container' >
134
+
135
+                      <view key={`${type}-${item.orderId}`}>
136
+                        <OrderCard item={item} setShowCutover={setShowCutover} show={show} />
137
+                      </view>
138
+                    </SpinBox>
139
+
134 140
                   );
135 141
                 }
136 142
                 /* 待核销 */
137 143
                 else {
138 144
                   return (
139
-                    <view key={`${type}-${item.orderId}`}>
140
-                      <OrderCard item={item} />
141
-                    </view>
145
+                    <SpinBox loading={loading} className='index-container' >
146
+
147
+                      <view key={`${type}-${item.orderId}`}>
148
+                        <OrderCard item={item} />
149
+                      </view>
150
+                    </SpinBox>
151
+
142 152
                   );
143 153
                 }
144 154
               })}

+ 30
- 12
src/components/Spin/style.less Visa fil

@@ -1,4 +1,3 @@
1
-
2 1
 @width: 160px;
3 2
 
4 3
 .spin {
@@ -15,7 +14,8 @@
15 14
     position: absolute;
16 15
   }
17 16
 
18
-  .mask-left, .mask-right {
17
+  .mask-left,
18
+  .mask-right {
19 19
     // background: #fff;
20 20
     top: 0;
21 21
     width: calc(50% + 1px);
@@ -33,7 +33,9 @@
33 33
       border-left: 0;
34 34
       // transform: rotate(180deg);
35 35
       transform-origin: center left;
36
-      animation: spin-rotate-right 1.2s cubic-bezier(.25,.5,.25,1) 0.6s infinite, spin-color 2s linear infinite;
36
+      animation: spin-rotate-right 1.2s cubic-bezier(0.25, 0.5, 0.25, 1) 0.6s
37
+          infinite,
38
+        spin-color 2s linear infinite;
37 39
     }
38 40
   }
39 41
 
@@ -46,7 +48,9 @@
46 48
       border-bottom-left-radius: @width;
47 49
       border-right: 0;
48 50
       transform-origin: center right;
49
-      animation: spin-rotate-right 1.2s cubic-bezier(1,.25,.5,.25) infinite, spin-color 2s linear infinite;
51
+      animation: spin-rotate-right 1.2s cubic-bezier(1, 0.25, 0.5, 0.25)
52
+          infinite,
53
+        spin-color 2s linear infinite;
50 54
     }
51 55
   }
52 56
 
@@ -98,7 +102,8 @@
98 102
 }
99 103
 
100 104
 @keyframes spin-color {
101
-  0%, 100% {
105
+  0%,
106
+  100% {
102 107
     border-color: #d62d20;
103 108
   }
104 109
   40% {
@@ -107,7 +112,8 @@
107 112
   60% {
108 113
     border-color: #008744;
109 114
   }
110
-  80%, 90% {
115
+  80%,
116
+  90% {
111 117
     border-color: #ffa700;
112 118
   }
113 119
 }
@@ -120,7 +126,7 @@
120 126
   left: 0;
121 127
   z-index: 100;
122 128
   text-align: center;
123
-  background: rgba(255, 255, 255, .75);
129
+  background: rgba(255, 255, 255, 0.75);
124 130
 
125 131
   .spin2 {
126 132
     display: inline-block;
@@ -131,21 +137,33 @@
131 137
   }
132 138
 }
133 139
 
134
-
135 140
 .loading-wrapper {
136 141
   position: relative;
137 142
 
138 143
   .loading-box {
144
+    // position: absolute;
145
+    // z-index: 10;
146
+    // top: 0;
147
+    // left: 0;
148
+    // width: 100%;
149
+    // height: 100%;
150
+    // min-height: 72px;
151
+    // padding-top: 60%;
152
+    // padding-left: 50%;
153
+    // background: rgba(255, 255, 255, .95);
154
+    // box-sizing: border-box;
155
+
139 156
     position: absolute;
140 157
     z-index: 10;
141 158
     top: 0;
142 159
     left: 0;
143 160
     width: 100%;
144 161
     height: 100%;
145
-    min-height: 72px;
146
-    padding-top: 60%;
162
+    display: flex;
163
+    padding-top: 35%;
147 164
     padding-left: 50%;
148
-    background: rgba(255, 255, 255, .95);
165
+    background: rgba(255, 255, 255, 0.95);
166
+    -webkit-box-sizing: border-box;
149 167
     box-sizing: border-box;
150 168
   }
151
-}
169
+}

+ 26
- 16
src/components/toggleRole/ToggleRole.jsx Visa fil

@@ -1,4 +1,5 @@
1 1
 import { useState, useEffect } from 'react';
2
+import SpinBox from "@/components/Spin/SpinBox";
2 3
 
3 4
 import touristON from '@/assets/icons/UserCenter/touristON.png'
4 5
 import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
@@ -14,7 +15,9 @@ import { useModel } from '@/store'
14 15
 
15 16
 export default (props) => {
16 17
   const { showCutover, onClose, maskClosable, role } = props
17
-  const { getRole } = useModel('person')
18
+  const { getRole, loading } = useModel('person')
19
+  // const [loading, setLoading] = useState(false)
20
+
18 21
   const goToPerson = () => {
19 22
     getRole('normal')
20 23
   }
@@ -26,22 +29,29 @@ export default (props) => {
26 29
     getRole('shop')
27 30
   }
28 31
   return (
32
+
29 33
     <Popup show={showCutover} maskClosable={maskClosable} onClose={onClose}>
30
-      <view className='User-box-sths' >
31
-        <view className='User-box-selectUser'>请选择身份:</view>
32
-        <view className='User-box-tourist' onClick={goToPerson}>
33
-          <image className='Ubs-tourist-image' src={role === 'normal' ? touristON : touristOFF} />
34
-          <text className='Ubs-tourist-text'>我是用户</text>
35
-        </view>
36
-        <view className='User-box-hotelBoss' onClick={goToHotel}>
37
-          <image className='Ubs-hotelBoss-image' src={role === 'hotel' ? hotelBossON : hotelBossOFF} />
38
-          <text className='Ubs-hotelBoss-text'>我是房东</text>
39
-        </view>
40
-        <view className='User-box-shopBoss' onClick={goToShop}>
41
-          <image className='Ubs-shopBoss-image' src={role === 'shop' ? shopBossON : shopBossOFF} />
42
-          <text className='Ubs-shopBoss-text'>我是商铺</text>
34
+      <SpinBox loading={loading} className='index-container' >
35
+        <view className='User-box-sths' >
36
+          <view className='User-box-selectUser'>请选择身份:</view>
37
+          <view className='User-box-tourist' onClick={goToPerson}>
38
+            <image className='Ubs-tourist-image' src={role === 'normal' ? touristON : touristOFF} />
39
+            <text className='Ubs-tourist-text'>我是用户</text>
40
+          </view>
41
+          <view className='User-box-hotelBoss' onClick={goToHotel}>
42
+            <image className='Ubs-hotelBoss-image' src={role === 'hotel' ? hotelBossON : hotelBossOFF} />
43
+            <text className='Ubs-hotelBoss-text'>我是房东</text>
44
+          </view>
45
+          <view className='User-box-shopBoss' onClick={goToShop}>
46
+            <image className='Ubs-shopBoss-image' src={role === 'shop' ? shopBossON : shopBossOFF} />
47
+            <text className='Ubs-shopBoss-text'>我是商铺</text>
48
+          </view>
43 49
         </view>
44
-      </view>
45
-    </Popup>
50
+      </SpinBox>
51
+
52
+
53
+    </Popup >
54
+
55
+
46 56
   )
47 57
 }

+ 0
- 4
src/pages/MineUserAll/AllOrder/index.jsx Visa fil

@@ -7,13 +7,9 @@ import Complete from '@/components/CompoentsOrder/complete'
7 7
 import './style.less'
8 8
 
9 9
 
10
-
11 10
 export default withLayout((props) => {
12 11
   const [activeTab, setActiveTab] = useState(0)
13
-  const [swiperHeight, setSwiperHeight] = useState(0)
14 12
   const { router, person } = props
15
-
16
-
17 13
   const { params } = useRouter()
18 14
   const { tabJump } = params || {}
19 15
 

+ 21
- 2
src/pages/MineUserAll/ContactMe/index.jsx Visa fil

@@ -1,6 +1,8 @@
1 1
 import { saveFeedback } from '@/services/mine'
2
+import { useState } from 'react';
2 3
 import CustomNav from '@/components/CustomNav'
3 4
 import Taro from '@tarojs/taro'
5
+import SpinBox from "@/components/Spin/SpinBox";
4 6
 import { Image, Button } from '@tarojs/components'
5 7
 import withLayout from '@/layouts'
6 8
 import './style.less'
@@ -9,16 +11,28 @@ import './style.less'
9 11
 export default withLayout((props) => {
10 12
   const { person } = props
11 13
   const { personId } = person
14
+  const [loading, setLoading] = useState(false)
12 15
   const back = () => {
13 16
     Taro.navigateBack()
14 17
   }
15 18
   const submit = () => {
16 19
     var content = document.getElementById('content').value
17 20
     if (content != '') {
21
+      setLoading(true)
18 22
       saveFeedback({
19 23
         personId,
20 24
         content
21 25
       }).then(() => {
26
+
27
+        Taro.navigateBack({
28
+          delta: 1
29
+        })
30
+        Taro.showToast({
31
+          title: '反馈成功',
32
+          icon: 'success',
33
+          duration: 2000
34
+        })
35
+        setLoading(false)
22 36
       })
23 37
     }
24 38
     else {
@@ -41,11 +55,16 @@ export default withLayout((props) => {
41 55
         <view className='weChate-image' >
42 56
           <Image mode='aspectFit' src='https://yz-shigongli.oss-cn-shanghai.aliyuncs.com/images/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20210918145337.png' />
43 57
         </view>
58
+
44 59
         <view className='button-info'>
45
-          <Button className='button-box' onClick={submit}>提交</Button>
60
+
61
+          <Button className='button-box' onClick={submit} loading={loading}  >提交</Button>
62
+
46 63
           <Button className='button-box-Cancel' onClick={back} >取消</Button>
64
+
47 65
         </view>
66
+
48 67
       </view>
49
-    </view>
68
+    </view >
50 69
   )
51 70
 })

+ 104
- 93
src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx Visa fil

@@ -1,6 +1,8 @@
1 1
 import Taro from "@tarojs/taro";
2 2
 import { Button, Textarea, View } from "@tarojs/components";
3 3
 import formatPrice from "@/utils/formatPrice";
4
+import SpinBox from "@/components/Spin/SpinBox";
5
+
4 6
 import { useState, useEffect } from "react";
5 7
 import OrderCard from '@/components/CompoentsOrder/OrderCard'
6 8
 import withLayout from "@/layouts";
@@ -39,6 +41,7 @@ const options = [
39 41
 export default withLayout((props) => {
40 42
   const { router, person } = props;
41 43
   const { id } = props.router.params;
44
+  const [loading, setLoading] = useState(false)
42 45
 
43 46
   // 说明
44 47
   const [explain, setExplain] = useState();
@@ -50,15 +53,19 @@ export default withLayout((props) => {
50 53
   const [checkeds, setCheckeds] = useState([1]);
51 54
 
52 55
   const getData = (orderId) => {
53
-    Taro.showLoading();
56
+    setLoading(true)
57
+
54 58
     getOrderSub({
55 59
       pageNum: 1,
56 60
       pageSize: 50,
57 61
       orderId: orderId,
58 62
     }).then((res) => {
59 63
       setList(res.records);
60
-      Taro.hideLoading();
61
-    });
64
+      setLoading(false)
65
+
66
+    }).catch(e => {
67
+      setLoading(false)
68
+    })
62 69
   };
63 70
 
64 71
   useEffect(() => {
@@ -115,100 +122,104 @@ export default withLayout((props) => {
115 122
       <View className='index-container'>
116 123
         <View className='box-content'>
117 124
           <scroll-view scroll-y style='height: 100%;' >
118
-            <view className='Refund-Content-box'>
119
-              <view className='title-image'>
120
-                <image
121
-                  mode='scaleToFill'
122
-                  className='title-image-cup'
123
-                  src={BlackSpot}
124
-                />
125
-                <text className='title-title-boss'>商品信息</text>
125
+            <SpinBox loading={loading} className='index-container' >
126
+
127
+              <view className='Refund-Content-box'>
128
+                <view className='title-image'>
129
+                  <image
130
+                    mode='scaleToFill'
131
+                    className='title-image-cup'
132
+                    src={BlackSpot}
133
+                  />
134
+                  <text className='title-title-boss'>商品信息</text>
135
+                </view>
126 136
               </view>
127
-            </view>
128
-            {/* 商品信息结束 */}
129
-            <view>
130
-              {(list || []).map((item) => {
131
-                return (
132
-                  <OrderCard item={item} key={item.orderId} kkp='1' />
133
-                );
134
-              })}
135
-            </view>
136
-            {/* 卡片结束 */}
137
-            <view className='Refund-Content-box'>
138
-              <view className='title-image'>
139
-                <image
140
-                  mode='scaleToFill'
141
-                  className='title-image-cup'
142
-                  src={BlackSpot}
143
-                />
144
-                <text className='title-title-boss'>退款原因</text>
137
+              {/* 商品信息结束 */}
138
+              <view>
139
+                {(list || []).map((item) => {
140
+                  return (
141
+                    <OrderCard item={item} key={item.orderId} kkp='1' />
142
+                  );
143
+                })}
144
+              </view>
145
+              {/* 卡片结束 */}
146
+              <view className='Refund-Content-box'>
147
+                <view className='title-image'>
148
+                  <image
149
+                    mode='scaleToFill'
150
+                    className='title-image-cup'
151
+                    src={BlackSpot}
152
+                  />
153
+                  <text className='title-title-boss'>退款原因</text>
154
+                </view>
155
+                {/* 退款结束 */}
145 156
               </view>
146
-              {/* 退款结束 */}
147
-            </view>
148
-            <view className='Refund-content'>
149
-              {options.map((x) => {
150
-                return (
151
-                  <text
152
-                    className={`Refund-star-view1 ${checkeds.indexOf(x.key) > -1
153
-                      ? "bg2"
154
-                      : `Refund-star-view2`
155
-                      }`}
156
-                    key={x.key}
157
-                    onClick={() => viewOK(x)}
158
-                  >
159
-                    {x.title}
160
-                  </text>
161
-                );
162
-              })}
163
-            </view>
164
-            <view className='Refund-Content-box'>
165
-              <view className='title-image'>
166
-                <image
167
-                  mode='scaleToFill'
168
-                  className='title-image-cup'
169
-                  src={BlackSpot}
157
+              <view className='Refund-content'>
158
+                {options.map((x) => {
159
+                  return (
160
+                    <text
161
+                      className={`Refund-star-view1 ${checkeds.indexOf(x.key) > -1
162
+                        ? "bg2"
163
+                        : `Refund-star-view2`
164
+                        }`}
165
+                      key={x.key}
166
+                      onClick={() => viewOK(x)}
167
+                    >
168
+                      {x.title}
169
+                    </text>
170
+                  );
171
+                })}
172
+              </view>
173
+              <view className='Refund-Content-box'>
174
+                <view className='title-image'>
175
+                  <image
176
+                    mode='scaleToFill'
177
+                    className='title-image-cup'
178
+                    src={BlackSpot}
179
+                  />
180
+                  <text className='title-title-boss'>退款说明</text>
181
+                </view>
182
+              </view>
183
+              <view class='section'>
184
+                <Textarea
185
+                  placeholder='请补充退款说明(选填)!'
186
+                  onInput={(e) => setExplain(e.detail.value)}
187
+                  confirm-type='done'
170 188
                 />
171
-                <text className='title-title-boss'>退款说明</text>
172 189
               </view>
173
-            </view>
174
-            <view class='section'>
175
-              <Textarea
176
-                placeholder='请补充退款说明(选填)!'
177
-                onInput={(e) => setExplain(e.detail.value)}
178
-                confirm-type='done'
179
-              />
180
-            </view>
181
-            <view className='money-title'>
182
-              实付金额:{" "}
183
-              <text className='money-name'>{formatPrice(totalPrice.charges)}元</text>
184
-            </view>
185
-            <view className='money-title'>
186
-              已获返现:{" "}
187
-              <text className='money-name'>{formatPrice(totalPrice.cashback)}元</text>
188
-            </view>
189
-            <view className='money-title'>
190
-              退款金额:{" "}
191
-              <text className='money-name'>{formatPrice(totalPrice.refundPrice)}元</text>
192
-            </view>
193
-            <view className='ul-li-text'>
194
-              <view className='ul-li-view'></view>
195
-              <text className='ul-li-textname'>退款金额不可修改</text>
196
-            </view>
197
-            <view className='ul-li-text'>
198
-              <view className='ul-li-view'></view>
199
-              <text className='ul-li-textname'>
200
-                下单获得返现金额,会在退款时被扣除;
201
-              </text>
202
-            </view>
203
-            <view className='ul-li-text'>
204
-              <view className='ul-li-view'></view>
205
-              <text className='ul-li-textname'>退款将在七个工作日内原路退还。</text>
206
-            </view>
207
-            <view className='button-info' >
208
-              <Button className='button-box' onClick={() => onRefund()}>
209
-                提交申请
210
-              </Button>
211
-            </view>
190
+              <view className='money-title'>
191
+                实付金额:{" "}
192
+                <text className='money-name'>{formatPrice(totalPrice.charges)}元</text>
193
+              </view>
194
+              <view className='money-title'>
195
+                已获返现:{" "}
196
+                <text className='money-name'>{formatPrice(totalPrice.cashback)}元</text>
197
+              </view>
198
+              <view className='money-title'>
199
+                退款金额:{" "}
200
+                <text className='money-name'>{formatPrice(totalPrice.refundPrice)}元</text>
201
+              </view>
202
+              <view className='ul-li-text'>
203
+                <view className='ul-li-view'></view>
204
+                <text className='ul-li-textname'>退款金额不可修改</text>
205
+              </view>
206
+              <view className='ul-li-text'>
207
+                <view className='ul-li-view'></view>
208
+                <text className='ul-li-textname'>
209
+                  下单获得返现金额,会在退款时被扣除;
210
+                </text>
211
+              </view>
212
+              <view className='ul-li-text'>
213
+                <view className='ul-li-view'></view>
214
+                <text className='ul-li-textname'>退款将在七个工作日内原路退还。</text>
215
+              </view>
216
+              <view className='button-info' >
217
+                <Button className='button-box' onClick={() => onRefund()}>
218
+                  提交申请
219
+                </Button>
220
+              </view>
221
+            </SpinBox>
222
+
212 223
           </scroll-view>
213 224
         </View>
214 225
       </View>

+ 23
- 38
src/pages/MineUserAll/RefundMoney/index.jsx Visa fil

@@ -1,5 +1,7 @@
1 1
 import { useState, useEffect } from "react";
2 2
 import Taro, { useDidShow } from "@tarojs/taro";
3
+import SpinBox from "@/components/Spin/SpinBox";
4
+
3 5
 import withLayout from "@/layouts";
4 6
 import OrderCard from '@/components/CompoentsOrder/OrderCard'
5 7
 import { getOrderSub } from "@/services/payOrder";
@@ -13,12 +15,11 @@ export default withLayout((props) => {
13 15
   const [IsPull, setPull] = useState(false);
14 16
   const [pageNum, setNumber] = useState(1);
15 17
   const [HasNextPage, setHasNextPage] = useState(true);
16
-  const [isFirst, setFirst] = useState(true)
18
+  const [loading, setLoading] = useState(false)
17 19
 
18 20
   const getList = () => {
19
-    setFirst(false)
21
+    setLoading(true)
20 22
     setHasNextPage(false);
21
-    Taro.showLoading()
22 23
     getOrderSub({
23 24
       pageNum,
24 25
       pageSize: 10,
@@ -30,15 +31,13 @@ export default withLayout((props) => {
30 31
       );
31 32
       setHasNextPage(res.current < res.pages);
32 33
       setPull(false);
33
-      Taro.hideLoading();
34
-
35
-    });
34
+      setLoading(false)
35
+    }).catch(e => {
36
+      setLoading(false)
37
+    })
36 38
   };
37 39
 
38
-  const pageRefresh = () => {
39
-    // 页面下拉刷新回调
40
-    setPull(true);
41
-  };
40
+
42 41
 
43 42
   const pageLoadMore = () => {
44 43
     // 页面上拉加载更多
@@ -47,28 +46,14 @@ export default withLayout((props) => {
47 46
     }
48 47
   };
49 48
 
50
-  useDidShow(() => {
51
-    if (!isFirst) {
52
-      getList();
53
-    }
54 49
 
55
-  })
56 50
 
57
-  useEffect(() => {
58
-    // 下拉刷新触发
59
-    if (IsPull) {
60
-      if (pageNum === 1) {
61
-        getList();
62
-      } else {
63
-        setNumber(1);
64
-      }
65
-    }
66
-  }, [IsPull]);
51
+
67 52
 
68 53
   useEffect(() => {
69 54
     getList();
70 55
   }, [pageNum]);
71
-    
56
+
72 57
   return (
73 58
     <view className='box-content'>
74 59
       <view className='index-navbar'>
@@ -77,20 +62,20 @@ export default withLayout((props) => {
77 62
       <scroll-view
78 63
         scrollY
79 64
         style='height: calc(100vh - 176rpx);'
80
-        refresher-enabled
81
-        refresher-triggered={IsPull}
82
-        onrefresherrefresh={pageRefresh}
83
-        refresher-background='#fff'
84 65
         onscrolltolower={pageLoadMore}
85 66
       >
86
-        <view className='View-box-Card'>
87
-          {(list || []).map((item) => {
88
-            return (
89
-              <OrderCard item={item}  key={item.orderId} sh='1' />              
90
-            )            
91
-          })}
92
-          <view className='foot'>这是我的底线</view>
93
-        </view>
67
+        <SpinBox loading={loading} className='index-container' >
68
+
69
+          <view className='View-box-Card'>
70
+            {(list || []).map((item) => {
71
+              return (
72
+                <OrderCard item={item} key={item.orderId} sh='1' />
73
+              )
74
+            })}
75
+            <view className='foot'>这是我的底线</view>
76
+          </view>
77
+        </SpinBox>
78
+
94 79
       </scroll-view>
95 80
     </view>
96 81
   );

+ 11
- 2
src/store/models/person.js Visa fil

@@ -1,16 +1,17 @@
1 1
 import { useState } from "react"
2 2
 import Taro from '@tarojs/taro'
3
-import { signIn, authPhone, authAvatar,toggleRole } from '@/services/person'
3
+import { signIn, authPhone, authAvatar, toggleRole } from '@/services/person'
4 4
 
5 5
 export default () => {
6 6
   const [person, setPerson] = useState()
7 7
   const [qrCode, setQrCode] = useState()
8 8
   const [peronRoles, setPersonRoles] = useState([])
9 9
   const [sessionKey, setSessionKey] = useState()
10
+  const [loading, setLoading] = useState(false)
10 11
 
11 12
   const login = (params) => {
12 13
     signIn(params).then((res) => {
13
-      const { person: taPerson, personRoleList, sessionKey : skey, qrcode, token } = res;
14
+      const { person: taPerson, personRoleList, sessionKey: skey, qrcode, token } = res;
14 15
       setPerson(taPerson);
15 16
       setPersonRoles(personRoleList);
16 17
       setQrCode(qrcode);
@@ -34,8 +35,15 @@ export default () => {
34 35
   }
35 36
 
36 37
   const getRole = (data) => {
38
+    setLoading(true)
39
+
37 40
     return toggleRole(data).then((res) => {
41
+      setLoading(false)
42
+
38 43
       setPerson(res);
44
+    }).catch(e => {
45
+      setLoading(false)
46
+
39 47
     })
40 48
   }
41 49
 
@@ -44,6 +52,7 @@ export default () => {
44 52
     peronRoles,
45 53
     qrCode,
46 54
     sessionKey,
55
+    loading,
47 56
     setPerson,
48 57
     login,
49 58
     getPhone,