Commit e09493fe by zeven

刷脸设备兼容共享客服店

parent 47ce025e
{ {
"name": "zm-face-counter", "name": "zm-face-counter",
"version": "1.3.8", "version": "1.3.9",
"private": true, "private": true,
"scripts": { "scripts": {
"android": "react-native run-android", "android": "react-native run-android",
......
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
if (data && data.code === 1) { if (data && data.code === 1) {
if (data.data && data.data.type) { if (data.data && data.data.type) {
// 设备类型 // 设备类型
yield call(AsyncStorage.setItem, 'DTYPE', data.data.type); yield call(AsyncStorage.setItem, 'STYPE', 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);
......
...@@ -58,7 +58,8 @@ class FacePage extends Component { ...@@ -58,7 +58,8 @@ class FacePage extends Component {
this.storeKey = await AsyncStorage.getItem('KEY'); this.storeKey = await AsyncStorage.getItem('KEY');
let contact = await AsyncStorage.getItem('CONTACT'); let contact = await AsyncStorage.getItem('CONTACT');
let storeName = await AsyncStorage.getItem('NAME'); let storeName = await AsyncStorage.getItem('NAME');
this.setState({contact, storeName}); let stype = await AsyncStorage.getItem('STYPE');
this.setState({contact, storeName, stype});
if (!this.init) { if (!this.init) {
this.init = await WxFacepay.initialize(10000, { this.init = await WxFacepay.initialize(10000, {
perform_mode: 'LOW_PERFORM', perform_mode: 'LOW_PERFORM',
...@@ -246,7 +247,7 @@ class FacePage extends Component { ...@@ -246,7 +247,7 @@ class FacePage extends Component {
else if (action === '出店') this.action = 'enter'; else if (action === '出店') this.action = 'enter';
this.loading(false); this.loading(false);
// 即拿迷你店,唤醒屏幕时间为1分钟 // 即拿迷你店,唤醒屏幕时间为1分钟
this.sense ? this.wakeUp(60000) : this.wakeUp(); this.wakeUp();
if (this.sense) { if (this.sense) {
// 进门自动调起刷脸 // 进门自动调起刷脸
if (this.action === 'enter') this.face(); if (this.action === 'enter') this.face();
...@@ -570,6 +571,7 @@ class FacePage extends Component { ...@@ -570,6 +571,7 @@ class FacePage extends Component {
}; };
if (validity.phone.test(this.phone)) action.phone = this.phone; if (validity.phone.test(this.phone)) action.phone = this.phone;
if (this.sense) action.sense = true; if (this.sense) action.sense = true;
if (this.state.stype) action.stype = this.state.stype;
const ret = await this.props.dispatch(action); const ret = await this.props.dispatch(action);
this.phone = ''; this.phone = '';
this.loading(false); this.loading(false);
...@@ -629,6 +631,7 @@ class FacePage extends Component { ...@@ -629,6 +631,7 @@ class FacePage extends Component {
alipayUid: res.uid, alipayUid: res.uid,
}; };
if (this.sense) action.sense = true; if (this.sense) action.sense = true;
if (this.state.stype) action.stype = this.state.stype;
const ret = await this.props.dispatch(action); const ret = await this.props.dispatch(action);
this.loading(false); this.loading(false);
this.handleDoorLogin(ret); this.handleDoorLogin(ret);
...@@ -701,12 +704,13 @@ class FacePage extends Component { ...@@ -701,12 +704,13 @@ class FacePage extends Component {
} }
}; };
wakeUp = (timeout = 18888) => { wakeUp = (timeout = 60000) => {
this.setState({sleep: false, tipsModal: false, goTipsModal: false}); this.setState({sleep: false, tipsModal: false, goTipsModal: false});
clearTimeout(this.wakeUpTimeout); clearTimeout(this.wakeUpTimeout);
this.wakeUpTimeout = setTimeout(() => { this.wakeUpTimeout = setTimeout(() => {
this.setState({sleep: true, tipsModal: false, goTipsModal: false}); this.setState({sleep: true, tipsModal: false, goTipsModal: false});
}, timeout); }, timeout);
if (this.state.stype === 'guard') this.face();
}; };
goTips = async () => { goTips = async () => {
......
...@@ -54,11 +54,11 @@ class VerticalPage extends Component { ...@@ -54,11 +54,11 @@ class VerticalPage extends Component {
}; };
async componentWillMount() { async componentWillMount() {
let dtype = await AsyncStorage.getItem('DTYPE'); let stype = await AsyncStorage.getItem('STYPE');
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({dtype, contact}); this.setState({stype, 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);
...@@ -361,7 +361,9 @@ class VerticalPage extends Component { ...@@ -361,7 +361,9 @@ class VerticalPage extends Component {
hintVisible: true, hintVisible: true,
}); });
clearTimeout(this.callModalTimeout); clearTimeout(this.callModalTimeout);
this.callModalTimeout = setTimeout(() => { this.setState({ hintVisible: false }); }, 300000); this.callModalTimeout = setTimeout(() => {
this.setState({hintVisible: false});
}, 300000);
}; };
onNoBuy = async () => { onNoBuy = async () => {
...@@ -554,7 +556,7 @@ class VerticalPage extends Component { ...@@ -554,7 +556,7 @@ class VerticalPage extends Component {
logoVisible, logoVisible,
logo, logo,
priceVisible, priceVisible,
dtype, stype,
} = this.state; } = this.state;
pageSize = pageSize =
goods && goods.bags.length > 0 goods && goods.bags.length > 0
...@@ -595,7 +597,7 @@ class VerticalPage extends Component { ...@@ -595,7 +597,7 @@ class VerticalPage extends Component {
this.state.faceType === 'wxpay' ? this.wxFacepay : this.smilepay; this.state.faceType === 'wxpay' ? this.wxFacepay : this.smilepay;
return ( return (
<View style={styles.main}> <View style={styles.main}>
{goodsArr.length === 0 && dtype === 'guard' ? ( {goodsArr.length === 0 && stype === 'guard' ? (
<View style={styles.guardModal}> <View style={styles.guardModal}>
<View style={styles.guardModal_image}> <View style={styles.guardModal_image}>
<Image style={styles.Imageee} source={guide} /> <Image style={styles.Imageee} source={guide} />
...@@ -1108,8 +1110,7 @@ class HintPhone extends React.Component { ...@@ -1108,8 +1110,7 @@ class HintPhone extends React.Component {
如无法接通客服,可拨打电话: {contact} 如无法接通客服,可拨打电话: {contact}
</Text> </Text>
</View> </View>
<Touch <Touch onPress={closeHint}>
onPress={closeHint}>
<View <View
style={{ style={{
width: scaleSize(200), width: scaleSize(200),
......
...@@ -46,6 +46,7 @@ export function wxdoor({ ...@@ -46,6 +46,7 @@ export function wxdoor({
sense, sense,
orderId, orderId,
authCode, authCode,
stype,
}) { }) {
return axios.post( return axios.post(
'/store/wxdoor', '/store/wxdoor',
...@@ -60,6 +61,7 @@ export function wxdoor({ ...@@ -60,6 +61,7 @@ export function wxdoor({
sense, sense,
orderId, orderId,
authCode, authCode,
stype,
}), }),
); );
} }
......
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