Commit 23740cff by zeven

修复小票打印倒计时问题

parent 85ec95d4
{
"name": "zm-face-counter",
"version": "1.3.1",
"version": "1.3.2",
"private": true,
"scripts": {
"android": "react-native run-android",
......@@ -8,8 +8,8 @@
"test": "jest",
"lint": "eslint --ext .js index.js src",
"apk": "cd android && ./gradlew app:assembleRelease && cp ./app/build/outputs/apk/release/app-release.apk ../fcounter.apk",
"android-staging": "code-push release-react ZmFaceCounter-android android -t '1.0.0' --des '1.3.1'",
"android-product": "code-push promote ZmFaceCounter-android Staging Production --des '1.3.1'",
"android-staging": "code-push release-react ZmFaceCounter-android android -t '1.0.0' --des '1.3.2'",
"android-product": "code-push promote ZmFaceCounter-android Staging Production --des '1.3.2'",
"android-history": "code-push deployment history ZmFaceCounter-android Production"
},
"pre-commit": [
......
......@@ -64,7 +64,7 @@ const CounterMixins = ComposeComponent => {
visible: false,
receipt: {},
printer: [],
time: 5,
receiptTime: 5,
};
componentWillMount = async () => {
......@@ -397,17 +397,17 @@ const CounterMixins = ComposeComponent => {
if (data.data.receipt.confirm) {
await this.setState({
visible: true,
time: data.data.receipt.tipsTime || 5,
receiptTime: data.data.receipt.tipsTime || 5,
});
this.interval = setInterval(async () => {
this.time -= 1;
await this.setState({time: this.state.time - 1});
if (this.state.time === 0) {
clearInterval(this.receiptTimeInter);
this.receiptTimeInter = setInterval(async () => {
await this.setState({receiptTime: this.state.receiptTime - 1});
if (this.state.receiptTime <= 0) {
this.setState({
visible: false,
time: data.data.receipt.tipsTime || 5,
receiptTime: data.data.receipt.tipsTime || 5,
});
clearInterval(this.interval);
clearInterval(this.receiptTimeInter);
}
}, 1000);
} else {
......@@ -885,7 +885,7 @@ const CounterMixins = ComposeComponent => {
luckyVisible,
amount,
visible,
time,
receiptTime,
} = this.state;
return (
<View style={{flex: 1}}>
......@@ -924,7 +924,7 @@ const CounterMixins = ComposeComponent => {
backgroundColor: '#959595',
color: '#fff',
}}>
取消({time}s)
取消({receiptTime}s)
</Text>
</Touch>
<Touch onPress={() => this.confirm()}>
......
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