Commit 82e2e90a by 姜雷

删除支付调试页面

parent 6cc8b45d
...@@ -27,7 +27,6 @@ class App extends Component { ...@@ -27,7 +27,6 @@ class App extends Component {
'pages/scanEnter/scanEnter', 'pages/scanEnter/scanEnter',
'pages/index/index', 'pages/index/index',
'pages/pay/pay', 'pages/pay/pay',
'pages/stringPay/stringPay',
], ],
window: { window: {
backgroundTextStyle: 'light', backgroundTextStyle: 'light',
......
.stringPay {
padding: 20px;
.stringPay-input {
width: 100%;
height: 600px;
border: 1px solid #eee;
margin-bottom: 50px;
}
}
import './stringPay.scss';
import Taro, { Component, useState, useCallback } from '@tarojs/taro';
import { View, Button, Textarea } from '@tarojs/components';
class stringPay extends Component {
render() {
const [value, setValue] = useState('');
const inputHandle = useCallback(
e => {
setValue(e.detail.value);
},
[setValue],
);
const payHandle = () => {
console.log(value);
if (value) {
const payData = JSON.parse(value);
Taro.requestPayment({
timeStamp: payData.timeStamp.toString(),
nonceStr: payData.nonceStr,
package: payData.package,
signType: payData.signType,
paySign: payData.paySign,
}).then(res => {
console.log(res);
Taro.showToast({
title: '支付成功!',
icon: 'success',
mask: true,
});
setValue('');
});
}
};
return (
<View className='stringPay'>
<Textarea
className='stringPay-input'
value={value}
onInput={inputHandle}></Textarea>
<Button onClick={payHandle}>支付</Button>
</View>
);
}
}
export default stringPay;
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