Commit 8c76f0c0 by zeven

收银台设备类型

parent 1f5a29e1
...@@ -53,6 +53,10 @@ export default { ...@@ -53,6 +53,10 @@ export default {
? yield call(api.token, action) ? yield call(api.token, action)
: yield call(api.refreshToken); : yield call(api.refreshToken);
if (data && data.code === 1) { if (data && data.code === 1) {
if (data.data && data.data.type) {
// 设备类型
yield call(AsyncStorage.setItem, 'DTYPE', data.data.type);
}
if (data.data && data.data.contact) { if (data.data && data.data.contact) {
yield call(AsyncStorage.setItem, 'CONTACT', data.data.contact); yield call(AsyncStorage.setItem, 'CONTACT', data.data.contact);
} }
......
...@@ -46,10 +46,11 @@ class VerticalPage extends Component { ...@@ -46,10 +46,11 @@ class VerticalPage extends Component {
}; };
async componentWillMount() { async componentWillMount() {
let dtype = await AsyncStorage.getItem('DTYPE');
let contact = await AsyncStorage.getItem('CONTACT'); let contact = await AsyncStorage.getItem('CONTACT');
// let lock = await AsyncStorage.getItem('settingLock'); // let lock = await AsyncStorage.getItem('settingLock');
// if (lock) this.props.dispatch({ type: 'app/lock', lock }); // if (lock) this.props.dispatch({ type: 'app/lock', lock });
this.setState({contact}); this.setState({dtype, contact});
this.storeKey = await AsyncStorage.getItem('KEY'); this.storeKey = await AsyncStorage.getItem('KEY');
if (!this.init) { if (!this.init) {
this.init = await WxFacepay.initialize(10000); this.init = await WxFacepay.initialize(10000);
......
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