李志伟 3 年之前
父節點
當前提交
7a03e5418f

+ 1
- 4
src/pages/MineUserAll/AllOrder/index.jsx 查看文件

1
 import { useState, useEffect, useMemo, } from 'react'
1
 import { useState, useEffect, useMemo, } from 'react'
2
-import { Current, Taro, useRouter } from '@tarojs/taro'
2
+import {Taro, useRouter } from '@tarojs/taro'
3
 import { View } from '@tarojs/components'
3
 import { View } from '@tarojs/components'
4
 import withLayout from '@/layouts'
4
 import withLayout from '@/layouts'
5
 import CustomNav from '@/components/CustomNav'
5
 import CustomNav from '@/components/CustomNav'
41
     }
41
     }
42
   }, [tabJump])
42
   }, [tabJump])
43
 
43
 
44
-
45
   const handleTabClick = (index) => {
44
   const handleTabClick = (index) => {
46
     setActiveTab(index)
45
     setActiveTab(index)
47
-
48
   }
46
   }
49
 
47
 
50
-
51
   return (
48
   return (
52
     <view className='page-index box-content'>
49
     <view className='page-index box-content'>
53
       <view className='index-navbar'  >
50
       <view className='index-navbar'  >

+ 2
- 17
src/pages/PayOrder/index.jsx 查看文件

1
 import { useState, useEffect } from "react";
1
 import { useState, useEffect } from "react";
2
 import withLayout from "@/layouts";
2
 import withLayout from "@/layouts";
3
-import Taro, { useDidShow } from "@tarojs/taro";
3
+import Taro from "@tarojs/taro";
4
 import { getPackageDetail } from "@/services/home";
4
 import { getPackageDetail } from "@/services/home";
5
 import { saveOrder, getOrderSub, payOrder } from "@/services/payOrder";
5
 import { saveOrder, getOrderSub, payOrder } from "@/services/payOrder";
6
 import formatPrice from "@/utils/formatPrice";
6
 import formatPrice from "@/utils/formatPrice";
7
-import usePrevious from "@/utils/hooks/usePrevious";
8
 import { Button, Radio, View } from "@tarojs/components";
7
 import { Button, Radio, View } from "@tarojs/components";
9
 import InputNumber from "@/components/InputNumber";
8
 import InputNumber from "@/components/InputNumber";
10
 import AuthPage from '@/components/AuthPage'
9
 import AuthPage from '@/components/AuthPage'
39
     setShowDialog(false);
38
     setShowDialog(false);
40
   };
39
   };
41
   const ButtonOK = (e) => {
40
   const ButtonOK = (e) => {
42
-
43
     if (BuyNumber <= 0) {
41
     if (BuyNumber <= 0) {
44
       Taro.showToast({
42
       Taro.showToast({
45
         title: '最少需要一个套餐哦',
43
         title: '最少需要一个套餐哦',
53
         )
51
         )
54
       );
52
       );
55
       setShowDialog(false);
53
       setShowDialog(false);
56
-
57
     }
54
     }
58
   };
55
   };
59
 
56
 
64
       package: params.packageValue,
61
       package: params.packageValue,
65
       success: () => {
62
       success: () => {
66
         setPayInfo();
63
         setPayInfo();
67
-
68
         Taro.showToast({
64
         Taro.showToast({
69
           title: "支付成功",
65
           title: "支付成功",
70
           icon: "none",
66
           icon: "none",
82
                 Taro.navigateTo({
78
                 Taro.navigateTo({
83
                   url: `/pages/TobeShop/index?id=${id}&subOrderId=${subOrderId}`,
79
                   url: `/pages/TobeShop/index?id=${id}&subOrderId=${subOrderId}`,
84
                 });
80
                 });
85
-
86
               } else if (res.cancel) {
81
               } else if (res.cancel) {
87
                 Taro.redirectTo({
82
                 Taro.redirectTo({
88
                   url: "/pages/MineUserAll/AllOrder/index",
83
                   url: "/pages/MineUserAll/AllOrder/index",
91
             }
86
             }
92
           })
87
           })
93
         }
88
         }
94
-
95
-
96
       },
89
       },
97
       fail: (e) => {
90
       fail: (e) => {
98
         Taro.showToast({
91
         Taro.showToast({
110
 
103
 
111
   const onShowPay = (e) => {
104
   const onShowPay = (e) => {
112
     if (agreement) {
105
     if (agreement) {
113
-      // if (payInfo) {
114
-      //   requestPayment(payInfo);
115
-      //   return;
116
-      // }
117
       Taro.showLoading({
106
       Taro.showLoading({
118
         title: '支付中',
107
         title: '支付中',
119
       })
108
       })
120
-
121
       if (packageId) {
109
       if (packageId) {
122
         if (!totalPrice?.actualPrice) {
110
         if (!totalPrice?.actualPrice) {
123
           Taro.showToast({
111
           Taro.showToast({
126
           })
114
           })
127
           return
115
           return
128
         }
116
         }
129
-
130
-
131
         saveOrder(
117
         saveOrder(
132
           list.map((x) => {
118
           list.map((x) => {
133
             return {
119
             return {
259
               <view className='ul-li-view'></view>
245
               <view className='ul-li-view'></view>
260
               <text className='ul-li-textname'>返现金将以退款形式到账</text>
246
               <text className='ul-li-textname'>返现金将以退款形式到账</text>
261
             </view>
247
             </view>
262
-
263
           </view>
248
           </view>
264
           {/* 支付按钮 */}
249
           {/* 支付按钮 */}
265
           <Button className='payorder' onClick={() => onShowPay()}>
250
           <Button className='payorder' onClick={() => onShowPay()}>
273
         </view>
258
         </view>
274
       </view>
259
       </view>
275
   );
260
   );
276
-});
261
+});

+ 1
- 7
src/pages/index/tabs/Mine.jsx 查看文件

56
           sessionKey,
56
           sessionKey,
57
         }
57
         }
58
         getAvatar(data)
58
         getAvatar(data)
59
-
60
       },
59
       },
61
       fail: () => {
60
       fail: () => {
62
         //拒绝授权
61
         //拒绝授权
105
 
104
 
106
   return !person.phone ? <AuthPage /> : (
105
   return !person.phone ? <AuthPage /> : (
107
     <scroll-view scrollY style='height: 100%;' >
106
     <scroll-view scrollY style='height: 100%;' >
108
-
109
-
110
       <view className='User-box'>
107
       <view className='User-box'>
111
         {/* 身份切换 */}
108
         {/* 身份切换 */}
112
         <ToggleRole showCutover={showCutover} maskClosable={showCutover} onClose={onClose} role='normal' />
109
         <ToggleRole showCutover={showCutover} maskClosable={showCutover} onClose={onClose} role='normal' />
169
             </view>
166
             </view>
170
           </view>
167
           </view>
171
         </view>
168
         </view>
172
-
173
       </view>
169
       </view>
174
-
175
-
176
     </scroll-view>
170
     </scroll-view>
177
   )
171
   )
178
-}
172
+}

+ 29
- 32
src/pages/search/search.jsx 查看文件

8
 
8
 
9
 
9
 
10
 export default withLayout((props) => {
10
 export default withLayout((props) => {
11
-    const { router, person } = props    
12
-    const [hotList, setHotList] = useState([])
13
-    const hotSearch = (val) => {
14
-        Taro.navigateTo({ url: `/pages/searchResult/searchResult?q=${val}` });
11
+  const { router, person } = props
12
+  const [hotList, setHotList] = useState([])
13
+  const hotSearch = (val) => {
14
+    Taro.navigateTo({ url: `/pages/searchResult/searchResult?q=${val}` });
15
+  }
16
+  const onSearch = (e) => {
17
+    if (e.detail.value !== '') {
18
+      Taro.navigateTo({ url: `/pages/searchResult/searchResult?q=${e.detail.value}` });
15
     }
19
     }
16
-    const onSearch = (e) => {
17
-        if (e.detail.value !== '') {
18
-            Taro.navigateTo({ url: `/pages/searchResult/searchResult?q=${e.detail.value}` });
19
-        }
20
-    }
21
-    useEffect(() => {
22
-        getIndexSearch().then((res) => {
23
-            setHotList(res || [])
24
-        })
25
-    }, [])
26
-    return (
27
-        <view className='page-index'>
28
-            <view className='index-navbar'>
29
-                <CustomNav title='搜索' />
30
-            </view>
31
-
32
-            <SearchBar placeholder='搜索景点/店铺' onBlur={onSearch} />
33
-
34
-            <view className='content'>
35
-                <view className='hotSearch'>热门搜索</view>
36
-                <view className='hotSearchtip'>
37
-                    {
38
-                        (hotList||[]).map((item) => <view onClick={()=>hotSearch(item.word)}>{item.word}</view>)
39
-                    }
40
-                </view>
41
-            </view>
42
-
20
+  }
21
+  useEffect(() => {
22
+    getIndexSearch().then((res) => {
23
+      setHotList(res || [])
24
+    })
25
+  }, [])
26
+  return (
27
+    <view className='page-index'>
28
+      <view className='index-navbar'>
29
+        <CustomNav title='搜索' />
30
+      </view>
31
+      <SearchBar placeholder='搜索景点/店铺' onBlur={onSearch} />
32
+      <view className='content'>
33
+        <view className='hotSearch'>热门搜索</view>
34
+        <view className='hotSearchtip'>
35
+          {
36
+            (hotList || []).map((item) => <view onClick={() => hotSearch(item.word)}>{item.word}</view>)
37
+          }
43
         </view>
38
         </view>
44
-    )
39
+      </view>
40
+    </view>
41
+  )
45
 })
42
 })

+ 1
- 6
src/pages/searchResult/searchResult.jsx 查看文件

54
     }
54
     }
55
   }
55
   }
56
 
56
 
57
-
58
-
59
   const onSearch = () => {
57
   const onSearch = () => {
60
     // 用绝对路径
58
     // 用绝对路径
61
     Taro.navigateTo({ url: '/pages/search/search' });
59
     Taro.navigateTo({ url: '/pages/search/search' });
62
   }
60
   }
63
 
61
 
64
-
65
-
66
-
67
   return (
62
   return (
68
     <view className='page-index'>
63
     <view className='page-index'>
69
       <view className='index-navbar'>
64
       <view className='index-navbar'>
109
       </view>
104
       </view>
110
     </view>
105
     </view>
111
   )
106
   )
112
-})
107
+})