For rapidly and efficiently detecting levofloxacin, we synthesize a turn-on fluorescence probe based on lanthanide ions-functionalized COFs. Tb3+ can serve as a bridge in the whole detection system to increase the fluorescence sensitivity and determination of LVX. 2D COFs, serves as the support frameworks, can provide better thermal and chemical stability for system. Experimental and theoretical results show the product has a wide linear range (5 × 10−6 M to 2.4 × 10-4 M) and low limit of detection that 1.26 μM (0.47 ppm). Furthermore, the distinct luminescence alteration can be observed under UV excitation. We put the luminescence signals into logic gates to monitored and analyze LVX. It can selectively identify levofloxacin in urine and serum through a “turn-on” process, which avoiding complex operations and expensive instrumentation.