Commit c53ffc87 by 姜雷

添加刷新条码逻辑

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