Commit bb546863 by 姜雷

调整条码样式

parent 97a06a3d
......@@ -41,9 +41,13 @@
height: 52px;
}
.BarCodeCav {
display: none;
width: 100%;
height: 100%;
}
.BarCodeCav.show {
display: block;
}
.toggleBtn {
position: absolute;
right: 0;
......
......@@ -186,29 +186,24 @@ class BarCode extends Component {
}
payDoneHandle() {
const { showBig } = this.state;
this.setState(
{
showPayOrder: false,
},
() => {
this.drawBarCode(showBig);
this.drawBarCode();
},
);
}
drawBarCode(showBig: boolean) {
drawBarCode() {
const { userinfo } = this.props;
let idBar = userinfo.idBar.substring(0, userinfo.idBar.length - 2) + '04';
if (showBig) {
wxbarcode.barcode('BarCode', idBar, 700, 188);
} else {
wxbarcode.barcode('BarCode', idBar, 700, 364);
}
wxbarcode.barcode('BarCode', idBar, 646, 188);
wxbarcode.barcode('BarCodeBig', idBar, 700, 364);
}
toggleBigBarCode() {
const { showBig } = this.state;
this.drawBarCode(showBig);
this.setState({
showBig: !showBig,
});
......@@ -222,7 +217,7 @@ class BarCode extends Component {
updateUserInfo({
idBar: data,
});
this.drawBarCode(false);
this.drawBarCode();
})
.catch(err => {
Taro.showToast({
......@@ -267,11 +262,18 @@ class BarCode extends Component {
onClick={this.refreshCodeBar}
/>
)}
<View className={`BarCodeImg ${showBig ? 'BarCodeImgBig' : ''}`}>
{showPayOrder ? null : (
<Canvas className='BarCodeCav' canvasId='BarCode' />
)}
<View className={`BarCodeImg ${showBig ? 'BarCodeImgBig' : ''}`}>
<Canvas
className={`BarCodeCav ${showBig ? 'show' : ''}`}
canvasId='BarCodeBig'
/>
<Canvas
className={`BarCodeCav ${showBig ? '' : 'show'}`}
canvasId='BarCode'
/>
</View>
)}
<View className='toggleBtn' onClick={this.toggleBigBarCode}>
{showBig ? '缩小' : '放大'}
</View>
......
......@@ -229,12 +229,16 @@ class Home extends Component {
<View className='Home-UserBox-BeanItem'>
<Image className='Home-UserBox-BeanIcon' src={HBeanIcon} />
<Text>吹风豆:</Text>
<Text className='Home-UserBox-BeanCount'>{hairDryerBean}</Text>
<Text className='Home-UserBox-BeanCount'>
{hairDryerBean.toFixed(2)}
</Text>
</View>
<View className='Home-UserBox-BeanItem'>
<Image className='Home-UserBox-BeanIcon' src={TBeanIcon} />
<Text>通用豆:</Text>
<Text className='Home-UserBox-BeanCount'>{commBean}</Text>
<Text className='Home-UserBox-BeanCount'>
{commBean.toFixed(2)}
</Text>
</View>
</View>
<View className='Home-UserBox-Order'>
......
......@@ -165,23 +165,22 @@ class OrderPayway extends Component {
}).toString(Utf8),
);
console.log(payData);
Taro.requestPayment({
timeStamp: payData.msg.timeStamp.toString(),
nonceStr: payData.msg.nonceStr,
package: payData.msg.package,
signType: payData.msg.signType,
paySign: payData.msg.paySign,
success(res) {
})
.then(res => {
console.log(res);
onPayDoneCallback();
},
fail(res) {
})
.catch(err => {
Taro.showToast({
title: res.msg || '发起支付失败',
title: err.msg || '发起支付失败',
icon: 'none',
});
},
});
} else {
onPayDoneCallback();
......
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