Commit dde90b0f by 姜雷

修改预约提示文字

parent e2bcb4f2
...@@ -193,7 +193,7 @@ class Home extends Component { ...@@ -193,7 +193,7 @@ class Home extends Component {
} }
goShower = () => { goShower = () => {
const { userinfo } = this.props; const { userinfo, updateShowerControlConfig } = this.props;
getShowerController({ getShowerController({
campusId: userinfo.areaId, campusId: userinfo.areaId,
customerId: userinfo.customerId, customerId: userinfo.customerId,
......
...@@ -46,6 +46,24 @@ function ShowerAppointment() { ...@@ -46,6 +46,24 @@ function ShowerAppointment() {
const searchEquipment = () => { const searchEquipment = () => {
setSearchString(search.value); 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 appointingStart = (deviceCode: string, operationMode: number) => {
const thresholdValue = showerControlConfig.thresholdValue; const thresholdValue = showerControlConfig.thresholdValue;
let aimiItem = showerControlConfig.balances.find( let aimiItem = showerControlConfig.balances.find(
...@@ -59,30 +77,23 @@ function ShowerAppointment() { ...@@ -59,30 +77,23 @@ function ShowerAppointment() {
let money = operationMode === OperationMode.onlyAimi ? aimi : aimi + bean; let money = operationMode === OperationMode.onlyAimi ? aimi : aimi + bean;
if (money < thresholdValue) { 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({ Taro.showModal({
title: '提示', title: '提示',
content: text, content: text,
}).then(res => { }).then(res => {
if (res.confirm) { if (res.confirm) {
appointingEquipment({ appointingEquipmentHandle(deviceCode);
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);
});
} }
}); });
} else {
appointingEquipmentHandle(deviceCode);
} }
}; };
const goBluetoothShower = () => { const goBluetoothShower = () => {
......
...@@ -56,5 +56,11 @@ ...@@ -56,5 +56,11 @@
color: #6180f4; color: #6180f4;
background-color: #fafafe; background-color: #fafafe;
border-radius: 0 0 16px 16px; 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