Near-infrared (NIR) organic dyes have received increasing attention in recent years as diagnostic and therapeutic agents in the field of tumor research. In this study, IR-822, a near-infrared fluorescence (NIRF) heptamethine cyanine dye, was chosen as a fluorophore due to its high extinction coefficients, and native preferential tumor accumulation property. To enhance its specificity in tumor imaging, N-1-(pyridin-4-ylmethyl)ethane-1,2-diamine (PY) was conjugated to IR-822 as a pH-sensing receptor, forming a fluorophore-spacer-receptor molecular probe (IR-PY) that can modulate the fluorescence emission intensity through a fast photoinduced electron-transfer process, which allowed the probe to "switch on'' significantly in an acidic tumor microenvironment and which realized enhanced NIRF imaging in vivo. Having a strong NIR absorption at 600-850 nm, this small-molecule IR-PY showed not only high spatial resolution photoacoustic (PA) imaging in mice, but also effective tumor photothermal ablation in vivo. After photothermal therapy (PTT) with IR-PY under NIR 808 nm laser irradiation, the mice exhibited remarkable ablation with no tumor recurrence after treatment. Therefore, a single smart small-molecule probe IR-PY has been designed, synthesized and verified as an "all in one'' multifunctional agent, including pH sensitivity, tumor targeting, "switch-on'' near-infrared fluorescence imaging, high-spatial-resolution PA imaging and efficient near-infrared photothermal therapy, which is promising for clinical application in NIRF/PA dual-modal imaging-guided cancer diagnosis and treatment.