Commit dde90b0f by 姜雷

修改预约提示文字

parent e2bcb4f2
......@@ -193,7 +193,7 @@ class Home extends Component {
}
goShower = () => {
const { userinfo } = this.props;
const { userinfo, updateShowerControlConfig } = this.props;
getShowerController({
campusId: userinfo.areaId,
customerId: userinfo.customerId,
......
......@@ -46,6 +46,24 @@ function ShowerAppointment() {
const searchEquipment = () => {
setSearchString(search.value);
};
const appointingEquipmentHandle = (deviceCode: string) => {
return appointingEquipment({
account: userInfo.customerId.toString(),
phone: userInfo.customerPhone,
userId: userInfo.customerId,
userName: userInfo.customerName,
deviceCode: deviceCode,
})
.then(res => {
console.log(res);
Taro.showToast({
title: res.msg,
});
})
.catch(err => {
console.log(err);
});
};
const appointingStart = (deviceCode: string, operationMode: number) => {
const thresholdValue = showerControlConfig.thresholdValue;
let aimiItem = showerControlConfig.balances.find(
......@@ -59,30 +77,23 @@ function ShowerAppointment() {
let money = operationMode === OperationMode.onlyAimi ? aimi : aimi + bean;
if (money < thresholdValue) {
let text = showerControlConfig.appointmentThresholdPrompt;
let i = 0;
let text = showerControlConfig.appointmentThresholdPrompt.replace(
/\{\}/g,
() => {
return i++ == 0 ? aimi.toFixed(2) : bean.toFixed(2);
},
);
Taro.showModal({
title: '提示',
content: text,
}).then(res => {
if (res.confirm) {
appointingEquipment({
account: userInfo.customerId.toString(),
phone: userInfo.customerPhone,
userId: userInfo.customerId,
userName: userInfo.customerName,
deviceCode: deviceCode,
})
.then(res => {
console.log(res);
Taro.showToast({
title: res.msg,
});
})
.catch(err => {
console.log(err);
});
appointingEquipmentHandle(deviceCode);
}
});
} else {
appointingEquipmentHandle(deviceCode);
}
};
const goBluetoothShower = () => {
......
......@@ -56,5 +56,11 @@
color: #6180f4;
background-color: #fafafe;
border-radius: 0 0 16px 16px;
text:last-child{
display: inline-block;
margin-left: 20px;
width: 300px;
text-align: left;
}
}
}
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