Although enrofloxacin (ENR) is a widely used broad-spectrum antibiotic in veterinary medicine, its residues in animals can pose a risk to human health. Thus, we developed a new method for detecting ENR based on aptamers and AuNPs. In the absence of ENR, the aptamers attached to the surface of the AuNPs via electrostatic interactions to protect the AuNPs from NaCl, and the solution remained red. Conversely, the aptamer bonded with ENR, leading the aptamer to detach from the AuNP surface, and the color of the solution changed from red to blue. Based on this principle, ENR can be qualitatively detected by the naked eye and quantitatively detected by measuring the absorbance ratio at 650 nm and 530 nm. The experimental results showed a good linear relationship within the ENR concentration range of 0-400 nM, with a limit of detection (LOD) of 1.72 nM, which is satisfactory for detection in food safety. Additionally, this method has also been successfully applied to the detection of ENR in tap water, river water, milk, serum and urine, with good recovery rates and RSD values of less than 7%, indicating its great potential for ENR detection in environmental water samples. More importantly, the combination of this method with a smartphone platform provided great convenience for on-site and visual detection of ENR, offering promising applicability prospects.