Commit c53ffc87 by 姜雷

添加刷新条码逻辑

parent 5c6fedd7
import { customerFetch } from '.';
import { customerFetch, ResponseDataEntity } from '.';
export class LoginParams {
/** 登陆标识 */
......@@ -78,3 +78,8 @@ export const fetchFeedback = (entity: CustomerParam) =>
method: 'POST',
data: entity,
});
export const refreshCodeBar = (): Promise<ResponseDataEntity<string>> =>
customerFetch({
url: '/dcxy/wechat/applet/flush/idbar',
});
......@@ -19,6 +19,7 @@ import {
CustomerBeanAccountVo,
} from '../../api/baseClass';
import { Customer } from '../../types/Customer/Customer';
import { refreshCodeBar } from '../../api/customer';
type PageStateProps = {
userinfo: Customer;
......@@ -187,10 +188,21 @@ class BarCode extends Component {
}
refreshCodeBar() {
const { updateUserInfo } = this.props;
refreshCodeBar()
.then(res => {
console.log(res);
const data = res.data;
updateUserInfo({
idBar: '',
idBar: data,
});
this.drawBarCode(false);
})
.catch(err => {
Taro.showToast({
title: err.msg || '获取失败',
icon: 'none',
});
});
}
render() {
......
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