Commit da65c15b by 姜雷

修改洗浴设备发起支付流程

parent f85a7c44
...@@ -30,6 +30,9 @@ type DeviceInfoResponse = { ...@@ -30,6 +30,9 @@ type DeviceInfoResponse = {
positionId: string; positionId: string;
// 位置id // 位置id
rates: RateInfoResponse[]; rates: RateInfoResponse[];
//是否纯蓝牙设备 1:是,0:否
isOnlyBluetooth: number;
}; };
type RateInfoResponse = { type RateInfoResponse = {
mark: string; mark: string;
......
...@@ -243,6 +243,10 @@ class Pay extends Component { ...@@ -243,6 +243,10 @@ class Pay extends Component {
); );
}) })
.catch(err => { .catch(err => {
Taro.showModal({
title: '温馨提示',
content: '为保障正常使用,请打开蓝牙设备!',
});
console.error(err); console.error(err);
Taro.onBluetoothAdapterStateChange(res => { Taro.onBluetoothAdapterStateChange(res => {
console.log('adapterState changed, now is', res); console.log('adapterState changed, now is', res);
...@@ -717,10 +721,12 @@ class Pay extends Component { ...@@ -717,10 +721,12 @@ class Pay extends Component {
} = this.props; } = this.props;
const { payId, deviceDone, sockedDone } = this.state; const { payId, deviceDone, sockedDone } = this.state;
if (payId) { if (payId) {
if (this.checkIsShower()) { if (device.isOnlyBluetooth && device.isOnlyBluetooth === 1) {
console.log(deviceDone, sockedDone); if (this.checkIsShower()) {
if (!deviceDone || !sockedDone) { console.log(deviceDone, sockedDone);
return this.showerPayHandle(); if (!deviceDone || !sockedDone) {
return this.showerPayHandle();
}
} }
} }
getPayOrder({ getPayOrder({
......
...@@ -17,6 +17,7 @@ export const INITIAL_STATE = { ...@@ -17,6 +17,7 @@ export const INITIAL_STATE = {
rates: [], rates: [],
serviceId: 0, serviceId: 0,
serviceName: '', serviceName: '',
isOnlyBluetooth: 0,
}; };
export const updateDeviceData = (entity: DeviceState): Action => ({ export const updateDeviceData = (entity: DeviceState): Action => ({
......
...@@ -20,4 +20,5 @@ export type Device = { ...@@ -20,4 +20,5 @@ export type Device = {
rates: Rate[]; rates: Rate[];
serviceId: number; serviceId: number;
serviceName: string; serviceName: string;
isOnlyBluetooth: number;
}; };
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