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

+ 31
- 21
src/components/CompoentsOrder/complete/index.jsx View File

2
 import Taro, { useDidShow, AtSwipeAction } from "@tarojs/taro";
2
 import Taro, { useDidShow, AtSwipeAction } from "@tarojs/taro";
3
 import { getOrderSub, deleteOrder } from "@/services/payOrder";
3
 import { getOrderSub, deleteOrder } from "@/services/payOrder";
4
 import NoData from '@/components/NoData'
4
 import NoData from '@/components/NoData'
5
+import SpinBox from "@/components/Spin/SpinBox";
6
+
5
 import ico_delete from '../../../assets/icons/ProCard/ico_delete.png'
7
 import ico_delete from '../../../assets/icons/ProCard/ico_delete.png'
6
 import AlreadyUsed from "../AlreadyUsed";
8
 import AlreadyUsed from "../AlreadyUsed";
7
 import OrderCard from '../OrderCard'
9
 import OrderCard from '../OrderCard'
8
 import "./style.less";
10
 import "./style.less";
9
 import { View } from "@tarojs/components";
11
 import { View } from "@tarojs/components";
10
-import SlideViewOrder from '@/components/SlideViewOrder';
12
+
11
 
13
 
12
 
14
 
13
 const dict = {
15
 const dict = {
22
   const [IsPull, setPull] = useState(false);
24
   const [IsPull, setPull] = useState(false);
23
   const [pageNum, setNumber] = useState(1);
25
   const [pageNum, setNumber] = useState(1);
24
   const [HasNextPage, setHasNextPage] = useState(true);
26
   const [HasNextPage, setHasNextPage] = useState(true);
27
+  const [loading, setLoading] = useState(false)
25
 
28
 
26
   useDidShow(() => {
29
   useDidShow(() => {
27
     setNumber(1)
30
     setNumber(1)
34
 
37
 
35
   }, [pageNum]);
38
   }, [pageNum]);
36
 
39
 
37
-  const pageRefresh = () => {
38
-    // 页面下拉刷新回调
39
-    setPull(true);
40
-  };
40
+
41
 
41
 
42
   const getList = () => {
42
   const getList = () => {
43
+    setLoading(true)
43
     setHasNextPage(false);
44
     setHasNextPage(false);
44
     getOrderSub({
45
     getOrderSub({
45
       pageNum,
46
       pageNum,
52
       );
53
       );
53
       setHasNextPage(res.current < res.pages);
54
       setHasNextPage(res.current < res.pages);
54
       setPull(false);
55
       setPull(false);
55
-    });
56
+      setLoading(false)
57
+
58
+    }).catch(e => {
59
+      setLoading(false)
60
+    })
56
   };
61
   };
57
 
62
 
58
   const pageLoadMore = () => {
63
   const pageLoadMore = () => {
103
       <scroll-view
108
       <scroll-view
104
         scrollY
109
         scrollY
105
         style={{ height: '100%' }}
110
         style={{ height: '100%' }}
106
-        refresher-enabled
107
-        refresher-triggered={IsPull}
108
-        onrefresherrefresh={pageRefresh}
109
-        refresher-background='#fff'
110
         onscrolltolower={pageLoadMore}
111
         onscrolltolower={pageLoadMore}
111
       >
112
       >
112
         {
113
         {
118
                 /* 待支付 */
119
                 /* 待支付 */
119
                 if (item.status === 0) {
120
                 if (item.status === 0) {
120
                   return (
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
                 else if (item.isVerified == 1) {
131
                 else if (item.isVerified == 1) {
130
                   return (
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
                 else {
143
                 else {
138
                   return (
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 View File

1
-
2
 @width: 160px;
1
 @width: 160px;
3
 
2
 
4
 .spin {
3
 .spin {
15
     position: absolute;
14
     position: absolute;
16
   }
15
   }
17
 
16
 
18
-  .mask-left, .mask-right {
17
+  .mask-left,
18
+  .mask-right {
19
     // background: #fff;
19
     // background: #fff;
20
     top: 0;
20
     top: 0;
21
     width: calc(50% + 1px);
21
     width: calc(50% + 1px);
33
       border-left: 0;
33
       border-left: 0;
34
       // transform: rotate(180deg);
34
       // transform: rotate(180deg);
35
       transform-origin: center left;
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
       border-bottom-left-radius: @width;
48
       border-bottom-left-radius: @width;
47
       border-right: 0;
49
       border-right: 0;
48
       transform-origin: center right;
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
 }
102
 }
99
 
103
 
100
 @keyframes spin-color {
104
 @keyframes spin-color {
101
-  0%, 100% {
105
+  0%,
106
+  100% {
102
     border-color: #d62d20;
107
     border-color: #d62d20;
103
   }
108
   }
104
   40% {
109
   40% {
107
   60% {
112
   60% {
108
     border-color: #008744;
113
     border-color: #008744;
109
   }
114
   }
110
-  80%, 90% {
115
+  80%,
116
+  90% {
111
     border-color: #ffa700;
117
     border-color: #ffa700;
112
   }
118
   }
113
 }
119
 }
120
   left: 0;
126
   left: 0;
121
   z-index: 100;
127
   z-index: 100;
122
   text-align: center;
128
   text-align: center;
123
-  background: rgba(255, 255, 255, .75);
129
+  background: rgba(255, 255, 255, 0.75);
124
 
130
 
125
   .spin2 {
131
   .spin2 {
126
     display: inline-block;
132
     display: inline-block;
131
   }
137
   }
132
 }
138
 }
133
 
139
 
134
-
135
 .loading-wrapper {
140
 .loading-wrapper {
136
   position: relative;
141
   position: relative;
137
 
142
 
138
   .loading-box {
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
     position: absolute;
156
     position: absolute;
140
     z-index: 10;
157
     z-index: 10;
141
     top: 0;
158
     top: 0;
142
     left: 0;
159
     left: 0;
143
     width: 100%;
160
     width: 100%;
144
     height: 100%;
161
     height: 100%;
145
-    min-height: 72px;
146
-    padding-top: 60%;
162
+    display: flex;
163
+    padding-top: 35%;
147
     padding-left: 50%;
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
     box-sizing: border-box;
167
     box-sizing: border-box;
150
   }
168
   }
151
-}
169
+}

+ 26
- 16
src/components/toggleRole/ToggleRole.jsx View File

1
 import { useState, useEffect } from 'react';
1
 import { useState, useEffect } from 'react';
2
+import SpinBox from "@/components/Spin/SpinBox";
2
 
3
 
3
 import touristON from '@/assets/icons/UserCenter/touristON.png'
4
 import touristON from '@/assets/icons/UserCenter/touristON.png'
4
 import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
5
 import touristOFF from '@/assets/icons/UserCenter/touristOFF.png'
14
 
15
 
15
 export default (props) => {
16
 export default (props) => {
16
   const { showCutover, onClose, maskClosable, role } = props
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
   const goToPerson = () => {
21
   const goToPerson = () => {
19
     getRole('normal')
22
     getRole('normal')
20
   }
23
   }
26
     getRole('shop')
29
     getRole('shop')
27
   }
30
   }
28
   return (
31
   return (
32
+
29
     <Popup show={showCutover} maskClosable={maskClosable} onClose={onClose}>
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
         </view>
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 View File

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

+ 21
- 2
src/pages/MineUserAll/ContactMe/index.jsx View File

1
 import { saveFeedback } from '@/services/mine'
1
 import { saveFeedback } from '@/services/mine'
2
+import { useState } from 'react';
2
 import CustomNav from '@/components/CustomNav'
3
 import CustomNav from '@/components/CustomNav'
3
 import Taro from '@tarojs/taro'
4
 import Taro from '@tarojs/taro'
5
+import SpinBox from "@/components/Spin/SpinBox";
4
 import { Image, Button } from '@tarojs/components'
6
 import { Image, Button } from '@tarojs/components'
5
 import withLayout from '@/layouts'
7
 import withLayout from '@/layouts'
6
 import './style.less'
8
 import './style.less'
9
 export default withLayout((props) => {
11
 export default withLayout((props) => {
10
   const { person } = props
12
   const { person } = props
11
   const { personId } = person
13
   const { personId } = person
14
+  const [loading, setLoading] = useState(false)
12
   const back = () => {
15
   const back = () => {
13
     Taro.navigateBack()
16
     Taro.navigateBack()
14
   }
17
   }
15
   const submit = () => {
18
   const submit = () => {
16
     var content = document.getElementById('content').value
19
     var content = document.getElementById('content').value
17
     if (content != '') {
20
     if (content != '') {
21
+      setLoading(true)
18
       saveFeedback({
22
       saveFeedback({
19
         personId,
23
         personId,
20
         content
24
         content
21
       }).then(() => {
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
     else {
38
     else {
41
         <view className='weChate-image' >
55
         <view className='weChate-image' >
42
           <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' />
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
         </view>
57
         </view>
58
+
44
         <view className='button-info'>
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
           <Button className='button-box-Cancel' onClick={back} >取消</Button>
63
           <Button className='button-box-Cancel' onClick={back} >取消</Button>
64
+
47
         </view>
65
         </view>
66
+
48
       </view>
67
       </view>
49
-    </view>
68
+    </view >
50
   )
69
   )
51
 })
70
 })

+ 104
- 93
src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx View File

1
 import Taro from "@tarojs/taro";
1
 import Taro from "@tarojs/taro";
2
 import { Button, Textarea, View } from "@tarojs/components";
2
 import { Button, Textarea, View } from "@tarojs/components";
3
 import formatPrice from "@/utils/formatPrice";
3
 import formatPrice from "@/utils/formatPrice";
4
+import SpinBox from "@/components/Spin/SpinBox";
5
+
4
 import { useState, useEffect } from "react";
6
 import { useState, useEffect } from "react";
5
 import OrderCard from '@/components/CompoentsOrder/OrderCard'
7
 import OrderCard from '@/components/CompoentsOrder/OrderCard'
6
 import withLayout from "@/layouts";
8
 import withLayout from "@/layouts";
39
 export default withLayout((props) => {
41
 export default withLayout((props) => {
40
   const { router, person } = props;
42
   const { router, person } = props;
41
   const { id } = props.router.params;
43
   const { id } = props.router.params;
44
+  const [loading, setLoading] = useState(false)
42
 
45
 
43
   // 说明
46
   // 说明
44
   const [explain, setExplain] = useState();
47
   const [explain, setExplain] = useState();
50
   const [checkeds, setCheckeds] = useState([1]);
53
   const [checkeds, setCheckeds] = useState([1]);
51
 
54
 
52
   const getData = (orderId) => {
55
   const getData = (orderId) => {
53
-    Taro.showLoading();
56
+    setLoading(true)
57
+
54
     getOrderSub({
58
     getOrderSub({
55
       pageNum: 1,
59
       pageNum: 1,
56
       pageSize: 50,
60
       pageSize: 50,
57
       orderId: orderId,
61
       orderId: orderId,
58
     }).then((res) => {
62
     }).then((res) => {
59
       setList(res.records);
63
       setList(res.records);
60
-      Taro.hideLoading();
61
-    });
64
+      setLoading(false)
65
+
66
+    }).catch(e => {
67
+      setLoading(false)
68
+    })
62
   };
69
   };
63
 
70
 
64
   useEffect(() => {
71
   useEffect(() => {
115
       <View className='index-container'>
122
       <View className='index-container'>
116
         <View className='box-content'>
123
         <View className='box-content'>
117
           <scroll-view scroll-y style='height: 100%;' >
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
               </view>
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
               </view>
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
               </view>
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
           </scroll-view>
223
           </scroll-view>
213
         </View>
224
         </View>
214
       </View>
225
       </View>

+ 23
- 38
src/pages/MineUserAll/RefundMoney/index.jsx View File

1
 import { useState, useEffect } from "react";
1
 import { useState, useEffect } from "react";
2
 import Taro, { useDidShow } from "@tarojs/taro";
2
 import Taro, { useDidShow } from "@tarojs/taro";
3
+import SpinBox from "@/components/Spin/SpinBox";
4
+
3
 import withLayout from "@/layouts";
5
 import withLayout from "@/layouts";
4
 import OrderCard from '@/components/CompoentsOrder/OrderCard'
6
 import OrderCard from '@/components/CompoentsOrder/OrderCard'
5
 import { getOrderSub } from "@/services/payOrder";
7
 import { getOrderSub } from "@/services/payOrder";
13
   const [IsPull, setPull] = useState(false);
15
   const [IsPull, setPull] = useState(false);
14
   const [pageNum, setNumber] = useState(1);
16
   const [pageNum, setNumber] = useState(1);
15
   const [HasNextPage, setHasNextPage] = useState(true);
17
   const [HasNextPage, setHasNextPage] = useState(true);
16
-  const [isFirst, setFirst] = useState(true)
18
+  const [loading, setLoading] = useState(false)
17
 
19
 
18
   const getList = () => {
20
   const getList = () => {
19
-    setFirst(false)
21
+    setLoading(true)
20
     setHasNextPage(false);
22
     setHasNextPage(false);
21
-    Taro.showLoading()
22
     getOrderSub({
23
     getOrderSub({
23
       pageNum,
24
       pageNum,
24
       pageSize: 10,
25
       pageSize: 10,
30
       );
31
       );
31
       setHasNextPage(res.current < res.pages);
32
       setHasNextPage(res.current < res.pages);
32
       setPull(false);
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
   const pageLoadMore = () => {
42
   const pageLoadMore = () => {
44
     // 页面上拉加载更多
43
     // 页面上拉加载更多
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
   useEffect(() => {
53
   useEffect(() => {
69
     getList();
54
     getList();
70
   }, [pageNum]);
55
   }, [pageNum]);
71
-    
56
+
72
   return (
57
   return (
73
     <view className='box-content'>
58
     <view className='box-content'>
74
       <view className='index-navbar'>
59
       <view className='index-navbar'>
77
       <scroll-view
62
       <scroll-view
78
         scrollY
63
         scrollY
79
         style='height: calc(100vh - 176rpx);'
64
         style='height: calc(100vh - 176rpx);'
80
-        refresher-enabled
81
-        refresher-triggered={IsPull}
82
-        onrefresherrefresh={pageRefresh}
83
-        refresher-background='#fff'
84
         onscrolltolower={pageLoadMore}
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
       </scroll-view>
79
       </scroll-view>
95
     </view>
80
     </view>
96
   );
81
   );

+ 11
- 2
src/store/models/person.js View File

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