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