Commit e6c34a86 by 姜雷

调整条码页和公告获取

parent c53ffc87
......@@ -30,6 +30,7 @@ type PageDispatchProps = {
type PageOwnProps = {};
type PageState = {
ScreenBrightness: number;
showPayOrder: boolean;
showBig: boolean;
accounts: CustomerBeanAccountVo[];
......@@ -71,6 +72,7 @@ class BarCode extends Component {
constructor(props: PageOwnProps) {
super(props);
this.state = {
ScreenBrightness: 1,
showPayOrder: false,
showBig: false,
accounts: [],
......@@ -137,6 +139,33 @@ class BarCode extends Component {
.catch(err => {
console.log(err);
});
console.log('调整亮度');
Taro.getScreenBrightness()
.then(({ value }) => {
console.log(value);
this.setState({
ScreenBrightness: value,
});
Taro.setScreenBrightness({
value: 1,
});
})
.catch(err => {
console.log(err);
Taro.setScreenBrightness({
value: 1,
});
});
}
componentWillUnmount() {
console.log('调整亮度');
const { ScreenBrightness } = this.state;
console.log(ScreenBrightness);
Taro.setScreenBrightness({
value: ScreenBrightness,
});
}
fetchOrder(id: number) {
......@@ -169,9 +198,7 @@ class BarCode extends Component {
}
drawBarCode(showBig: boolean) {
const { userinfo } = this.props;
Taro.setScreenBrightness({
value: 1,
});
if (showBig) {
wxbarcode.barcode('BarCode', userinfo.idBar, 646, 188);
} else {
......
......@@ -126,9 +126,9 @@ class Home extends Component {
url: '/pages/Feedback/Feedback',
});
}
goAnn() {
goAnn(id: number) {
Taro.navigateTo({
url: '/pages/Announcement/Announcement?sectionId=896',
url: '/pages/Announcement/Announcement?sectionId=' + id,
});
}
......@@ -160,7 +160,7 @@ class Home extends Component {
})
.catch(console.log);
}
formatePhone = phone => {
formatePhone = (phone: string) => {
let newPhone = phone.replace(/([0-9]{3})([0-9]{4})([0-9]{4})/, '$1****$3');
return newPhone;
};
......@@ -248,7 +248,9 @@ class Home extends Component {
<Image className='bg' src={AnnouncementBg} />
<View className='Home-Announcement-title'>
<Text>最新公告</Text>
<View className='Home-Announcement-more' onClick={this.goAnn}>
<View
className='Home-Announcement-more'
onClick={() => this.goAnn(annItem.id)}>
更多
<Image className='more-icon' src={MoreIcon} />
</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