Commit 8a4821e7 by 姜雷

点击返回退出小程序

parent 34146f6f
.AppPay{ .AppPay {
.AppBackButton {
background-color: #456beb;
color: #fff;
height: 82rpx;
line-height: 82rpx;
font-size: 28rpx;
text-align: center;
text-decoration: none;
border-radius: 5px;
overflow: hidden;
margin: 24rpx 80rpx 0;
}
} }
import "./AppPay.scss"; import "./AppPay.scss";
import Taro, { Component, useState, useCallback } from "@tarojs/taro"; import Taro, { Component, useState, useCallback } from "@tarojs/taro";
import { View, Button } from "@tarojs/components"; import { View, Button, Navigator } from "@tarojs/components";
import { rechargeFromAppOrder } from "@/api/account"; import { rechargeFromAppOrder } from "@/api/account";
import AES from "crypto-js/aes"; import AES from "crypto-js/aes";
import Utf8 from "crypto-js/enc-utf8"; import Utf8 from "crypto-js/enc-utf8";
...@@ -8,6 +8,22 @@ import ECBmode from "crypto-js/mode-ecb"; ...@@ -8,6 +8,22 @@ import ECBmode from "crypto-js/mode-ecb";
import PaddingPkcs7 from "crypto-js/pad-pkcs7"; import PaddingPkcs7 from "crypto-js/pad-pkcs7";
import AppBackButton from "../../components/AppBackButton/AppBackButton"; import AppBackButton from "../../components/AppBackButton/AppBackButton";
type PageStateProps = {};
type PageDispatchProps = {};
type PageOwnProps = {};
type PageState = {
errorMsg: string;
showBack: boolean;
showError: boolean;
};
type IProps = PageStateProps & PageOwnProps & PageDispatchProps;
interface AppPay {
props: IProps;
state: PageState;
}
class AppPay extends Component { class AppPay extends Component {
constructor(props) { constructor(props) {
super(props); super(props);
...@@ -98,27 +114,31 @@ class AppPay extends Component { ...@@ -98,27 +114,31 @@ class AppPay extends Component {
{showBack && ( {showBack && (
<View className="AppPay-info"> <View className="AppPay-info">
支付成功 支付成功
<Button <Navigator target="miniProgram" open-type="exit">
className="AppBackButton" <Button
open-type="launchApp" className="AppBackButton"
app-parameter={errorMsg} open-type="launchApp"
onError={this.goBackAppError} app-parameter={errorMsg}
> onError={this.goBackAppError}
返回App >
</Button> 返回
</Button>
</Navigator>
</View> </View>
)} )}
{showError && ( {showError && (
<View className="AppPay-info"> <View className="AppPay-info">
支付失败 支付失败
<Button <Navigator target="miniProgram" open-type="exit">
className="AppBackButton" <Button
open-type="launchApp" className="AppBackButton"
app-parameter={errorMsg} open-type="launchApp"
onError={this.goBackAppError} app-parameter={errorMsg}
> onError={this.goBackAppError}
返回App >
</Button> 返回
</Button>
</Navigator>
</View> </View>
)} )}
</View> </View>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment