张延森 3 vuotta sitten
vanhempi
commit
34d92be546

+ 5
- 7
src/components/CompoentsOrder/OrderCard/index.jsx Näytä tiedosto

@@ -1,7 +1,7 @@
1 1
 import Taro from "@tarojs/taro";
2 2
 import { View, Text } from '@tarojs/components'
3 3
 import formatTime from "@/utils/formatTime";
4
-import SlideViewOrder from '@/components/SlideViewOrder';
4
+import SlideView from '@/components/SlideView';
5 5
 import CouponCard from '@/components/CouponCard'
6 6
 import QRcode from "@/assets/icons/UserCenter/QRcode.png";
7 7
 import refund from "@/assets/icons/GuideCheck/refund.png";
@@ -78,8 +78,8 @@ export default (props) => {
78 78
         sh != '1' || kkp != '1' ? <view className='OrderNumber'>订单编号:{item.orderId}</view> : null
79 79
       }
80 80
       {
81
-        item.status === 0 ? <SlideViewOrder del onDelete={() => handeDelete(item)} >
82
-          <CouponCard action={PayAction}>
81
+        item.status === 0 ? <SlideView del onDelete={() => handeDelete(item)} >
82
+          <CouponCard onClick={() => { Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` })}} action={PayAction}>
83 83
             <CouponMedia>
84 84
               <CouponMedia.Header
85 85
                 cashback={item.cashback}
@@ -111,11 +111,9 @@ export default (props) => {
111 111
               </CouponMedia.Body>
112 112
             </CouponMedia>
113 113
           </CouponCard>
114
-        </SlideViewOrder>
114
+        </SlideView>
115 115
           :
116
-          <CouponCard onClick={() => {
117
-            item.status === 1 && item.isVerified == false ? Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` }) : ''
118
-          }} action={PayAction} >
116
+          <CouponCard onClick={() => { Taro.navigateTo({ url: `/pages/details/foodDetails/foodDetails?id=${item.shopId}` })}} action={PayAction} >
119 117
             <CouponMedia>
120 118
               <CouponMedia.Header
121 119
                 cashback={item.cashback}

+ 0
- 1
src/components/CompoentsOrder/complete/index.jsx Näytä tiedosto

@@ -84,7 +84,6 @@ export default (props) => {
84 84
     setItem(val)
85 85
   }
86 86
   const slideButtonTap = (e) => {
87
-    console.log(e)
88 87
     deleteOrder(e.orderId).then(() => {
89 88
       Taro.showToast({
90 89
         title: '删除订单成功',

+ 1
- 1
src/components/SlideView/index.jsx Näytä tiedosto

@@ -56,7 +56,7 @@ export default (props) => {
56 56
             const { height } = res[0]
57 57
             if (height && height !== contentHeightRef.current) {
58 58
               setActStyle({
59
-                height: `${height}px`,
59
+                height: `calc(${height}px - 10px)`,
60 60
               })
61 61
               contentHeightRef.current = height
62 62
             }

+ 0
- 97
src/components/SlideViewOrder/index.jsx Näytä tiedosto

@@ -1,97 +0,0 @@
1
-
2
-import React, { useEffect, useMemo, useRef, useState } from 'react'
3
-import Taro from '@tarojs/taro';
4
-import { ScrollView, View, Image, Text } from '@tarojs/components';
5
-import deleteIcon from '@/assets/icons/landlord/delete.png';
6
-import './style.less'
7
-
8
-export default (props) => {
9
-  const { className, action, del, onDelete } = props;
10
-
11
-  const contextRef = useRef()
12
-  const contentHeightRef = useRef(0)
13
-  const [actStyle, setActStyle]= useState()
14
-
15
-  const uqClass = useMemo(() => `f-${Math.random().toString(36).substring(2)}`, [])
16
-  const classes = [className, 'slideview-wrapper', uqClass].filter(Boolean).join(' ');
17
-
18
-  const handleScrollLeft = () => {
19
-    if (contextRef.current) {
20
-      contextRef.current.scrollIntoView('.slideview-content')
21
-    }
22
-  }
23
-
24
-  const handleScrollRight = () => {
25
-    if (contextRef.current) {
26
-      contextRef.current.scrollIntoView('.slideview-actions')
27
-    }
28
-  }
29
-
30
-  const handleDelete = (e) => {
31
-    if (onDelete) {
32
-      onDelete(e)
33
-    }
34
-  }
35
-
36
-  useEffect(() => {
37
-    Taro.nextTick(() => {
38
-      Taro.createSelectorQuery()
39
-      .select(`.${uqClass}`)
40
-      .node()
41
-      .exec((res) => {
42
-        contextRef.current = res[0].node;
43
-      })
44
-    })
45
-  }, [])
46
-
47
-  useEffect(() => {
48
-    Taro.nextTick(() => {
49
-      // 不清楚为什么, 此处获取高度一直不准确
50
-      const t = setTimeout(() => {
51
-        Taro.createSelectorQuery()
52
-        .select(`.${uqClass}`)
53
-        .boundingClientRect()
54
-        .exec((res) => {
55
-          if (res && res[0]) {
56
-            const { height } = res[0]
57
-            if (height && height !== contentHeightRef.current) {
58
-              setActStyle({
59
-                height: `${height}px`,
60
-              })
61
-              contentHeightRef.current = height
62
-            }
63
-          }
64
-        })
65
-        clearTimeout(t)
66
-      }, 500)
67
-    })
68
-  })
69
-
70
-  return (
71
-    <ScrollView
72
-      className={classes}
73
-      upperThreshold={20}
74
-      lowerThreshold={20}
75
-      scrollX
76
-      scrollWithAnimation
77
-      enhanced
78
-      onScrollToUpper={handleScrollLeft}
79
-      onScrollToLower={handleScrollRight}
80
-    >
81
-      <View className='slideview-content'>{props.children}</View>
82
-      <View className='slideview-actions' style={actStyle}>
83
-        <View className='slideview-action'>
84
-          {
85
-            del && (
86
-              <View className='slideview-action_delete' onClick={handleDelete}>
87
-                <Image src={deleteIcon} />
88
-                <View>删除</View>
89
-              </View>
90
-            )
91
-          }
92
-          {action}
93
-        </View>
94
-      </View>
95
-    </ScrollView>
96
-  )
97
-}

+ 0
- 52
src/components/SlideViewOrder/style.less Näytä tiedosto

@@ -1,52 +0,0 @@
1
-.slideview-wrapper {
2
-  box-sizing: border-box;
3
-  white-space: nowrap;
4
-
5
-  &::-webkit-scrollbar{
6
-    width: 0;
7
-    height: 0;
8
-    color: transparent;
9
-  }
10
-
11
-  .slideview-content {
12
-    min-width: 100%;
13
-    display: inline-block;
14
-    vertical-align: middle;
15
-  }
16
-
17
-  .slideview-actions {
18
-    display: inline-block;
19
-    vertical-align: middle;
20
-    margin: 0 20px;
21
-    background: #FFFFFF;
22
-    box-shadow: 0px 8px 38px 0px rgba(0, 0, 0, 0.12);
23
-    border-radius: 12px;
24
-
25
-    .slideview-action {
26
-      height: 100%;
27
-      display: flex;
28
-      align-items: center;
29
-      justify-content: center;
30
-      
31
-      &_delete {
32
-        display: block;
33
-        flex: none;
34
-        height: 74px;
35
-        width: 67px;
36
-        text-align: center;
37
-        padding: 10px;
38
-        font-size: 24px;
39
-        font-weight: bold;
40
-        color: #FF3434;
41
-
42
-        & > image {
43
-          width: 28px;
44
-          height: 30px;
45
-          display: block;
46
-          margin: 0 auto 20px;
47
-        }
48
-      }
49
-    }
50
-
51
-  }
52
-}

+ 6
- 8
src/pages/MineUserAll/ContactMe/index.jsx Näytä tiedosto

@@ -23,20 +23,18 @@ export default withLayout((props) => {
23 23
         personId,
24 24
         content
25 25
       }).then(() => {
26
-
27 26
         Taro.showToast({
28
-          title: '反馈成功',
27
+          title: '我们已经收到亲亲的反馈了哟~',
29 28
           icon: 'success',
30
-          duration: 2000
31
-
32
-        }).then(x => {
33
-
29
+          duration: 1500
30
+        }).then(
31
+          setTimeout(() => {
34 32
           Taro.navigateBack({
35 33
             delta: 1
36 34
           })
37 35
           setLoading(false)
38
-
39
-        })
36
+        },1500)
37
+          )
40 38
       })
41 39
     }
42 40
     else {

+ 3
- 1
src/pages/MineUserAll/RefundMoney/CheckRefund/index.jsx Näytä tiedosto

@@ -92,7 +92,9 @@ export default withLayout((props) => {
92 92
       refundReason: explain,
93 93
     }).then((res) => {
94 94
       Taro.hideLoading();
95
-      Taro.navigateTo({ url: '/pages/MineUserAll/AllOrder/index?tabJump=0' })
95
+      Taro.navigateBack({
96
+        delta: 1
97
+      })
96 98
       Taro.showToast({
97 99
         title: "退款成功",
98 100
         icon: "none",

+ 19
- 13
src/pages/MineUserAll/RefundMoney/index.jsx Näytä tiedosto

@@ -12,12 +12,21 @@ import "./style.less";
12 12
 export default withLayout((props) => {
13 13
   const { router, person } = props;
14 14
   const [list, setList] = useState([]);
15
+  const [IsPull, setPull] = useState(false);
15 16
   const [pageNum, setNumber] = useState(1);
16 17
   const [HasNextPage, setHasNextPage] = useState(true);
18
+  const [isFirst, setFirst] = useState(true)
19
+  useDidShow(() => {
20
+    if (!isFirst) {
21
+      getList();
22
+    }
23
+  })
24
+
17 25
   const [loading, setLoading] = useState(false)
18 26
 
19 27
   const getList = () => {
20 28
     setLoading(true)
29
+    setFirst(false)
21 30
     setHasNextPage(false);
22 31
     getOrderSub({
23 32
       pageNum,
@@ -29,14 +38,15 @@ export default withLayout((props) => {
29 38
         pageNum === 1 ? res.records || [] : list.concat(res.records || [])
30 39
       );
31 40
       setHasNextPage(res.current < res.pages);
41
+      setPull(false);
32 42
       setLoading(false)
33
-
34 43
     }).catch(e => {
35 44
       setLoading(false)
36 45
     })
37 46
   };
38 47
 
39 48
 
49
+
40 50
   const pageLoadMore = () => {
41 51
     // 页面上拉加载更多
42 52
     if (HasNextPage) {
@@ -56,26 +66,22 @@ export default withLayout((props) => {
56 66
       <view className='index-navbar'>
57 67
         <CustomNav title='售后退款' />
58 68
       </view>
59
-      <scroll-view
60
-        scrollY
61
-        style='height: calc(100vh - 176rpx);'
62
-        onscrolltolower={pageLoadMore}
63
-      >
64
-        <SpinBox loading={loading} className='index-container' >
65
-
69
+      <SpinBox loading={loading} className='index-container' >
70
+        <scroll-view
71
+          scrollY
72
+          style='height: calc(100vh - 176rpx);'
73
+          onscrolltolower={pageLoadMore}
74
+        >
66 75
           <view className='View-box-Card'>
67
-
68 76
             {(list || []).map((item) => {
69 77
               return (
70 78
                 <OrderCard item={item} key={item.orderId} sh='1' />
71 79
               )
72 80
             })}
73 81
             <view className='foot'>这是我的底线</view>
74
-
75 82
           </view>
76
-        </SpinBox>
77
-
78
-      </scroll-view>
83
+        </scroll-view>
84
+      </SpinBox>
79 85
     </view>
80 86
   );
81 87
 });

+ 5
- 9
src/pages/TobeShop/index.jsx Näytä tiedosto

@@ -122,15 +122,11 @@ export default withLayout((props) => {
122 122
   };
123 123
 
124 124
   const PerfectionOK = () => {
125
-    setConsumption(false);
126
-    if (list?.length > 1) {
127
-      getList()
128
-    } else {
129
-      Taro.redirectTo({
130
-        url: '/pages/MineUserAll/AllOrder/index?tabJump=3',
131
-      });
132
-      // Taro.navigateBack({ delta: 1 })
133
-    }
125
+    setConsumption(false);    
126
+    Taro.redirectTo({
127
+      url: '/pages/MineUserAll/AllOrder/index?tabJump=3',
128
+    });
129
+    // Taro.navigateBack({ delta: 1 })    
134 130
   };
135 131
 
136 132
   const btnText = ['确认核销', checked && checked.length > 0 ? `(${checked.length})` : undefined].filter(Boolean).join(' ')

+ 1
- 1
src/pages/details/foodDetails/foodDetails.jsx Näytä tiedosto

@@ -272,7 +272,7 @@ export default withLayout((props) => {
272 272
           }
273 273
         </scroll-view>
274 274
       </SpinBox>
275
-      <view className='bottomTab'>
275
+      <view className='index-tabber bottomTab'>
276 276
         <Button openType='share' className='sharebtn'>
277 277
           分享
278 278
         </Button>

+ 1
- 1
src/pages/details/mjDetails/sceneryDetails.jsx Näytä tiedosto

@@ -176,7 +176,7 @@ export default withLayout((props) => {
176 176
           <view className='bottom'>这是我的底线</view>
177 177
         </scroll-view>
178 178
       </SpinBox>
179
-      <view className='bottomTab'>
179
+      <view className='index-tabber bottomTab'>
180 180
         <Button openType='share' className='sharebtn'>分享</Button>
181 181
         <view className='tab'>
182 182
           <image className='share' src={share} />分享