|
|
@ -25,7 +25,7 @@ export default function Bluetooth() { |
|
|
|
if (!res.success) { |
|
|
|
Toast.show(res.message); |
|
|
|
} else { |
|
|
|
dispatch(updateBleLinkStatus({mac, link: true})) |
|
|
|
dispatch(updateBleLinkStatus({ mac, link: true })); |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
@ -34,7 +34,7 @@ export default function Bluetooth() { |
|
|
|
if (!res.success) { |
|
|
|
Toast.show(res.message); |
|
|
|
} else { |
|
|
|
dispatch(updateBleLinkStatus({mac, link: false})) |
|
|
|
dispatch(updateBleLinkStatus({ mac, link: false })); |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
@ -53,15 +53,19 @@ export default function Bluetooth() { |
|
|
|
{contextState.bleList.map((ble) => ( |
|
|
|
<div |
|
|
|
key={ble.mac} |
|
|
|
className="h-12 flex items-center border-b border-[#eee]" |
|
|
|
className="py-2 flex items-center border-b border-[#eee]" |
|
|
|
onClick={ |
|
|
|
contextState.bleList.some((bl) => bl.linked) |
|
|
|
? undefined |
|
|
|
: () => onConnect(ble.mac) |
|
|
|
} |
|
|
|
> |
|
|
|
<span>{ble.name}</span> |
|
|
|
<span className="text-xs text-title ml-2">{ble.linked ? '已连接' : ''}</span> |
|
|
|
<div> |
|
|
|
<p>{ble.name}</p> |
|
|
|
<p className='text-[10px] text-title'>{ble.mac}</p> |
|
|
|
</div> |
|
|
|
|
|
|
|
<span className="text-xs text-title ml-3">{ble.linked ? '已连接' : ''}</span> |
|
|
|
{ble.linked && ( |
|
|
|
<button |
|
|
|
className="btn-contained px-2 py-1 rounded ml-auto" |
|
|
|