Commit 74f182b7 by 黄日华

息屏导购图兼容问题

增加云值守付款后续操作
parent c906b971
......@@ -117,6 +117,9 @@ export default {
return data.data;
}
},
*open(action, {call}) {
return yield call(api.open, action);
},
*wxdoor(action, {call}) {
const {data} = yield call(api.wxdoor, action);
if (data.code === 1) {
......
......@@ -48,6 +48,7 @@ const CounterMixins = ComposeComponent => {
static displayName = 'CounterMixins';
state = {
stype: 'guard',
goodsArr: [],
preventRevert: false,
modalS: false,
......@@ -65,6 +66,7 @@ const CounterMixins = ComposeComponent => {
receipt: {},
printer: [],
receiptTime: 5,
cloudFinishModal: false,
};
componentWillMount = async () => {
......@@ -79,8 +81,9 @@ const CounterMixins = ComposeComponent => {
adType: data.data.type,
});
}
const stype = await AsyncStorage.getItem('STYPE');
const qrHost = await AsyncStorage.getItem('QRHOST');
await this.setState({qrHost});
await this.setState({qrHost, stype});
};
componentDidMount = async () => {
......@@ -419,7 +422,10 @@ const CounterMixins = ComposeComponent => {
Speech.speak(msg);
this.storeSetting(this.state.goodsArr);
this.onLucky();
const {stype} = this.state;
if (stype !== 'guard') {
this.clearList();
}
};
storeSetting = async printer => {
......@@ -429,8 +435,8 @@ const CounterMixins = ComposeComponent => {
group,
});
if (data.code === 1) {
this.setState({receipt: data.data.receipt, printer});
if (data.data.receipt.enable) {
this.setState({receipt: data.data.receipt || {}, printer});
if (data.data.receipt && data.data.receipt.enable) {
if (data.data.receipt.confirm) {
await this.setState({
visible: true,
......@@ -484,6 +490,7 @@ const CounterMixins = ComposeComponent => {
type: 'lucky/getLucky',
orderId: this.orderId,
});
const {stype} = this.state;
if (codeLucky === 1) {
this.setState({
luckyVisible: true,
......@@ -493,7 +500,18 @@ const CounterMixins = ComposeComponent => {
this.setState({
luckyVisible: false,
});
if (stype === 'guard') {
this.setState({
cloudFinishModal: true,
});
}
}, 10000);
} else {
if (stype === 'guard') {
this.setState({
cloudFinishModal: true,
});
}
}
};
......@@ -911,6 +929,40 @@ const CounterMixins = ComposeComponent => {
this.setState({
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 () => {
......@@ -923,6 +975,7 @@ const CounterMixins = ComposeComponent => {
render = () => {
let {
cloudFinishModal,
voiceModal,
voiceTitle,
title,
......@@ -1016,6 +1069,55 @@ const CounterMixins = ComposeComponent => {
<Image source={require('../assets/voice.gif')} />
</View>
</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
{...this.props}
{...this.state}
......
......@@ -105,7 +105,7 @@ class HomePage extends React.Component {
flex: 0.25,
textAlign: 'right',
}}>
单价
单价:
</Text>
<Text
style={{
......
......@@ -1699,7 +1699,7 @@ const styles = {
display: 'flex',
width: '100%',
height: '100%',
backgroundColor: '#000000',
backgroundColor: '#0C0C0C',
},
guardModal_image: {
height: '70%',
......@@ -1709,8 +1709,7 @@ const styles = {
alignItems: 'center',
},
Imageee: {
height: '65%',
width: '80%',
minHeight: '65%',
},
guardModal_button: {
height: '30%',
......
......@@ -35,6 +35,10 @@ export function door({userId}) {
return axios.post('/store/door', qs.stringify({userId}));
}
export function open() {
return axios.post('/store/openDoor');
}
export function wxdoor({
userId,
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