Commit 2fcc14ad by 姜雷

修改有订单时条码页显示问题

parent 1afd9990
import Taro, { Component } from '@tarojs/taro'; import Taro, { Component, useEffect } from '@tarojs/taro';
import { ComponentClass } from 'react'; import { ComponentClass } from 'react';
import { View, Canvas, Image, Text } from '@tarojs/components'; import { View, Canvas, Image, Text } from '@tarojs/components';
...@@ -164,6 +164,12 @@ class BarCode extends Component { ...@@ -164,6 +164,12 @@ class BarCode extends Component {
state.orderState.waitPayOrderState, state.orderState.waitPayOrderState,
); );
useEffect(() => {
if (!payOrderState) {
this.drawBarCode();
}
}, [payOrderState]);
return ( return (
<View className='BarCode'> <View className='BarCode'>
<WaitPayOrderComponent /> <WaitPayOrderComponent />
...@@ -180,16 +186,19 @@ class BarCode extends Component { ...@@ -180,16 +186,19 @@ class BarCode extends Component {
src={RefreshIcon} src={RefreshIcon}
onClick={this.refreshCodeBar} onClick={this.refreshCodeBar}
/> />
<View className={`BarCodeImg ${showBig ? 'BarCodeImgBig' : ''}`}> {payOrderState ? null : (
<Canvas <View className={`BarCodeImg ${showBig ? 'BarCodeImgBig' : ''}`}>
className={`BarCodeCav ${showBig ? 'show' : ''}`} <Canvas
canvasId='BarCodeBig' className={`BarCodeCav ${showBig ? 'show' : ''}`}
/> canvasId='BarCodeBig'
<Canvas />
className={`BarCodeCav ${showBig ? '' : 'show'}`} <Canvas
canvasId='BarCode' className={`BarCodeCav ${showBig ? '' : 'show'}`}
/> canvasId='BarCode'
</View> />
</View>
)}
<View className='toggleBtn' onClick={this.toggleBigBarCode}> <View className='toggleBtn' onClick={this.toggleBigBarCode}>
<Image <Image
className={`arricon ${showBig ? 'rever' : ''}`} className={`arricon ${showBig ? 'rever' : ''}`}
......
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