To achieve accurate fluorescence imaging-guided cancer therapy, intelligent systems with specific responsiveness to the tumor microenvironment need to be designed. Here, we have achieved both enhanced NIR fluorescence and photodynamic therapy by introducing a dimethylamino functional group in BODIPY dyes, which can be used as a pH sensor under acidic conditions by coordinating with the proton. At pH 7.4, the fluorescence is quenched due to the photo-induced electron transfer (PET) process. After the photosensitizer is protonated in tumor cell lysosomes (pH 4.0-5.5), the PET process is inhibited and the fluorophore emission capacity is restored (fluorescence enhancement up to 10-fold), resulting in near-infrared fluorescence with the OFF/ON transition inside the tumor and enhanced singlet oxygen production for lysosome targeting capability. Due to the substitution of heavy atom iodine, the compound has a high singlet oxygen quantum yield of 81.8% in dichloromethane. In addition, using a pH-sensitive amphiphilic polypeptide (POEGMA23-PE9) as a carrier to wrap the photosensitizer BDPI can release enough drug in the acidic environment (pH 5.5-6.5) of intracellular endosomes/lysosomes, which is conducive to more adequate interactions of the photosensitizer with H+ and more effective enhancement of fluorescence emission and 1O2 production, achieving precise fluorescence imaging capability and extremely low background toxicity.