Commit 74f182b7 by 黄日华

息屏导购图兼容问题

增加云值守付款后续操作
parent c906b971
...@@ -117,6 +117,9 @@ export default { ...@@ -117,6 +117,9 @@ export default {
return data.data; return data.data;
} }
}, },
*open(action, {call}) {
return yield call(api.open, action);
},
*wxdoor(action, {call}) { *wxdoor(action, {call}) {
const {data} = yield call(api.wxdoor, action); const {data} = yield call(api.wxdoor, action);
if (data.code === 1) { if (data.code === 1) {
......
...@@ -48,6 +48,7 @@ const CounterMixins = ComposeComponent => { ...@@ -48,6 +48,7 @@ const CounterMixins = ComposeComponent => {
static displayName = 'CounterMixins'; static displayName = 'CounterMixins';
state = { state = {
stype: 'guard',
goodsArr: [], goodsArr: [],
preventRevert: false, preventRevert: false,
modalS: false, modalS: false,
...@@ -65,6 +66,7 @@ const CounterMixins = ComposeComponent => { ...@@ -65,6 +66,7 @@ const CounterMixins = ComposeComponent => {
receipt: {}, receipt: {},
printer: [], printer: [],
receiptTime: 5, receiptTime: 5,
cloudFinishModal: false,
}; };
componentWillMount = async () => { componentWillMount = async () => {
...@@ -79,8 +81,9 @@ const CounterMixins = ComposeComponent => { ...@@ -79,8 +81,9 @@ const CounterMixins = ComposeComponent => {
adType: data.data.type, adType: data.data.type,
}); });
} }
const stype = await AsyncStorage.getItem('STYPE');
const qrHost = await AsyncStorage.getItem('QRHOST'); const qrHost = await AsyncStorage.getItem('QRHOST');
await this.setState({qrHost}); await this.setState({qrHost, stype});
}; };
componentDidMount = async () => { componentDidMount = async () => {
...@@ -419,7 +422,10 @@ const CounterMixins = ComposeComponent => { ...@@ -419,7 +422,10 @@ const CounterMixins = ComposeComponent => {
Speech.speak(msg); Speech.speak(msg);
this.storeSetting(this.state.goodsArr); this.storeSetting(this.state.goodsArr);
this.onLucky(); this.onLucky();
this.clearList(); const {stype} = this.state;
if (stype !== 'guard') {
this.clearList();
}
}; };
storeSetting = async printer => { storeSetting = async printer => {
...@@ -429,8 +435,8 @@ const CounterMixins = ComposeComponent => { ...@@ -429,8 +435,8 @@ const CounterMixins = ComposeComponent => {
group, group,
}); });
if (data.code === 1) { if (data.code === 1) {
this.setState({receipt: data.data.receipt, printer}); this.setState({receipt: data.data.receipt || {}, printer});
if (data.data.receipt.enable) { if (data.data.receipt && data.data.receipt.enable) {
if (data.data.receipt.confirm) { if (data.data.receipt.confirm) {
await this.setState({ await this.setState({
visible: true, visible: true,
...@@ -484,6 +490,7 @@ const CounterMixins = ComposeComponent => { ...@@ -484,6 +490,7 @@ const CounterMixins = ComposeComponent => {
type: 'lucky/getLucky', type: 'lucky/getLucky',
orderId: this.orderId, orderId: this.orderId,
}); });
const {stype} = this.state;
if (codeLucky === 1) { if (codeLucky === 1) {
this.setState({ this.setState({
luckyVisible: true, luckyVisible: true,
...@@ -493,7 +500,18 @@ const CounterMixins = ComposeComponent => { ...@@ -493,7 +500,18 @@ const CounterMixins = ComposeComponent => {
this.setState({ this.setState({
luckyVisible: false, luckyVisible: false,
}); });
if (stype === 'guard') {
this.setState({
cloudFinishModal: true,
});
}
}, 10000); }, 10000);
} else {
if (stype === 'guard') {
this.setState({
cloudFinishModal: true,
});
}
} }
}; };
...@@ -911,6 +929,40 @@ const CounterMixins = ComposeComponent => { ...@@ -911,6 +929,40 @@ const CounterMixins = ComposeComponent => {
this.setState({ this.setState({
luckyVisible: false, luckyVisible: false,
}); });
const {stype} = this.state;
if (stype === 'guard') {
this.setState({
cloudFinishModal: true,
});
}
};
onCloseCloudFinish = () => {
this.setState({
cloudFinishModal: false,
});
this.clearList();
};
onOpen = async () => {
const {data} = await this.props.dispatch({
type: 'store/open',
});
if (data.code === 1) {
this.setState({
cloudFinishModal: false,
});
Speech.speak(data.msg || '门已经打开,谢谢惠顾');
} else {
Toast.info(data.msg || '开门失败,请联系客服处理', 2);
Speech.speak(data.msg || '开门失败,请联系客服处理');
setTimeout(() => {
this.setState({
cloudFinishModal: false,
});
}, 10000);
}
this.clearList();
}; };
onReceiveLucky = async () => { onReceiveLucky = async () => {
...@@ -923,6 +975,7 @@ const CounterMixins = ComposeComponent => { ...@@ -923,6 +975,7 @@ const CounterMixins = ComposeComponent => {
render = () => { render = () => {
let { let {
cloudFinishModal,
voiceModal, voiceModal,
voiceTitle, voiceTitle,
title, title,
...@@ -1016,6 +1069,55 @@ const CounterMixins = ComposeComponent => { ...@@ -1016,6 +1069,55 @@ const CounterMixins = ComposeComponent => {
<Image source={require('../assets/voice.gif')} /> <Image source={require('../assets/voice.gif')} />
</View> </View>
</Modal> </Modal>
<Modal visible={cloudFinishModal} transparent>
<View style={{alignItems: 'center'}}>
<Image
style={{
width: 100,
height: 100,
marginLeft: '5%',
resizeMode: 'contain',
alignSelf: 'flex-start',
}}
source={require('../assets/paied.png')}
/>
<View
style={{
justifyContent: 'center',
alignItems: 'center',
marginTop: -30,
}}>
<Text style={{color: '#000000', fontSize: 26}}>云值守店</Text>
</View>
<Touch
onPress={() => this.onCloseCloudFinish()}
style={{
width: '90%',
height: 70,
borderRadius: 5,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#FC4001',
marginTop: 40,
}}>
<Text style={{color: '#ffffff', fontSize: 22}}>在逛一逛</Text>
</Touch>
<Touch
onPress={() => this.onOpen()}
style={{
width: '90%',
height: 70,
borderRadius: 5,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#E3DDDD',
marginTop: 40,
marginBottom: 20,
}}>
<Text style={{color: '#000000', fontSize: 22}}>开门离店</Text>
</Touch>
</View>
</Modal>
<ComposeComponent <ComposeComponent
{...this.props} {...this.props}
{...this.state} {...this.state}
......
...@@ -105,7 +105,7 @@ class HomePage extends React.Component { ...@@ -105,7 +105,7 @@ class HomePage extends React.Component {
flex: 0.25, flex: 0.25,
textAlign: 'right', textAlign: 'right',
}}> }}>
单价 单价:
</Text> </Text>
<Text <Text
style={{ style={{
......
...@@ -1699,7 +1699,7 @@ const styles = { ...@@ -1699,7 +1699,7 @@ const styles = {
display: 'flex', display: 'flex',
width: '100%', width: '100%',
height: '100%', height: '100%',
backgroundColor: '#000000', backgroundColor: '#0C0C0C',
}, },
guardModal_image: { guardModal_image: {
height: '70%', height: '70%',
...@@ -1709,8 +1709,7 @@ const styles = { ...@@ -1709,8 +1709,7 @@ const styles = {
alignItems: 'center', alignItems: 'center',
}, },
Imageee: { Imageee: {
height: '65%', minHeight: '65%',
width: '80%',
}, },
guardModal_button: { guardModal_button: {
height: '30%', height: '30%',
......
...@@ -35,6 +35,10 @@ export function door({userId}) { ...@@ -35,6 +35,10 @@ export function door({userId}) {
return axios.post('/store/door', qs.stringify({userId})); return axios.post('/store/door', qs.stringify({userId}));
} }
export function open() {
return axios.post('/store/openDoor');
}
export function wxdoor({ export function wxdoor({
userId, userId,
openid, openid,
......
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