A fluorescent probe with excellent biocompatibility and water solubility was constructed, which can achieve highly selective detection of trace 2,4,6-trinitrophenol (TNP) and 2,6-bis(picrylamino)-3,5-dinitropyridine (PYX). The probe exhibits a purple color and red fluorescence in aqueous solution, and can specifically and rapidly recognize TNP and PYX through a dual-channel mode of naked-eye color change and fluorescence quenching, showing good detection sensitivity. Spectroscopic test results indicated that the limits of detection (LOD) of TNP and PYX measured by UV-vis absorption spectroscopy were as low as 3.4830 μM and 14.4785 μM, respectively. In contrast, fluorescence spectroscopy further improved the LODs to 1.5956 μM and 3.0820 μM, demonstrating its advantage of high sensitivity in the field of fluorescence detection. Stability studies showed that the probe could maintain stable detection performance in the pH range of 4-9. To promote practical application, the probe was fabricated into test strips, which can quickly complete qualitative and visual detection of TNP and PYX. Combined with smartphone visual colorimetric analysis, semi-quantitative detection of target analytes in water samples can be realized. In addition, the probe can be successfully applied to the fluorescence imaging analysis of exogenous TNP and PYX in HeLa cells.